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-2018 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  * @todo When making an interface change to SCIPcreateProb(), add an indication whether it is known that the objective
32  * function is integral or whether this is not known. This avoids a manual call of SCIPsetObjIntegral(). Moreover,
33  * then the detection could be performed incrementally, whenever a variable is added.
34  */
35 
36 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
37 
38 #include <ctype.h>
39 #include <stdarg.h>
40 #include <assert.h>
41 #include <string.h>
42 #if defined(_WIN32) || defined(_WIN64)
43 #else
44 #include <strings.h> /*lint --e{766}*/
45 #endif
46 
47 #ifdef WITH_ZLIB
48 #include <zlib.h>
49 #endif
50 
51 #include "scip/def.h"
52 #include "scip/retcode.h"
53 #include "scip/set.h"
54 #include "scip/paramset.h"
55 #include "scip/stat.h"
56 #include "scip/clock.h"
57 #include "scip/visual.h"
58 #include "scip/interrupt.h"
59 #include "scip/mem.h"
60 #include "scip/misc.h"
61 #include "scip/history.h"
62 #include "scip/event.h"
63 #include "scip/lp.h"
64 #include "scip/nlp.h"
65 #include "scip/var.h"
66 #include "scip/implics.h"
67 #include "scip/prob.h"
68 #include "scip/sol.h"
69 #include "scip/primal.h"
70 #include "scip/reopt.h"
71 #include "scip/tree.h"
72 #include "scip/pricestore.h"
73 #include "scip/sepastore.h"
74 #include "scip/conflictstore.h"
75 #include "scip/syncstore.h"
76 #include "scip/cutpool.h"
77 #include "scip/solve.h"
78 #include "scip/scipbuildflags.h"
79 #include "scip/scipgithash.h"
80 #include "scip/cuts.h"
81 #include "scip/scip.h"
82 #include "lpi/lpi.h"
83 
84 #include "scip/scipcoreplugins.h"
85 #include "scip/branch.h"
86 #include "scip/conflict.h"
87 #include "scip/cons.h"
88 #include "scip/dialog.h"
89 #include "scip/disp.h"
90 #include "scip/table.h"
91 #include "scip/heur.h"
92 #include "scip/concsolver.h"
93 #include "scip/compr.h"
94 #include "scip/nodesel.h"
95 #include "scip/reader.h"
96 #include "scip/presol.h"
97 #include "scip/pricer.h"
98 #include "scip/relax.h"
99 #include "scip/sepa.h"
100 #include "scip/prop.h"
101 #include "nlpi/nlpi.h"
102 #include "nlpi/exprinterpret.h"
103 #include "scip/debug.h"
104 #include "scip/dialog_default.h"
105 #include "scip/message_default.h"
106 #include "scip/syncstore.h"
107 #include "scip/concurrent.h"
108 #include "xml/xml.h"
109 
110 /* We include the linear constraint handler to be able to copy a (multi)aggregation of variables (to a linear constraint).
111  * The better way would be to handle the distinction between original and transformed variables via a flag 'isoriginal'
112  * in the variable data structure. This would allow to have (multi)aggregated variables in the original problem.
113  *
114  * A second reason for including the linear constraint handler is for copying cuts to linear constraints.
115  */
116 #include "scip/cons_linear.h"
117 
118 /* We need to include the branching and the heurtistics for reoptimization after creating the reoptimization because we
119  * do not want to use these plugins by default if reoptimization is disabled. */
120 #include "scip/branch_nodereopt.h"
121 #include "scip/heur_reoptsols.h"
123 #include "scip/heur_ofins.h"
124 
125 /* In debug mode, we include the SCIP's structure in scip.c, such that no one can access
126  * this structure except the interface methods in scip.c.
127  * In optimized mode, the structure is included in scip.h, because some of the methods
128  * are implemented as defines for performance reasons (e.g. the numerical comparisons)
129  */
130 #ifndef NDEBUG
131 #include "scip/struct_scip.h"
132 #endif
133 
134 /*
135  * Local methods
136  */
137 
138 
139 /** checks, if SCIP is in one of the feasible stages */
140 #ifndef NDEBUG
141 static
143  SCIP* scip, /**< SCIP data structure */
144  const char* method, /**< method that was called */
145  SCIP_Bool init, /**< may method be called in the INIT stage? */
146  SCIP_Bool problem, /**< may method be called in the PROBLEM stage? */
147  SCIP_Bool transforming, /**< may method be called in the TRANSFORMING stage? */
148  SCIP_Bool transformed, /**< may method be called in the TRANSFORMED stage? */
149  SCIP_Bool initpresolve, /**< may method be called in the INITPRESOLVE stage? */
150  SCIP_Bool presolving, /**< may method be called in the PRESOLVING stage? */
151  SCIP_Bool exitpresolve, /**< may method be called in the EXITPRESOLE stage? */
152  SCIP_Bool presolved, /**< may method be called in the PRESOLVED stage? */
153  SCIP_Bool initsolve, /**< may method be called in the INITSOLVE stage? */
154  SCIP_Bool solving, /**< may method be called in the SOLVING stage? */
155  SCIP_Bool solved, /**< may method be called in the SOLVED stage? */
156  SCIP_Bool exitsolve, /**< may method be called in the EXITSOLVE stage? */
157  SCIP_Bool freetrans, /**< may method be called in the FREETRANS stage? */
158  SCIP_Bool freescip /**< may method be called in the FREE stage? */
159  )
160 {
161  assert(scip != NULL);
162  assert(method != NULL);
163 
164  /*SCIPdebugMsg(scip, "called method <%s> at stage %d ------------------------------------------------\n",
165  method, scip->set->stage);*/
166 
167  assert(scip->mem != NULL);
168  assert(scip->set != NULL);
169  assert(scip->interrupt != NULL);
170  assert(scip->dialoghdlr != NULL);
171  assert(scip->totaltime != NULL);
172 
173  switch( scip->set->stage )
174  {
175  case SCIP_STAGE_INIT:
176  assert(scip->stat == NULL);
177  assert(scip->origprob == NULL);
178  assert(scip->eventfilter == NULL);
179  assert(scip->eventqueue == NULL);
180  assert(scip->branchcand == NULL);
181  assert(scip->lp == NULL);
182  assert(scip->nlp == NULL);
183  assert(scip->primal == NULL);
184  assert(scip->tree == NULL);
185  assert(scip->conflict == NULL);
186  assert(scip->transprob == NULL);
187  assert(scip->pricestore == NULL);
188  assert(scip->sepastore == NULL);
189  assert(scip->cutpool == NULL);
190  assert(scip->delayedcutpool == NULL);
191 
192  if( !init )
193  {
194  SCIPerrorMessage("cannot call method <%s> in initialization stage\n", method);
195  return SCIP_INVALIDCALL;
196  }
197  return SCIP_OKAY;
198 
199  case SCIP_STAGE_PROBLEM:
200  assert(scip->stat != NULL);
201  assert(scip->origprob != NULL);
202  assert(scip->eventfilter == NULL);
203  assert(scip->eventqueue == NULL);
204  assert(scip->branchcand == NULL);
205  assert(scip->lp == NULL);
206  assert(scip->nlp == NULL);
207  assert(scip->primal == NULL);
208  assert(scip->tree == NULL);
209  assert(scip->conflict == NULL);
210  assert(scip->transprob == NULL);
211  assert(scip->pricestore == NULL);
212  assert(scip->sepastore == NULL);
213  assert(scip->cutpool == NULL);
214  assert(scip->delayedcutpool == NULL);
215 
216  if( !problem )
217  {
218  SCIPerrorMessage("cannot call method <%s> in problem creation stage\n", method);
219  return SCIP_INVALIDCALL;
220  }
221  return SCIP_OKAY;
222 
224  assert(scip->stat != NULL);
225  assert(scip->origprob != NULL);
226  assert(scip->eventfilter != NULL);
227  assert(scip->eventqueue != NULL);
228  assert(scip->branchcand != NULL);
229  assert(scip->lp != NULL);
230  assert(scip->primal != NULL);
231  assert(scip->tree != NULL);
232  assert(scip->conflict != NULL);
233  assert(scip->transprob != NULL);
234  assert(scip->pricestore == NULL);
235  assert(scip->sepastore == NULL);
236  assert(scip->cutpool == NULL);
237  assert(scip->delayedcutpool == NULL);
238 
239  if( !transforming )
240  {
241  SCIPerrorMessage("cannot call method <%s> in problem transformation stage\n", method);
242  return SCIP_INVALIDCALL;
243  }
244  return SCIP_OKAY;
245 
247  assert(scip->stat != NULL);
248  assert(scip->origprob != NULL);
249  assert(scip->eventfilter != NULL);
250  assert(scip->eventqueue != NULL);
251  assert(scip->branchcand != NULL);
252  assert(scip->lp != NULL);
253  assert(scip->primal != NULL);
254  assert(scip->tree != NULL);
255  assert(scip->conflict != NULL);
256  assert(scip->transprob != NULL);
257  assert(scip->pricestore == NULL);
258  assert(scip->sepastore == NULL);
259  assert(scip->cutpool == NULL);
260  assert(scip->delayedcutpool == NULL);
261 
262  if( !transformed )
263  {
264  SCIPerrorMessage("cannot call method <%s> in problem transformed stage\n", method);
265  return SCIP_INVALIDCALL;
266  }
267  return SCIP_OKAY;
268 
270  assert(scip->stat != NULL);
271  assert(scip->origprob != NULL);
272  assert(scip->eventfilter != NULL);
273  assert(scip->eventqueue != NULL);
274  assert(scip->branchcand != NULL);
275  assert(scip->lp != NULL);
276  assert(scip->primal != NULL);
277  assert(scip->tree != NULL);
278  assert(scip->conflict != NULL);
279  assert(scip->transprob != NULL);
280  assert(scip->pricestore == NULL);
281  assert(scip->sepastore == NULL);
282  assert(scip->cutpool == NULL);
283  assert(scip->delayedcutpool == NULL);
284 
285  if( !initpresolve )
286  {
287  SCIPerrorMessage("cannot call method <%s> in init presolving stage\n", method);
288  return SCIP_INVALIDCALL;
289  }
290  return SCIP_OKAY;
291 
293  assert(scip->stat != NULL);
294  assert(scip->origprob != NULL);
295  assert(scip->eventfilter != NULL);
296  assert(scip->eventqueue != NULL);
297  assert(scip->branchcand != NULL);
298  assert(scip->lp != NULL);
299  assert(scip->primal != NULL);
300  assert(scip->tree != NULL);
301  assert(scip->conflict != NULL);
302  assert(scip->transprob != NULL);
303  assert(scip->pricestore == NULL);
304  assert(scip->sepastore == NULL);
305  assert(scip->cutpool == NULL);
306  assert(scip->delayedcutpool == NULL);
307 
308  if( !presolving )
309  {
310  SCIPerrorMessage("cannot call method <%s> in presolving stage\n", method);
311  return SCIP_INVALIDCALL;
312  }
313  return SCIP_OKAY;
314 
316  assert(scip->stat != NULL);
317  assert(scip->origprob != NULL);
318  assert(scip->eventfilter != NULL);
319  assert(scip->eventqueue != NULL);
320  assert(scip->branchcand != NULL);
321  assert(scip->lp != NULL);
322  assert(scip->primal != NULL);
323  assert(scip->tree != NULL);
324  assert(scip->conflict != NULL);
325  assert(scip->transprob != NULL);
326  assert(scip->pricestore == NULL);
327  assert(scip->sepastore == NULL);
328  assert(scip->cutpool == NULL);
329  assert(scip->delayedcutpool == NULL);
330 
331  if( !exitpresolve )
332  {
333  SCIPerrorMessage("cannot call method <%s> in exit presolving stage\n", method);
334  return SCIP_INVALIDCALL;
335  }
336  return SCIP_OKAY;
337 
339  assert(scip->stat != NULL);
340  assert(scip->origprob != NULL);
341  assert(scip->eventfilter != NULL);
342  assert(scip->eventqueue != NULL);
343  assert(scip->branchcand != NULL);
344  assert(scip->lp != NULL);
345  assert(scip->primal != NULL);
346  assert(scip->tree != NULL);
347  assert(scip->conflict != NULL);
348  assert(scip->transprob != NULL);
349  assert(scip->pricestore == NULL);
350  assert(scip->sepastore == NULL);
351  assert(scip->cutpool == NULL);
352  assert(scip->delayedcutpool == NULL);
353 
354  if( !presolved )
355  {
356  SCIPerrorMessage("cannot call method <%s> in problem presolved stage\n", method);
357  return SCIP_INVALIDCALL;
358  }
359  return SCIP_OKAY;
360 
362  assert(scip->stat != NULL);
363  assert(scip->origprob != NULL);
364  assert(scip->eventfilter != NULL);
365  assert(scip->eventqueue != NULL);
366  assert(scip->branchcand != NULL);
367  assert(scip->lp != NULL);
368  assert(scip->primal != NULL);
369  assert(scip->tree != NULL);
370  assert(scip->transprob != NULL);
371 
372  if( !initsolve )
373  {
374  SCIPerrorMessage("cannot call method <%s> in init solve stage\n", method);
375  return SCIP_INVALIDCALL;
376  }
377  return SCIP_OKAY;
378 
379  case SCIP_STAGE_SOLVING:
380  assert(scip->stat != NULL);
381  assert(scip->origprob != NULL);
382  assert(scip->eventfilter != NULL);
383  assert(scip->eventqueue != NULL);
384  assert(scip->branchcand != NULL);
385  assert(scip->lp != NULL);
386  assert(scip->primal != NULL);
387  assert(scip->tree != NULL);
388  assert(scip->conflict != NULL);
389  assert(scip->transprob != NULL);
390  assert(scip->pricestore != NULL);
391  assert(scip->sepastore != NULL);
392  assert(scip->cutpool != NULL);
393  assert(scip->delayedcutpool != NULL);
394 
395  if( !solving )
396  {
397  SCIPerrorMessage("cannot call method <%s> in solving stage\n", method);
398  return SCIP_INVALIDCALL;
399  }
400  return SCIP_OKAY;
401 
402  case SCIP_STAGE_SOLVED:
403  assert(scip->stat != NULL);
404  assert(scip->origprob != NULL);
405  assert(scip->eventfilter != NULL);
406  assert(scip->eventqueue != NULL);
407  assert(scip->branchcand != NULL);
408  assert(scip->lp != NULL);
409  assert(scip->primal != NULL);
410  assert(scip->tree != NULL);
411  assert(scip->conflict != NULL);
412  assert(scip->transprob != NULL);
413  assert(scip->pricestore != NULL);
414  assert(scip->sepastore != NULL);
415  assert(scip->cutpool != NULL);
416  assert(scip->delayedcutpool != NULL);
417 
418  if( !solved )
419  {
420  SCIPerrorMessage("cannot call method <%s> in problem solved stage\n", method);
421  return SCIP_INVALIDCALL;
422  }
423  return SCIP_OKAY;
424 
426  assert(scip->stat != NULL);
427  assert(scip->origprob != NULL);
428  assert(scip->eventfilter != NULL);
429  assert(scip->eventqueue != NULL);
430  assert(scip->branchcand != NULL);
431  assert(scip->lp != NULL);
432  assert(scip->primal != NULL);
433  assert(scip->tree != NULL);
434  assert(scip->transprob != NULL);
435 
436  if( !exitsolve )
437  {
438  SCIPerrorMessage("cannot call method <%s> in solve deinitialization stage\n", method);
439  return SCIP_INVALIDCALL;
440  }
441  return SCIP_OKAY;
442 
444  assert(scip->stat != NULL);
445  assert(scip->origprob != NULL);
446  assert(scip->pricestore == NULL);
447  assert(scip->sepastore == NULL);
448  assert(scip->cutpool == NULL);
449  assert(scip->delayedcutpool == NULL);
450 
451  if( !freetrans )
452  {
453  SCIPerrorMessage("cannot call method <%s> in free transformed problem stage\n", method);
454  return SCIP_INVALIDCALL;
455  }
456  return SCIP_OKAY;
457 
458  case SCIP_STAGE_FREE:
459  if( !freescip )
460  {
461  SCIPerrorMessage("cannot call method <%s> in free stage\n", method);
462  return SCIP_INVALIDCALL;
463  }
464  return SCIP_OKAY;
465 
466  default:
467  /* note that this is in an internal SCIP error since all SCIP stages are covert in the switch above */
468  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
469  return SCIP_ERROR;
470  }
471 }
472 #else
473 #define checkStage(scip,method,init,problem,transforming,transformed,initpresolve,presolving,exitpresolve,presolved, \
474  initsolve,solving,solved,exitsolve,freetrans,freescip) SCIP_OKAY
475 #endif
476 
477 /** gets global lower (dual) bound in transformed problem */
478 static
480  SCIP* scip /**< SCIP data structure */
481  )
482 {
483  if( scip->set->stage <= SCIP_STAGE_INITSOLVE )
484  return -SCIPinfinity(scip);
485 
486  return SCIPtreeGetLowerbound(scip->tree, scip->set);
487 }
488 
489 /** gets global upper (primal) bound in transformed problem (objective value of best solution or user objective limit) */
490 static
492  SCIP* scip /**< SCIP data structure */
493  )
494 {
495  if( SCIPgetStatus(scip) == SCIP_STATUS_UNBOUNDED )
496  return -SCIPinfinity(scip);
497  else
498  return scip->primal->upperbound;
499 }
500 
501 
502 /** gets global primal bound (objective value of best solution or user objective limit) */
503 static
505  SCIP* scip /**< SCIP data structure */
506  )
507 {
508  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, getUpperbound(scip));
509 }
510 
511 /** gets global dual bound */
512 static
514  SCIP* scip /**< SCIP data structure */
515  )
516 {
517  SCIP_Real lowerbound;
518 
519  if( scip->set->stage <= SCIP_STAGE_INITSOLVE )
520  {
521  /* in case we are in presolving we use the stored dual bound if it exits, otherwise, minus or plus infinity
522  * depending on the objective sense
523  */
524  if( scip->transprob->dualbound < SCIP_INVALID )
525  lowerbound = SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, scip->transprob->dualbound);
526  else
527  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, -SCIPinfinity(scip));
528  }
529  else
530  lowerbound = SCIPtreeGetLowerbound(scip->tree, scip->set);
531 
532  if( SCIPsetIsInfinity(scip->set, lowerbound) )
533  {
534  /* in case we could not prove whether the problem is unbounded or infeasible, we want to terminate with
535  * dual bound = -inf instead of dual bound = primal bound = +inf
536  * also in case we prove that the problem is unbounded, it seems to make sense to return with dual bound = -inf,
537  * since -infinity is the only valid lower bound
538  */
540  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, -SCIPinfinity(scip));
541  else
542  return getPrimalbound(scip);
543  }
544  else
545  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, lowerbound);
546 }
547 
548 /*
549  * miscellaneous methods
550  */
551 
552 /** returns complete SCIP version number in the format "major . minor tech"
553  *
554  * @return complete SCIP version
555  */
557  void
558  )
559 {
560  return (SCIP_Real)(SCIP_VERSION)/100.0;
561 }
562 
563 /** returns SCIP major version
564  *
565  * @return major SCIP version
566  */
568  void
569  )
570 {
571  return SCIP_VERSION/100;
572 }
573 
574 /** returns SCIP minor version
575  *
576  * @return minor SCIP version
577  */
579  void
580  )
581 {
582  return (SCIP_VERSION/10) % 10; /*lint !e778*/
583 }
584 
585 /** returns SCIP technical version
586  *
587  * @return technical SCIP version
588  */
590  void
591  )
592 {
593  return SCIP_VERSION % 10; /*lint !e778*/
594 }
595 
596 /** returns SCIP sub version number
597  *
598  * @return subversion SCIP version
599  */
601  void
602  )
603 {
604  return SCIP_SUBVERSION;
605 }
606 
607 /** prints a version information line to a file stream via the message handler system
608  *
609  * @note If the message handler is set to a NULL pointer nothing will be printed
610  */
612  SCIP* scip, /**< SCIP data structure */
613  FILE* file /**< output file (or NULL for standard output) */
614  )
615 {
616  assert( scip != NULL );
617 
618  SCIPmessageFPrintInfo(scip->messagehdlr, file, "SCIP version %d.%d.%d",
620 #if SCIP_SUBVERSION > 0
621  SCIPmessageFPrintInfo(scip->messagehdlr, file, ".%d", SCIPsubversion());
622 #endif
623 
624  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [precision: %d byte]", (int)sizeof(SCIP_Real));
625 
626 #ifndef BMS_NOBLOCKMEM
627  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [memory: block]");
628 #else
629  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [memory: standard]");
630 #endif
631 #ifndef NDEBUG
632  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [mode: debug]");
633 #else
634  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [mode: optimized]");
635 #endif
636  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [LP solver: %s]", SCIPlpiGetSolverName());
637  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [GitHash: %s]", SCIPgetGitHash());
638  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
639  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%s\n", SCIP_COPYRIGHT);
640 }
641 
642 /** prints detailed information on the compile-time flags
643  *
644  * @note If the message handler is set to a NULL pointer nothing will be printed
645  */
647  SCIP* scip, /**< SCIP data structure */
648  FILE* file /**< output file (or NULL for standard output) */
649  )
650 {
651  assert( scip != NULL );
652 
653  /* compiler */
654  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Compiler: ");
655 #if defined(__INTEL_COMPILER)
656  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Intel %d\n", __INTEL_COMPILER);
657 #elif defined(__clang__)
658  SCIPmessageFPrintInfo(scip->messagehdlr, file, "clang %d.%d.%d\n", __clang_major__, __clang_minor__, __clang_patchlevel__);
659 #elif defined(_MSC_VER)
660  SCIPmessageFPrintInfo(scip->messagehdlr, file, "microsoft visual c %d\n", _MSC_FULL_VER);
661 #elif defined(__GNUC__)
662 #if defined(__GNUC_PATCHLEVEL__)
663  SCIPmessageFPrintInfo(scip->messagehdlr, file, "gcc %d.%d.%d\n", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
664 #else
665  SCIPmessageFPrintInfo(scip->messagehdlr, file, "gcc %d.%d\n", __GNUC__, __GNUC_MINOR__);
666 #endif
667 #else
668  SCIPmessageFPrintInfo(scip->messagehdlr, file, "unknown\n");
669 #endif
670 
671  /* build flags */
672  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\nBuild options:\n%s", SCIPgetBuildFlags());
673 }
674 
675 /** prints error message for the given SCIP_RETCODE via the error prints method */
677  SCIP_RETCODE retcode /**< SCIP return code causing the error */
678  )
679 {
680  SCIPmessagePrintError("SCIP Error (%d): ", retcode);
681  SCIPretcodePrintError(retcode);
682  SCIPmessagePrintError("\n");
683 }
684 
685 /*
686  * general SCIP methods
687  */
688 
689 /** internal method to create SCIP */
690 static
692  SCIP** scip /**< pointer to SCIP data structure */
693  )
694 {
695  assert(scip != NULL);
696 
697  SCIP_ALLOC( BMSallocMemory(scip) );
698 
699  /* all members are initialized to NULL */
700  BMSclearMemory(*scip);
701 
702  /* create a default message handler */
703  SCIP_CALL( SCIPcreateMessagehdlrDefault(&(*scip)->messagehdlr, TRUE, NULL, FALSE) );
704 
705  SCIP_CALL( SCIPmemCreate(&(*scip)->mem) );
706  SCIP_CALL( SCIPsetCreate(&(*scip)->set, (*scip)->messagehdlr, (*scip)->mem->setmem, *scip) );
707  SCIP_CALL( SCIPinterruptCreate(&(*scip)->interrupt) );
708  SCIP_CALL( SCIPdialoghdlrCreate((*scip)->set, &(*scip)->dialoghdlr) );
709  SCIP_CALL( SCIPclockCreate(&(*scip)->totaltime, SCIP_CLOCKTYPE_DEFAULT) );
710  SCIP_CALL( SCIPsyncstoreCreate( &(*scip)->syncstore ) );
711 
712  /* include additional core functionality */
714 
715  SCIPclockStart((*scip)->totaltime, (*scip)->set);
716 
717  SCIP_CALL( SCIPnlpInclude((*scip)->set, SCIPblkmem(*scip)) );
718 
719  if( strcmp(SCIPlpiGetSolverName(), "NONE") != 0 )
720  {
722  }
723  if( strcmp(SCIPexprintGetName(), "NONE") != 0 )
724  {
726  }
727 
728 #ifdef WITH_ZLIB
729  SCIP_CALL( SCIPsetIncludeExternalCode((*scip)->set, "ZLIB " ZLIB_VERSION, "General purpose compression library by J. Gailly and M. Adler (zlib.net)") );
730 #endif
731 
732  return SCIP_OKAY;
733 }
734 
735 /** creates and initializes SCIP data structures
736  *
737  * @note The SCIP default message handler is installed. Use the method SCIPsetMessagehdlr() to install your own
738  * message handler or SCIPsetMessagehdlrLogfile() and SCIPsetMessagehdlrQuiet() to write into a log
739  * file and turn off/on the display output, respectively.
740  *
741  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
742  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
743  *
744  * @post After calling this method \SCIP reached the solving stage \ref SCIP_STAGE_INIT
745  *
746  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
747  */
749  SCIP** scip /**< pointer to SCIP data structure */
750  )
751 {
752  assert(scip != NULL);
753 
754  SCIP_CALL_FINALLY( doScipCreate(scip), (void)SCIPfree(scip) );
755 
756  return SCIP_OKAY;
757 }
758 
759 /** frees SCIP data structures
760  *
761  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
762  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
763  *
764  * @pre This method can be called if @p scip is in one of the following stages:
765  * - \ref SCIP_STAGE_INIT
766  * - \ref SCIP_STAGE_PROBLEM
767  * - \ref SCIP_STAGE_TRANSFORMED
768  * - \ref SCIP_STAGE_INITPRESOLVE
769  * - \ref SCIP_STAGE_PRESOLVING
770  * - \ref SCIP_STAGE_PRESOLVED
771  * - \ref SCIP_STAGE_EXITPRESOLVE
772  * - \ref SCIP_STAGE_SOLVING
773  * - \ref SCIP_STAGE_SOLVED
774  * - \ref SCIP_STAGE_FREE
775  *
776  * @post After calling this method \SCIP reached the solving stage \ref SCIP_STAGE_FREE
777  *
778  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
779  */
781  SCIP** scip /**< pointer to SCIP data structure */
782  )
783 {
784  assert(scip != NULL);
785  if( *scip == NULL )
786  return SCIP_OKAY;
787 
788  SCIP_CALL( checkStage(*scip, "SCIPfree", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE) );
789 
790  SCIP_CALL( SCIPfreeProb(*scip) );
791  assert((*scip)->set->stage == SCIP_STAGE_INIT);
792 
793  /* switch stage to FREE */
794  (*scip)->set->stage = SCIP_STAGE_FREE;
795 
796  SCIP_CALL( SCIPsyncstoreRelease(&(*scip)->syncstore) );
797  SCIP_CALL( SCIPsetFree(&(*scip)->set, (*scip)->mem->setmem) );
798  SCIP_CALL( SCIPdialoghdlrFree(*scip, &(*scip)->dialoghdlr) );
799  SCIPclockFree(&(*scip)->totaltime);
800  SCIPinterruptFree(&(*scip)->interrupt);
801  SCIP_CALL( SCIPmemFree(&(*scip)->mem) );
802 
803  /* release message handler */
804  SCIP_CALL( SCIPmessagehdlrRelease(&(*scip)->messagehdlr) );
805 
806  BMSfreeMemory(scip);
807 
808  return SCIP_OKAY;
809 }
810 
811 #undef SCIPgetStage
812 #undef SCIPhasPerformedPresolve
813 #undef SCIPisStopped
814 
815 /** returns current stage of SCIP
816  *
817  * @return the current SCIP stage
818  *
819  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
820  */
822  SCIP* scip /**< SCIP data structure */
823  )
824 {
825  assert(scip != NULL);
826  assert(scip->set != NULL);
827 
828  return scip->set->stage;
829 }
830 
831 /** outputs SCIP stage and solution status if applicable via the message handler
832  *
833  * @note If the message handler is set to a NULL pointer nothing will be printed
834  *
835  * @note If limits have been changed between the solution and the call to this function, the status is recomputed and
836  * thus may to correspond to the original status.
837  *
838  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
839  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
840  *
841  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
842  */
844  SCIP* scip, /**< SCIP data structure */
845  FILE* file /**< output file (or NULL for standard output) */
846  )
847 {
848  SCIP_CALL( checkStage(scip, "SCIPprintStage", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
849 
850  switch( scip->set->stage )
851  {
852  case SCIP_STAGE_INIT:
853  SCIPmessageFPrintInfo(scip->messagehdlr, file, "initialization");
854  break;
855  case SCIP_STAGE_PROBLEM:
856  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem creation / modification");
857  break;
859  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem transformation");
860  break;
862  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem transformed");
863  break;
865  SCIPmessageFPrintInfo(scip->messagehdlr, file, "presolving is being initialized");
866  break;
868  if( SCIPsolveIsStopped(scip->set, scip->stat, TRUE) )
869  {
870  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solving was interrupted [");
871  SCIP_CALL( SCIPprintStatus(scip, file) );
872  SCIPmessageFPrintInfo(scip->messagehdlr, file, "]");
873  }
874  else
875  SCIPmessageFPrintInfo(scip->messagehdlr, file, "presolving process is running");
876  break;
878  SCIPmessageFPrintInfo(scip->messagehdlr, file, "presolving is being exited");
879  break;
881  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem is presolved");
882  break;
884  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solving process initialization");
885  break;
886  case SCIP_STAGE_SOLVING:
887  if( SCIPsolveIsStopped(scip->set, scip->stat, TRUE) )
888  {
889  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solving was interrupted [");
890  SCIP_CALL( SCIPprintStatus(scip, file) );
891  SCIPmessageFPrintInfo(scip->messagehdlr, file, "]");
892  }
893  else
894  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solving process is running");
895  break;
896  case SCIP_STAGE_SOLVED:
897  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem is solved [");
898  SCIP_CALL( SCIPprintStatus(scip, file) );
899  SCIPmessageFPrintInfo(scip->messagehdlr, file, "]");
900 
901  if( scip->primal->nlimsolsfound == 0 && !SCIPisInfinity(scip, (int)SCIPgetObjsense(scip) * getPrimalbound(scip)) )
902  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (objective limit reached)");
903 
904  break;
906  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solving process deinitialization");
907  break;
909  SCIPmessageFPrintInfo(scip->messagehdlr, file, "freeing transformed problem");
910  break;
911  case SCIP_STAGE_FREE:
912  SCIPmessageFPrintInfo(scip->messagehdlr, file, "freeing SCIP");
913  break;
914  default:
915  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
916  return SCIP_INVALIDDATA;
917  }
918 
919  return SCIP_OKAY;
920 }
921 
922 /** gets solution status
923  *
924  * @return SCIP solution status
925  *
926  * See \ref SCIP_Status "SCIP_STATUS" for a complete list of all possible solving status.
927  */
929  SCIP* scip /**< SCIP data structure */
930  )
931 {
932  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetStatus", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
933 
934  if( scip->set->stage == SCIP_STAGE_INIT || scip->set->stage == SCIP_STAGE_FREE )
935  return SCIP_STATUS_UNKNOWN;
936  else
937  {
938  assert(scip->stat != NULL);
939 
940  return scip->stat->status;
941  }
942 }
943 
944 /** outputs solution status
945  *
946  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
947  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
948  *
949  * See \ref SCIP_Status "SCIP_STATUS" for a complete list of all possible solving status.
950  */
952  SCIP* scip, /**< SCIP data structure */
953  FILE* file /**< output file (or NULL for standard output) */
954  )
955 {
956  SCIP_CALL( checkStage(scip, "SCIPprintStatus", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
957 
958  switch( SCIPgetStatus(scip) )
959  {
960  case SCIP_STATUS_UNKNOWN:
961  SCIPmessageFPrintInfo(scip->messagehdlr, file, "unknown");
962  break;
964  SCIPmessageFPrintInfo(scip->messagehdlr, file, "user interrupt");
965  break;
967  SCIPmessageFPrintInfo(scip->messagehdlr, file, "node limit reached");
968  break;
970  SCIPmessageFPrintInfo(scip->messagehdlr, file, "total node limit reached");
971  break;
973  SCIPmessageFPrintInfo(scip->messagehdlr, file, "stall node limit reached");
974  break;
976  SCIPmessageFPrintInfo(scip->messagehdlr, file, "time limit reached");
977  break;
979  SCIPmessageFPrintInfo(scip->messagehdlr, file, "memory limit reached");
980  break;
982  SCIPmessageFPrintInfo(scip->messagehdlr, file, "gap limit reached");
983  break;
985  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solution limit reached");
986  break;
988  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solution improvement limit reached");
989  break;
991  SCIPmessageFPrintInfo(scip->messagehdlr, file, "restart limit reached");
992  break;
993  case SCIP_STATUS_OPTIMAL:
994  SCIPmessageFPrintInfo(scip->messagehdlr, file, "optimal solution found");
995  break;
997  SCIPmessageFPrintInfo(scip->messagehdlr, file, "infeasible");
998  break;
1000  SCIPmessageFPrintInfo(scip->messagehdlr, file, "unbounded");
1001  break;
1002  case SCIP_STATUS_INFORUNBD:
1003  SCIPmessageFPrintInfo(scip->messagehdlr, file, "infeasible or unbounded");
1004  break;
1005  default:
1006  SCIPerrorMessage("invalid status code <%d>\n", SCIPgetStatus(scip));
1007  return SCIP_INVALIDDATA;
1008  }
1009 
1010  return SCIP_OKAY;
1011 }
1012 
1013 /** returns whether the current stage belongs to the transformed problem space
1014  *
1015  * @return Returns TRUE if the \SCIP instance is transformed, otherwise FALSE
1016  */
1018  SCIP* scip /**< SCIP data structure */
1019  )
1020 {
1021  assert(scip != NULL);
1022 
1023  return ((int)scip->set->stage >= (int)SCIP_STAGE_TRANSFORMING);
1024 }
1025 
1026 /** returns whether the solution process should be probably correct
1027  *
1028  * @note This feature is not supported yet!
1029  *
1030  * @return Returns TRUE if \SCIP is exact solving mode, otherwise FALSE
1031  */
1033  SCIP* scip /**< SCIP data structure */
1034  )
1035 {
1036  assert(scip != NULL);
1037  assert(scip->set != NULL);
1038 
1039  return (scip->set->misc_exactsolve);
1040 }
1041 
1042 /** returns whether the presolving process would be finished given no more presolving reductions are found in this
1043  * presolving round
1044  *
1045  * Checks whether the number of presolving rounds is not exceeded and the presolving reductions found in the current
1046  * presolving round suffice to trigger another presolving round.
1047  *
1048  * @note if subsequent presolvers find more reductions, presolving might continue even if the method returns FALSE
1049  * @note does not check whether infeasibility or unboundedness was already detected in presolving (which would result
1050  * in presolving being stopped although the method returns TRUE)
1051  *
1052  * @return Returns TRUE if presolving is finished if no further reductions are detected
1053  */
1055  SCIP* scip /**< SCIP data structure */
1056  )
1057 {
1058  int maxnrounds;
1059  SCIP_Bool finished;
1060 
1061  assert(scip != NULL);
1062  assert(scip->stat != NULL);
1063  assert(scip->transprob != NULL);
1064 
1065  SCIP_CALL_ABORT( checkStage(scip, "SCIPisPresolveFinished", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
1066 
1067  /* get maximum number of presolving rounds */
1068  maxnrounds = scip->set->presol_maxrounds;
1069  if( maxnrounds == -1 )
1070  maxnrounds = INT_MAX;
1071 
1072  /* don't abort, if enough changes were applied to the variables */
1073  finished = (scip->transprob->nvars == 0
1074  || (scip->stat->npresolfixedvars - scip->stat->lastnpresolfixedvars
1075  + scip->stat->npresolaggrvars - scip->stat->lastnpresolaggrvars
1077  + (scip->stat->npresolchgbds - scip->stat->lastnpresolchgbds)/10.0
1078  + (scip->stat->npresoladdholes - scip->stat->lastnpresoladdholes)/10.0
1079  <= scip->set->presol_abortfac * scip->transprob->nvars)); /*lint !e653*/
1080 
1081  /* don't abort, if enough changes were applied to the constraints */
1082  finished = finished
1083  && (scip->transprob->nconss == 0
1084  || (scip->stat->npresoldelconss - scip->stat->lastnpresoldelconss
1085  + scip->stat->npresoladdconss - scip->stat->lastnpresoladdconss
1087  + scip->stat->npresolchgsides - scip->stat->lastnpresolchgsides
1088  <= scip->set->presol_abortfac * scip->transprob->nconss));
1089 
1090  /* don't abort, if enough changes were applied to the coefficients (assume a 1% density of non-zero elements) */
1091  finished = finished
1092  && (scip->transprob->nvars == 0 || scip->transprob->nconss == 0
1093  || (scip->stat->npresolchgcoefs - scip->stat->lastnpresolchgcoefs
1094  <= scip->set->presol_abortfac * 0.01 * scip->transprob->nvars * scip->transprob->nconss));
1095 
1096 #ifdef SCIP_DISABLED_CODE
1097  /* since 2005, we do not take cliques and implications into account when deciding whether to stop presolving */
1098  /* don't abort, if enough new implications or cliques were found (assume 100 implications per variable) */
1099  finished = finished
1100  && (scip->stat->nimplications - scip->stat->lastnpresolimplications
1101  <= scip->set->presol_abortfac * 100 * scip->transprob->nbinvars)
1102  && (SCIPcliquetableGetNCliques(scip->cliquetable) - scip->stat->lastnpresolcliques
1103  <= scip->set->presol_abortfac * scip->transprob->nbinvars);
1104 #endif
1105 
1106  /* abort if maximal number of presolving rounds is reached */
1107  finished = finished || (scip->stat->npresolrounds + 1 >= maxnrounds);
1108 
1109  return finished;
1110 }
1111 
1112 /** returns whether SCIP has performed presolving during the last solve
1113  *
1114  * @return Returns TRUE if presolving was performed during the last solve
1115  */
1117  SCIP* scip /**< SCIP data structure */
1118  )
1119 {
1120  assert(scip != NULL);
1121  assert(scip->stat != NULL);
1122 
1123  SCIP_CALL_ABORT( checkStage(scip, "SCIPhasPerformedPresolve", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
1124 
1125  return scip->stat->performpresol;
1126 }
1127 
1128 /** returns whether the user pressed CTRL-C to interrupt the solving process
1129  *
1130  * @return Returns TRUE if Ctrl-C was pressed, otherwise FALSE.
1131  */
1133  SCIP* scip /**< SCIP data structure */
1134  )
1135 {
1136  return SCIPinterrupted();
1137 }
1138 
1139 /** returns whether the solving process should be / was stopped before proving optimality;
1140  * if the solving process should be / was stopped, the status returned by SCIPgetStatus() yields
1141  * the reason for the premature abort
1142  *
1143  * @return Returns TRUE if solving process is stopped/interrupted, otherwise FALSE.
1144  */
1146  SCIP* scip /**< SCIP data structure */
1147  )
1148 {
1149  SCIP_CALL_ABORT( checkStage(scip, "SCIPisStopped", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
1150 
1151  return SCIPsolveIsStopped(scip->set, scip->stat, FALSE);
1152 }
1153 
1154 /** enable debug solution mechanism
1155  *
1156  * the debug solution mechanism allows to trace back the invalidation of
1157  * a debug solution during the solution process of SCIP. It must be explicitly
1158  * enabled for the SCIP data structure.
1159  *
1160  * @see debug.h for more information on debug solution mechanism
1161  */
1163  SCIP* scip /**< SCIP data structure */
1164  )
1165 {
1166  SCIP_CALL_ABORT( checkStage(scip, "SCIPenableDebugSol", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
1167 
1168  SCIPdebugSolEnable(scip);
1169 }
1170 
1171 /** disable solution debugging mechanism
1172  *
1173  * @see debug.h for more information on debug solution mechanism
1174  */
1176  SCIP* scip /**< SCIP data structure */
1177  )
1178 {
1179  SCIP_CALL_ABORT( checkStage(scip, "SCIPdisableDebugSol", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
1180 
1181  SCIPdebugSolDisable(scip);
1182 }
1183 
1184 /*
1185  * message output methods
1186  */
1187 
1188 /** installs the given message handler, such that all messages are passed to this handler. A messages handler can be
1189  * created via SCIPmessagehdlrCreate().
1190  *
1191  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1192  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1193  *
1194  * @pre this method can be called in one of the following stages of the SCIP solving process:
1195  * - \ref SCIP_STAGE_INIT
1196  * - \ref SCIP_STAGE_PROBLEM
1197  *
1198  * @note The currently installed messages handler gets freed if this SCIP instance is its last user (w.r.t. capture/release).
1199  */
1201  SCIP* scip, /**< SCIP data structure */
1202  SCIP_MESSAGEHDLR* messagehdlr /**< message handler to install, or NULL to suppress all output */
1203  )
1204 {
1205  int i;
1206 
1207  SCIP_CALL( checkStage(scip, "SCIPsetMessagehdlr", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
1208 
1209  assert(scip != NULL);
1210  assert(scip->set != NULL);
1211  assert(scip->set->nlpis != NULL || scip->set->nnlpis == 0);
1212 
1213  /* update message handler in NLP solver interfaces */
1214  for( i = 0; i < scip->set->nnlpis; ++i )
1215  {
1216  assert(scip->set->nlpis[i] != NULL);
1217 
1218  SCIP_CALL( SCIPnlpiSetMessageHdlr(scip->set->nlpis[i], messagehdlr) );
1219  }
1220 
1221  SCIPmessagehdlrCapture(messagehdlr);
1222 
1224  assert(scip->messagehdlr == NULL);
1225 
1226  scip->messagehdlr = messagehdlr;
1227 
1228  return SCIP_OKAY;
1229 }
1230 
1231 /** returns the currently installed message handler
1232  *
1233  * @return the currently installed message handler, or NULL if messages are currently suppressed
1234  */
1236  SCIP* scip /**< SCIP data structure */
1237  )
1238 {
1239  return scip->messagehdlr;
1240 }
1241 
1242 /** sets the log file name for the currently installed message handler */
1244  SCIP* scip, /**< SCIP data structure */
1245  const char* filename /**< name of log file, or NULL (no log) */
1246  )
1247 {
1248  if( scip->messagehdlr != NULL )
1249  {
1250  SCIPmessagehdlrSetLogfile(scip->messagehdlr, filename);
1251  }
1252 }
1253 
1254 /** sets the currently installed message handler to be quiet (or not) */
1256  SCIP* scip, /**< SCIP data structure */
1257  SCIP_Bool quiet /**< should screen messages be suppressed? */
1258  )
1259 {
1260  if( scip->messagehdlr != NULL )
1261  {
1262  SCIPmessagehdlrSetQuiet(scip->messagehdlr, quiet);
1263  }
1264 }
1265 
1266 /** prints a warning message via the message handler */
1268  SCIP* scip, /**< SCIP data structure */
1269  const char* formatstr, /**< format string like in printf() function */
1270  ... /**< format arguments line in printf() function */
1271  )
1272 {
1273  va_list ap;
1274 
1275  assert(scip != NULL);
1276 
1277  va_start(ap, formatstr); /*lint !e838*/
1278  SCIPmessageVFPrintWarning(scip->messagehdlr, formatstr, ap);
1279  va_end(ap);
1280 }
1281 
1282 /** prints a debug message */
1284  SCIP* scip, /**< SCIP data structure */
1285  const char* sourcefile, /**< name of the source file that called the function */
1286  int sourceline, /**< line in the source file where the function was called */
1287  const char* formatstr, /**< format string like in printf() function */
1288  ... /**< format arguments line in printf() function */
1289  )
1290 {
1291  int subscipdepth = 0;
1292  va_list ap;
1293 
1294  assert( sourcefile != NULL );
1295  assert( scip != NULL );
1296 
1297  if ( scip->stat != NULL )
1298  subscipdepth = scip->stat->subscipdepth;
1299  if ( subscipdepth > 0 )
1300  SCIPmessageFPrintInfo(scip->messagehdlr, NULL, "%d: [%s:%d] debug: ", subscipdepth, sourcefile, sourceline);
1301  else
1302  SCIPmessageFPrintInfo(scip->messagehdlr, NULL, "[%s:%d] debug: ", sourcefile, sourceline);
1303 
1304  va_start(ap, formatstr); /*lint !e838*/
1305  SCIPmessageVFPrintInfo(scip->messagehdlr, NULL, formatstr, ap);
1306  va_end(ap);
1307 }
1308 
1309 /** prints a debug message without precode */
1311  SCIP* scip, /**< SCIP data structure */
1312  const char* formatstr, /**< format string like in printf() function */
1313  ... /**< format arguments line in printf() function */
1314  )
1315 {
1316  va_list ap;
1317 
1318  assert( scip != NULL );
1319 
1320  va_start(ap, formatstr); /*lint !e838*/
1321  SCIPmessageVFPrintInfo(scip->messagehdlr, NULL, formatstr, ap);
1322  va_end(ap);
1323 }
1324 
1325 /** prints a dialog message that requests user interaction or is a direct response to a user interactive command */
1327  SCIP* scip, /**< SCIP data structure */
1328  FILE* file, /**< file stream to print into, or NULL for stdout */
1329  const char* formatstr, /**< format string like in printf() function */
1330  ... /**< format arguments line in printf() function */
1331  )
1332 {
1333  va_list ap;
1334 
1335  assert(scip != NULL);
1336 
1337  va_start(ap, formatstr); /*lint !e838*/
1338  SCIPmessageVFPrintDialog(scip->messagehdlr, file, formatstr, ap);
1339  va_end(ap);
1340 }
1341 
1342 /** prints a message */
1344  SCIP* scip, /**< SCIP data structure */
1345  FILE* file, /**< file stream to print into, or NULL for stdout */
1346  const char* formatstr, /**< format string like in printf() function */
1347  ... /**< format arguments line in printf() function */
1348  )
1349 {
1350  va_list ap;
1351 
1352  assert(scip != NULL);
1353 
1354  va_start(ap, formatstr); /*lint !e838*/
1355  SCIPmessageVFPrintInfo(scip->messagehdlr, file, formatstr, ap);
1356  va_end(ap);
1357 }
1358 
1359 /** prints a message depending on the verbosity level */
1361  SCIP* scip, /**< SCIP data structure */
1362  SCIP_VERBLEVEL msgverblevel, /**< verbosity level of this message */
1363  FILE* file, /**< file stream to print into, or NULL for stdout */
1364  const char* formatstr, /**< format string like in printf() function */
1365  ... /**< format arguments line in printf() function */
1366  )
1367 {
1368  va_list ap;
1369 
1370  assert(scip != NULL);
1371  assert(scip->set != NULL);
1372 
1373  va_start(ap, formatstr); /*lint !e838*/
1374  SCIPmessageVFPrintVerbInfo(scip->messagehdlr, scip->set->disp_verblevel, msgverblevel, file, formatstr, ap);
1375  va_end(ap);
1376 }
1377 
1378 /** returns the current message verbosity level
1379  *
1380  * @return message verbosity level of SCIP
1381  *
1382  * @see \ref SCIP_VerbLevel "SCIP_VERBLEVEL" for a list of all verbosity levels
1383  */
1385  SCIP* scip /**< SCIP data structure */
1386  )
1387 {
1388  assert(scip != NULL);
1389  assert(scip->set != NULL);
1390 
1391  return scip->set->disp_verblevel;
1392 }
1393 
1394 
1395 /*
1396  * SCIP copy methods
1397  */
1398 
1399 /** returns true if the @p cut matches the selection criterium for copying */
1400 static
1402  SCIP* scip, /**< SCIP data structure */
1403  SCIP_CUT* cut, /**< a cut */
1404  char cutsel /**< cut selection for sub SCIPs ('a'ge, activity 'q'uotient) */
1405  )
1406 {
1407  SCIP_Bool takecut;
1408 
1409  assert(cut != NULL);
1410 
1411  if( !SCIProwIsInLP(SCIPcutGetRow(cut)) )
1412  return FALSE;
1413 
1414  switch( cutsel )
1415  {
1416  case 'a':
1417  takecut = (SCIPcutGetAge(cut) == 0);
1418  break;
1419  case 'q':
1420  takecut = (SCIPcutGetLPActivityQuot(cut) >= scip->set->sepa_minactivityquot);
1421  break;
1422  default:
1423  SCIPerrorMessage("unknown cut selection strategy %c, must be either 'a' or 'q'\n");
1424  SCIPABORT();
1425  takecut = FALSE; /*lint !e527*/
1426  break;
1427  }
1428 
1429  return takecut;
1430 }
1431 
1432 /** copy active and tight cuts from one SCIP instance to linear constraints of another SCIP instance */
1433 static
1435  SCIP* sourcescip, /**< source SCIP data structure */
1436  SCIP* targetscip, /**< target SCIP data structure */
1437  SCIP_CUT** cuts, /**< cuts to copy */
1438  int ncuts, /**< number of cuts to copy */
1439  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
1440  * target variables, or NULL */
1441  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1442  * target constraints, or NULL */
1443  SCIP_Bool global, /**< create a global or a local copy? */
1444  int* ncutsadded /**< pointer to store number of copied cuts */
1445  )
1446 {
1447  int c;
1448 
1449  assert(sourcescip != NULL);
1450  assert(targetscip != NULL);
1451  assert(cuts != NULL || ncuts == 0);
1452  assert(ncutsadded != NULL);
1453 
1454  for( c = 0; c < ncuts; ++c )
1455  {
1456  SCIP_ROW* row;
1457  SCIP_Bool takecut;
1458 
1459  assert( cuts[c] != NULL ); /*lint !e613*/
1460  row = SCIPcutGetRow(cuts[c]); /*lint !e613*/
1461  assert(!SCIProwIsLocal(row));
1462  assert(!SCIProwIsModifiable(row));
1463 
1464  /* in case of a restart, convert the cuts with a good LP activity quotient; in other cases, e.g., when heuristics
1465  * copy cuts into subscips, take only currently active ones
1466  */
1467  if( sourcescip == targetscip )
1468  {
1469  assert( SCIPisInRestart(sourcescip) );
1470  takecut = takeCut(sourcescip, cuts[c], sourcescip->set->sepa_cutselrestart); /*lint !e613*/
1471  }
1472  else
1473  takecut = takeCut(sourcescip, cuts[c], sourcescip->set->sepa_cutselsubscip); /*lint !e613*/
1474 
1475  /* create a linear constraint out of the cut */
1476  if( takecut )
1477  {
1478  char name[SCIP_MAXSTRLEN];
1479  SCIP_CONS* cons;
1480  SCIP_COL** cols;
1481  SCIP_VAR** vars;
1482  int ncols;
1483  int i;
1484 
1485  cols = SCIProwGetCols(row);
1486  ncols = SCIProwGetNNonz(row);
1487 
1488  /* get all variables of the row */
1489  SCIP_CALL( SCIPallocBufferArray(targetscip, &vars, ncols) );
1490  for( i = 0; i < ncols; ++i )
1491  vars[i] = SCIPcolGetVar(cols[i]);
1492 
1493  /* get corresponding variables in targetscip if necessary */
1494  if( sourcescip != targetscip )
1495  {
1496  SCIP_Bool success;
1497 
1498  for( i = 0; i < ncols; ++i )
1499  {
1500  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, vars[i], &vars[i], varmap, consmap, global, &success) );
1501 
1502  if( !success )
1503  {
1504  SCIPdebugMsg(sourcescip, "Converting cuts to constraints failed.\n");
1505 
1506  /* free temporary memory */
1507  SCIPfreeBufferArray(targetscip, &vars);
1508  return SCIP_OKAY;
1509  }
1510  }
1511  }
1512 
1513  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%d", SCIProwGetName(row), SCIPgetNRuns(sourcescip));
1514  SCIP_CALL( SCIPcreateConsLinear(targetscip, &cons, name, ncols, vars, SCIProwGetVals(row),
1517  SCIP_CALL( SCIPaddCons(targetscip, cons) );
1518 
1519  SCIPdebugMsg(sourcescip, "Converted cut <%s> to constraint <%s>.\n", SCIProwGetName(row), SCIPconsGetName(cons));
1520  SCIPdebugPrintCons(targetscip, cons, NULL);
1521  SCIP_CALL( SCIPreleaseCons(targetscip, &cons) );
1522 
1523  /* free temporary memory */
1524  SCIPfreeBufferArray(targetscip, &vars);
1525 
1526  ++(*ncutsadded);
1527  }
1528  }
1529 
1530  return SCIP_OKAY;
1531 }
1532 
1533 /** copies plugins from sourcescip to targetscip; in case that a constraint handler which does not need constraints
1534  * cannot be copied, valid will return FALSE. All plugins can declare that, if their copy process failed, the
1535  * copied SCIP instance might not represent the same problem semantics as the original.
1536  * Note that in this case dual reductions might be invalid.
1537  *
1538  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
1539  * Also, 'passmessagehdlr' should be set to FALSE.
1540  * @note Do not change the source SCIP environment during the copying process
1541  *
1542  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1543  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1544  *
1545  * @pre This method can be called if sourcescip is in one of the following stages:
1546  * - \ref SCIP_STAGE_PROBLEM
1547  * - \ref SCIP_STAGE_TRANSFORMED
1548  * - \ref SCIP_STAGE_INITPRESOLVE
1549  * - \ref SCIP_STAGE_PRESOLVING
1550  * - \ref SCIP_STAGE_EXITPRESOLVE
1551  * - \ref SCIP_STAGE_PRESOLVED
1552  * - \ref SCIP_STAGE_INITSOLVE
1553  * - \ref SCIP_STAGE_SOLVING
1554  * - \ref SCIP_STAGE_SOLVED
1555  *
1556  * @pre This method can be called if targetscip is in one of the following stages:
1557  * - \ref SCIP_STAGE_INIT
1558  * - \ref SCIP_STAGE_FREE
1559  *
1560  * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
1561  * process was interrupted:
1562  * - \ref SCIP_STAGE_PROBLEM
1563  *
1564  * @note sourcescip stage does not get changed
1565  *
1566  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1567  */
1569  SCIP* sourcescip, /**< source SCIP data structure */
1570  SCIP* targetscip, /**< target SCIP data structure */
1571  SCIP_Bool copyreaders, /**< should the file readers be copied */
1572  SCIP_Bool copypricers, /**< should the variable pricers be copied */
1573  SCIP_Bool copyconshdlrs, /**< should the constraint handlers be copied */
1574  SCIP_Bool copyconflicthdlrs, /**< should the conflict handlers be copied */
1575  SCIP_Bool copypresolvers, /**< should the presolvers be copied */
1576  SCIP_Bool copyrelaxators, /**< should the relaxation handlers be copied */
1577  SCIP_Bool copyseparators, /**< should the separators be copied */
1578  SCIP_Bool copypropagators, /**< should the propagators be copied */
1579  SCIP_Bool copyheuristics, /**< should the heuristics be copied */
1580  SCIP_Bool copyeventhdlrs, /**< should the event handlers be copied */
1581  SCIP_Bool copynodeselectors, /**< should the node selectors be copied */
1582  SCIP_Bool copybranchrules, /**< should the branchrules be copied */
1583  SCIP_Bool copydisplays, /**< should the display columns be copied */
1584  SCIP_Bool copydialogs, /**< should the dialogs be copied */
1585  SCIP_Bool copytables, /**< should the statistics tables be copied */
1586  SCIP_Bool copynlpis, /**< should the NLPIs be copied */
1587  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
1588  SCIP_Bool* valid /**< pointer to store whether plugins, in particular all constraint
1589  * handlers which do not need constraints were validly copied */
1590  )
1591 {
1592  assert(sourcescip != NULL);
1593  assert(targetscip != NULL);
1594  assert(sourcescip->set != NULL);
1595  assert(targetscip->set != NULL);
1596 
1597  /* check stages for both, the source and the target SCIP data structure */
1598  SCIP_CALL( checkStage(sourcescip, "SCIPcopyPlugins", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1599  SCIP_CALL( checkStage(targetscip, "SCIPcopyPlugins", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
1600 
1601  /* passes the message handler of the source SCIP to the target SCIP, also if NULL */
1602  if( passmessagehdlr )
1603  {
1604  SCIP_CALL( SCIPsetMessagehdlr(targetscip, SCIPgetMessagehdlr(sourcescip)) );
1605  }
1606 
1607  SCIP_CALL( SCIPsetCopyPlugins(sourcescip->set, targetscip->set,
1608  copyreaders, copypricers, copyconshdlrs, copyconflicthdlrs, copypresolvers, copyrelaxators, copyseparators, copypropagators,
1609  copyheuristics, copyeventhdlrs, copynodeselectors, copybranchrules, copydisplays, copydialogs, copytables, copynlpis, valid) );
1610 
1611  return SCIP_OKAY;
1612 }
1613 
1614 /** create a problem by copying the problem data of the source SCIP */
1615 static
1617  SCIP* sourcescip, /**< source SCIP data structure */
1618  SCIP* targetscip, /**< target SCIP data structure */
1619  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
1620  * target variables, or NULL */
1621  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1622  * target constraints, or NULL */
1623  SCIP_Bool original, /**< should the original problem be copied? */
1624  SCIP_Bool global, /**< create a global or a local copy? (set to TRUE for original copy) */
1625  const char* name /**< problem name of target */
1626  )
1627 {
1628  SCIP_PROB* sourceprob;
1629  SCIP_HASHMAP* localvarmap;
1630  SCIP_HASHMAP* localconsmap;
1631  SCIP_Bool uselocalvarmap;
1632  SCIP_Bool uselocalconsmap;
1633 
1634  assert(sourcescip != NULL);
1635  assert(targetscip != NULL);
1636  assert(!original || global);
1637  assert(original || SCIPisTransformed(sourcescip));
1638 
1639  /* free old problem */
1640  SCIP_CALL( SCIPfreeProb(targetscip) );
1641  assert(targetscip->set->stage == SCIP_STAGE_INIT);
1642 
1643  uselocalvarmap = (varmap == NULL);
1644  uselocalconsmap = (consmap == NULL);
1645 
1646  if( uselocalvarmap )
1647  {
1648  /* create the variable mapping hash map */
1649  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPgetNVars(sourcescip)) );
1650  }
1651  else
1652  localvarmap = varmap;
1653 
1654  if( uselocalconsmap )
1655  {
1656  /* create the constraint mapping hash map */
1657  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPgetNConss(sourcescip)) );
1658  }
1659  else
1660  localconsmap = consmap;
1661 
1662  /* switch stage to PROBLEM */
1663  targetscip->set->stage = SCIP_STAGE_PROBLEM;
1664 
1665  if( original )
1666  sourceprob = sourcescip->origprob;
1667  else
1668  sourceprob = sourcescip->transprob;
1669 
1670  /* create the statistics data structure */
1671  SCIP_CALL( SCIPstatCreate(&targetscip->stat, targetscip->mem->probmem, targetscip->set, targetscip->transprob, targetscip->origprob, targetscip->messagehdlr) );
1672  targetscip->stat->subscipdepth = sourcescip->stat->subscipdepth + 1;
1673 
1674  /* create the problem by copying the source problem */
1675  SCIP_CALL( SCIPprobCopy(&targetscip->origprob, targetscip->mem->probmem, targetscip->set, name, sourcescip, sourceprob, localvarmap, localconsmap, global) );
1676 
1677  /* creating the solution candidates storage */
1678  /**@todo copy solution of source SCIP as candidates for the target SCIP */
1679  SCIP_CALL( SCIPprimalCreate(&targetscip->origprimal) );
1680 
1681  /* create conflict store to store conflict constraints */
1682  SCIP_CALL( SCIPconflictstoreCreate(&targetscip->conflictstore, targetscip->set) );
1683 
1684  if( uselocalvarmap )
1685  {
1686  /* free hash map */
1687  SCIPhashmapFree(&localvarmap);
1688  }
1689 
1690  if( uselocalconsmap )
1691  {
1692  /* free hash map */
1693  SCIPhashmapFree(&localconsmap);
1694  }
1695 
1696  return SCIP_OKAY;
1697 }
1698 
1699 
1700 /** create a problem by copying the problem data of the source SCIP
1701  *
1702  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
1703  * @note Do not change the source SCIP environment during the copying process
1704  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1705  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1706  *
1707  * @pre This method can be called if sourcescip is in one of the following stages:
1708  * - \ref SCIP_STAGE_PROBLEM
1709  * - \ref SCIP_STAGE_TRANSFORMED
1710  * - \ref SCIP_STAGE_INITPRESOLVE
1711  * - \ref SCIP_STAGE_PRESOLVING
1712  * - \ref SCIP_STAGE_EXITPRESOLVE
1713  * - \ref SCIP_STAGE_PRESOLVED
1714  * - \ref SCIP_STAGE_INITSOLVE
1715  * - \ref SCIP_STAGE_SOLVING
1716  * - \ref SCIP_STAGE_SOLVED
1717  *
1718  * @pre This method can be called if targetscip is in one of the following stages:
1719  * - \ref SCIP_STAGE_INIT
1720  * - \ref SCIP_STAGE_PROBLEM
1721  * - \ref SCIP_STAGE_TRANSFORMED
1722  * - \ref SCIP_STAGE_INITPRESOLVE
1723  * - \ref SCIP_STAGE_PRESOLVING
1724  * - \ref SCIP_STAGE_EXITPRESOLVE
1725  * - \ref SCIP_STAGE_PRESOLVED
1726  * - \ref SCIP_STAGE_INITSOLVE
1727  * - \ref SCIP_STAGE_SOLVING
1728  * - \ref SCIP_STAGE_SOLVED
1729  * - \ref SCIP_STAGE_FREE
1730  *
1731  * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
1732  * process was interrupted:
1733  * - \ref SCIP_STAGE_PROBLEM
1734  *
1735  * @note sourcescip stage does not get changed
1736  *
1737  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1738  */
1740  SCIP* sourcescip, /**< source SCIP data structure */
1741  SCIP* targetscip, /**< target SCIP data structure */
1742  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
1743  * target variables, or NULL */
1744  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1745  * target constraints, or NULL */
1746  SCIP_Bool global, /**< create a global or a local copy? */
1747  const char* name /**< problem name of target */
1748  )
1749 {
1750  assert(sourcescip != NULL);
1751  assert(targetscip != NULL);
1752 
1753  /* check stages for both, the source and the target SCIP data structure */
1754  SCIP_CALL( checkStage(sourcescip, "SCIPcopyProb", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1755  SCIP_CALL( checkStage(targetscip, "SCIPcopyProb", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE) );
1756 
1757  SCIP_CALL( copyProb(sourcescip, targetscip, varmap, consmap, FALSE, global, name) );
1758 
1759  return SCIP_OKAY;
1760 }
1761 
1762 /** create a problem by copying the original problem data of the source SCIP
1763  *
1764  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
1765  * @note Do not change the source SCIP environment during the copying process
1766  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1767  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1768  *
1769  * @pre This method can be called if sourcescip is in one of the following stages:
1770  * - \ref SCIP_STAGE_PROBLEM
1771  * - \ref SCIP_STAGE_TRANSFORMED
1772  * - \ref SCIP_STAGE_INITPRESOLVE
1773  * - \ref SCIP_STAGE_PRESOLVING
1774  * - \ref SCIP_STAGE_EXITPRESOLVE
1775  * - \ref SCIP_STAGE_PRESOLVED
1776  * - \ref SCIP_STAGE_INITSOLVE
1777  * - \ref SCIP_STAGE_SOLVING
1778  * - \ref SCIP_STAGE_SOLVED
1779  *
1780  * @pre This method can be called if targetscip is in one of the following stages:
1781  * - \ref SCIP_STAGE_INIT
1782  * - \ref SCIP_STAGE_FREE
1783  *
1784  * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
1785  * process was interrupted:
1786  * - \ref SCIP_STAGE_PROBLEM
1787  *
1788  * @note sourcescip stage does not get changed
1789  *
1790  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1791  */
1793  SCIP* sourcescip, /**< source SCIP data structure */
1794  SCIP* targetscip, /**< target SCIP data structure */
1795  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
1796  * target variables, or NULL */
1797  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1798  * target constraints, or NULL */
1799  const char* name /**< problem name of target */
1800  )
1801 {
1802  assert(sourcescip != NULL);
1803  assert(targetscip != NULL);
1804 
1805  /* check stages for both, the source and the target SCIP data structure */
1806  SCIP_CALL( checkStage(sourcescip, "SCIPcopyOrigProb", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1807  SCIP_CALL( checkStage(targetscip, "SCIPcopyOrigProb", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
1808 
1809  SCIP_CALL( copyProb(sourcescip, targetscip, varmap, consmap, TRUE, TRUE, name) );
1810 
1811  /* set the correct objective sense; necessary if we maximize in the original problem */
1812  SCIP_CALL( SCIPsetObjsense(targetscip, SCIPgetObjsense(sourcescip)) );
1813 
1814  return SCIP_OKAY;
1815 }
1816 
1817 /** enables constraint compression.
1818  *
1819  * If constraint compression is enabled, fixed variables will be treated as constants
1820  * by all constraints that are copied after calling this method.
1821  *
1822  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1823  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1824  *
1825  * @pre This method can be called if scip is in one of the following stages:
1826  * - \ref SCIP_STAGE_PROBLEM
1827  *
1828  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1829  */
1831  SCIP* scip /**< source SCIP data structure */
1832  )
1833 {
1834  assert(scip != NULL);
1835  assert(scip->origprob != NULL);
1836 
1837 
1838  /* check stage */
1839  SCIP_CALL( checkStage(scip, "SCIPenableConsCompression", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
1840 
1841  /* enable problem compression */
1843 
1844  return SCIP_OKAY;
1845 }
1846 
1847 /** is constraint compression enabled?
1848  *
1849  * If constraint compression is enabled, fixed variables can be treated as constants
1850  * by all constraints that are copied after calling this method.
1851  *
1852  * @return TRUE if problem constraint compression is enabled, otherwise FALSE
1853  *
1854  * @pre This method can be called if scip is in one of the following stages:
1855  * - \ref SCIP_STAGE_PROBLEM
1856  * - \ref SCIP_STAGE_TRANSFORMING
1857  * - \ref SCIP_STAGE_TRANSFORMED
1858  * - \ref SCIP_STAGE_INITPRESOLVE
1859  * - \ref SCIP_STAGE_PRESOLVING
1860  * - \ref SCIP_STAGE_EXITPRESOLVE
1861  * - \ref SCIP_STAGE_PRESOLVED
1862  * - \ref SCIP_STAGE_INITSOLVE
1863  * - \ref SCIP_STAGE_SOLVING
1864  * - \ref SCIP_STAGE_SOLVED
1865  * - \ref SCIP_STAGE_EXITSOLVE
1866  * - \ref SCIP_STAGE_FREETRANS
1867  *
1868  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1869  */
1871  SCIP* scip /**< source SCIP data structure */
1872  )
1873 {
1874  assert(scip != NULL);
1875  assert(scip->origprob != NULL);
1876 
1877  /* check stage */
1878  SCIP_CALL_ABORT( checkStage(scip, "SCIPisConsCompressionEnabled", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
1879 
1880  /* is problem compression enabled */
1882 }
1883 
1884 /** returns copy of the source variable; if there already is a copy of the source variable in the variable hash map,
1885  * it is just returned as target variable; otherwise a new variable will be created and added to the target SCIP; this
1886  * created variable is added to the variable hash map and returned as target variable
1887  *
1888  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
1889  * @note Do not change the source SCIP environment during the copying process
1890  * @note if a new variable was created, this variable will be added to the target-SCIP, but it is not captured
1891  *
1892  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1893  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1894  *
1895  * @pre This method can be called if sourcescip is in one of the following stages:
1896  * - \ref SCIP_STAGE_PROBLEM
1897  * - \ref SCIP_STAGE_TRANSFORMED
1898  * - \ref SCIP_STAGE_INITPRESOLVE
1899  * - \ref SCIP_STAGE_PRESOLVING
1900  * - \ref SCIP_STAGE_EXITPRESOLVE
1901  * - \ref SCIP_STAGE_PRESOLVED
1902  * - \ref SCIP_STAGE_INITSOLVE
1903  * - \ref SCIP_STAGE_SOLVING
1904  * - \ref SCIP_STAGE_SOLVED
1905  *
1906  * @pre This method can be called if targetscip is in one of the following stages:
1907  * - \ref SCIP_STAGE_PROBLEM
1908  * - \ref SCIP_STAGE_TRANSFORMED
1909  * - \ref SCIP_STAGE_INITPRESOLVE
1910  * - \ref SCIP_STAGE_PRESOLVING
1911  * - \ref SCIP_STAGE_EXITPRESOLVE
1912  * - \ref SCIP_STAGE_SOLVING
1913  *
1914  * @note targetscip stage does not get changed
1915  *
1916  * @note sourcescip stage does not get changed
1917  *
1918  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1919  */
1921  SCIP* sourcescip, /**< source SCIP data structure */
1922  SCIP* targetscip, /**< target SCIP data structure */
1923  SCIP_VAR* sourcevar, /**< source variable */
1924  SCIP_VAR** targetvar, /**< pointer to store the target variable */
1925  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
1926  * target variables, or NULL */
1927  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1928  * target constraints, or NULL */
1929  SCIP_Bool global, /**< should global or local bounds be used? */
1930  SCIP_Bool* success /**< pointer to store whether the copying was successful or not */
1931  )
1932 {
1933  SCIP_HASHMAP* localvarmap;
1934  SCIP_HASHMAP* localconsmap;
1935  SCIP_VAR* var;
1936  SCIP_Bool uselocalvarmap;
1937  SCIP_Bool uselocalconsmap;
1938 
1939  assert(sourcescip != NULL);
1940  assert(targetscip != NULL);
1941  assert(sourcevar != NULL);
1942  assert(targetvar != NULL);
1943  assert(sourcevar->scip == sourcescip);
1944 
1945  /* check stages for both, the source and the target SCIP data structure */
1946  SCIP_CALL( checkStage(sourcescip, "SCIPgetVarCopy", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1947  SCIP_CALL( checkStage(targetscip, "SCIPgetVarCopy", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1948 
1949  uselocalvarmap = (varmap == NULL);
1950  uselocalconsmap = (consmap == NULL);
1951  *success = TRUE;
1952 
1953  /* try to retrieve copied variable from hashmap */
1954  if( !uselocalvarmap )
1955  {
1956  *targetvar = (SCIP_VAR*) SCIPhashmapGetImage(varmap, sourcevar);
1957  if( *targetvar != NULL )
1958  return SCIP_OKAY;
1959  }
1960 
1961  /* if the target SCIP is already in solving stage we currently are not copying the variable!
1962  * this has to be done because we cannot simply add variables to SCIP during solving and thereby enlarge the search
1963  * space.
1964  * unlike column generation we cannot assume here that the variable could be implicitly set to zero in all prior
1965  * computations
1966  */
1967  if( SCIPgetStage(targetscip) > SCIP_STAGE_PROBLEM )
1968  {
1969  *success = FALSE;
1970  *targetvar = NULL;
1971 
1972  return SCIP_OKAY;
1973  }
1974 
1975  /* create the variable mapping hash map */
1976  if( uselocalvarmap )
1977  {
1978  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPgetNVars(sourcescip)) );
1979  }
1980  else
1981  localvarmap = varmap;
1982 
1983  if( uselocalconsmap )
1984  {
1985  /* create the constraint mapping hash map */
1986  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPgetNConss(sourcescip)) );
1987  }
1988  else
1989  localconsmap = consmap;
1990 
1991  /* if variable does not exist yet in target SCIP, create it */
1992  switch( SCIPvarGetStatus(sourcevar) )
1993  {
1995  case SCIP_VARSTATUS_COLUMN:
1996  case SCIP_VARSTATUS_LOOSE:
1997  case SCIP_VARSTATUS_FIXED:
1998  SCIP_CALL( SCIPvarCopy(&var, targetscip->mem->probmem, targetscip->set, targetscip->stat,
1999  sourcescip, sourcevar, localvarmap, localconsmap, global) );
2000  break;
2001 
2003  {
2004  SCIP_CONS* cons;
2005  char name[SCIP_MAXSTRLEN];
2006 
2007  SCIP_VAR* sourceaggrvar;
2008  SCIP_VAR* targetaggrvar;
2009  SCIP_Real aggrcoef;
2010  SCIP_Real constant;
2011 
2012  /* get aggregation data */
2013  sourceaggrvar = SCIPvarGetAggrVar(sourcevar);
2014  aggrcoef = SCIPvarGetAggrScalar(sourcevar);
2015  constant = SCIPvarGetAggrConstant(sourcevar);
2016 
2017  /* get copy of the aggregation variable */
2018  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, sourceaggrvar, &targetaggrvar, localvarmap, localconsmap, global, success) );
2019  assert(*success);
2020 
2021  /* create copy of the aggregated variable */
2022  SCIP_CALL( SCIPvarCopy(&var, targetscip->mem->probmem, targetscip->set, targetscip->stat,
2023  sourcescip, sourcevar, localvarmap, localconsmap, global) );
2024 
2025  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_aggr", SCIPvarGetName(sourcevar));
2026 
2027  /* add aggregation x = a*y + c as linear constraint x - a*y = c */
2028  SCIP_CALL( SCIPcreateConsLinear(targetscip, &cons, name, 0, NULL, NULL, constant,
2029  constant, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE) );
2030  SCIP_CALL( SCIPaddCoefLinear(targetscip, cons, var, 1.0) );
2031  SCIP_CALL( SCIPaddCoefLinear(targetscip, cons, targetaggrvar, -aggrcoef) );
2032 
2033  SCIP_CALL( SCIPaddCons(targetscip, cons) );
2034  SCIP_CALL( SCIPreleaseCons(targetscip, &cons) );
2035 
2036  break;
2037  }
2039  {
2040  SCIP_CONS* cons;
2041  char name[SCIP_MAXSTRLEN];
2042 
2043  SCIP_VAR** sourceaggrvars;
2044  SCIP_VAR** targetaggrvars;
2045  SCIP_Real* aggrcoefs;
2046  SCIP_Real constant;
2047 
2048  int naggrvars;
2049  int i;
2050 
2051  /* get the active representation */
2052  SCIP_CALL( SCIPflattenVarAggregationGraph(sourcescip, sourcevar) );
2053 
2054  /* get multi-aggregation data */
2055  naggrvars = SCIPvarGetMultaggrNVars(sourcevar);
2056  sourceaggrvars = SCIPvarGetMultaggrVars(sourcevar);
2057  aggrcoefs = SCIPvarGetMultaggrScalars(sourcevar);
2058  constant = SCIPvarGetMultaggrConstant(sourcevar);
2059 
2060  SCIP_CALL( SCIPallocBufferArray(targetscip, &targetaggrvars, naggrvars) );
2061 
2062  /* get copies of the active variables of the multi-aggregation */
2063  for( i = 0; i < naggrvars; ++i )
2064  {
2065  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, sourceaggrvars[i], &targetaggrvars[i], localvarmap, localconsmap, global, success) );
2066  assert(*success);
2067  }
2068 
2069  /* create copy of the multi-aggregated variable */
2070  SCIP_CALL( SCIPvarCopy(&var, targetscip->mem->probmem, targetscip->set, targetscip->stat,
2071  sourcescip, sourcevar, localvarmap, localconsmap, global) );
2072 
2073  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_multaggr", SCIPvarGetName(sourcevar));
2074 
2075  /* add multi-aggregation x = a^T y + c as linear constraint a^T y - x = -c */
2076  SCIP_CALL( SCIPcreateConsLinear(targetscip, &cons, name, naggrvars, targetaggrvars, aggrcoefs, -constant,
2077  -constant, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE) );
2078  SCIP_CALL( SCIPaddCoefLinear(targetscip, cons, var, -1.0) );
2079  SCIP_CALL( SCIPaddCons(targetscip, cons) );
2080  SCIP_CALL( SCIPreleaseCons(targetscip, &cons) );
2081 
2082  SCIPfreeBufferArray(targetscip, &targetaggrvars);
2083 
2084  break;
2085  }
2087  {
2088  SCIP_VAR* sourcenegatedvar;
2089  SCIP_VAR* targetnegatedvar;
2090 
2091  /* get negated source variable */
2092  sourcenegatedvar = SCIPvarGetNegationVar(sourcevar);
2093  assert(sourcenegatedvar != NULL);
2094  assert(SCIPvarGetStatus(sourcenegatedvar) != SCIP_VARSTATUS_NEGATED);
2095 
2096  /* get copy of negated source variable */
2097  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, sourcenegatedvar, &targetnegatedvar, localvarmap, localconsmap, global, success) );
2098  assert(*success);
2099  assert(SCIPvarGetStatus(targetnegatedvar) != SCIP_VARSTATUS_NEGATED);
2100 
2101  /* get negation of copied negated source variable, this is the target variable */
2102  SCIP_CALL( SCIPgetNegatedVar(targetscip, targetnegatedvar, targetvar) );
2103  assert(SCIPvarGetStatus(*targetvar) == SCIP_VARSTATUS_NEGATED);
2104 
2105  /* free local hash maps if necessary */
2106  if( uselocalvarmap )
2107  SCIPhashmapFree(&localvarmap);
2108 
2109  if( uselocalconsmap )
2110  SCIPhashmapFree(&localconsmap);
2111 
2112  /* we have to return right away, to avoid adding the negated variable to the problem since the "not negated"
2113  * variable was already added */
2114  return SCIP_OKAY;
2115  }
2116  default:
2117  /* note that this is in an internal SCIP error since the variable status is only handled by the core */
2118  SCIPerrorMessage("unknown variable status\n");
2119  SCIPABORT();
2120  return SCIP_ERROR; /*lint !e527*/
2121  }
2122 
2123  /* add the (new) target variable to the target problem */
2124  SCIP_CALL( SCIPaddVar(targetscip, var) );
2125 
2126  *targetvar = var;
2127 
2128  /* remove the variable capture which was done due to the creation of the variable */
2129  SCIP_CALL( SCIPreleaseVar(targetscip, &var) );
2130 
2131  /* free local hash maps if necessary */
2132  if( uselocalvarmap )
2133  SCIPhashmapFree(&localvarmap);
2134 
2135  if( uselocalconsmap )
2136  SCIPhashmapFree(&localconsmap);
2137 
2138  return SCIP_OKAY;
2139 }
2140 
2141 /** copies all original or active variables from source-SCIP and adds these variable to the target-SCIP; the mapping
2142  * between these variables are stored in the variable hashmap, target-SCIP has to be in problem creation stage, fixed
2143  * and aggregated variables do not get copied
2144  */
2145 static
2147  SCIP* sourcescip, /**< source SCIP data structure */
2148  SCIP* targetscip, /**< target SCIP data structure */
2149  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
2150  * target variables, or NULL */
2151  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2152  * target constraints, or NULL */
2153  SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
2154  SCIP_Real* fixedvals, /**< array of fixing values for target SCIP variables, or NULL */
2155  int nfixedvars, /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
2156  SCIP_Bool original, /**< should original variables be copied? */
2157  SCIP_Bool global /**< should global or local bounds be used? (for original=FALSE) */
2158  )
2159 {
2160  SCIP_VAR** sourcevars;
2161  SCIP_HASHMAP* localvarmap;
2162  SCIP_HASHMAP* localconsmap;
2163  SCIP_Bool uselocalvarmap;
2164  SCIP_Bool uselocalconsmap;
2165  int nsourcevars;
2166  int i;
2167 
2168  assert(sourcescip != NULL);
2169  assert(targetscip != NULL);
2170  assert(nfixedvars == 0 || fixedvars != NULL);
2171  assert(nfixedvars == 0 || fixedvals != NULL);
2172 
2173  if( original )
2174  {
2175  /* get original variables of the source SCIP */
2176  SCIP_CALL( SCIPgetOrigVarsData(sourcescip, &sourcevars, &nsourcevars, NULL, NULL, NULL, NULL) );
2177  }
2178  else
2179  {
2180  /* get active variables of the source SCIP */
2181  SCIP_CALL( SCIPgetVarsData(sourcescip, &sourcevars, &nsourcevars, NULL, NULL, NULL, NULL) );
2182  }
2183 
2184  uselocalvarmap = (varmap == NULL);
2185  uselocalconsmap = (consmap == NULL);
2186 
2187  if( uselocalvarmap )
2188  {
2189  /* create the variable mapping hash map */
2190  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPgetNVars(sourcescip)) );
2191  }
2192  else
2193  localvarmap = varmap;
2194 
2195  if( uselocalconsmap )
2196  {
2197  /* create the constraint mapping hash map */
2198  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPgetNConss(sourcescip)) );
2199  }
2200  else
2201  localconsmap = consmap;
2202 
2203  /* create the variables of the target SCIP */
2204  for( i = 0; i < nsourcevars; ++i )
2205  {
2206  SCIP_Bool success;
2207  SCIP_VAR* targetvar;
2208 
2209  /* copy variable and add this copy to the target SCIP if the copying was valid */
2210  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, sourcevars[i], &targetvar, localvarmap, localconsmap, global, &success) );
2211  assert(success);
2212  assert(targetvar != NULL);
2213  }
2214 
2215  /* fix the variables that should be fixed right away */
2216  for( i = 0; i < nfixedvars; ++i )
2217  {
2218  SCIP_VAR* targetvar;
2219  SCIP_Bool infeasible;
2220  SCIP_Bool fixed;
2221 
2222  /* retrieve target variable as image of the source variable */
2223  targetvar = (SCIP_VAR*) SCIPhashmapGetImage(localvarmap, (void *)fixedvars[i]);
2224  assert(targetvar != NULL);
2225 
2226  /* fix the variable to the specified value */
2227  infeasible = fixed = FALSE;
2228  SCIP_CALL( SCIPfixVar(targetscip, targetvar, fixedvals[i], &infeasible, &fixed) );
2229 
2230  assert(!infeasible);
2231  assert(fixed);
2232  }
2233 
2234  /* integer variables that are fixed to zero or one or have bounds [0,1] will be converted to binaries */
2235 #ifndef NDEBUG
2236  if( original )
2237  {
2238  /* TODO : account for integers converted to binaries
2239  assert(SCIPgetNOrigBinVars(sourcescip) == SCIPgetNOrigBinVars(targetscip));
2240  assert(SCIPgetNOrigIntVars(sourcescip) == SCIPgetNOrigIntVars(targetscip));
2241  assert(SCIPgetNOrigImplVars(sourcescip) == SCIPgetNOrigImplVars(targetscip));
2242  assert(SCIPgetNOrigContVars(sourcescip) == SCIPgetNOrigContVars(targetscip));
2243  */
2244  }
2245  else
2246  {
2247  SCIP_VAR** sourcefixedvars;
2248  int nsourcefixedvars;
2249  int nfixedbinvars;
2250  int nfixedintvars;
2251  int nfixedimplvars;
2252  int nfixedcontvars;
2253 
2254  sourcefixedvars = SCIPgetFixedVars(sourcescip);
2255  nsourcefixedvars = SCIPgetNFixedVars(sourcescip);
2256  nfixedbinvars = 0;
2257  nfixedintvars = 0;
2258  nfixedimplvars = 0;
2259  nfixedcontvars = 0;
2260 
2261  /* count number of fixed variables for all variable types */
2262  for( i = 0; i < nsourcefixedvars; ++i )
2263  {
2264  switch( SCIPvarGetType(sourcefixedvars[i]) )
2265  {
2266  case SCIP_VARTYPE_BINARY:
2267  nfixedbinvars++;
2268  break;
2269  case SCIP_VARTYPE_INTEGER:
2270  nfixedintvars++;
2271  break;
2272  case SCIP_VARTYPE_IMPLINT:
2273  nfixedimplvars++;
2274  break;
2276  nfixedcontvars++;
2277  break;
2278  default:
2279  SCIPerrorMessage("unknown variable type\n");
2280  return SCIP_INVALIDDATA;
2281  }
2282  }
2283  assert(nsourcefixedvars == nfixedbinvars + nfixedintvars + nfixedimplvars + nfixedcontvars);
2284  assert(SCIPgetNBinVars(sourcescip) <= SCIPgetNBinVars(targetscip));
2285  assert(SCIPgetNIntVars(sourcescip) + SCIPgetNBinVars(sourcescip) <= SCIPgetNIntVars(targetscip) + SCIPgetNBinVars(targetscip)
2286  && SCIPgetNIntVars(targetscip) + SCIPgetNBinVars(targetscip) <= SCIPgetNIntVars(sourcescip) + SCIPgetNBinVars(sourcescip) + nfixedbinvars + nfixedintvars );
2287  assert(SCIPgetNImplVars(sourcescip) <= SCIPgetNImplVars(targetscip)
2288  && SCIPgetNImplVars(targetscip) <= SCIPgetNImplVars(sourcescip) + nfixedimplvars);
2289  assert(SCIPgetNContVars(sourcescip) <= SCIPgetNContVars(targetscip)
2290  && SCIPgetNContVars(targetscip) <= SCIPgetNContVars(targetscip) + nfixedcontvars);
2291  }
2292 #endif
2293 
2294  if( uselocalvarmap )
2295  {
2296  /* free hash map */
2297  SCIPhashmapFree(&localvarmap);
2298  }
2299 
2300  if( uselocalconsmap )
2301  {
2302  /* free hash map */
2303  SCIPhashmapFree(&localconsmap);
2304  }
2305 
2306  return SCIP_OKAY;
2307 }
2308 
2309 /** copies all active variables from source-SCIP and adds these variable to the target-SCIP; the mapping between these
2310  * variables are stored in the variable hashmap, target-SCIP has to be in problem creation stage, fixed and aggregated
2311  * variables are not copied
2312  *
2313  * @note the variables are added to the target-SCIP but not captured
2314  *
2315  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
2316  * @note Do not change the source SCIP environment during the copying process
2317  *
2318  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2319  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2320  *
2321  * @pre This method can be called if sourcescip is in one of the following stages:
2322  * - \ref SCIP_STAGE_PROBLEM
2323  * - \ref SCIP_STAGE_TRANSFORMED
2324  * - \ref SCIP_STAGE_INITPRESOLVE
2325  * - \ref SCIP_STAGE_PRESOLVING
2326  * - \ref SCIP_STAGE_EXITPRESOLVE
2327  * - \ref SCIP_STAGE_PRESOLVED
2328  * - \ref SCIP_STAGE_INITSOLVE
2329  * - \ref SCIP_STAGE_SOLVING
2330  * - \ref SCIP_STAGE_SOLVED
2331  *
2332  * @pre This method can be called if targetscip is in one of the following stages:
2333  * - \ref SCIP_STAGE_PROBLEM
2334  *
2335  * @note sourcescip stage does not get changed
2336  *
2337  * @note targetscip stage does not get changed
2338  *
2339  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2340  */
2342  SCIP* sourcescip, /**< source SCIP data structure */
2343  SCIP* targetscip, /**< target SCIP data structure */
2344  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
2345  * target variables, or NULL */
2346  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2347  * target constraints, or NULL */
2348  SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
2349  SCIP_Real* fixedvals, /**< array of fixing values for target SCIP variables, or NULL */
2350  int nfixedvars, /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
2351  SCIP_Bool global /**< should global or local bounds be used? */
2352  )
2353 {
2354  assert(sourcescip != NULL);
2355  assert(targetscip != NULL);
2356 
2357  /* check stages for both, the source and the target SCIP data structure */
2358  SCIP_CALL( checkStage(sourcescip, "SCIPcopyVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2359  SCIP_CALL( checkStage(targetscip, "SCIPcopyVars", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
2360 
2361  SCIP_CALL( copyVars(sourcescip, targetscip, varmap, consmap, fixedvars, fixedvals, nfixedvars, FALSE, global) );
2362 
2363  return SCIP_OKAY;
2364 }
2365 
2366 /** copies all original variables from source-SCIP and adds these variable to the target-SCIP; the mapping between these
2367  * variables are stored in the variable hashmap, target-SCIP has to be in problem creation stage, fixed and aggregated
2368  * variables do not get copied
2369  *
2370  * @note the variables are added to the target-SCIP but not captured
2371  *
2372  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
2373  * @note Do not change the source SCIP environment during the copying process
2374  *
2375  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2376  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2377  *
2378  * @pre This method can be called if sourcescip is in one of the following stages:
2379  * - \ref SCIP_STAGE_PROBLEM
2380  * - \ref SCIP_STAGE_TRANSFORMED
2381  * - \ref SCIP_STAGE_INITPRESOLVE
2382  * - \ref SCIP_STAGE_PRESOLVING
2383  * - \ref SCIP_STAGE_EXITPRESOLVE
2384  * - \ref SCIP_STAGE_PRESOLVED
2385  * - \ref SCIP_STAGE_INITSOLVE
2386  * - \ref SCIP_STAGE_SOLVING
2387  * - \ref SCIP_STAGE_SOLVED
2388  *
2389  * @pre This method can be called if targetscip is in one of the following stages:
2390  * - \ref SCIP_STAGE_PROBLEM
2391  *
2392  * @note sourcescip stage does not get changed
2393  *
2394  * @note targetscip stage does not get changed
2395  *
2396  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2397  */
2399  SCIP* sourcescip, /**< source SCIP data structure */
2400  SCIP* targetscip, /**< target SCIP data structure */
2401  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
2402  * target variables, or NULL */
2403  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2404  * target constraints, or NULL */
2405  SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
2406  SCIP_Real* fixedvals, /**< array of fixing values for target SCIP variables, or NULL */
2407  int nfixedvars /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
2408  )
2409 {
2410  assert(sourcescip != NULL);
2411  assert(targetscip != NULL);
2412 
2413  /* check stages for both, the source and the target SCIP data structure */
2414  SCIP_CALL( checkStage(sourcescip, "SCIPcopyOrigVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2415  SCIP_CALL( checkStage(targetscip, "SCIPcopyOrigVars", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
2416 
2417  SCIP_CALL( copyVars(sourcescip, targetscip, varmap, consmap, fixedvars, fixedvals, nfixedvars, TRUE, TRUE) );
2418 
2419  return SCIP_OKAY;
2420 }
2421 
2422 /** merges the histories of variables from a source SCIP into a target SCIP. The two data structures should point to
2423  * different SCIP instances.
2424  *
2425  * @note the notion of source and target is inverted here; \p sourcescip usually denotes a copied SCIP instance, whereas
2426  * \p targetscip denotes the original instance
2427  */
2429  SCIP* sourcescip, /**< source SCIP data structure */
2430  SCIP* targetscip, /**< target SCIP data structure */
2431  SCIP_VAR** sourcevars, /**< source variables for history merge */
2432  SCIP_VAR** targetvars, /**< target variables for history merge */
2433  int nvars /**< number of variables in both variable arrays */
2434  )
2435 {
2436  int i;
2437 
2438  /* check if target scip has been set to allow merging variable statistics */
2439  if( !targetscip->set->history_allowmerge )
2440  return SCIP_OKAY;
2441 
2442  assert(nvars == 0 || (sourcevars != NULL && targetvars != NULL));
2443  assert(sourcescip != targetscip);
2444 
2445  /* we do not want to copy statistics from a scip that has not really started solving */
2446  if( SCIPgetStage(sourcescip) < SCIP_STAGE_SOLVING )
2447  return SCIP_OKAY;
2448 
2449  /* if the transformation of the source was subject to scaling, the history information cannot be just copied */
2450  if( !SCIPsetIsEQ(targetscip->set, 1.0, SCIPgetOrigObjscale(sourcescip))
2451  || !SCIPsetIsEQ(targetscip->set, 0.0, SCIPgetOrigObjoffset(sourcescip)) )
2452  return SCIP_OKAY;
2453 
2454  /* merge histories of the targetSCIP-variables to the SCIP variables. */
2455  for( i = 0; i < nvars; ++i )
2456  {
2457  SCIP_VARSTATUS sourcevarstatus;
2458 
2459  assert(sourcevars[i]->scip == sourcescip);
2460  assert(targetvars[i]->scip == targetscip);
2461 
2462  sourcevarstatus = SCIPvarGetStatus(sourcevars[i]);
2463 
2464  /* depending on the variable status, we use either the transformed variable history or the history of the col itself */
2465  switch( sourcevarstatus )
2466  {
2468  assert(NULL != SCIPvarGetTransVar(sourcevars[i]));
2469  SCIPvarMergeHistories(targetvars[i], SCIPvarGetTransVar(sourcevars[i]), targetscip->stat);
2470  break;
2471  case SCIP_VARSTATUS_COLUMN:
2472  SCIPvarMergeHistories(targetvars[i], sourcevars[i], targetscip->stat);
2473  break;
2474  default:
2475  /* other variable status are currently not supported for the merging */
2476  break;
2477  } /*lint !e788*/
2478  }
2479 
2480  return SCIP_OKAY;
2481 }
2482 
2483 /** returns copy of the source constraint; if there already is a copy of the source constraint in the constraint hash
2484  * map, it is just returned as target constraint; elsewise a new constraint will be created; this created constraint is
2485  * added to the constraint hash map and returned as target constraint; the variable map is used to map the variables of
2486  * the source SCIP to the variables of the target SCIP
2487  *
2488  * @warning If a constraint is marked to be checked for feasibility but not to be enforced, a LP or pseudo solution may
2489  * be declared feasible even if it violates this particular constraint. This constellation should only be
2490  * used, if no LP or pseudo solution can violate the constraint -- e.g. if a local constraint is redundant due
2491  * to the variable's local bounds.
2492  *
2493  * @note The constraint is not added to the target SCIP. You can check whether a constraint is added by calling
2494  * SCIPconsIsAdded(). (If you mix SCIPgetConsCopy() with SCIPcopyConss() you should pay attention to what you add
2495  * explicitly and what is already added.)
2496  *
2497  * @note The constraint is always captured, either during the creation of the copy or after finding the copy of the
2498  * constraint in the constraint hash map
2499  *
2500  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
2501  * @note Do not change the source SCIP environment during the copying process
2502  *
2503  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2504  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2505  *
2506  * @pre This method can be called if sourcescip is in one of the following stages:
2507  * - \ref SCIP_STAGE_PROBLEM
2508  * - \ref SCIP_STAGE_TRANSFORMED
2509  * - \ref SCIP_STAGE_INITPRESOLVE
2510  * - \ref SCIP_STAGE_PRESOLVING
2511  * - \ref SCIP_STAGE_EXITPRESOLVE
2512  * - \ref SCIP_STAGE_PRESOLVED
2513  * - \ref SCIP_STAGE_INITSOLVE
2514  * - \ref SCIP_STAGE_SOLVING
2515  * - \ref SCIP_STAGE_SOLVED
2516  *
2517  * @pre This method can be called if targetscip is in one of the following stages:
2518  * - \ref SCIP_STAGE_PROBLEM
2519  * - \ref SCIP_STAGE_TRANSFORMING
2520  * - \ref SCIP_STAGE_INITPRESOLVE
2521  * - \ref SCIP_STAGE_PRESOLVING
2522  * - \ref SCIP_STAGE_EXITPRESOLVE
2523  * - \ref SCIP_STAGE_PRESOLVED
2524  * - \ref SCIP_STAGE_SOLVING
2525  * - \ref SCIP_STAGE_EXITSOLVE
2526  *
2527  * @note sourcescip stage does not get changed
2528  *
2529  * @note targetscip stage does not get changed
2530  *
2531  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2532  */
2534  SCIP* sourcescip, /**< source SCIP data structure */
2535  SCIP* targetscip, /**< target SCIP data structure */
2536  SCIP_CONS* sourcecons, /**< source constraint of the source SCIP */
2537  SCIP_CONS** targetcons, /**< pointer to store the created target constraint */
2538  SCIP_CONSHDLR* sourceconshdlr, /**< source constraint handler for this constraint */
2539  SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to the corresponding
2540  * variables of the target SCIP, or NULL */
2541  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2542  * target constraints, or NULL */
2543  const char* name, /**< name of constraint, or NULL if the name of the source constraint should be used */
2544  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP? */
2545  SCIP_Bool separate, /**< should the constraint be separated during LP processing? */
2546  SCIP_Bool enforce, /**< should the constraint be enforced during node processing? */
2547  SCIP_Bool check, /**< should the constraint be checked for feasibility? */
2548  SCIP_Bool propagate, /**< should the constraint be propagated during node processing? */
2549  SCIP_Bool local, /**< is constraint only valid locally? */
2550  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)? */
2551  SCIP_Bool dynamic, /**< is constraint subject to aging? */
2552  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup? */
2553  SCIP_Bool stickingatnode, /**< should the constraint always be kept at the node where it was added, even
2554  * if it may be moved to a more global node? */
2555  SCIP_Bool global, /**< create a global or a local copy? */
2556  SCIP_Bool* valid /**< pointer to store whether the copying was valid or not */
2557  )
2558 {
2559  SCIP_HASHMAP* localvarmap;
2560  SCIP_HASHMAP* localconsmap;
2561  SCIP_Bool uselocalvarmap;
2562  SCIP_Bool uselocalconsmap;
2563 
2564  assert(targetcons != NULL);
2565  assert(sourceconshdlr != NULL);
2566 
2567  SCIP_CALL( checkStage(sourcescip, "SCIPgetConsCopy", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2568  SCIP_CALL( checkStage(targetscip, "SCIPgetConsCopy", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
2569 
2570  uselocalvarmap = (varmap == NULL);
2571  uselocalconsmap = (consmap == NULL);
2572 
2573  /* a variables map and a constraint map is needed to avoid infinite recursion */
2574  if( uselocalvarmap )
2575  {
2576  /* create the variable mapping hash map */
2577  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPgetNVars(sourcescip)) );
2578  }
2579  else
2580  localvarmap = varmap;
2581 
2582  *targetcons = NULL;
2583  if( uselocalconsmap )
2584  {
2585  /* create local constraint mapping hash map */
2586  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPgetNConss(sourcescip)) );
2587  }
2588  else
2589  {
2590  /* use global map and try to retrieve copied constraint */
2591  localconsmap = consmap;
2592  *targetcons = (SCIP_CONS*) SCIPhashmapGetImage(localconsmap, sourcecons);
2593  }
2594 
2595  if( *targetcons != NULL )
2596  {
2597  /* if found capture existing copy of the constraint */
2598  SCIP_CALL( SCIPcaptureCons(targetscip, *targetcons) );
2599  *valid = TRUE;
2600  }
2601  else
2602  {
2603  /* otherwise create a copy of the constraint */
2604  SCIP_CALL( SCIPconsCopy(targetcons, targetscip->set, name, sourcescip, sourceconshdlr, sourcecons, localvarmap, localconsmap,
2605  initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, global, valid) );
2606 
2607  /* it is possible for the constraint handler to declare the copy valid although no target constraint was created */
2608  assert(*targetcons == NULL || *valid);
2609 
2610  /* if a target constraint was created */
2611  if( *targetcons != NULL && !uselocalconsmap )
2612  {
2613  /* insert constraint into mapping between source SCIP and the target SCIP */
2614  SCIP_CALL( SCIPhashmapInsert(consmap, sourcecons, *targetcons) );
2615  }
2616  }
2617 
2618  /* free locally allocated hash maps */
2619  if( uselocalvarmap )
2620  {
2621  SCIPhashmapFree(&localvarmap);
2622  }
2623 
2624  if( uselocalconsmap )
2625  {
2626  SCIPhashmapFree(&localconsmap);
2627  }
2628 
2629  return SCIP_OKAY;
2630 }
2631 
2632 /** copies constraints from the source-SCIP and adds these to the target-SCIP; for mapping the
2633  * variables between the source and the target SCIP a hash map can be given; if the variable hash
2634  * map is NULL or necessary variable mapping is missing, the required variables are created in the
2635  * target-SCIP and added to the hash map, if not NULL; all variables which are created are added to
2636  * the target-SCIP but not (user) captured; if the constraint hash map is not NULL the mapping
2637  * between the constraints of the source and target-SCIP is stored
2638  *
2639  * @note the constraints are added to the target-SCIP but are not (user) captured in the target SCIP. (If you mix
2640  * SCIPgetConsCopy() with SCIPcopyConss() you should pay attention to what you add explicitly and what is already
2641  * added.) You can check whether a constraint is added by calling SCIPconsIsAdded().
2642  *
2643  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
2644  * @note Do not change the source SCIP environment during the copying process
2645  *
2646  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2647  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2648  *
2649  * @pre This method can be called if sourcescip is in one of the following stages:
2650  * - \ref SCIP_STAGE_PROBLEM
2651  * - \ref SCIP_STAGE_TRANSFORMED
2652  * - \ref SCIP_STAGE_INITPRESOLVE
2653  * - \ref SCIP_STAGE_PRESOLVING
2654  * - \ref SCIP_STAGE_EXITPRESOLVE
2655  * - \ref SCIP_STAGE_PRESOLVED
2656  * - \ref SCIP_STAGE_INITSOLVE
2657  * - \ref SCIP_STAGE_SOLVING
2658  * - \ref SCIP_STAGE_SOLVED
2659  *
2660  * @pre This method can be called if targetscip is in one of the following stages:
2661  * - \ref SCIP_STAGE_PROBLEM
2662  *
2663  * @note sourcescip stage does not get changed
2664  *
2665  * @note targetscip stage does not get changed
2666  *
2667  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2668  */
2670  SCIP* sourcescip, /**< source SCIP data structure */
2671  SCIP* targetscip, /**< target SCIP data structure */
2672  SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to the corresponding
2673  * variables of the target SCIP, or NULL */
2674  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2675  * target constraints, or NULL */
2676  SCIP_Bool global, /**< create a global or a local copy? */
2677  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance?
2678  * If TRUE, the modifiable flag of constraints will be copied. */
2679  SCIP_Bool* valid /**< pointer to store whether all constraints were validly copied */
2680  )
2681 {
2682  SCIP_CONSHDLR** sourceconshdlrs;
2683  SCIP_HASHMAP* localvarmap;
2684  SCIP_HASHMAP* localconsmap;
2685  SCIP_Bool uselocalvarmap;
2686  SCIP_Bool uselocalconsmap;
2687  int nsourceconshdlrs;
2688  int i;
2689 
2690  assert(sourcescip != NULL);
2691  assert(targetscip != NULL);
2692  assert(valid != NULL);
2693 
2694  /* check stages for both, the source and the target SCIP data structure */
2695  SCIP_CALL( checkStage(sourcescip, "SCIPcopyConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2696  SCIP_CALL( checkStage(targetscip, "SCIPcopyConss", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
2697 
2698  /* check if we locally need to create a variable or constraint hash map */
2699  uselocalvarmap = (varmap == NULL);
2700  uselocalconsmap = (consmap == NULL);
2701 
2702  if( uselocalvarmap )
2703  {
2704  /* create the variable mapping hash map */
2705  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPgetNVars(sourcescip)) );
2706  }
2707  else
2708  localvarmap = varmap;
2709 
2710  if( uselocalconsmap )
2711  {
2712  /* create the constraint mapping hash map */
2713  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPgetNConss(sourcescip)) );
2714  }
2715  else
2716  localconsmap = consmap;
2717 
2718  nsourceconshdlrs = SCIPgetNConshdlrs(sourcescip);
2719  sourceconshdlrs = SCIPgetConshdlrs(sourcescip);
2720  assert(nsourceconshdlrs == 0 || sourceconshdlrs != NULL);
2721  assert(SCIPisTransformed(sourcescip));
2722 
2723  *valid = TRUE;
2724 
2725  /* copy constraints: loop through all (source) constraint handlers */
2726  for( i = 0; i < nsourceconshdlrs; ++i )
2727  {
2728  SCIP_CONS** sourceconss;
2729  SCIP_CONS* targetcons;
2730  int nsourceconss;
2731  int c;
2732 
2733  assert(sourceconshdlrs[i] != NULL);
2734 
2735  /* constraint handlers have to explicitly set the valid pointer to TRUE for every single constraint */
2736 
2737  /* Get all active constraints for copying; this array contains all active constraints;
2738  * constraints are active if they are globally valid and not deleted after presolving OR they
2739  * were locally added during the search and we are currently in a node which belongs to the
2740  * corresponding subtree.
2741  */
2742  nsourceconss = SCIPconshdlrGetNActiveConss(sourceconshdlrs[i]);
2743  sourceconss = SCIPconshdlrGetConss(sourceconshdlrs[i]);
2744 
2745 
2746 #ifdef SCIP_DISABLED_CODE
2747  /* @todo using the following might reduce the number of copied constraints - check whether this is better */
2748  /* Get all checked constraints for copying; this included local constraints */
2749  if( !global )
2750  {
2751  nsourceconss = SCIPconshdlrGetNCheckConss(sourceconshdlrs[i]);
2752  sourceconss = SCIPconshdlrGetCheckConss(sourceconshdlrs[i]);
2753  }
2754 #endif
2755 
2756  assert(nsourceconss == 0 || sourceconss != NULL);
2757 
2758  if( nsourceconss > 0 )
2759  {
2760  SCIPdebugMsg(sourcescip, "Attempting to copy %d %s constraints\n", nsourceconss, SCIPconshdlrGetName(sourceconshdlrs[i]));
2761  }
2762 
2763  /* copy all constraints of one constraint handler */
2764  for( c = 0; c < nsourceconss; ++c )
2765  {
2766  SCIP_Bool singlevalid = FALSE;
2767  /* all constraints have to be active */
2768  assert(sourceconss[c] != NULL);
2769  assert(SCIPconsIsActive(sourceconss[c]));
2770  assert(!SCIPconsIsDeleted(sourceconss[c]));
2771 
2772  /* in case of copying the global problem we have to ignore the local constraints which are active */
2773  if( global && SCIPconsIsLocal(sourceconss[c]) )
2774  {
2775  SCIPdebugMsg(sourcescip, "did not copy local constraint <%s> when creating global copy\n", SCIPconsGetName(sourceconss[c]));
2776  continue;
2777  }
2778 
2779  /* use the copy constructor of the constraint handler and creates and captures the constraint if possible */
2780  targetcons = NULL;
2781  SCIP_CALL( SCIPgetConsCopy(sourcescip, targetscip, sourceconss[c], &targetcons, sourceconshdlrs[i], localvarmap, localconsmap, NULL,
2782  SCIPconsIsInitial(sourceconss[c]), SCIPconsIsSeparated(sourceconss[c]),
2783  SCIPconsIsEnforced(sourceconss[c]), SCIPconsIsChecked(sourceconss[c]),
2784  SCIPconsIsPropagated(sourceconss[c]), FALSE, SCIPconsIsModifiable(sourceconss[c]),
2785  SCIPconsIsDynamic(sourceconss[c]), SCIPconsIsRemovable(sourceconss[c]), FALSE, global, &singlevalid) );
2786 
2787  /* it is possible for a constraint handler to declare the copy valid, although no target constraint was created */
2788  assert(targetcons == NULL || singlevalid);
2789 
2790  /* add the copied constraint to target SCIP if the copying process created a constraint */
2791  if( targetcons != NULL )
2792  {
2793 
2794  if( !enablepricing )
2795  SCIPconsSetModifiable(targetcons, FALSE);
2796 
2797  /* add constraint to target SCIP */
2798  SCIP_CALL( SCIPaddCons(targetscip, targetcons) );
2799 
2800  /* add the conflict constraint to the store of targetscip */
2801  if( SCIPconsIsConflict(sourceconss[c]) )
2802  {
2803  /* add the constraint as a conflict to the conflict pool of targetscip */
2804  SCIP_CALL( SCIPconflictstoreAddConflict(targetscip->conflictstore, targetscip->mem->probmem, targetscip->set,
2805  targetscip->stat, NULL, NULL, targetscip->reopt, targetcons, SCIP_CONFTYPE_UNKNOWN, FALSE, -SCIPinfinity(targetscip)) );
2806  }
2807 
2808  /* release constraint once for the creation capture */
2809  SCIP_CALL( SCIPreleaseCons(targetscip, &targetcons) );
2810  }
2811  else
2812  {
2813  *valid = (*valid && singlevalid);
2814  SCIPdebugMsg(sourcescip, "Constraint %s not copied, copy is %svalid\n",
2815  SCIPconsGetName(sourceconss[c]), *valid ? "" : "not ");
2816  }
2817  }
2818  }
2819 
2820  if( uselocalvarmap )
2821  {
2822  /* free hash map */
2823  SCIPhashmapFree(&localvarmap);
2824  }
2825 
2826  if( uselocalconsmap )
2827  {
2828  /* free hash map */
2829  SCIPhashmapFree(&localconsmap);
2830  }
2831 
2832  return SCIP_OKAY;
2833 }
2834 
2835 /** copies all original constraints from the source-SCIP and adds these to the target-SCIP; for mapping the
2836  * variables between the source and the target SCIP a hash map can be given; if the variable hash
2837  * map is NULL or necessary variable mapping is missing, the required variables are created in the
2838  * target-SCIP and added to the hash map, if not NULL; all variables which are created are added to
2839  * the target-SCIP but not (user) captured; if the constraint hash map is not NULL the mapping
2840  * between the constraints of the source and target-SCIP is stored
2841  *
2842  * @note the constraints are added to the target-SCIP but are not (user) captured in the target SCIP. (If you mix
2843  * SCIPgetConsCopy() with SCIPcopyConss() you should pay attention to what you add explicitly and what is already
2844  * added.) You can check whether a constraint is added by calling SCIPconsIsAdded().
2845  *
2846  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
2847  * @note Do not change the source SCIP environment during the copying process
2848  *
2849  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2850  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2851  *
2852  * @pre This method can be called if sourcescip is in one of the following stages:
2853  * - \ref SCIP_STAGE_PROBLEM
2854  * - \ref SCIP_STAGE_TRANSFORMED
2855  * - \ref SCIP_STAGE_INITPRESOLVE
2856  * - \ref SCIP_STAGE_PRESOLVING
2857  * - \ref SCIP_STAGE_EXITPRESOLVE
2858  * - \ref SCIP_STAGE_PRESOLVED
2859  * - \ref SCIP_STAGE_INITSOLVE
2860  * - \ref SCIP_STAGE_SOLVING
2861  * - \ref SCIP_STAGE_SOLVED
2862  *
2863  * @pre This method can be called if targetscip is in one of the following stages:
2864  * - \ref SCIP_STAGE_PROBLEM
2865  *
2866  * @note sourcescip stage does not get changed
2867  *
2868  * @note targetscip stage does not get changed
2869  *
2870  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2871  */
2873  SCIP* sourcescip, /**< source SCIP data structure */
2874  SCIP* targetscip, /**< target SCIP data structure */
2875  SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to the corresponding
2876  * variables of the target SCIP, or NULL */
2877  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2878  * target constraints, or NULL */
2879  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance?
2880  * If TRUE, the modifiable flag of constraints will be copied. */
2881  SCIP_Bool* valid /**< pointer to store whether all constraints were validly copied */
2882  )
2883 {
2884  SCIP_CONS** sourceconss;
2885  SCIP_HASHMAP* localvarmap;
2886  SCIP_HASHMAP* localconsmap;
2887  SCIP_Bool uselocalvarmap;
2888  SCIP_Bool uselocalconsmap;
2889  int nsourceconss;
2890  int c;
2891 
2892  assert(sourcescip != NULL);
2893  assert(targetscip != NULL);
2894  assert(valid != NULL);
2895 
2896  /* check stages for both, the source and the target SCIP data structure */
2897  SCIP_CALL( checkStage(sourcescip, "SCIPcopyOrigConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2898  SCIP_CALL( checkStage(targetscip, "SCIPcopyOrigConss", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
2899 
2900  /* check if we locally need to create a variable or constraint hash map */
2901  uselocalvarmap = (varmap == NULL);
2902  uselocalconsmap = (consmap == NULL);
2903 
2904  if( uselocalvarmap )
2905  {
2906  /* create the variable mapping hash map */
2907  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPgetNVars(sourcescip)) );
2908  }
2909  else
2910  localvarmap = varmap;
2911 
2912  if( uselocalconsmap )
2913  {
2914  /* create the constraint mapping hash map */
2915  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPgetNConss(sourcescip)) );
2916  }
2917  else
2918  localconsmap = consmap;
2919 
2920  sourceconss = SCIPgetOrigConss(sourcescip);
2921  nsourceconss = SCIPgetNOrigConss(sourcescip);
2922 
2923  *valid = TRUE;
2924 
2925  SCIPdebugMsg(sourcescip, "Attempting to copy %d original constraints\n", nsourceconss);
2926 
2927  /* copy constraints: loop through all (source) constraint handlers */
2928  for( c = 0; c < nsourceconss; ++c )
2929  {
2930  SCIP_CONS* targetcons;
2931  SCIP_Bool success;
2932 
2933  /* constraint handlers have to explicitly set the success pointer to TRUE */
2934  success = FALSE;
2935 
2936  /* all constraints have to be active */
2937  assert(sourceconss[c] != NULL);
2938  assert(SCIPconsIsOriginal(sourceconss[c]));
2939 
2940  /* use the copy constructor of the constraint handler and creates and captures the constraint if possible */
2941  targetcons = NULL;
2942  SCIP_CALL( SCIPgetConsCopy(sourcescip, targetscip, sourceconss[c], &targetcons, SCIPconsGetHdlr(sourceconss[c]), localvarmap, localconsmap, NULL,
2943  SCIPconsIsInitial(sourceconss[c]), SCIPconsIsSeparated(sourceconss[c]),
2944  SCIPconsIsEnforced(sourceconss[c]), SCIPconsIsChecked(sourceconss[c]),
2945  SCIPconsIsPropagated(sourceconss[c]), FALSE, SCIPconsIsModifiable(sourceconss[c]),
2946  SCIPconsIsDynamic(sourceconss[c]), SCIPconsIsRemovable(sourceconss[c]), FALSE, TRUE, &success) );
2947 
2948  /* add the copied constraint to target SCIP if the copying process was valid */
2949  if( success )
2950  {
2951  assert(targetcons != NULL);
2952 
2953  if( !enablepricing )
2954  SCIPconsSetModifiable(targetcons, FALSE);
2955 
2956  /* add constraint to target SCIP */
2957  SCIP_CALL( SCIPaddCons(targetscip, targetcons) );
2958 
2959  /* release constraint once for the creation capture */
2960  SCIP_CALL( SCIPreleaseCons(targetscip, &targetcons) );
2961  }
2962  else
2963  {
2964  *valid = FALSE;
2965  SCIPdebugMsg(sourcescip, "failed to copy constraint %s\n", SCIPconsGetName(sourceconss[c]));
2966  }
2967  }
2968 
2969  if( uselocalvarmap )
2970  {
2971  /* free hash map */
2972  SCIPhashmapFree(&localvarmap);
2973  }
2974 
2975  if( uselocalconsmap )
2976  {
2977  /* free hash map */
2978  SCIPhashmapFree(&localconsmap);
2979  }
2980 
2981  return SCIP_OKAY;
2982 }
2983 
2984 
2985 /** convert all active cuts from cutpool to linear constraints
2986  *
2987  * @note Do not change the source SCIP environment during the copying process
2988  *
2989  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2990  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2991  *
2992  * @pre This method can be called if SCIP is in one of the following stages:
2993  * - \ref SCIP_STAGE_PROBLEM
2994  * - \ref SCIP_STAGE_INITPRESOLVE
2995  * - \ref SCIP_STAGE_PRESOLVING
2996  * - \ref SCIP_STAGE_EXITPRESOLVE
2997  * - \ref SCIP_STAGE_PRESOLVED
2998  * - \ref SCIP_STAGE_SOLVING
2999  * - \ref SCIP_STAGE_EXITSOLVE
3000  *
3001  * @note SCIP stage does not get changed
3002  *
3003  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3004  */
3006  SCIP* scip, /**< SCIP data structure */
3007  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
3008  * target variables, or NULL */
3009  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
3010  * target constraints, or NULL */
3011  SCIP_Bool global, /**< create a global or a local copy? */
3012  int* ncutsadded /**< pointer to store number of added cuts, or NULL */
3013  )
3014 {
3015  assert(scip != NULL);
3016  assert(scip->set != NULL);
3017 
3018  /* check stages for the SCIP data structure */
3019  SCIP_CALL( checkStage(scip, "SCIPconvertCutsToConss", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
3020 
3021  /* if we do not have any cuts, nothing can be converted */
3022  if( scip->set->stage < SCIP_STAGE_SOLVING )
3023  return SCIP_OKAY;
3024 
3025  /* create out of all active cuts in cutpool linear constraints in targetscip */
3026  SCIP_CALL( SCIPcopyCuts(scip, scip, varmap, consmap, global, ncutsadded) );
3027 
3028  return SCIP_OKAY;
3029 }
3030 
3031 /** copies all active cuts from cutpool of sourcescip to linear constraints in targetscip
3032  *
3033  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
3034  * @note Do not change the source SCIP environment during the copying process
3035  *
3036  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3037  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3038  *
3039  * @pre This method can be called if sourcescip is in one of the following stages:
3040  * - \ref SCIP_STAGE_PROBLEM
3041  * - \ref SCIP_STAGE_TRANSFORMED
3042  * - \ref SCIP_STAGE_INITPRESOLVE
3043  * - \ref SCIP_STAGE_PRESOLVING
3044  * - \ref SCIP_STAGE_EXITPRESOLVE
3045  * - \ref SCIP_STAGE_PRESOLVED
3046  * - \ref SCIP_STAGE_SOLVING
3047  * - \ref SCIP_STAGE_SOLVED
3048  * - \ref SCIP_STAGE_EXITSOLVE
3049  *
3050  * @pre This method can be called if targetscip is in one of the following stages:
3051  * - \ref SCIP_STAGE_PROBLEM
3052  * - \ref SCIP_STAGE_INITPRESOLVE
3053  * - \ref SCIP_STAGE_PRESOLVING
3054  * - \ref SCIP_STAGE_EXITPRESOLVE
3055  * - \ref SCIP_STAGE_PRESOLVED
3056  * - \ref SCIP_STAGE_SOLVING
3057  * - \ref SCIP_STAGE_EXITSOLVE
3058  *
3059  * @note sourcescip stage does not get changed
3060  *
3061  * @note targetscip stage does not get changed
3062  *
3063  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3064  */
3066  SCIP* sourcescip, /**< source SCIP data structure */
3067  SCIP* targetscip, /**< target SCIP data structure */
3068  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
3069  * target variables, or NULL */
3070  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
3071  * target constraints, or NULL */
3072  SCIP_Bool global, /**< create a global or a local copy? */
3073  int* ncutsadded /**< pointer to store number of copied cuts, or NULL */
3074  )
3075 {
3076  SCIP_CUT** cuts;
3077  int ncuts;
3078  int nlocalcutsadded;
3079 
3080  assert(sourcescip != NULL);
3081  assert(targetscip != NULL);
3082 
3083  /* check stages for both, the source and the target SCIP data structure */
3084  SCIP_CALL( checkStage(sourcescip, "SCIPcopyCuts", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
3085  SCIP_CALL( checkStage(targetscip, "SCIPcopyCuts", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
3086 
3087  if ( ncutsadded != NULL )
3088  *ncutsadded = 0;
3089  nlocalcutsadded = 0;
3090 
3091  /* if we do not have any cuts, nothing can be converted */
3092  if( sourcescip->set->stage < SCIP_STAGE_SOLVING )
3093  return SCIP_OKAY;
3094 
3095  if( SCIPfindConshdlr(targetscip, "linear") == NULL )
3096  {
3097  SCIPdebugMsg(sourcescip, "No linear constraint handler available. Cannot convert cuts.\n");
3098  return SCIP_OKAY;
3099  }
3100 
3101  /* convert cut from global cut pool */
3102  cuts = SCIPgetPoolCuts(sourcescip);
3103  ncuts = SCIPgetNPoolCuts(sourcescip);
3104 
3105  SCIP_CALL( copyCuts(sourcescip, targetscip, cuts, ncuts, varmap, consmap, global, &nlocalcutsadded) );
3106 
3107  SCIPdebugMsg(sourcescip, "Converted %d active cuts to constraints.\n", nlocalcutsadded);
3108 
3109  /* convert delayed cuts from global delayed cut pool */
3110  cuts = SCIPgetDelayedPoolCuts(sourcescip);
3111  ncuts = SCIPgetNDelayedPoolCuts(sourcescip);
3112 
3113  SCIP_CALL( copyCuts(sourcescip, targetscip, cuts, ncuts, varmap, consmap, global, &nlocalcutsadded) );
3114 
3115  if( ncutsadded != NULL )
3116  *ncutsadded = nlocalcutsadded;
3117 
3118  SCIPdebugMsg(sourcescip, "Converted %d active cuts to constraints.\n", nlocalcutsadded);
3119 
3120  return SCIP_OKAY;
3121 }
3122 
3123 /** copies all active conflicts from the conflict pool of sourcescip and adds them as linear constraints to targetscip
3124  *
3125  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
3126  * @note Do not change the source SCIP environment during the copying process
3127  *
3128  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3129  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3130  *
3131  * @pre This method can be called if sourcescip is in one of the following stages:
3132  * - \ref SCIP_STAGE_PROBLEM
3133  * - \ref SCIP_STAGE_TRANSFORMED
3134  * - \ref SCIP_STAGE_INITPRESOLVE
3135  * - \ref SCIP_STAGE_PRESOLVING
3136  * - \ref SCIP_STAGE_EXITPRESOLVE
3137  * - \ref SCIP_STAGE_PRESOLVED
3138  * - \ref SCIP_STAGE_SOLVING
3139  * - \ref SCIP_STAGE_SOLVED
3140  * - \ref SCIP_STAGE_EXITSOLVE
3141  *
3142  * @pre This method can be called if targetscip is in one of the following stages:
3143  * - \ref SCIP_STAGE_PROBLEM
3144  * - \ref SCIP_STAGE_INITPRESOLVE
3145  * - \ref SCIP_STAGE_PRESOLVING
3146  * - \ref SCIP_STAGE_EXITPRESOLVE
3147  * - \ref SCIP_STAGE_PRESOLVED
3148  * - \ref SCIP_STAGE_SOLVING
3149  * - \ref SCIP_STAGE_EXITSOLVE
3150  *
3151  * @note sourcescip stage does not change
3152  *
3153  * @note targetscip stage does not change
3154  *
3155  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3156  */
3158  SCIP* sourcescip, /**< source SCIP data structure */
3159  SCIP* targetscip, /**< target SCIP data structure */
3160  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
3161  * target variables, or NULL */
3162  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
3163  * target constraints, or NULL */
3164  SCIP_Bool global, /**< create a global or a local copy? */
3165  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance?
3166  * If TRUE, the modifiable flag of constraints will be copied. */
3167  SCIP_Bool* valid /**< pointer to store whether all constraints were validly copied */
3168  )
3169 {
3170  SCIP_CONS** sourceconfs;
3171  SCIP_HASHMAP* localvarmap;
3172  SCIP_HASHMAP* localconsmap;
3173  SCIP_Bool uselocalvarmap;
3174  SCIP_Bool uselocalconsmap;
3175  SCIP_Bool success;
3176  int sourceconfssize;
3177  int nsourceconfs;
3178  int c;
3179 
3180  assert(sourcescip != NULL);
3181  assert(targetscip != NULL);
3182 
3183  /* check stages for both, the source and the target SCIP data structure */
3184  SCIP_CALL( checkStage(sourcescip, "SCIPcopyConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3185  SCIP_CALL( checkStage(targetscip, "SCIPcopyConss", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
3186 
3187  /* check if we locally need to create a variable or constraint hash map */
3188  uselocalvarmap = (varmap == NULL);
3189  uselocalconsmap = (consmap == NULL);
3190 
3191  if( uselocalvarmap )
3192  {
3193  /* create the variable mapping hash map */
3194  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPgetNVars(sourcescip)) );
3195  }
3196  else
3197  localvarmap = varmap;
3198 
3199  if( uselocalconsmap )
3200  {
3201  /* create the constraint mapping hash map */
3202  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPgetNConss(sourcescip)) );
3203  }
3204  else
3205  localconsmap = consmap;
3206 
3207  /* get number of conflicts stored in the conflict pool */
3208  sourceconfssize = SCIPconflictstoreGetNConflictsInStore(sourcescip->conflictstore);
3209 
3210  /* allocate buffer */
3211  SCIP_CALL( SCIPallocBufferArray(sourcescip, &sourceconfs, sourceconfssize) );
3212 
3213  /* get all conflicts stored in the conflict pool */
3214  SCIP_CALL( SCIPconflictstoreGetConflicts(sourcescip->conflictstore, sourceconfs, sourceconfssize, &nsourceconfs) );
3215  assert(nsourceconfs <= sourceconfssize);
3216 
3217  assert(SCIPisTransformed(sourcescip));
3218 
3219  /* copy conflicts */
3220  for( c = 0; c < nsourceconfs; ++c )
3221  {
3222  SCIP_CONS* targetcons;
3223 
3224  /* all constraints have to be active */
3225  assert(sourceconfs[c] != NULL);
3226  assert(SCIPconsIsActive(sourceconfs[c]));
3227  assert(!SCIPconsIsDeleted(sourceconfs[c]));
3228  assert(SCIPconsIsConflict(sourceconfs[c]));
3229 
3230  /* in case of copying the global problem we have to ignore the local constraints which are active */
3231  if( global && SCIPconsIsLocal(sourceconfs[c]) )
3232  {
3233  SCIPdebugMsg(sourcescip, "did not copy local constraint <%s> when creating global copy\n", SCIPconsGetName(sourceconfs[c]));
3234  continue;
3235  }
3236 
3237  /* use the copy constructor of the constraint handler and creates and captures the constraint if possible */
3238  targetcons = NULL;
3239  SCIP_CALL( SCIPgetConsCopy(sourcescip, targetscip, sourceconfs[c], &targetcons, SCIPconsGetHdlr(sourceconfs[c]),
3240  localvarmap, localconsmap, NULL, SCIPconsIsInitial(sourceconfs[c]), SCIPconsIsSeparated(sourceconfs[c]),
3241  SCIPconsIsEnforced(sourceconfs[c]), SCIPconsIsChecked(sourceconfs[c]),
3242  SCIPconsIsPropagated(sourceconfs[c]), FALSE, SCIPconsIsModifiable(sourceconfs[c]),
3243  SCIPconsIsDynamic(sourceconfs[c]), SCIPconsIsRemovable(sourceconfs[c]), FALSE, global, &success) );
3244 
3245  /* add the copied constraint to target SCIP if the copying process was valid */
3246  if( success )
3247  {
3248  assert(targetcons != NULL);
3249 
3250  if( !enablepricing )
3251  SCIPconsSetModifiable(targetcons, FALSE);
3252 
3253  /* add constraint to target SCIP */
3254  SCIP_CALL( SCIPaddCons(targetscip, targetcons) );
3255 
3256  /* release constraint once for the creation capture */
3257  SCIP_CALL( SCIPreleaseCons(targetscip, &targetcons) );
3258  }
3259  else
3260  {
3261  *valid = FALSE;
3262  SCIPdebugMsg(sourcescip, "failed to copy constraint %s\n", SCIPconsGetName(sourceconfs[c]));
3263  }
3264  }
3265 
3266  if( uselocalvarmap )
3267  {
3268  /* free hash map */
3269  SCIPhashmapFree(&localvarmap);
3270  }
3271 
3272  if( uselocalconsmap )
3273  {
3274  /* free hash map */
3275  SCIPhashmapFree(&localconsmap);
3276  }
3277 
3278  return SCIP_OKAY;
3279 }
3280 
3281 /** copies implications and cliques of sourcescip to targetscip
3282  *
3283  * This function should be called for a targetscip in transformed stage. It can save time in presolving of the
3284  * targetscip, since implications and cliques are copied.
3285  *
3286  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
3287  * @note Do not change the source SCIP environment during the copying process
3288  *
3289  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3290  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3291  *
3292  * @pre This method can be called if sourcescip is in one of the following stages:
3293  * - \ref SCIP_STAGE_TRANSFORMED
3294  * - \ref SCIP_STAGE_INITPRESOLVE
3295  * - \ref SCIP_STAGE_PRESOLVING
3296  * - \ref SCIP_STAGE_EXITPRESOLVE
3297  * - \ref SCIP_STAGE_PRESOLVED
3298  * - \ref SCIP_STAGE_SOLVING
3299  * - \ref SCIP_STAGE_SOLVED
3300  * - \ref SCIP_STAGE_EXITSOLVE
3301  *
3302  * @pre This method can be called if targetscip is in one of the following stages:
3303  * - \ref SCIP_STAGE_TRANSFORMED
3304  * - \ref SCIP_STAGE_INITPRESOLVE
3305  * - \ref SCIP_STAGE_PRESOLVING
3306  * - \ref SCIP_STAGE_EXITPRESOLVE
3307  * - \ref SCIP_STAGE_PRESOLVED
3308  * - \ref SCIP_STAGE_INITSOLVE
3309  * - \ref SCIP_STAGE_SOLVING
3310  *
3311  * @note sourcescip stage does not get changed
3312  *
3313  * @note targetscip stage does not get changed
3314  *
3315  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3316  */
3318  SCIP* sourcescip, /**< source SCIP data structure */
3319  SCIP* targetscip, /**< target SCIP data structure */
3320  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
3321  * target variables, or NULL */
3322  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
3323  * target constraints, or NULL */
3324  SCIP_Bool global, /**< create a global or a local copy? */
3325  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
3326  int* nbdchgs, /**< pointer to store the number of performed bound changes, or NULL */
3327  int* ncopied /**< pointer to store number of copied implications and cliques, or NULL */
3328  )
3329 {
3330  SCIP_CLIQUE** cliques;
3331  SCIP_VAR** sourcevars;
3332  SCIP_Bool success;
3333  int nvars;
3334  int nbinvars;
3335  int ncliques;
3336  int j;
3337  int c;
3338 
3339  assert( sourcescip != NULL );
3340  assert( targetscip != NULL );
3341  assert( sourcescip != targetscip );
3342  assert( infeasible != NULL );
3343 
3344  /* check stages for both, the source and the target SCIP data structure */
3345  SCIP_CALL( checkStage(sourcescip, "SCIPcopyImplicationsCliques", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
3346  SCIP_CALL( checkStage(targetscip, "SCIPcopyImplicationsCliques", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
3347 
3348  if ( ncopied != NULL )
3349  *ncopied = 0;
3350  if ( nbdchgs != NULL )
3351  *nbdchgs = 0;
3352 
3353  /* get all active variables */
3354  SCIP_CALL( SCIPgetVarsData(sourcescip, &sourcevars, &nvars, &nbinvars, NULL, NULL, NULL) );
3355 
3356  /* stop if no possible variables for cliques exist */
3357  if ( nbinvars == 0 )
3358  return SCIP_OKAY;
3359 
3360  /* get cliques */
3361  ncliques = SCIPgetNCliques(sourcescip);
3362  if ( ncliques > 0 )
3363  {
3364  SCIP_VAR** targetclique;
3365 
3366  /* get space for target cliques */
3367  SCIP_CALL( SCIPallocBufferArray(targetscip, &targetclique, nvars) );
3368  cliques = SCIPgetCliques(sourcescip);
3369 
3370  /* loop through all cliques */
3371  for (c = 0; c < ncliques; ++c)
3372  {
3373  SCIP_VAR** cliquevars;
3374  SCIP_Bool* cliquevals;
3375  int cliquesize;
3376  int nboundchg = 0;
3377 
3378  assert( cliques[c] != NULL );
3379  cliquevals = SCIPcliqueGetValues(cliques[c]);
3380  cliquevars = SCIPcliqueGetVars(cliques[c]);
3381  cliquesize = SCIPcliqueGetNVars(cliques[c]);
3382 
3383  /* get target variables of clique */
3384  for (j = 0; j < cliquesize; ++j)
3385  {
3386  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, cliquevars[j], &targetclique[j], varmap, consmap, global, &success) );
3387  if ( ! success )
3388  {
3389  SCIPdebugMsg(sourcescip, "Getting copy for variable <%s> failed.\n", SCIPvarGetName(cliquevars[j]));
3390  SCIPfreeBufferArray(targetscip, &targetclique);
3391  return SCIP_OKAY;
3392  }
3393  }
3394 
3395  /* create clique */
3396  SCIP_CALL( SCIPaddClique(targetscip, targetclique, cliquevals, cliquesize, SCIPcliqueIsEquation(cliques[c]),
3397  infeasible, &nboundchg) );
3398 
3399  if ( *infeasible )
3400  {
3401  SCIPfreeBufferArray(targetscip, &targetclique);
3402  return SCIP_OKAY;
3403  }
3404  if ( ncopied != NULL )
3405  ++(*ncopied);
3406  if ( nbdchgs != NULL )
3407  *nbdchgs += nboundchg;
3408  }
3409  SCIPfreeBufferArray(targetscip, &targetclique);
3410  }
3411 
3412  /* create binary implications */
3413  for (j = 0; j < nbinvars; ++j)
3414  {
3415  SCIP_VAR* sourcevar;
3416  SCIP_VAR* targetvar;
3417  SCIP_Bool d;
3418 
3419  sourcevar = sourcevars[j];
3420  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, sourcevar, &targetvar, varmap, consmap, global, &success) );
3421  if ( ! success )
3422  {
3423  SCIPdebugMsg(sourcescip, "Getting copy for variable <%s> failed.\n", SCIPvarGetName(sourcevar));
3424  return SCIP_OKAY;
3425  }
3426 
3427  /* consider both possible implications */
3428  for (d = 0; d <= 1; ++d)
3429  {
3430  SCIP_BOUNDTYPE* impltypes;
3431  SCIP_VAR** implvars;
3432  SCIP_Real* implbounds;
3433  int nimpls;
3434  int l;
3435 
3436  nimpls = SCIPvarGetNImpls(sourcevar, d);
3437  if ( nimpls == 0 )
3438  continue;
3439 
3440  impltypes = SCIPvarGetImplTypes(sourcevar, d);
3441  implvars = SCIPvarGetImplVars(sourcevar, d);
3442  implbounds = SCIPvarGetImplBounds(sourcevar, d);
3443 
3444  /* create implications */
3445  for (l = 0; l < nimpls; ++l)
3446  {
3447  SCIP_VAR* implvar;
3448  int nboundchg = 0;
3449 
3450  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, implvars[l], &implvar, varmap, consmap, global, &success) );
3451  if ( ! success )
3452  {
3453  SCIPdebugMsg(sourcescip, "Getting copy for variable <%s> failed.\n", SCIPvarGetName(implvars[l]));
3454  return SCIP_OKAY;
3455  }
3456 
3457  SCIP_CALL( SCIPaddVarImplication(targetscip, targetvar, d, implvar, impltypes[l], implbounds[l], infeasible, &nboundchg) );
3458  if ( *infeasible )
3459  return SCIP_OKAY;
3460  if ( ncopied != NULL )
3461  ++(*ncopied);
3462  if ( nbdchgs != NULL )
3463  *nbdchgs += nboundchg;
3464  }
3465  }
3466  }
3467 
3468  return SCIP_OKAY;
3469 }
3470 
3471 /** copies parameter settings from sourcescip to targetscip
3472  *
3473  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
3474  * @note Do not change the source SCIP environment during the copying process
3475  *
3476  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3477  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3478  *
3479  * @pre This method can be called if sourcescip is in one of the following stages:
3480  * - \ref SCIP_STAGE_PROBLEM
3481  * - \ref SCIP_STAGE_TRANSFORMED
3482  * - \ref SCIP_STAGE_INITPRESOLVE
3483  * - \ref SCIP_STAGE_PRESOLVING
3484  * - \ref SCIP_STAGE_EXITPRESOLVE
3485  * - \ref SCIP_STAGE_PRESOLVED
3486  * - \ref SCIP_STAGE_INITSOLVE
3487  * - \ref SCIP_STAGE_SOLVING
3488  * - \ref SCIP_STAGE_SOLVED
3489  *
3490  * @pre This method can be called if targetscip is in one of the following stages:
3491  * - \ref SCIP_STAGE_INIT
3492  * - \ref SCIP_STAGE_PROBLEM
3493  * - \ref SCIP_STAGE_FREE
3494  *
3495  * @note sourcescip stage does not get changed
3496  *
3497  * @note targetscip stage does not get changed
3498  *
3499  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3500  */
3502  SCIP* sourcescip, /**< source SCIP data structure */
3503  SCIP* targetscip /**< target SCIP data structure */
3504  )
3505 {
3506  assert(sourcescip != NULL);
3507  assert(targetscip != NULL);
3508  assert(sourcescip->set != NULL);
3509  assert(targetscip->set != NULL);
3510 
3511  /* check stages for both, the source and the target SCIP data structure */
3512  SCIP_CALL( checkStage(sourcescip, "SCIPcopyParamSettings", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3513  SCIP_CALL( checkStage(targetscip, "SCIPcopyParamSettings", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
3514 
3515  SCIP_CALL( SCIPsetCopyParams(sourcescip->set, targetscip->set, targetscip->messagehdlr) );
3516 
3517  return SCIP_OKAY;
3518 }
3519 
3520 /** gets depth of current scip instance (increased by each copy call)
3521  *
3522  * @return Depth of subscip of SCIP is returned.
3523  *
3524  * @pre This method can be called if SCIP is in one of the following stages:
3525  * - \ref SCIP_STAGE_PROBLEM
3526  * - \ref SCIP_STAGE_TRANSFORMING
3527  * - \ref SCIP_STAGE_TRANSFORMED
3528  * - \ref SCIP_STAGE_INITPRESOLVE
3529  * - \ref SCIP_STAGE_PRESOLVING
3530  * - \ref SCIP_STAGE_EXITPRESOLVE
3531  * - \ref SCIP_STAGE_PRESOLVED
3532  * - \ref SCIP_STAGE_INITSOLVE
3533  * - \ref SCIP_STAGE_SOLVING
3534  * - \ref SCIP_STAGE_SOLVED
3535  * - \ref SCIP_STAGE_EXITSOLVE
3536  * - \ref SCIP_STAGE_FREETRANS
3537  *
3538  * @note SCIP stage does not get changed
3539  *
3540  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3541  */
3543  SCIP* scip /**< SCIP data structure */
3544  )
3545 {
3546  assert( scip != NULL );
3547  assert( scip->stat != NULL );
3548 
3549  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSubscipDepth", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
3550 
3551  return scip->stat->subscipdepth;
3552 }
3553 
3554 /** sets depth of scip instance
3555  *
3556  * @pre This method can be called if SCIP is in one of the following stages:
3557  * - \ref SCIP_STAGE_PROBLEM
3558  *
3559  * @note SCIP stage does not get changed
3560  *
3561  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3562  */
3564  SCIP* scip, /**< SCIP data structure */
3565  int newdepth /**< new subscip depth */
3566  )
3567 {
3568  assert( scip != NULL );
3569  assert( scip->stat != NULL );
3570  assert( newdepth > 0 );
3571 
3572  SCIP_CALL_ABORT( checkStage(scip, "SCIPsetSubscipDepth", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
3573 
3574  scip->stat->subscipdepth = newdepth;
3575 }
3576 
3577 /** copies source SCIP data into target SCIP data structure
3578  *
3579  * distinguishes between
3580  * - local and global copies
3581  * - copies of the original or transformed problem
3582  *
3583  * Allows for constraint compression by specifying a number of source variables
3584  * and values that should be fixed in the copy.
3585  */
3586 static
3588  SCIP* sourcescip, /**< source SCIP data structure */
3589  SCIP* targetscip, /**< target SCIP data structure */
3590  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
3591  * target variables, or NULL */
3592  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
3593  * target constraints, or NULL */
3594  const char* suffix, /**< optional suffix for problem name inside the target SCIP */
3595  SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
3596  SCIP_Real* fixedvals, /**< array of fixing values for target SCIP variables, or NULL */
3597  int nfixedvars, /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
3598  SCIP_Bool useconscompression, /**< should constraint compression be used when constraints are created? */
3599  SCIP_Bool global, /**< create a global or a local copy? */
3600  SCIP_Bool original, /**< copy original or transformed problem? if TRUE, a copy using local bounds is not possible */
3601  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
3602  * plugins will be copied and activated, and the modifiable flag of
3603  * constraints will be respected. If FALSE, valid will be set to FALSE, when
3604  * there are pricers present */
3605  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
3606  SCIP_Bool* valid /**< pointer to store whether the copying was valid or not, or NULL */
3607  )
3608 {
3609  SCIP_HASHMAP* localvarmap;
3610  SCIP_HASHMAP* localconsmap;
3611  SCIP_Real startcopytime;
3612  SCIP_Real copytime;
3613  SCIP_Bool uselocalvarmap;
3614  SCIP_Bool uselocalconsmap;
3615  SCIP_Bool consscopyvalid;
3616  SCIP_Bool localvalid;
3617  SCIP_Bool msghdlrquiet;
3618  char name[SCIP_MAXSTRLEN];
3619 
3620  assert(sourcescip != NULL);
3621  assert(targetscip != NULL);
3622  assert(suffix != NULL);
3623 
3624  /* copy the original problem if we are in SCIP_STAGE_PROBLEM stage */
3625  if( SCIPgetStage(sourcescip) == SCIP_STAGE_PROBLEM )
3626  original = TRUE;
3627 
3628  /* global must be TRUE for the original problem */
3629  assert(global || !original);
3630 
3631  /* get time before start of copy procedure */
3632  startcopytime = SCIPclockGetTime(sourcescip->stat->copyclock);
3633 
3634  /* start time measuring */
3635  SCIPclockStart(sourcescip->stat->copyclock, sourcescip->set);
3636 
3637  /* copy all plugins */
3638  SCIP_CALL( SCIPcopyPlugins(sourcescip, targetscip, TRUE, enablepricing, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
3639  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, passmessagehdlr, &localvalid) );
3640 
3641  /* in case there are active pricers and pricing is disabled, targetscip will not be a valid copy of sourcescip */
3642  if( ! enablepricing && SCIPgetNActivePricers(sourcescip) > 0 )
3643  localvalid = FALSE;
3644 
3645  SCIPdebugMsg(sourcescip, "Copying plugins was%s valid.\n", localvalid ? "" : " not");
3646 
3647  uselocalvarmap = (varmap == NULL);
3648  uselocalconsmap = (consmap == NULL);
3649 
3650  if( uselocalvarmap )
3651  {
3652  /* create the variable mapping hash map */
3653  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPgetNVars(sourcescip)) );
3654  }
3655  else
3656  localvarmap = varmap;
3657 
3658  if( uselocalconsmap )
3659  {
3660  /* create the constraint mapping hash map */
3661  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPgetNConss(sourcescip)) );
3662  }
3663  else
3664  localconsmap = consmap;
3665 
3666  /* construct name for the target SCIP using the source problem name and the given suffix string */
3667  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%s", SCIPgetProbName(sourcescip), suffix);
3668 
3669  /* store the quiet state of the message handler, if existent */
3670  msghdlrquiet = SCIPmessagehdlrIsQuiet(targetscip->messagehdlr);
3671 
3672  /* explicitly suppress output when copying parameters */
3673  SCIPsetMessagehdlrQuiet(targetscip, TRUE);
3674 
3675  /* copy all settings */
3676  SCIP_CALL( SCIPcopyParamSettings(sourcescip, targetscip) );
3677 
3678  /* restore original quiet state */
3679  SCIPsetMessagehdlrQuiet(targetscip, msghdlrquiet);
3680 
3681  /* create problem in the target SCIP copying the source original or transformed problem data */
3682  if( original )
3683  {
3684  SCIP_CALL( SCIPcopyOrigProb(sourcescip, targetscip, localvarmap, localconsmap, name) );
3685  }
3686  else
3687  {
3688  SCIP_CALL( SCIPcopyProb(sourcescip, targetscip, localvarmap, localconsmap, global, name) );
3689  }
3690 
3691  /* copy original or transformed variables and perform fixings if needed */
3692  SCIP_CALL( copyVars(sourcescip, targetscip, localvarmap, localconsmap, fixedvars, fixedvals, nfixedvars, original, global) );
3693 
3694  /* if fixed variables are directly specified or inferred from local bounds, enable constraint compression */
3695  if( useconscompression && (nfixedvars > 0 || !global) )
3696  {
3697  SCIP_CALL( SCIPenableConsCompression(targetscip) );
3698 
3699  /* domain reductions yield a copy that is no longer guaranteed to be valid */
3700  localvalid = FALSE;
3701  }
3702 
3703  /* copy all (original) constraints */
3704  if( original )
3705  {
3706  SCIP_CALL( SCIPcopyOrigConss(sourcescip, targetscip, localvarmap, localconsmap, enablepricing, &consscopyvalid) );
3707  }
3708  else
3709  {
3710  SCIP_CALL( SCIPcopyConss(sourcescip, targetscip, localvarmap, localconsmap, global, enablepricing, &consscopyvalid) );
3711  }
3712 
3713  SCIPdebugMsg(sourcescip, "Copying constraints was%s valid.\n", consscopyvalid ? "" : " not");
3714 
3715  localvalid = localvalid && consscopyvalid;
3716 
3717  if( uselocalvarmap )
3718  {
3719  /* free hash map */
3720  SCIPhashmapFree(&localvarmap);
3721  }
3722 
3723  if( uselocalconsmap )
3724  {
3725  /* free hash map */
3726  SCIPhashmapFree(&localconsmap);
3727  }
3728 
3729  /* stop time measuring */
3730  SCIPclockStop(sourcescip->stat->copyclock, sourcescip->set);
3731 
3732  /* get time after copying procedure */
3733  copytime = SCIPclockGetTime(sourcescip->stat->copyclock) - startcopytime;
3734 
3735  if( copytime > sourcescip->stat->maxcopytime )
3736  sourcescip->stat->maxcopytime = copytime;
3737  if( copytime < sourcescip->stat->mincopytime )
3738  sourcescip->stat->mincopytime = copytime;
3739 
3740  /* increase copy counter */
3741  ++(sourcescip->stat->ncopies);
3742 
3743  targetscip->concurrent = sourcescip->concurrent;
3744  SCIP_CALL( SCIPsyncstoreRelease(&targetscip->syncstore) );
3745  targetscip->syncstore = sourcescip->syncstore;
3746  SCIP_CALL( SCIPsyncstoreCapture(targetscip->syncstore) );
3747 
3748  /* return the information about a valid copy to the user */
3749  if( valid != NULL )
3750  *valid = localvalid;
3751 
3752  return SCIP_OKAY;
3753 }
3754 
3755 /** copies source SCIP to target SCIP; the copying process is done in the following order:
3756  * 1) copy the plugins
3757  * 2) copy the settings
3758  * 3) create problem data in target-SCIP and copy the problem data of the source-SCIP
3759  * 4) copy all active variables
3760  * 5) copy all constraints
3761  *
3762  * The source problem depends on the stage of the \p sourcescip - In SCIP_STAGE_PROBLEM, the original problem is copied,
3763  * otherwise, the transformed problem is copied. For an explicit copy of the original problem, use SCIPcopyOrig().
3764  *
3765  * @note all variables and constraints which are created in the target-SCIP are not (user) captured
3766  *
3767  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
3768  * Also, 'passmessagehdlr' should be set to FALSE.
3769  * @note Do not change the source SCIP environment during the copying process
3770  *
3771  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3772  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3773  *
3774  * @pre This method can be called if sourcescip is in one of the following stages:
3775  * - \ref SCIP_STAGE_PROBLEM
3776  * - \ref SCIP_STAGE_TRANSFORMED
3777  * - \ref SCIP_STAGE_INITPRESOLVE
3778  * - \ref SCIP_STAGE_PRESOLVING
3779  * - \ref SCIP_STAGE_EXITPRESOLVE
3780  * - \ref SCIP_STAGE_PRESOLVED
3781  * - \ref SCIP_STAGE_INITSOLVE
3782  * - \ref SCIP_STAGE_SOLVING
3783  * - \ref SCIP_STAGE_SOLVED
3784  *
3785  * @pre This method can be called if targetscip is in one of the following stages:
3786  * - \ref SCIP_STAGE_INIT
3787  * - \ref SCIP_STAGE_FREE
3788  *
3789  * @note sourcescip stage does not get changed
3790  *
3791  * @note targetscip stage does not get changed
3792  *
3793  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3794  */
3796  SCIP* sourcescip, /**< source SCIP data structure */
3797  SCIP* targetscip, /**< target SCIP data structure */
3798  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
3799  * target variables, or NULL */
3800  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
3801  * target constraints, or NULL */
3802  const char* suffix, /**< optional suffix for problem name inside the target SCIP */
3803  SCIP_Bool global, /**< create a global or a local copy? */
3804  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
3805  * plugins will be copied and activated, and the modifiable flag of
3806  * constraints will be respected. If FALSE, valid will be set to FALSE, when
3807  * there are pricers present */
3808  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
3809  SCIP_Bool* valid /**< pointer to store whether the copying was valid, or NULL */
3810  )
3811 {
3812  SCIP_VAR** fixedvars = NULL;
3813  SCIP_Real* fixedvals = NULL;
3814  int nfixedvars = 0;
3815  SCIP_Bool original = FALSE;
3816  SCIP_Bool useconscompression = FALSE;
3817 
3818  assert(sourcescip != NULL);
3819  assert(targetscip != NULL);
3820  assert(suffix != NULL);
3821 
3822  /* check stages for both, the source and the target SCIP data structure */
3823  SCIP_CALL( checkStage(sourcescip, "SCIPcopy", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3824  SCIP_CALL( checkStage(targetscip, "SCIPcopy", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
3825 
3826  /* copy source SCIP data into target SCIP data structure */
3827  SCIP_CALL( doCopy(sourcescip, targetscip, varmap, consmap, suffix, fixedvars, fixedvals, nfixedvars,
3828  useconscompression, global, original, enablepricing, passmessagehdlr, valid) );
3829 
3830  return SCIP_OKAY;
3831 }
3832 
3833 /** copies source SCIP to target SCIP but compresses constraints
3834  *
3835  * constraint compression is performed by removing fixed variables immediately
3836  * during constraint creation if the involved constraint handlers support
3837  * compression
3838  *
3839  * the copying process is done in the following order:
3840  * 1) copy the plugins
3841  * 2) copy the settings
3842  * 3) create problem data in target-SCIP and copy the problem data of the source-SCIP
3843  * 4) copy all active variables
3844  * a) fix all variable copies specified by \p fixedvars, \p fixedvals, and \p nfixedvars
3845  * b) enable constraint compression
3846  * 5) copy all constraints
3847  *
3848  * The source problem depends on the stage of the \p sourcescip - In SCIP_STAGE_PROBLEM, the original problem is copied,
3849  * otherwise, the transformed problem is copied. For an explicit copy of the original problem, use SCIPcopyOrigConsCompression().
3850  *
3851  * @note: in case that a combination of local bounds and explicit fixing values should be used,
3852  * the fixing value of a variable is preferred if local bounds and fixing value disagree.
3853  *
3854  * @note all variables and constraints which are created in the target-SCIP are not (user) captured
3855  *
3856  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
3857  * Also, 'passmessagehdlr' should be set to FALSE.
3858  * @note Do not change the source SCIP environment during the copying process
3859  *
3860  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3861  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3862  *
3863  * @pre This method can be called if sourcescip is in one of the following stages:
3864  * - \ref SCIP_STAGE_PROBLEM
3865  * - \ref SCIP_STAGE_TRANSFORMED
3866  * - \ref SCIP_STAGE_INITPRESOLVE
3867  * - \ref SCIP_STAGE_PRESOLVING
3868  * - \ref SCIP_STAGE_EXITPRESOLVE
3869  * - \ref SCIP_STAGE_PRESOLVED
3870  * - \ref SCIP_STAGE_INITSOLVE
3871  * - \ref SCIP_STAGE_SOLVING
3872  * - \ref SCIP_STAGE_SOLVED
3873  *
3874  * @pre This method can be called if targetscip is in one of the following stages:
3875  * - \ref SCIP_STAGE_INIT
3876  * - \ref SCIP_STAGE_FREE
3877  *
3878  * @note sourcescip stage does not get changed
3879  *
3880  * @note targetscip stage does not get changed
3881  *
3882  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3883  */
3885  SCIP* sourcescip, /**< source SCIP data structure */
3886  SCIP* targetscip, /**< target SCIP data structure */
3887  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
3888  * target variables, or NULL */
3889  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
3890  * target constraints, or NULL */
3891  const char* suffix, /**< optional suffix for problem name inside the target SCIP */
3892  SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
3893  SCIP_Real* fixedvals, /**< array of fixing values for target SCIP variables, or NULL */
3894  int nfixedvars, /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
3895  SCIP_Bool global, /**< create a global or a local copy? */
3896  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
3897  * plugins will be copied and activated, and the modifiable flag of
3898  * constraints will be respected. If FALSE, valid will be set to FALSE, when
3899  * there are pricers present */
3900  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
3901  SCIP_Bool* valid /**< pointer to store whether the copying was valid, or NULL */
3902  )
3903 {
3904  SCIP_Bool original = FALSE;
3905  SCIP_Bool useconscompression = TRUE;
3906 
3907  assert(sourcescip != NULL);
3908  assert(targetscip != NULL);
3909  assert(suffix != NULL);
3910 
3911  /* check stages for both, the source and the target SCIP data structure */
3912  SCIP_CALL( checkStage(sourcescip, "SCIPcopyConsCompression", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3913  SCIP_CALL( checkStage(targetscip, "SCIPcopyConsCompression", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
3914 
3915  /* copy the source problem data */
3916  SCIP_CALL( doCopy(sourcescip, targetscip, varmap, consmap, suffix, fixedvars, fixedvals, nfixedvars,
3917  useconscompression, global, original, enablepricing, passmessagehdlr, valid) );
3918 
3919  return SCIP_OKAY;
3920 }
3921 
3922 
3923 /** copies source SCIP original problem to target SCIP; the copying process is done in the following order:
3924  * 1) copy the plugins
3925  * 2) copy the settings
3926  * 3) create problem data in target-SCIP and copy the original problem data of the source-SCIP
3927  * 4) copy all original variables
3928  * 5) copy all original constraints
3929  *
3930  * @note all variables and constraints which are created in the target-SCIP are not (user) captured
3931  *
3932  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
3933  * Also, 'passmessagehdlr' should be set to FALSE.
3934  * @note Do not change the source SCIP environment during the copying process
3935  *
3936  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3937  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3938  *
3939  * @pre This method can be called if sourcescip is in one of the following stages:
3940  * - \ref SCIP_STAGE_PROBLEM
3941  * - \ref SCIP_STAGE_TRANSFORMED
3942  * - \ref SCIP_STAGE_INITPRESOLVE
3943  * - \ref SCIP_STAGE_PRESOLVING
3944  * - \ref SCIP_STAGE_EXITPRESOLVE
3945  * - \ref SCIP_STAGE_PRESOLVED
3946  * - \ref SCIP_STAGE_INITSOLVE
3947  * - \ref SCIP_STAGE_SOLVING
3948  * - \ref SCIP_STAGE_SOLVED
3949  *
3950  * @pre This method can be called if targetscip is in one of the following stages:
3951  * - \ref SCIP_STAGE_INIT
3952  * - \ref SCIP_STAGE_FREE
3953  *
3954  * @note sourcescip stage does not get changed
3955  *
3956  * @note targetscip stage does not get changed
3957  *
3958  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3959  */
3961  SCIP* sourcescip, /**< source SCIP data structure */
3962  SCIP* targetscip, /**< target SCIP data structure */
3963  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
3964  * target variables, or NULL */
3965  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
3966  * target constraints, or NULL */
3967  const char* suffix, /**< suffix which will be added to the names of the target SCIP, might be empty */
3968  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
3969  * plugins will be copied and activated, and the modifiable flag of
3970  * constraints will be respected. If FALSE, valid will be set to FALSE, when
3971  * there are pricers present */
3972  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
3973  SCIP_Bool* valid /**< pointer to store whether the copying was valid, or NULL */
3974  )
3975 {
3976  SCIP_VAR** fixedvars = NULL;
3977  SCIP_Real* fixedvals = NULL;
3978  int nfixedvars = 0;
3979  SCIP_Bool global = TRUE;
3980  SCIP_Bool original = TRUE;
3981  SCIP_Bool useconscompression = FALSE;
3982 
3983  assert(sourcescip != NULL);
3984  assert(targetscip != NULL);
3985  assert(suffix != NULL);
3986 
3987  /* check stages for both, the source and the target SCIP data structure */
3988  SCIP_CALL( checkStage(sourcescip, "SCIPcopyOrig", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3989  SCIP_CALL( checkStage(targetscip, "SCIPcopyOrig", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
3990 
3991  SCIP_CALL( doCopy(sourcescip, targetscip, varmap, consmap, suffix, fixedvars, fixedvals, nfixedvars,
3992  useconscompression, global, original, enablepricing, passmessagehdlr, valid) );
3993 
3994  return SCIP_OKAY;
3995 }
3996 
3997 /** copies source SCIP original problem to target SCIP but compresses constraints
3998  *
3999  * constraint compression is performed by removing fixed variables immediately
4000  * during constraint creation if the involved constraint handlers support
4001  * compression
4002  *
4003  * the copying process is done in the following order:
4004  * 1) copy the plugins
4005  * 2) copy the settings
4006  * 3) create problem data in target-SCIP and copy the problem data of the source-SCIP
4007  * 4) copy all original variables
4008  * a) fix all variable copies specified by \p fixedvars, \p fixedvals, and \p nfixedvars
4009  * b) enable constraint compression
4010  * 5) copy all constraints
4011  *
4012  * @note all variables and constraints which are created in the target-SCIP are not (user) captured
4013  *
4014  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
4015  * Also, 'passmessagehdlr' should be set to FALSE.
4016  * @note Do not change the source SCIP environment during the copying process
4017  *
4018  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4019  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4020  *
4021  * @pre This method can be called if sourcescip is in one of the following stages:
4022  * - \ref SCIP_STAGE_PROBLEM
4023  * - \ref SCIP_STAGE_TRANSFORMED
4024  * - \ref SCIP_STAGE_INITPRESOLVE
4025  * - \ref SCIP_STAGE_PRESOLVING
4026  * - \ref SCIP_STAGE_EXITPRESOLVE
4027  * - \ref SCIP_STAGE_PRESOLVED
4028  * - \ref SCIP_STAGE_INITSOLVE
4029  * - \ref SCIP_STAGE_SOLVING
4030  * - \ref SCIP_STAGE_SOLVED
4031  *
4032  * @pre This method can be called if targetscip is in one of the following stages:
4033  * - \ref SCIP_STAGE_INIT
4034  * - \ref SCIP_STAGE_FREE
4035  *
4036  * @note sourcescip stage does not get changed
4037  *
4038  * @note targetscip stage does not get changed
4039  *
4040  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
4041  */
4043  SCIP* sourcescip, /**< source SCIP data structure */
4044  SCIP* targetscip, /**< target SCIP data structure */
4045  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
4046  * target variables, or NULL */
4047  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
4048  * target constraints, or NULL */
4049  const char* suffix, /**< optional suffix for problem name inside the target SCIP */
4050  SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
4051  SCIP_Real* fixedvals, /**< array of fixing values for target SCIP variables, or NULL */
4052  int nfixedvars, /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
4053  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
4054  * plugins will be copied and activated, and the modifiable flag of
4055  * constraints will be respected. If FALSE, valid will be set to FALSE, when
4056  * there are pricers present */
4057  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
4058  SCIP_Bool* valid /**< pointer to store whether the copying was valid, or NULL */
4059  )
4060 {
4061  SCIP_Bool original = TRUE;
4062  SCIP_Bool global = TRUE;
4063  SCIP_Bool useconscompression = TRUE;
4064 
4065  assert(sourcescip != NULL);
4066  assert(targetscip != NULL);
4067  assert(suffix != NULL);
4068 
4069  /* check stages for both, the source and the target SCIP data structure */
4070  SCIP_CALL( checkStage(sourcescip, "SCIPcopyOrigConsCompression", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
4071  SCIP_CALL( checkStage(targetscip, "SCIPcopyOrigConsCompression", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
4072 
4073  /* copy the source problem data */
4074  SCIP_CALL( doCopy(sourcescip, targetscip, varmap, consmap, suffix, fixedvars, fixedvals, nfixedvars,
4075  useconscompression, global, original, enablepricing, passmessagehdlr, valid) );
4076 
4077  SCIP_CALL( SCIPsyncstoreRelease(&targetscip->syncstore) );
4078  targetscip->syncstore = sourcescip->syncstore;
4079  SCIP_CALL( SCIPsyncstoreCapture(targetscip->syncstore) );
4080 
4081  return SCIP_OKAY;
4082 }
4083 
4084 /** return updated time limit for a sub-SCIP */
4085 static
4087  SCIP* sourcescip, /**< source SCIP data structure */
4088  SCIP_Real* timelimit /**< pointer to store sub-SCIP time limit */
4089  )
4090 {
4091  SCIP_CALL( SCIPgetRealParam(sourcescip, "limits/time", timelimit) );
4092  if( !SCIPisInfinity(sourcescip, *timelimit) )
4093  (*timelimit) -= SCIPgetSolvingTime(sourcescip);
4094 
4095  return SCIP_OKAY;
4096 }
4097 
4098 /** set updated time limit for a sub-SCIP */
4099 static
4101  SCIP* sourcescip, /**< source SCIP data structure */
4102  SCIP* targetscip /**< target SCIP data structure */
4103  )
4104 {
4105  if( SCIPgetParam(targetscip, "limits/softtime") == NULL )
4106  return SCIP_OKAY;
4107  else
4108  {
4109  SCIP_Real timelimit = -1.0;
4110 
4111  SCIP_CALL( SCIPgetRealParam(sourcescip, "limits/softtime", &timelimit) );
4112  if( !SCIPisNegative(sourcescip, timelimit) )
4113  {
4114  timelimit -= SCIPgetSolvingTime(sourcescip);
4115  timelimit = MAX(0.0, timelimit);
4116  }
4117 
4118  SCIP_CALL( SCIPsetRealParam(targetscip, "limits/softtime", timelimit) );
4119  }
4120  return SCIP_OKAY;
4121 }
4122 
4123 /** return updated memory limit for a sub-SCIP */
4124 static
4126  SCIP* sourcescip, /**< source SCIP data structure */
4127  SCIP_Real* memorylimit /**< pointer to store sub-SCIP memory limit */
4128  )
4129 {
4130  SCIP_CALL( SCIPgetRealParam(sourcescip, "limits/memory", memorylimit) );
4131 
4132  /* substract the memory already used by the main SCIP and the estimated memory usage of external software */
4133  if( !SCIPisInfinity(sourcescip, *memorylimit) )
4134  (*memorylimit) -= (SCIPgetMemUsed(sourcescip) + SCIPgetMemExternEstim(sourcescip))/1048576.0;
4135 
4136  return SCIP_OKAY;
4137 }
4138 
4139 /** checks if there is enough time and memory left for copying the sourcescip into a sub-SCIP and solve the sub-SCIP
4140  *
4141  * This is the case if the time and memory limit that would be passed to the sub-SCIP are larger than 0.0
4142  *
4143  * @pre This method can be called if sourcescip is in one of the following stages:
4144  * - \ref SCIP_STAGE_PROBLEM
4145  * - \ref SCIP_STAGE_TRANSFORMED
4146  * - \ref SCIP_STAGE_INITPRESOLVE
4147  * - \ref SCIP_STAGE_PRESOLVING
4148  * - \ref SCIP_STAGE_EXITPRESOLVE
4149  * - \ref SCIP_STAGE_PRESOLVED
4150  * - \ref SCIP_STAGE_INITSOLVE
4151  * - \ref SCIP_STAGE_SOLVING
4152  * - \ref SCIP_STAGE_SOLVED
4153  *
4154  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
4155  */
4157  SCIP* sourcescip, /**< source SCIP data structure */
4158  SCIP_Bool* success /**< pointer to store whether there is time and memory left to copy the
4159  * problem and run the sub-SCIP */
4160  )
4161 {
4162  SCIP_Real timelimit;
4163  SCIP_Real memorylimit;
4164 
4165  SCIP_CALL( getCopyTimelimit(sourcescip, &timelimit) );
4166  SCIP_CALL( getCopyMemlimit(sourcescip, &memorylimit) );
4167 
4168  *success = timelimit > 0.0 && memorylimit > 2.0 * SCIPgetMemExternEstim(sourcescip) / 1048576.0;
4169 
4170  return SCIP_OKAY;
4171 }
4172 
4173 /** copies limits from source SCIP to target SCIP
4174  *
4175  * @note time and memory limit are reduced by the amount already spent in the source SCIP before installing the limit
4176  * in the target SCIP
4177  * @note all other limits are disabled and need to be enabled afterwards, if needed
4178  *
4179  * @pre This method can be called if sourcescip is in one of the following stages:
4180  * - \ref SCIP_STAGE_PROBLEM
4181  * - \ref SCIP_STAGE_TRANSFORMED
4182  * - \ref SCIP_STAGE_INITPRESOLVE
4183  * - \ref SCIP_STAGE_PRESOLVING
4184  * - \ref SCIP_STAGE_EXITPRESOLVE
4185  * - \ref SCIP_STAGE_PRESOLVED
4186  * - \ref SCIP_STAGE_INITSOLVE
4187  * - \ref SCIP_STAGE_SOLVING
4188  * - \ref SCIP_STAGE_SOLVED
4189  *
4190  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
4191  */
4193  SCIP* sourcescip, /**< source SCIP data structure */
4194  SCIP* targetscip /**< target SCIP data structure */
4195  )
4196 {
4197  SCIP_Real timelimit;
4198  SCIP_Real memorylimit;
4199 
4200  SCIP_CALL( getCopyTimelimit(sourcescip, &timelimit) );
4201  SCIP_CALL( getCopyMemlimit(sourcescip, &memorylimit) );
4202 
4203  /* avoid negative limits */
4204  if( timelimit < 0.0 )
4205  timelimit = 0.0;
4206  if( memorylimit < 0.0 )
4207  memorylimit = 0.0;
4208 
4209  /* set time and memory limit to the adjusted values */
4210  SCIP_CALL( SCIPsetRealParam(targetscip, "limits/time", timelimit) );
4211  SCIP_CALL( SCIPsetRealParam(targetscip, "limits/memory", memorylimit) );
4212 
4213  /* copy and adjust soft time limit (or disable it) */
4214  SCIP_CALL( copySofttimelimit(sourcescip, targetscip) );
4215 
4216  /* disable all other limits */
4217  SCIP_CALL( SCIPsetRealParam(targetscip, "limits/absgap", 0.0) );
4218  SCIP_CALL( SCIPsetIntParam(targetscip, "limits/bestsol", -1) );
4219  SCIP_CALL( SCIPsetRealParam(targetscip, "limits/gap", 0.0) );
4220  SCIP_CALL( SCIPsetLongintParam(targetscip, "limits/nodes", -1LL) );
4221  SCIP_CALL( SCIPsetIntParam(targetscip, "limits/restarts", -1) );
4222  SCIP_CALL( SCIPsetIntParam(targetscip, "limits/solutions", -1) );
4223  SCIP_CALL( SCIPsetLongintParam(targetscip, "limits/stallnodes", -1LL) );
4224  SCIP_CALL( SCIPsetLongintParam(targetscip, "limits/totalnodes", -1LL) );
4225 
4226  return SCIP_OKAY;
4227 }
4228 
4229 
4230 /*
4231  * parameter settings
4232  */
4233 
4234 /** creates a SCIP_Bool parameter, sets it to its default value, and adds it to the parameter set
4235  *
4236  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4237  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4238  */
4240  SCIP* scip, /**< SCIP data structure */
4241  const char* name, /**< name of the parameter */
4242  const char* desc, /**< description of the parameter */
4243  SCIP_Bool* valueptr, /**< pointer to store the current parameter value, or NULL */
4244  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
4245  SCIP_Bool defaultvalue, /**< default value of the parameter */
4246  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
4247  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
4248  )
4249 {
4250  assert(scip != NULL);
4251  assert(scip->set != NULL);
4252  assert(scip->mem != NULL);
4253 
4254  SCIP_CALL( SCIPsetAddBoolParam(scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, valueptr, isadvanced,
4255  defaultvalue, paramchgd, paramdata) );
4256 
4257  return SCIP_OKAY;
4258 }
4259 
4260 /** creates a int parameter, sets it to its default value, and adds it to the parameter set
4261  *
4262  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4263  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4264  */
4266  SCIP* scip, /**< SCIP data structure */
4267  const char* name, /**< name of the parameter */
4268  const char* desc, /**< description of the parameter */
4269  int* valueptr, /**< pointer to store the current parameter value, or NULL */
4270  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
4271  int defaultvalue, /**< default value of the parameter */
4272  int minvalue, /**< minimum value for parameter */
4273  int maxvalue, /**< maximum value for parameter */
4274  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
4275  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
4276  )
4277 {
4278  assert(scip != NULL);
4279  assert(scip->set != NULL);
4280  assert(scip->mem != NULL);
4281 
4282  SCIP_CALL( SCIPsetAddIntParam(scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, valueptr, isadvanced,
4283  defaultvalue, minvalue, maxvalue, paramchgd, paramdata) );
4284 
4285  return SCIP_OKAY;
4286 }
4287 
4288 /** creates a SCIP_Longint parameter, sets it to its default value, and adds it to the parameter set
4289  *
4290  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4291  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4292  */
4294  SCIP* scip, /**< SCIP data structure */
4295  const char* name, /**< name of the parameter */
4296  const char* desc, /**< description of the parameter */
4297  SCIP_Longint* valueptr, /**< pointer to store the current parameter value, or NULL */
4298  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
4299  SCIP_Longint defaultvalue, /**< default value of the parameter */
4300  SCIP_Longint minvalue, /**< minimum value for parameter */
4301  SCIP_Longint maxvalue, /**< maximum value for parameter */
4302  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
4303  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
4304  )
4305 {
4306  assert(scip != NULL);
4307  assert(scip->set != NULL);
4308  assert(scip->mem != NULL);
4309 
4310  SCIP_CALL( SCIPsetAddLongintParam(scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, valueptr, isadvanced,
4311  defaultvalue, minvalue, maxvalue, paramchgd, paramdata) );
4312 
4313  return SCIP_OKAY;
4314 }
4315 
4316 /** creates a SCIP_Real parameter, sets it to its default value, and adds it to the parameter set
4317  *
4318  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4319  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4320  */
4322  SCIP* scip, /**< SCIP data structure */
4323  const char* name, /**< name of the parameter */
4324  const char* desc, /**< description of the parameter */
4325  SCIP_Real* valueptr, /**< pointer to store the current parameter value, or NULL */
4326  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
4327  SCIP_Real defaultvalue, /**< default value of the parameter */
4328  SCIP_Real minvalue, /**< minimum value for parameter */
4329  SCIP_Real maxvalue, /**< maximum value for parameter */
4330  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
4331  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
4332  )
4333 {
4334  assert(scip != NULL);
4335  assert(scip->set != NULL);
4336  assert(scip->mem != NULL);
4337 
4338  SCIP_CALL( SCIPsetAddRealParam(scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, valueptr, isadvanced,
4339  defaultvalue, minvalue, maxvalue, paramchgd, paramdata) );
4340 
4341  return SCIP_OKAY;
4342 }
4343 
4344 /** creates a char parameter, sets it to its default value, and adds it to the parameter set
4345  *
4346  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4347  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4348  */
4350  SCIP* scip, /**< SCIP data structure */
4351  const char* name, /**< name of the parameter */
4352  const char* desc, /**< description of the parameter */
4353  char* valueptr, /**< pointer to store the current parameter value, or NULL */
4354  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
4355  char defaultvalue, /**< default value of the parameter */
4356  const char* allowedvalues, /**< array with possible parameter values, or NULL if not restricted */
4357  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
4358  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
4359  )
4360 {
4361  assert(scip != NULL);
4362  assert(scip->set != NULL);
4363  assert(scip->mem != NULL);
4364 
4365  SCIP_CALL( SCIPsetAddCharParam(scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, valueptr, isadvanced,
4366  defaultvalue, allowedvalues, paramchgd, paramdata) );
4367 
4368  return SCIP_OKAY;
4369 }
4370 
4371 /** creates a string(char*) parameter, sets it to its default value, and adds it to the parameter set
4372  *
4373  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4374  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4375  */
4377  SCIP* scip, /**< SCIP data structure */
4378  const char* name, /**< name of the parameter */
4379  const char* desc, /**< description of the parameter */
4380  char** valueptr, /**< pointer to store the current parameter value, or NULL; if not NULL then *valueptr should be NULL */
4381  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
4382  const char* defaultvalue, /**< default value of the parameter */
4383  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
4384  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
4385  )
4386 {
4387  assert(scip != NULL);
4388  assert(scip->set != NULL);
4389  assert(scip->mem != NULL);
4390 
4391  SCIP_CALL( SCIPsetAddStringParam(scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, valueptr, isadvanced,
4392  defaultvalue, paramchgd, paramdata) );
4393 
4394  return SCIP_OKAY;
4395 }
4396 
4397 /** gets the fixing status of an existing parameter
4398  *
4399  * @return TRUE if the parameter is fixed to a value, otherwise FALSE.
4400  */
4402  SCIP* scip, /**< SCIP data structure */
4403  const char* name /**< name of the parameter */
4404  )
4405 {
4406  assert(scip != NULL);
4407  assert(scip->set != NULL);
4408 
4409  return SCIPsetIsParamFixed(scip->set, name);
4410 }
4411 
4412 /** returns the pointer to the SCIP parameter with the given name
4413  *
4414  * @return pointer to the parameter with the given name
4415  */
4417  SCIP* scip, /**< SCIP data structure */
4418  const char* name /**< name of the parameter */
4419  )
4420 {
4421  assert(scip != NULL);
4422  assert(scip->set != NULL);
4423 
4424  return SCIPsetGetParam(scip->set, name);
4425 }
4426 
4427 /** gets the value of an existing SCIP_Bool parameter
4428  *
4429  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4430  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4431  */
4433  SCIP* scip, /**< SCIP data structure */
4434  const char* name, /**< name of the parameter */
4435  SCIP_Bool* value /**< pointer to store the parameter */
4436  )
4437 {
4438  assert(scip != NULL);
4439  assert(scip->set != NULL);
4440 
4441  SCIP_CALL( SCIPsetGetBoolParam(scip->set, name, value) );
4442 
4443  return SCIP_OKAY;
4444 }
4445 
4446 /** gets the value of an existing int parameter
4447  *
4448  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4449  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4450  */
4452  SCIP* scip, /**< SCIP data structure */
4453  const char* name, /**< name of the parameter */
4454  int* value /**< pointer to store the parameter */
4455  )
4456 {
4457  assert(scip != NULL);
4458  assert(scip->set != NULL);
4459 
4460  SCIP_CALL( SCIPsetGetIntParam(scip->set, name, value) );
4461 
4462  return SCIP_OKAY;
4463 }
4464 
4465 /** gets the value of an existing SCIP_Longint parameter
4466  *
4467  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4468  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4469  */
4471  SCIP* scip, /**< SCIP data structure */
4472  const char* name, /**< name of the parameter */
4473  SCIP_Longint* value /**< pointer to store the parameter */
4474  )
4475 {
4476  assert(scip != NULL);
4477  assert(scip->set != NULL);
4478 
4479  SCIP_CALL( SCIPsetGetLongintParam(scip->set, name, value) );
4480 
4481  return SCIP_OKAY;
4482 }
4483 
4484 /** gets the value of an existing SCIP_Real parameter
4485  *
4486  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4487  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4488  */
4490  SCIP* scip, /**< SCIP data structure */
4491  const char* name, /**< name of the parameter */
4492  SCIP_Real* value /**< pointer to store the parameter */
4493  )
4494 {
4495  assert(scip != NULL);
4496  assert(scip->set != NULL);
4497 
4498  SCIP_CALL( SCIPsetGetRealParam(scip->set, name, value) );
4499 
4500  return SCIP_OKAY;
4501 }
4502 
4503 /** gets the value of an existing char parameter
4504  *
4505  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4506  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4507  */
4509  SCIP* scip, /**< SCIP data structure */
4510  const char* name, /**< name of the parameter */
4511  char* value /**< pointer to store the parameter */
4512  )
4513 {
4514  assert(scip != NULL);
4515  assert(scip->set != NULL);
4516 
4517  SCIP_CALL( SCIPsetGetCharParam(scip->set, name, value) );
4518 
4519  return SCIP_OKAY;
4520 }
4521 
4522 /** gets the value of an existing string(char*) parameter
4523  *
4524  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4525  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4526  */
4528  SCIP* scip, /**< SCIP data structure */
4529  const char* name, /**< name of the parameter */
4530  char** value /**< pointer to store the parameter */
4531  )
4532 {
4533  assert(scip != NULL);
4534  assert(scip->set != NULL);
4535 
4536  SCIP_CALL( SCIPsetGetStringParam(scip->set, name, value) );
4537 
4538  return SCIP_OKAY;
4539 }
4540 
4541 /** fixes the value of an existing parameter
4542  *
4543  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4544  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4545  *
4546  * @note: Be careful with this method! Some general settings, e.g., the time or node limit, should not be fixed because
4547  * they have to be changed for sub-SCIPs.
4548  */
4550  SCIP* scip, /**< SCIP data structure */
4551  const char* name /**< name of the parameter */
4552  )
4553 {
4554  assert(scip != NULL);
4555  assert(scip->set != NULL);
4556 
4557  SCIP_CALL( SCIPsetChgParamFixed(scip->set, name, TRUE) );
4558 
4559  return SCIP_OKAY;
4560 }
4561 
4562 /** unfixes the value of an existing parameter
4563  *
4564  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4565  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4566  */
4568  SCIP* scip, /**< SCIP data structure */
4569  const char* name /**< name of the parameter */
4570  )
4571 {
4572  assert(scip != NULL);
4573  assert(scip->set != NULL);
4574 
4575  SCIP_CALL( SCIPsetChgParamFixed(scip->set, name, FALSE) );
4576 
4577  return SCIP_OKAY;
4578 }
4579 
4580 /** changes the value of an existing parameter
4581  *
4582  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4583  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4584  */
4586  SCIP* scip, /**< SCIP data structure */
4587  const char* name, /**< name of the parameter */
4588  void* value /**< new value of the parameter */
4589  )
4590 {
4591  assert(scip != NULL);
4592  assert(scip->set != NULL);
4593 
4594  SCIP_CALL( SCIPsetSetParam(scip->set, scip->messagehdlr, name, value) );
4595 
4596  return SCIP_OKAY;
4597 }
4598 
4599 /** changes the value of an existing SCIP_Bool parameter
4600  *
4601  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4602  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4603  */
4605  SCIP* scip, /**< SCIP data structure */
4606  SCIP_PARAM* param, /**< parameter */
4607  SCIP_Bool value /**< new value of the parameter */
4608  )
4609 {
4610  SCIP_RETCODE retcode;
4611 
4612  assert(scip != NULL);
4613  assert(scip->set != NULL);
4614 
4615  retcode = SCIPsetChgBoolParam(scip->set, scip->messagehdlr, param, value);
4616 
4617  if( retcode != SCIP_PARAMETERWRONGVAL )
4618  {
4619  SCIP_CALL( retcode );
4620  }
4621 
4622  return retcode;
4623 }
4624 
4625 /** changes the value of an existing SCIP_Bool parameter
4626  *
4627  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4628  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4629  */
4631  SCIP* scip, /**< SCIP data structure */
4632  const char* name, /**< name of the parameter */
4633  SCIP_Bool value /**< new value of the parameter */
4634  )
4635 {
4636  assert(scip != NULL);
4637  assert(scip->set != NULL);
4638 
4639  SCIP_CALL( SCIPsetSetBoolParam(scip->set, scip->messagehdlr, name, value) );
4640 
4641  return SCIP_OKAY;
4642 }
4643 
4644 /** checks whether the value of an existing SCIP_Bool parameter is valid */
4646  SCIP* scip, /**< SCIP data structure */
4647  SCIP_PARAM* param, /**< parameter */
4648  SCIP_Bool value /**< value to check */
4649  )
4650 {
4651  assert(scip != NULL);
4652  assert(param != NULL);
4653 
4654  return SCIPparamIsValidBool(param, value);
4655 }
4656 
4657 /** changes the value of an existing int parameter
4658  *
4659  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4660  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4661  */
4663  SCIP* scip, /**< SCIP data structure */
4664  SCIP_PARAM* param, /**< parameter */
4665  int value /**< new value of the parameter */
4666  )
4667 {
4668  SCIP_RETCODE retcode;
4669 
4670  assert(scip != NULL);
4671  assert(scip->set != NULL);
4672 
4673  retcode = SCIPsetChgIntParam(scip->set, scip->messagehdlr, param, value);
4674 
4675  if( retcode != SCIP_PARAMETERWRONGVAL )
4676  {
4677  SCIP_CALL( retcode );
4678  }
4679 
4680  return retcode;
4681 }
4682 
4683 /** changes the value of an existing int parameter
4684  *
4685  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4686  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4687  */
4689  SCIP* scip, /**< SCIP data structure */
4690  const char* name, /**< name of the parameter */
4691  int value /**< new value of the parameter */
4692  )
4693 {
4694  assert(scip != NULL);
4695  assert(scip->set != NULL);
4696 
4697  SCIP_CALL( SCIPsetSetIntParam(scip->set, scip->messagehdlr, name, value) );
4698 
4699  return SCIP_OKAY;
4700 }
4701 
4702 /** checks whether parameter value of an existing int paramter is valid */
4704  SCIP* scip, /**< SCIP data structure */
4705  SCIP_PARAM* param, /**< parameter */
4706  int value /**< value to check */
4707  )
4708 {
4709  assert(scip != NULL);
4710  assert(param != NULL);
4711 
4712  return SCIPparamIsValidInt(param, value);
4713 }
4714 
4715 /** changes the value of an existing SCIP_Longint parameter
4716  *
4717  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4718  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4719  */
4721  SCIP* scip, /**< SCIP data structure */
4722  SCIP_PARAM* param, /**< parameter */
4723  SCIP_Longint value /**< new value of the parameter */
4724  )
4725 {
4726  SCIP_RETCODE retcode;
4727 
4728  assert(scip != NULL);
4729  assert(scip->set != NULL);
4730 
4731  retcode = SCIPsetChgLongintParam(scip->set, scip->messagehdlr, param, value);
4732 
4733  if( retcode != SCIP_PARAMETERWRONGVAL )
4734  {
4735  SCIP_CALL( retcode );
4736  }
4737 
4738  return retcode;
4739 }
4740 
4741 /** changes the value of an existing SCIP_Longint parameter
4742  *
4743  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4744  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4745  */
4747  SCIP* scip, /**< SCIP data structure */
4748  const char* name, /**< name of the parameter */
4749  SCIP_Longint value /**< new value of the parameter */
4750  )
4751 {
4752  assert(scip != NULL);
4753  assert(scip->set != NULL);
4754 
4755  SCIP_CALL( SCIPsetSetLongintParam(scip->set, scip->messagehdlr, name, value) );
4756 
4757  return SCIP_OKAY;
4758 }
4759 
4760 /** checks whether parameter value of an existing SCIP_Longint paramter is valid */
4762  SCIP* scip, /**< SCIP data structure */
4763  SCIP_PARAM* param, /**< parameter */
4764  SCIP_Longint value /**< value to check */
4765  )
4766 {
4767  assert(scip != NULL);
4768  assert(param != NULL);
4769 
4770  return SCIPparamIsValidLongint(param, value);
4771 }
4772 
4773 /** changes the value of an existing SCIP_Real parameter
4774  *
4775  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4776  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4777  */
4779  SCIP* scip, /**< SCIP data structure */
4780  SCIP_PARAM* param, /**< parameter */
4781  SCIP_Real value /**< new value of the parameter */
4782  )
4783 {
4784  SCIP_RETCODE retcode;
4785 
4786  assert(scip != NULL);
4787  assert(scip->set != NULL);
4788 
4789  retcode = SCIPsetChgRealParam(scip->set, scip->messagehdlr, param, value);
4790 
4791  if( retcode != SCIP_PARAMETERWRONGVAL )
4792  {
4793  SCIP_CALL( retcode );
4794  }
4795 
4796  return retcode;
4797 }
4798 
4799 /** changes the value of an existing SCIP_Real parameter
4800  *
4801  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4802  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4803  */
4805  SCIP* scip, /**< SCIP data structure */
4806  const char* name, /**< name of the parameter */
4807  SCIP_Real value /**< new value of the parameter */
4808  )
4809 {
4810  assert(scip != NULL);
4811  assert(scip->set != NULL);
4812 
4813  SCIP_CALL( SCIPsetSetRealParam(scip->set, scip->messagehdlr, name, value) );
4814 
4815  return SCIP_OKAY;
4816 }
4817 
4818 /** checks whether parameter value of an existing SCIP_Real paramter is valid */
4820  SCIP* scip, /**< SCIP data structure */
4821  SCIP_PARAM* param, /**< parameter */
4822  SCIP_Real value /**< value to check */
4823  )
4824 {
4825  assert(scip != NULL);
4826  assert(param != NULL);
4827 
4828  return SCIPparamIsValidReal(param, value);
4829 }
4830 
4831 /** changes the value of an existing char parameter
4832  *
4833  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4834  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4835  */
4837  SCIP* scip, /**< SCIP data structure */
4838  SCIP_PARAM* param, /**< parameter */
4839  char value /**< new value of the parameter */
4840  )
4841 {
4842  SCIP_RETCODE retcode;
4843 
4844  assert(scip != NULL);
4845  assert(scip->set != NULL);
4846 
4847  retcode = SCIPsetChgCharParam(scip->set, scip->messagehdlr, param, value);
4848 
4849  if( retcode != SCIP_PARAMETERWRONGVAL )
4850  {
4851  SCIP_CALL( retcode );
4852  }
4853 
4854  return retcode;
4855 }
4856 
4857 /** changes the value of an existing char parameter
4858  *
4859  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4860  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4861  */
4863  SCIP* scip, /**< SCIP data structure */
4864  const char* name, /**< name of the parameter */
4865  char value /**< new value of the parameter */
4866  )
4867 {
4868  assert(scip != NULL);
4869  assert(scip->set != NULL);
4870 
4871  SCIP_CALL( SCIPsetSetCharParam(scip->set, scip->messagehdlr, name, value) );
4872 
4873  return SCIP_OKAY;
4874 }
4875 
4876 /** checks whether parameter value for a given SCIP_Real parameter is valid */
4878  SCIP* scip, /**< SCIP data structure */
4879  SCIP_PARAM* param, /**< parameter */
4880  const char value /**< value to check */
4881  )
4882 {
4883  assert(scip != NULL);
4884  assert(param != NULL);
4885 
4886  return SCIPparamIsValidChar(param, value);
4887 }
4888 
4889 /** changes the value of an existing string(char*) parameter
4890  *
4891  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4892  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4893  */
4895  SCIP* scip, /**< SCIP data structure */
4896  SCIP_PARAM* param, /**< parameter */
4897  const char* value /**< new value of the parameter */
4898  )
4899 {
4900  SCIP_RETCODE retcode;
4901 
4902  assert(scip != NULL);
4903  assert(scip->set != NULL);
4904 
4905  retcode = SCIPsetChgStringParam(scip->set, scip->messagehdlr, param, value);
4906 
4907  if( retcode != SCIP_PARAMETERWRONGVAL )
4908  {
4909  SCIP_CALL( retcode );
4910  }
4911 
4912  return retcode;
4913 }
4914 
4915 /** changes the value of an existing string(char*) parameter
4916  *
4917  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4918  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4919  */
4921  SCIP* scip, /**< SCIP data structure */
4922  const char* name, /**< name of the parameter */
4923  const char* value /**< new value of the parameter */
4924  )
4925 {
4926  assert(scip != NULL);
4927  assert(scip->set != NULL);
4928 
4929  SCIP_CALL( SCIPsetSetStringParam(scip->set, scip->messagehdlr, name, value) );
4930 
4931  return SCIP_OKAY;
4932 }
4933 
4934 /** checks whether parameter value for a given string parameter is valid */
4936  SCIP* scip, /**< SCIP data structure */
4937  SCIP_PARAM* param, /**< parameter */
4938  const char* value /**< value to check */
4939  )
4940 {
4941  assert(scip != NULL);
4942  assert(param != NULL);
4943 
4944  return SCIPparamIsValidString(param, value);
4945 }
4946 
4947 /** reads parameters from a file
4948  *
4949  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4950  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4951  */
4953  SCIP* scip, /**< SCIP data structure */
4954  const char* filename /**< file name */
4955  )
4956 {
4957  assert(scip != NULL);
4958  assert(scip->set != NULL);
4959 
4960  SCIP_CALL( SCIPsetReadParams(scip->set, scip->messagehdlr, filename) );
4961 
4962  return SCIP_OKAY;
4963 }
4964 
4965 /** writes a single parameter to a file
4966  *
4967  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4968  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4969  */
4971  SCIP* scip, /**< SCIP data structure */
4972  SCIP_PARAM* param, /**< parameter */
4973  const char* filename, /**< file name, or NULL for stdout */
4974  SCIP_Bool comments, /**< should parameter descriptions be written as comments? */
4975  SCIP_Bool onlychanged /**< should only those parameters be written that are changed from their
4976  * default value?
4977  */
4978  )
4979 {
4980  assert(scip != NULL);
4981  assert(param != NULL);
4982 
4983  SCIP_CALL( SCIPparamWrite(param, scip->messagehdlr, filename, comments, onlychanged) );
4984 
4985  return SCIP_OKAY;
4986 }
4987 
4988 /** writes all parameters in the parameter set to a file
4989  *
4990  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4991  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4992  */
4994  SCIP* scip, /**< SCIP data structure */
4995  const char* filename, /**< file name, or NULL for stdout */
4996  SCIP_Bool comments, /**< should parameter descriptions be written as comments? */
4997  SCIP_Bool onlychanged /**< should only those parameters be written that are changed from their
4998  * default value?
4999  */
5000  )
5001 {
5002  assert(scip != NULL);
5003  assert(scip->set != NULL);
5004 
5005  SCIP_CALL( SCIPsetWriteParams(scip->set, scip->messagehdlr, filename, comments, onlychanged) );
5006 
5007  return SCIP_OKAY;
5008 }
5009 
5010 /** resets a single parameter to its default value
5011  *
5012  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5013  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5014  */
5016  SCIP* scip, /**< SCIP data structure */
5017  const char* name /**< name of the parameter */
5018  )
5019 {
5020  assert(scip != NULL);
5021  assert(scip->set != NULL);
5022 
5023  SCIP_CALL( SCIPsetResetParam(scip->set, scip->messagehdlr, name) );
5024 
5025  return SCIP_OKAY;
5026 }
5027 
5028 /** resets all parameters to their default values
5029  *
5030  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5031  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5032  */
5034  SCIP* scip /**< SCIP data structure */
5035  )
5036 {
5037  assert(scip != NULL);
5038  assert(scip->set != NULL);
5039 
5040  SCIP_CALL( SCIPsetResetParams(scip->set, scip->messagehdlr) );
5041 
5042  return SCIP_OKAY;
5043 }
5044 
5045 /** sets parameters to
5046  *
5047  * - \ref SCIP_PARAMEMPHASIS_DEFAULT to use default values (see also SCIPresetParams())
5048  * - \ref SCIP_PARAMEMPHASIS_COUNTER to get feasible and "fast" counting process
5049  * - \ref SCIP_PARAMEMPHASIS_CPSOLVER to get CP like search (e.g. no LP relaxation)
5050  * - \ref SCIP_PARAMEMPHASIS_EASYCIP to solve easy problems fast
5051  * - \ref SCIP_PARAMEMPHASIS_FEASIBILITY to detect feasibility fast
5052  * - \ref SCIP_PARAMEMPHASIS_HARDLP to be capable to handle hard LPs
5053  * - \ref SCIP_PARAMEMPHASIS_OPTIMALITY to prove optimality fast
5054  * - \ref SCIP_PARAMEMPHASIS_PHASEFEAS to find feasible solutions during a 3 phase solution process
5055  * - \ref SCIP_PARAMEMPHASIS_PHASEIMPROVE to find improved solutions during a 3 phase solution process
5056  * - \ref SCIP_PARAMEMPHASIS_PHASEPROOF to proof optimality during a 3 phase solution process
5057  *
5058  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5059  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5060  */
5062  SCIP* scip, /**< SCIP data structure */
5063  SCIP_PARAMEMPHASIS paramemphasis, /**< parameter settings */
5064  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
5065  )
5066 {
5067  assert(scip != NULL);
5068  assert(scip->set != NULL);
5069 
5070  SCIP_CALL( SCIPsetSetEmphasis(scip->set, scip->messagehdlr, paramemphasis, quiet) );
5071 
5072  return SCIP_OKAY;
5073 }
5074 
5075 /** sets parameters to deactivate separators and heuristics that use auxiliary SCIP instances; should be called for
5076  * auxiliary SCIP instances to avoid recursion
5077  *
5078  * @note only deactivates plugins which could cause recursion, some plugins which use sub-SCIPs stay activated
5079  *
5080  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5081  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5082  */
5084  SCIP* scip, /**< (auxiliary) SCIP data structure */
5085  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
5086  )
5087 {
5088  assert(scip != NULL);
5089  assert(scip->set != NULL);
5090 
5091  SCIP_CALL( SCIPsetSetSubscipsOff(scip->set, scip->messagehdlr, quiet) );
5092 
5093  return SCIP_OKAY;
5094 }
5095 
5096 /** sets heuristic parameters values to
5097  *
5098  * - SCIP_PARAMSETTING_DEFAULT which are the default values of all heuristic parameters
5099  * - SCIP_PARAMSETTING_FAST such that the time spent on heuristics is decreased
5100  * - SCIP_PARAMSETTING_AGGRESSIVE such that the heuristics are called more aggressively
5101  * - SCIP_PARAMSETTING_OFF which turn off all heuristics
5102  *
5103  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5104  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5105  */
5107  SCIP* scip, /**< SCIP data structure */
5108  SCIP_PARAMSETTING paramsetting, /**< parameter settings */
5109  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
5110  )
5111 {
5112  assert(scip != NULL);
5113  assert(scip->set != NULL);
5114  assert(paramsetting == SCIP_PARAMSETTING_DEFAULT || paramsetting == SCIP_PARAMSETTING_FAST
5115  || paramsetting == SCIP_PARAMSETTING_AGGRESSIVE || paramsetting == SCIP_PARAMSETTING_OFF);
5116 
5117  SCIP_CALL( SCIPsetSetHeuristics(scip->set, scip->messagehdlr, paramsetting, quiet) );
5118 
5119  return SCIP_OKAY;
5120 }
5121 
5122 /** sets presolving parameters to
5123  *
5124  * - SCIP_PARAMSETTING_DEFAULT which are the default values of all presolving parameters
5125  * - SCIP_PARAMSETTING_FAST such that the time spent on presolving is decreased
5126  * - SCIP_PARAMSETTING_AGGRESSIVE such that the presolving is more aggressive
5127  * - SCIP_PARAMSETTING_OFF which turn off all presolving
5128  *
5129  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5130  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5131  */
5133  SCIP* scip, /**< SCIP data structure */
5134  SCIP_PARAMSETTING paramsetting, /**< parameter settings */
5135  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
5136  )
5137 {
5138  assert(scip != NULL);
5139  assert(scip->set != NULL);
5140  assert(paramsetting == SCIP_PARAMSETTING_DEFAULT || paramsetting == SCIP_PARAMSETTING_FAST
5141  || paramsetting == SCIP_PARAMSETTING_AGGRESSIVE || paramsetting == SCIP_PARAMSETTING_OFF);
5142 
5143  SCIP_CALL( SCIPsetSetPresolving(scip->set, scip->messagehdlr, paramsetting, quiet) );
5144 
5145  return SCIP_OKAY;
5146 }
5147 
5148 /** sets separating parameters to
5149  *
5150  * - SCIP_PARAMSETTING_DEFAULT which are the default values of all separating parameters
5151  * - SCIP_PARAMSETTING_FAST such that the time spent on separating is decreased
5152  * - SCIP_PARAMSETTING_AGGRESSIVE such that separating is more aggressive
5153  * - SCIP_PARAMSETTING_OFF which turn off all separating
5154  *
5155  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5156  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5157  */
5159  SCIP* scip, /**< SCIP data structure */
5160  SCIP_PARAMSETTING paramsetting, /**< parameter settings */
5161  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
5162  )
5163 {
5164  assert(scip != NULL);
5165  assert(scip->set != NULL);
5166  assert(paramsetting == SCIP_PARAMSETTING_DEFAULT || paramsetting == SCIP_PARAMSETTING_FAST
5167  || paramsetting == SCIP_PARAMSETTING_AGGRESSIVE || paramsetting == SCIP_PARAMSETTING_OFF);
5168 
5169  SCIP_CALL( SCIPsetSetSeparating(scip->set, scip->messagehdlr, paramsetting, quiet) );
5170 
5171  return SCIP_OKAY;
5172 }
5173 
5174 /** returns the array of all available SCIP parameters
5175  *
5176  * @return SCIP_PARAM* array, containing all SCIP parameters.
5177  */
5179  SCIP* scip /**< SCIP data structure */
5180  )
5181 {
5182  assert(scip != NULL);
5183  assert(scip->set != NULL);
5184 
5185  return SCIPsetGetParams(scip->set);
5186 }
5187 
5188 /** returns the total number of all available SCIP parameters
5189  *
5190  * @return number of all SCIP parameters.
5191  */
5193  SCIP* scip /**< SCIP data structure */
5194  )
5195 {
5196  assert(scip != NULL);
5197  assert(scip->set != NULL);
5198 
5199  return SCIPsetGetNParams(scip->set);
5200 }
5201 
5202 
5203 
5204 
5205 /*
5206  * SCIP user functionality methods: managing plugins
5207  */
5208 
5209 /** creates a reader and includes it in SCIP
5210  *
5211  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5212  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5213  *
5214  * @pre This method can be called if SCIP is in one of the following stages:
5215  * - \ref SCIP_STAGE_INIT
5216  * - \ref SCIP_STAGE_PROBLEM
5217  *
5218  * @note method has all reader callbacks as arguments and is thus changed every time a new callback is added
5219  * in future releases; consider using SCIPincludeReaderBasic() and setter functions
5220  * if you seek for a method which is less likely to change in future releases
5221  */
5223  SCIP* scip, /**< SCIP data structure */
5224  const char* name, /**< name of reader */
5225  const char* desc, /**< description of reader */
5226  const char* extension, /**< file extension that reader processes */
5227  SCIP_DECL_READERCOPY ((*readercopy)), /**< copy method of reader or NULL if you don't want to copy your plugin into sub-SCIPs */
5228  SCIP_DECL_READERFREE ((*readerfree)), /**< destructor of reader */
5229  SCIP_DECL_READERREAD ((*readerread)), /**< read method */
5230  SCIP_DECL_READERWRITE ((*readerwrite)), /**< write method */
5231  SCIP_READERDATA* readerdata /**< reader data */
5232  )
5233 {
5234  SCIP_READER* reader;
5235 
5236  SCIP_CALL( checkStage(scip, "SCIPincludeReader", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5237 
5238  /* check whether reader is already present */
5239  if( SCIPfindReader(scip, name) != NULL )
5240  {
5241  SCIPerrorMessage("reader <%s> already included.\n", name);
5242  return SCIP_INVALIDDATA;
5243  }
5244 
5245  SCIP_CALL( SCIPreaderCreate(&reader, name, desc, extension, readercopy, readerfree, readerread, readerwrite, readerdata) );
5246  SCIP_CALL( SCIPsetIncludeReader(scip->set, reader) );
5247 
5248  return SCIP_OKAY;
5249 }
5250 
5251 /** creates a reader and includes it in SCIP. All non-fundamental (or optional) callbacks will be set to NULL.
5252  * Optional callbacks can be set via specific setter functions, see
5253  * SCIPsetReaderCopy(), SCIPsetReaderFree(), SCIPsetReaderRead(), SCIPsetReaderWrite().
5254  *
5255  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5256  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5257  *
5258  * @pre This method can be called if SCIP is in one of the following stages:
5259  * - \ref SCIP_STAGE_INIT
5260  * - \ref SCIP_STAGE_PROBLEM
5261  *
5262  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeReader() instead
5263  */
5265  SCIP* scip, /**< SCIP data structure */
5266  SCIP_READER** readerptr, /**< reference to reader pointer, or NULL */
5267  const char* name, /**< name of reader */
5268  const char* desc, /**< description of reader */
5269  const char* extension, /**< file extension that reader processes */
5270  SCIP_READERDATA* readerdata /**< reader data */
5271  )
5272 {
5273  SCIP_READER* reader;
5274 
5275  SCIP_CALL( checkStage(scip, "SCIPincludeReaderBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5276 
5277  /* check whether reader is already present */
5278  if( SCIPfindReader(scip, name) != NULL )
5279  {
5280  SCIPerrorMessage("reader <%s> already included.\n", name);
5281  return SCIP_INVALIDDATA;
5282  }
5283 
5284  SCIP_CALL( SCIPreaderCreate(&reader, name, desc, extension, NULL, NULL, NULL, NULL, readerdata) );
5285  SCIP_CALL( SCIPsetIncludeReader(scip->set, reader) );
5286 
5287  if( readerptr != NULL )
5288  *readerptr = reader;
5289 
5290  return SCIP_OKAY;
5291 }
5292 
5293 /** set copy method of reader
5294  *
5295  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5296  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5297  *
5298  * @pre This method can be called if SCIP is in one of the following stages:
5299  * - \ref SCIP_STAGE_INIT
5300  * - \ref SCIP_STAGE_PROBLEM
5301  */
5303  SCIP* scip, /**< SCIP data structure */
5304  SCIP_READER* reader, /**< reader */
5305  SCIP_DECL_READERCOPY ((*readercopy)) /**< copy method of reader or NULL if you don't want to copy your plugin into sub-SCIPs */
5306  )
5307 {
5308  assert(scip != NULL);
5309 
5310  SCIP_CALL( checkStage(scip, "SCIPsetReaderCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5311 
5312  SCIPreaderSetCopy(reader, readercopy);
5313 
5314  return SCIP_OKAY;
5315 }
5316 
5317 /** set deinitialization method of reader
5318  *
5319  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5320  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5321  *
5322  * @pre This method can be called if SCIP is in one of the following stages:
5323  * - \ref SCIP_STAGE_INIT
5324  * - \ref SCIP_STAGE_PROBLEM
5325  */
5327  SCIP* scip, /**< SCIP data structure */
5328  SCIP_READER* reader, /**< reader */
5329  SCIP_DECL_READERFREE ((*readerfree)) /**< destructor of reader */
5330  )
5331 {
5332  assert(scip != NULL);
5333 
5334  SCIP_CALL( checkStage(scip, "SCIPsetReaderFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5335 
5336  SCIPreaderSetFree(reader, readerfree);
5337 
5338  return SCIP_OKAY;
5339 }
5340 
5341 /** set read method of reader
5342  *
5343  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5344  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5345  *
5346  * @pre This method can be called if SCIP is in one of the following stages:
5347  * - \ref SCIP_STAGE_INIT
5348  * - \ref SCIP_STAGE_PROBLEM
5349  */
5351  SCIP* scip, /**< SCIP data structure */
5352  SCIP_READER* reader, /**< reader */
5353  SCIP_DECL_READERREAD ((*readerread)) /**< read method of reader */
5354  )
5355 {
5356  assert(scip != NULL);
5357 
5358  SCIP_CALL( checkStage(scip, "SCIPsetReaderRead", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5359 
5360  SCIPreaderSetRead(reader, readerread);
5361 
5362  return SCIP_OKAY;
5363 }
5364 
5365 /** set write method of reader
5366  *
5367  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5368  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5369  *
5370  * @pre This method can be called if SCIP is in one of the following stages:
5371  * - \ref SCIP_STAGE_INIT
5372  * - \ref SCIP_STAGE_PROBLEM
5373  */
5375  SCIP* scip, /**< SCIP data structure */
5376  SCIP_READER* reader, /**< reader */
5377  SCIP_DECL_READERWRITE ((*readerwrite)) /**< write method of reader */
5378  )
5379 {
5380  assert(scip != NULL);
5381 
5382  SCIP_CALL( checkStage(scip, "SCIPsetReaderWrite", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5383 
5384  SCIPreaderSetWrite(reader, readerwrite);
5385 
5386  return SCIP_OKAY;
5387 }
5388 
5389 /** returns the reader of the given name, or NULL if not existing */
5391  SCIP* scip, /**< SCIP data structure */
5392  const char* name /**< name of reader */
5393  )
5394 {
5395  assert(scip != NULL);
5396  assert(scip->set != NULL);
5397  assert(name != NULL);
5398 
5399  return SCIPsetFindReader(scip->set, name);
5400 }
5401 
5402 /** returns the array of currently available readers */
5404  SCIP* scip /**< SCIP data structure */
5405  )
5406 {
5407  assert(scip != NULL);
5408  assert(scip->set != NULL);
5409 
5410  return scip->set->readers;
5411 }
5412 
5413 /** returns the number of currently available readers */
5415  SCIP* scip /**< SCIP data structure */
5416  )
5417 {
5418  assert(scip != NULL);
5419  assert(scip->set != NULL);
5420 
5421  return scip->set->nreaders;
5422 }
5423 
5424 /** creates a variable pricer and includes it in SCIP
5425  * To use the variable pricer for solving a problem, it first has to be activated with a call to SCIPactivatePricer().
5426  * This should be done during the problem creation stage.
5427  *
5428  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5429  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5430  *
5431  * @pre This method can be called if SCIP is in one of the following stages:
5432  * - \ref SCIP_STAGE_INIT
5433  * - \ref SCIP_STAGE_PROBLEM
5434  *
5435  * @note method has all pricer callbacks as arguments and is thus changed every time a new callback is added
5436  * in future releases; consider using SCIPincludePricerBasic() and setter functions
5437  * if you seek for a method which is less likely to change in future releases
5438  */
5440  SCIP* scip, /**< SCIP data structure */
5441  const char* name, /**< name of variable pricer */
5442  const char* desc, /**< description of variable pricer */
5443  int priority, /**< priority of the variable pricer */
5444  SCIP_Bool delay, /**< should the pricer be delayed until no other pricers or already existing
5445  * problem variables with negative reduced costs are found?
5446  * if this is set to FALSE it may happen that the pricer produces columns
5447  * that already exist in the problem (which are also priced in by the
5448  * default problem variable pricing in the same round) */
5449  SCIP_DECL_PRICERCOPY ((*pricercopy)), /**< copy method of variable pricer or NULL if you don't want to copy your plugin into sub-SCIPs */
5450  SCIP_DECL_PRICERFREE ((*pricerfree)), /**< destructor of variable pricer */
5451  SCIP_DECL_PRICERINIT ((*pricerinit)), /**< initialize variable pricer */
5452  SCIP_DECL_PRICEREXIT ((*pricerexit)), /**< deinitialize variable pricer */
5453  SCIP_DECL_PRICERINITSOL((*pricerinitsol)),/**< solving process initialization method of variable pricer */
5454  SCIP_DECL_PRICEREXITSOL((*pricerexitsol)),/**< solving process deinitialization method of variable pricer */
5455  SCIP_DECL_PRICERREDCOST((*pricerredcost)),/**< reduced cost pricing method of variable pricer for feasible LPs */
5456  SCIP_DECL_PRICERFARKAS((*pricerfarkas)), /**< Farkas pricing method of variable pricer for infeasible LPs */
5457  SCIP_PRICERDATA* pricerdata /**< variable pricer data */
5458  )
5459 {
5460  SCIP_PRICER* pricer;
5461 
5462  SCIP_CALL( checkStage(scip, "SCIPincludePricer", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5463 
5464  /* check whether pricer is already present */
5465  if( SCIPfindPricer(scip, name) != NULL )
5466  {
5467  SCIPerrorMessage("pricer <%s> already included.\n", name);
5468  return SCIP_INVALIDDATA;
5469  }
5470 
5471  SCIP_CALL( SCIPpricerCreate(&pricer, scip->set, scip->messagehdlr, scip->mem->setmem,
5472  name, desc, priority, delay,
5473  pricercopy,
5474  pricerfree, pricerinit, pricerexit, pricerinitsol, pricerexitsol, pricerredcost, pricerfarkas, pricerdata) );
5475  SCIP_CALL( SCIPsetIncludePricer(scip->set, pricer) );
5476 
5477  return SCIP_OKAY;
5478 }
5479 
5480 /** creates a variable pricer and includes it in SCIP with all non-fundamental callbacks set to NULL;
5481  * if needed, these can be added afterwards via setter functions SCIPsetPricerCopy(), SCIPsetPricerFree(),
5482  * SCIPsetPricerInity(), SCIPsetPricerExit(), SCIPsetPricerInitsol(), SCIPsetPricerExitsol(),
5483  * SCIPsetPricerFarkas();
5484  *
5485  * To use the variable pricer for solving a problem, it first has to be activated with a call to SCIPactivatePricer().
5486  * This should be done during the problem creation stage.
5487  *
5488  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5489  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5490  *
5491  * @pre This method can be called if SCIP is in one of the following stages:
5492  * - \ref SCIP_STAGE_INIT
5493  * - \ref SCIP_STAGE_PROBLEM
5494  *
5495  * @note if you want to set all callbacks with a single method call, consider using SCIPincludePricer() instead
5496  */
5498  SCIP* scip, /**< SCIP data structure */
5499  SCIP_PRICER** pricerptr, /**< reference to a pricer, or NULL */
5500  const char* name, /**< name of variable pricer */
5501  const char* desc, /**< description of variable pricer */
5502  int priority, /**< priority of the variable pricer */
5503  SCIP_Bool delay, /**< should the pricer be delayed until no other pricers or already existing
5504  * problem variables with negative reduced costs are found?
5505  * if this is set to FALSE it may happen that the pricer produces columns
5506  * that already exist in the problem (which are also priced in by the
5507  * default problem variable pricing in the same round) */
5508  SCIP_DECL_PRICERREDCOST((*pricerredcost)),/**< reduced cost pricing method of variable pricer for feasible LPs */
5509  SCIP_DECL_PRICERFARKAS((*pricerfarkas)), /**< Farkas pricing method of variable pricer for infeasible LPs */
5510  SCIP_PRICERDATA* pricerdata /**< variable pricer data */
5511  )
5512 {
5513  SCIP_PRICER* pricer;
5514 
5515  SCIP_CALL( checkStage(scip, "SCIPincludePricerBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5516 
5517  /* check whether pricer is already present */
5518  if( SCIPfindPricer(scip, name) != NULL )
5519  {
5520  SCIPerrorMessage("pricer <%s> already included.\n", name);
5521  return SCIP_INVALIDDATA;
5522  }
5523 
5524  SCIP_CALL( SCIPpricerCreate(&pricer, scip->set, scip->messagehdlr, scip->mem->setmem,
5525  name, desc, priority, delay,
5526  NULL,
5527  NULL, NULL, NULL, NULL, NULL, pricerredcost, pricerfarkas, pricerdata) );
5528  SCIP_CALL( SCIPsetIncludePricer(scip->set, pricer) );
5529 
5530  if( pricerptr != NULL )
5531  *pricerptr = pricer;
5532 
5533  return SCIP_OKAY;
5534 }
5535 
5536 /** sets copy method of pricer
5537  *
5538  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5539  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5540  *
5541  * @pre This method can be called if SCIP is in one of the following stages:
5542  * - \ref SCIP_STAGE_INIT
5543  * - \ref SCIP_STAGE_PROBLEM
5544  */
5546  SCIP* scip, /**< SCIP data structure */
5547  SCIP_PRICER* pricer, /**< pricer */
5548  SCIP_DECL_PRICERCOPY ((*pricercopy)) /**< copy method of pricer or NULL if you don't want to copy your plugin into sub-SCIPs */
5549  )
5550 {
5551  SCIP_CALL( checkStage(scip, "SCIPsetPricerCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5552 
5553  assert(pricer != NULL);
5554 
5555  SCIPpricerSetCopy(pricer, pricercopy);
5556 
5557  return SCIP_OKAY;
5558 }
5559 
5560 /** sets destructor method of pricer
5561  *
5562  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5563  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5564  *
5565  * @pre This method can be called if SCIP is in one of the following stages:
5566  * - \ref SCIP_STAGE_INIT
5567  * - \ref SCIP_STAGE_PROBLEM
5568  */
5570  SCIP* scip, /**< SCIP data structure */
5571  SCIP_PRICER* pricer, /**< pricer */
5572  SCIP_DECL_PRICERFREE ((*pricerfree)) /**< destructor of pricer */
5573  )
5574 {
5575  SCIP_CALL( checkStage(scip, "SCIPsetPricerFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5576 
5577  assert(pricer != NULL);
5578 
5579  SCIPpricerSetFree(pricer, pricerfree);
5580 
5581  return SCIP_OKAY;
5582 }
5583 
5584 /** sets initialization method of pricer
5585  *
5586  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5587  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5588  *
5589  * @pre This method can be called if SCIP is in one of the following stages:
5590  * - \ref SCIP_STAGE_INIT
5591  * - \ref SCIP_STAGE_PROBLEM
5592  */
5594  SCIP* scip, /**< SCIP data structure */
5595  SCIP_PRICER* pricer, /**< pricer */
5596  SCIP_DECL_PRICERINIT ((*pricerinit)) /**< initialize pricer */
5597  )
5598 {
5599  SCIP_CALL( checkStage(scip, "SCIPsetPricerInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5600 
5601  assert(pricer != NULL);
5602 
5603  SCIPpricerSetInit(pricer, pricerinit);
5604 
5605  return SCIP_OKAY;
5606 }
5607 
5608 /** sets deinitialization method of pricer
5609  *
5610  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5611  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5612  *
5613  * @pre This method can be called if SCIP is in one of the following stages:
5614  * - \ref SCIP_STAGE_INIT
5615  * - \ref SCIP_STAGE_PROBLEM
5616  */
5618  SCIP* scip, /**< SCIP data structure */
5619  SCIP_PRICER* pricer, /**< pricer */
5620  SCIP_DECL_PRICEREXIT ((*pricerexit)) /**< deinitialize pricer */
5621  )
5622 {
5623  SCIP_CALL( checkStage(scip, "SCIPsetPricerExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5624 
5625  assert(pricer != NULL);
5626 
5627  SCIPpricerSetExit(pricer, pricerexit);
5628 
5629  return SCIP_OKAY;
5630 }
5631 
5632 /** sets solving process initialization method of pricer
5633  *
5634  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5635  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5636  *
5637  * @pre This method can be called if SCIP is in one of the following stages:
5638  * - \ref SCIP_STAGE_INIT
5639  * - \ref SCIP_STAGE_PROBLEM
5640  */
5642  SCIP* scip, /**< SCIP data structure */
5643  SCIP_PRICER* pricer, /**< pricer */
5644  SCIP_DECL_PRICERINITSOL ((*pricerinitsol))/**< solving process initialization method of pricer */
5645  )
5646 {
5647  SCIP_CALL( checkStage(scip, "SCIPsetPricerInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5648 
5649  assert(pricer != NULL);
5650 
5651  SCIPpricerSetInitsol(pricer, pricerinitsol);
5652 
5653  return SCIP_OKAY;
5654 }
5655 
5656 /** sets solving process deinitialization method of pricer
5657  *
5658  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5659  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5660  *
5661  * @pre This method can be called if SCIP is in one of the following stages:
5662  * - \ref SCIP_STAGE_INIT
5663  * - \ref SCIP_STAGE_PROBLEM
5664  */
5666  SCIP* scip, /**< SCIP data structure */
5667  SCIP_PRICER* pricer, /**< pricer */
5668  SCIP_DECL_PRICEREXITSOL((*pricerexitsol)) /**< solving process deinitialization method of pricer */
5669  )
5670 {
5671  SCIP_CALL( checkStage(scip, "SCIPsetPricerExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5672 
5673  assert(pricer != NULL);
5674 
5675  SCIPpricerSetExitsol(pricer, pricerexitsol);
5676 
5677  return SCIP_OKAY;
5678 }
5679 
5680 /** returns the variable pricer of the given name, or NULL if not existing */
5682  SCIP* scip, /**< SCIP data structure */
5683  const char* name /**< name of variable pricer */
5684  )
5685 {
5686  assert(scip != NULL);
5687  assert(scip->set != NULL);
5688  assert(name != NULL);
5689 
5690  return SCIPsetFindPricer(scip->set, name);
5691 }
5692 
5693 /** returns the array of currently available variable pricers; active pricers are in the first slots of the array */
5695  SCIP* scip /**< SCIP data structure */
5696  )
5697 {
5698  assert(scip != NULL);
5699  assert(scip->set != NULL);
5700 
5701  SCIPsetSortPricers(scip->set);
5702 
5703  return scip->set->pricers;
5704 }
5705 
5706 /** returns the number of currently available variable pricers */
5708  SCIP* scip /**< SCIP data structure */
5709  )
5710 {
5711  assert(scip != NULL);
5712  assert(scip->set != NULL);
5713 
5714  return scip->set->npricers;
5715 }
5716 
5717 /** returns the number of currently active variable pricers, that are used in the LP solving loop */
5719  SCIP* scip /**< SCIP data structure */
5720  )
5721 {
5722  assert(scip != NULL);
5723  assert(scip->set != NULL);
5724 
5725  return scip->set->nactivepricers;
5726 }
5727 
5728 /** sets the priority priority of a variable pricer */
5730  SCIP* scip, /**< SCIP data structure */
5731  SCIP_PRICER* pricer, /**< variable pricer */
5732  int priority /**< new priority of the variable pricer */
5733  )
5734 {
5735  assert(scip != NULL);
5736  assert(scip->set != NULL);
5737 
5738  SCIPpricerSetPriority(pricer, scip->set, priority);
5739 
5740  return SCIP_OKAY;
5741 }
5742 
5743 /** activates pricer to be used for the current problem
5744  * This method should be called during the problem creation stage for all pricers that are necessary to solve
5745  * the problem model.
5746  * The pricers are automatically deactivated when the problem is freed.
5747  *
5748  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5749  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5750  *
5751  * @pre This method can be called if SCIP is in one of the following stages:
5752  * - \ref SCIP_STAGE_PROBLEM
5753  */
5755  SCIP* scip, /**< SCIP data structure */
5756  SCIP_PRICER* pricer /**< variable pricer */
5757  )
5758 {
5759  SCIP_CALL( checkStage(scip, "SCIPactivatePricer", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5760 
5761  SCIP_CALL( SCIPpricerActivate(pricer, scip->set) );
5762 
5763  return SCIP_OKAY;
5764 }
5765 
5766 /** deactivates pricer
5767  *
5768  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5769  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5770  *
5771  * @pre This method can be called if SCIP is in one of the following stages:
5772  * - \ref SCIP_STAGE_PROBLEM
5773  * - \ref SCIP_STAGE_EXITSOLVE
5774  */
5776  SCIP* scip, /**< SCIP data structure */
5777  SCIP_PRICER* pricer /**< variable pricer */
5778  )
5779 {
5780  SCIP_CALL( checkStage(scip, "SCIPdeactivatePricer", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE) );
5781 
5782  SCIP_CALL( SCIPpricerDeactivate(pricer, scip->set) );
5783 
5784  return SCIP_OKAY;
5785 }
5786 
5787 /** creates a constraint handler and includes it in SCIP.
5788  *
5789  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5790  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5791  *
5792  * @pre This method can be called if SCIP is in one of the following stages:
5793  * - \ref SCIP_STAGE_INIT
5794  * - \ref SCIP_STAGE_PROBLEM
5795  *
5796  * @note method has all constraint handler callbacks as arguments and is thus changed every time a new
5797  * callback is added
5798  * in future releases; consider using SCIPincludeConshdlrBasic() and setter functions
5799  * if you seek for a method which is less likely to change in future releases
5800  */
5802  SCIP* scip, /**< SCIP data structure */
5803  const char* name, /**< name of constraint handler */
5804  const char* desc, /**< description of constraint handler */
5805  int sepapriority, /**< priority of the constraint handler for separation */
5806  int enfopriority, /**< priority of the constraint handler for constraint enforcing */
5807  int chckpriority, /**< priority of the constraint handler for checking feasibility (and propagation) */
5808  int sepafreq, /**< frequency for separating cuts; zero means to separate only in the root node */
5809  int propfreq, /**< frequency for propagating domains; zero means only preprocessing propagation */
5810  int eagerfreq, /**< frequency for using all instead of only the useful constraints in separation,
5811  * propagation and enforcement, -1 for no eager evaluations, 0 for first only */
5812  int maxprerounds, /**< maximal number of presolving rounds the constraint handler participates in (-1: no limit) */
5813  SCIP_Bool delaysepa, /**< should separation method be delayed, if other separators found cuts? */
5814  SCIP_Bool delayprop, /**< should propagation method be delayed, if other propagators found reductions? */
5815  SCIP_Bool needscons, /**< should the constraint handler be skipped, if no constraints are available? */
5816  SCIP_PROPTIMING proptiming, /**< positions in the node solving loop where propagation method of constraint handlers should be executed */
5817  SCIP_PRESOLTIMING presoltiming, /**< timing mask of the constraint handler's presolving method */
5818  SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), /**< copy method of constraint handler or NULL if you don't want to copy your plugin into sub-SCIPs */
5819  SCIP_DECL_CONSFREE ((*consfree)), /**< destructor of constraint handler */
5820  SCIP_DECL_CONSINIT ((*consinit)), /**< initialize constraint handler */
5821  SCIP_DECL_CONSEXIT ((*consexit)), /**< deinitialize constraint handler */
5822  SCIP_DECL_CONSINITPRE ((*consinitpre)), /**< presolving initialization method of constraint handler */
5823  SCIP_DECL_CONSEXITPRE ((*consexitpre)), /**< presolving deinitialization method of constraint handler */
5824  SCIP_DECL_CONSINITSOL ((*consinitsol)), /**< solving process initialization method of constraint handler */
5825  SCIP_DECL_CONSEXITSOL ((*consexitsol)), /**< solving process deinitialization method of constraint handler */
5826  SCIP_DECL_CONSDELETE ((*consdelete)), /**< free specific constraint data */
5827  SCIP_DECL_CONSTRANS ((*constrans)), /**< transform constraint data into data belonging to the transformed problem */
5828  SCIP_DECL_CONSINITLP ((*consinitlp)), /**< initialize LP with relaxations of "initial" constraints */
5829  SCIP_DECL_CONSSEPALP ((*conssepalp)), /**< separate cutting planes for LP solution */
5830  SCIP_DECL_CONSSEPASOL ((*conssepasol)), /**< separate cutting planes for arbitrary primal solution */
5831  SCIP_DECL_CONSENFOLP ((*consenfolp)), /**< enforcing constraints for LP solutions */
5832  SCIP_DECL_CONSENFORELAX ((*consenforelax)), /**< enforcing constraints for relaxation solutions */
5833  SCIP_DECL_CONSENFOPS ((*consenfops)), /**< enforcing constraints for pseudo solutions */
5834  SCIP_DECL_CONSCHECK ((*conscheck)), /**< check feasibility of primal solution */
5835  SCIP_DECL_CONSPROP ((*consprop)), /**< propagate variable domains */
5836  SCIP_DECL_CONSPRESOL ((*conspresol)), /**< presolving method */
5837  SCIP_DECL_CONSRESPROP ((*consresprop)), /**< propagation conflict resolving method */
5838  SCIP_DECL_CONSLOCK ((*conslock)), /**< variable rounding lock method */
5839  SCIP_DECL_CONSACTIVE ((*consactive)), /**< activation notification method */
5840  SCIP_DECL_CONSDEACTIVE((*consdeactive)), /**< deactivation notification method */
5841  SCIP_DECL_CONSENABLE ((*consenable)), /**< enabling notification method */
5842  SCIP_DECL_CONSDISABLE ((*consdisable)), /**< disabling notification method */
5843  SCIP_DECL_CONSDELVARS ((*consdelvars)), /**< variable deletion method */
5844  SCIP_DECL_CONSPRINT ((*consprint)), /**< constraint display method */
5845  SCIP_DECL_CONSCOPY ((*conscopy)), /**< constraint copying method */
5846  SCIP_DECL_CONSPARSE ((*consparse)), /**< constraint parsing method */
5847  SCIP_DECL_CONSGETVARS ((*consgetvars)), /**< constraint get variables method */
5848  SCIP_DECL_CONSGETNVARS((*consgetnvars)), /**< constraint get number of variable method */
5849  SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)), /**< constraint handler diving solution enforcement method */
5850  SCIP_CONSHDLRDATA* conshdlrdata /**< constraint handler data */
5851  )
5852 {
5853  SCIP_CONSHDLR* conshdlr;
5854 
5855  SCIP_CALL( checkStage(scip, "SCIPincludeConshdlr", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5856 
5857  /* check whether constraint handler is already present */
5858  if( SCIPfindConshdlr(scip, name) != NULL )
5859  {
5860  SCIPerrorMessage("constraint handler <%s> already included.\n", name);
5861  return SCIP_INVALIDDATA;
5862  }
5863 
5864  SCIP_CALL( SCIPconshdlrCreate(&conshdlr, scip->set, scip->messagehdlr, scip->mem->setmem,
5865  name, desc, sepapriority, enfopriority, chckpriority, sepafreq, propfreq, eagerfreq, maxprerounds,
5866  delaysepa, delayprop, needscons, proptiming, presoltiming, conshdlrcopy,
5867  consfree, consinit, consexit, consinitpre, consexitpre, consinitsol, consexitsol,
5868  consdelete, constrans, consinitlp, conssepalp, conssepasol, consenfolp, consenforelax, consenfops, conscheck, consprop,
5869  conspresol, consresprop, conslock, consactive, consdeactive, consenable, consdisable, consdelvars, consprint,
5870  conscopy, consparse, consgetvars, consgetnvars, consgetdivebdchgs, conshdlrdata) );
5871  SCIP_CALL( SCIPsetIncludeConshdlr(scip->set, conshdlr) );
5872 
5873  return SCIP_OKAY;
5874 }
5875 
5876 /** creates a constraint handler and includes it in SCIP. All non-fundamental (or optional) callbacks will be set to NULL.
5877  * Optional callbacks can be set via specific setter functions, see SCIPsetConshdlrInit(), SCIPsetConshdlrExit(),
5878  * SCIPsetConshdlrCopy(), SCIPsetConshdlrFree(), SCIPsetConshdlrInitsol(), SCIPsetConshdlrExitsol(),
5879  * SCIPsetConshdlrInitpre(), SCIPsetConshdlrExitpre(), SCIPsetConshdlrPresol(), SCIPsetConshdlrDelete(),
5880  * SCIPsetConshdlrDelvars(), SCIPsetConshdlrInitlp(), SCIPsetConshdlrActive(), SCIPsetConshdlrDeactive(),
5881  * SCIPsetConshdlrEnable(), SCIPsetConshdlrDisable(), SCIPsetConshdlrResprop(), SCIPsetConshdlrTrans(),
5882  * SCIPsetConshdlrPrint(), SCIPsetConshdlrParse(), SCIPsetConshdlrGetVars(), SCIPsetConshdlrGetNVars(), and
5883  * SCIPsetConshdlrGetDiveBdChgs().
5884  *
5885  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5886  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5887  *
5888  * @pre This method can be called if SCIP is in one of the following stages:
5889  * - \ref SCIP_STAGE_INIT
5890  * - \ref SCIP_STAGE_PROBLEM
5891  *
5892  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeConshdlr() instead
5893  */
5895  SCIP* scip, /**< SCIP data structure */
5896  SCIP_CONSHDLR** conshdlrptr, /**< reference to a constraint handler pointer, or NULL */
5897  const char* name, /**< name of constraint handler */
5898  const char* desc, /**< description of constraint handler */
5899  int enfopriority, /**< priority of the constraint handler for constraint enforcing */
5900  int chckpriority, /**< priority of the constraint handler for checking feasibility (and propagation) */
5901  int eagerfreq, /**< frequency for using all instead of only the useful constraints in separation,
5902  * propagation and enforcement, -1 for no eager evaluations, 0 for first only */
5903  SCIP_Bool needscons, /**< should the constraint handler be skipped, if no constraints are available? */
5904  SCIP_DECL_CONSENFOLP ((*consenfolp)), /**< enforcing constraints for LP solutions */
5905  SCIP_DECL_CONSENFOPS ((*consenfops)), /**< enforcing constraints for pseudo solutions */
5906  SCIP_DECL_CONSCHECK ((*conscheck)), /**< check feasibility of primal solution */
5907  SCIP_DECL_CONSLOCK ((*conslock)), /**< variable rounding lock method */
5908  SCIP_CONSHDLRDATA* conshdlrdata /**< constraint handler data */
5909  )
5910 {
5911  SCIP_CONSHDLR* conshdlr;
5912 
5913  SCIP_CALL( checkStage(scip, "SCIPincludeConshdlrBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5914 
5915  /* check whether constraint handler is already present */
5916  if( SCIPfindConshdlr(scip, name) != NULL )
5917  {
5918  SCIPerrorMessage("constraint handler <%s> already included.\n", name);
5919  return SCIP_INVALIDDATA;
5920  }
5921 
5922  SCIP_CALL( SCIPconshdlrCreate(&conshdlr, scip->set, scip->messagehdlr, scip->mem->setmem,
5923  name, desc, 0, enfopriority, chckpriority, -1, -1, eagerfreq, 0,
5924  FALSE, FALSE, needscons,
5926  NULL,
5927  NULL, NULL, NULL, NULL, NULL, NULL, NULL,
5928  NULL, NULL, NULL, NULL, NULL, consenfolp, NULL, consenfops, conscheck, NULL,
5929  NULL, NULL, conslock, NULL, NULL, NULL, NULL, NULL, NULL,
5930  NULL, NULL, NULL, NULL, NULL, conshdlrdata) );
5931  SCIP_CALL( SCIPsetIncludeConshdlr(scip->set, conshdlr) );
5932 
5933  if( conshdlrptr != NULL )
5934  *conshdlrptr = conshdlr;
5935 
5936  return SCIP_OKAY;
5937 }
5938 
5939 /** sets all separation related callbacks/parameters of the constraint handler
5940  *
5941  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5942  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5943  *
5944  * @pre This method can be called if SCIP is in one of the following stages:
5945  * - \ref SCIP_STAGE_INIT
5946  * - \ref SCIP_STAGE_PROBLEM
5947  */
5949  SCIP* scip, /**< SCIP data structure */
5950  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5951  SCIP_DECL_CONSSEPALP ((*conssepalp)), /**< separate cutting planes for LP solution */
5952  SCIP_DECL_CONSSEPASOL ((*conssepasol)), /**< separate cutting planes for arbitrary primal solution */
5953  int sepafreq, /**< frequency for separating cuts; zero means to separate only in the root node */
5954  int sepapriority, /**< priority of the constraint handler for separation */
5955  SCIP_Bool delaysepa /**< should separation method be delayed, if other separators found cuts? */
5956  )
5957 {
5958  int oldsepapriority;
5959  const char* name;
5960  char paramname[SCIP_MAXSTRLEN];
5961 
5962  assert(scip != NULL);
5963  assert(conshdlr != NULL);
5964 
5965  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrSepa", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5966 
5967  oldsepapriority = SCIPconshdlrGetSepaPriority(conshdlr);
5968  SCIPconshdlrSetSepa(conshdlr, conssepalp, conssepasol, sepafreq, sepapriority, delaysepa);
5969 
5970  /* change the position of the constraint handler in the constraint handler array w.r.t. its new sepa priority */
5971  if( oldsepapriority != sepapriority )
5972  SCIPsetReinsertConshdlrSepaPrio(scip->set, conshdlr, oldsepapriority);
5973 
5974  name = SCIPconshdlrGetName(conshdlr);
5975 
5976  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/sepafreq", name);
5977  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, sepafreq) );
5978 
5979  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/delaysepa", name);
5980  SCIP_CALL( SCIPsetSetDefaultBoolParam(scip->set, paramname, delaysepa) );
5981 
5982  return SCIP_OKAY;
5983 }
5984 
5985 /** sets both the propagation callback and the propagation frequency of the constraint handler
5986  *
5987  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5988  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5989  *
5990  * @pre This method can be called if SCIP is in one of the following stages:
5991  * - \ref SCIP_STAGE_INIT
5992  * - \ref SCIP_STAGE_PROBLEM
5993  */
5995  SCIP* scip, /**< SCIP data structure */
5996  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5997  SCIP_DECL_CONSPROP ((*consprop)), /**< propagate variable domains */
5998  int propfreq, /**< frequency for propagating domains; zero means only preprocessing propagation */
5999  SCIP_Bool delayprop, /**< should propagation method be delayed, if other propagators found reductions? */
6000  SCIP_PROPTIMING proptiming /**< positions in the node solving loop where propagation should be executed */
6001  )
6002 {
6003  const char* name;
6004  char paramname[SCIP_MAXSTRLEN];
6005 
6006  assert(scip != NULL);
6007  assert(conshdlr != NULL);
6008 
6009  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrProp", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6010 
6011  SCIPconshdlrSetProp(conshdlr, consprop, propfreq, delayprop, proptiming);
6012 
6013  name = SCIPconshdlrGetName(conshdlr);
6014 
6015  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/propfreq", name);
6016  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, propfreq) );
6017 
6018  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/proptiming", name);
6019  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, (int) proptiming) );
6020 
6021  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/delayprop", name);
6022  SCIP_CALL( SCIPsetSetDefaultBoolParam(scip->set, paramname, delayprop) );
6023 
6024  return SCIP_OKAY;
6025 }
6026 
6027 /** sets relaxation enforcement method of the constraint handler
6028  *
6029  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6030  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6031  *
6032  * @pre This method can be called if SCIP is in one of the following stages:
6033  * - \ref SCIP_STAGE_INIT
6034  * - \ref SCIP_STAGE_PROBLEM
6035  */
6037  SCIP* scip, /**< SCIP data structure */
6038  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6039  SCIP_DECL_CONSENFORELAX ((*consenforelax)) /**< enforcement method for relaxation solution of constraint handler (might be NULL) */
6040  )
6041 {
6042  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrEnforelax", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6043 
6044  assert(conshdlr != NULL);
6045 
6046  SCIPconshdlrSetEnforelax(conshdlr, consenforelax);
6047 
6048  return SCIP_OKAY;
6049 }
6050 
6051 /** sets copy method of both the constraint handler and each associated constraint
6052  *
6053  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6054  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6055  *
6056  * @pre This method can be called if SCIP is in one of the following stages:
6057  * - \ref SCIP_STAGE_INIT
6058  * - \ref SCIP_STAGE_PROBLEM
6059  */
6061  SCIP* scip, /**< SCIP data structure */
6062  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6063  SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), /**< copy method of constraint handler or NULL if you don't want to copy your plugin into sub-SCIPs */
6064  SCIP_DECL_CONSCOPY ((*conscopy)) /**< constraint copying method */
6065  )
6066 {
6067  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6068 
6069  assert(conshdlr != NULL);
6070 
6071  SCIPconshdlrSetCopy(conshdlr, conshdlrcopy, conscopy);
6072 
6073  return SCIP_OKAY;
6074 }
6075 
6076 /** sets destructor method of constraint handler
6077  *
6078  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6079  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6080  *
6081  * @pre This method can be called if SCIP is in one of the following stages:
6082  * - \ref SCIP_STAGE_INIT
6083  * - \ref SCIP_STAGE_PROBLEM
6084  */
6086  SCIP* scip, /**< SCIP data structure */
6087  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6088  SCIP_DECL_CONSFREE ((*consfree)) /**< destructor of constraint handler */
6089  )
6090 {
6091  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6092 
6093  assert(conshdlr != NULL);
6094 
6095  SCIPconshdlrSetFree(conshdlr, consfree);
6096 
6097  return SCIP_OKAY;
6098 }
6099 
6100 /** sets initialization method of constraint handler
6101  *
6102  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6103  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6104  *
6105  * @pre This method can be called if SCIP is in one of the following stages:
6106  * - \ref SCIP_STAGE_INIT
6107  * - \ref SCIP_STAGE_PROBLEM
6108  */
6110  SCIP* scip, /**< SCIP data structure */
6111  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6112  SCIP_DECL_CONSINIT ((*consinit)) /**< initialize constraint handler */
6113  )
6114 {
6115  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6116 
6117  assert(conshdlr != NULL);
6118 
6119  SCIPconshdlrSetInit(conshdlr, consinit);
6120 
6121  return SCIP_OKAY;
6122 }
6123 
6124 /** sets deinitialization method of constraint handler
6125  *
6126  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6127  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6128  *
6129  * @pre This method can be called if SCIP is in one of the following stages:
6130  * - \ref SCIP_STAGE_INIT
6131  * - \ref SCIP_STAGE_PROBLEM
6132  */
6134  SCIP* scip, /**< SCIP data structure */
6135  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6136  SCIP_DECL_CONSEXIT ((*consexit)) /**< deinitialize constraint handler */
6137  )
6138 {
6139  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6140 
6141  assert(conshdlr != NULL);
6142 
6143  SCIPconshdlrSetExit(conshdlr, consexit);
6144 
6145  return SCIP_OKAY;
6146 }
6147 
6148 /** sets solving process initialization method of constraint handler
6149  *
6150  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6151  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6152  *
6153  * @pre This method can be called if SCIP is in one of the following stages:
6154  * - \ref SCIP_STAGE_INIT
6155  * - \ref SCIP_STAGE_PROBLEM
6156  */
6158  SCIP* scip, /**< SCIP data structure */
6159  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6160  SCIP_DECL_CONSINITSOL((*consinitsol)) /**< solving process initialization method of constraint handler */
6161  )
6162 {
6163  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6164 
6165  assert(conshdlr != NULL);
6166 
6167  SCIPconshdlrSetInitsol(conshdlr, consinitsol);
6168 
6169  return SCIP_OKAY;
6170 }
6171 
6172 /** sets solving process deinitialization method of constraint handler
6173  *
6174  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6175  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6176  *
6177  * @pre This method can be called if SCIP is in one of the following stages:
6178  * - \ref SCIP_STAGE_INIT
6179  * - \ref SCIP_STAGE_PROBLEM
6180  */
6182  SCIP* scip, /**< SCIP data structure */
6183  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6184  SCIP_DECL_CONSEXITSOL ((*consexitsol))/**< solving process deinitialization method of constraint handler */
6185  )
6186 {
6187  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6188 
6189  assert(conshdlr != NULL);
6190 
6191  SCIPconshdlrSetExitsol(conshdlr, consexitsol);
6192 
6193  return SCIP_OKAY;
6194 }
6195 
6196 /** sets preprocessing initialization method of constraint handler
6197  *
6198  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6199  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6200  *
6201  * @pre This method can be called if SCIP is in one of the following stages:
6202  * - \ref SCIP_STAGE_INIT
6203  * - \ref SCIP_STAGE_PROBLEM
6204  */
6206  SCIP* scip, /**< SCIP data structure */
6207  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6208  SCIP_DECL_CONSINITPRE((*consinitpre)) /**< preprocessing initialization method of constraint handler */
6209  )
6210 {
6211  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrInitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6212 
6213  assert(conshdlr != NULL);
6214 
6215  SCIPconshdlrSetInitpre(conshdlr, consinitpre);
6216 
6217  return SCIP_OKAY;
6218 }
6219 
6220 /** sets preprocessing deinitialization method of constraint handler
6221  *
6222  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6223  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6224  *
6225  * @pre This method can be called if SCIP is in one of the following stages:
6226  * - \ref SCIP_STAGE_INIT
6227  * - \ref SCIP_STAGE_PROBLEM
6228  */
6230  SCIP* scip, /**< SCIP data structure */
6231  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6232  SCIP_DECL_CONSEXITPRE((*consexitpre)) /**< preprocessing deinitialization method of constraint handler */
6233  )
6234 {
6235  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrExitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6236 
6237  assert(conshdlr != NULL);
6238 
6239  SCIPconshdlrSetExitpre(conshdlr, consexitpre);
6240 
6241  return SCIP_OKAY;
6242 }
6243 
6244 /** sets presolving method of constraint handler
6245  *
6246  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6247  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6248  *
6249  * @pre This method can be called if SCIP is in one of the following stages:
6250  * - \ref SCIP_STAGE_INIT
6251  * - \ref SCIP_STAGE_PROBLEM
6252  */
6254  SCIP* scip, /**< SCIP data structure */
6255  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6256  SCIP_DECL_CONSPRESOL ((*conspresol)), /**< presolving method of constraint handler */
6257  int maxprerounds, /**< maximal number of presolving rounds the constraint handler participates in (-1: no limit) */
6258  SCIP_PRESOLTIMING presoltiming /**< timing mask of the constraint handler's presolving method */
6259  )
6260 {
6261  const char* name;
6262  char paramname[SCIP_MAXSTRLEN];
6263 
6264  assert(scip != NULL);
6265  assert(conshdlr != NULL);
6266 
6267  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrPresol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6268 
6269  SCIP_CALL( SCIPconshdlrSetPresol(conshdlr, conspresol, maxprerounds, presoltiming) );
6270 
6271  name = SCIPconshdlrGetName(conshdlr);
6272 
6273  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/maxprerounds", name);
6274  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, maxprerounds) );
6275 
6276  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/presoltiming", name);
6277  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, (int) presoltiming) );
6278 
6279  return SCIP_OKAY;
6280 }
6281 
6282 /** sets method of constraint handler to free specific constraint data
6283  *
6284  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6285  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6286  *
6287  * @pre This method can be called if SCIP is in one of the following stages:
6288  * - \ref SCIP_STAGE_INIT
6289  * - \ref SCIP_STAGE_PROBLEM
6290  */
6292  SCIP* scip, /**< SCIP data structure */
6293  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6294  SCIP_DECL_CONSDELETE ((*consdelete)) /**< free specific constraint data */
6295  )
6296 {
6297  assert(scip != NULL);
6298  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrDelete", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6299 
6300  SCIPconshdlrSetDelete(conshdlr, consdelete);
6301 
6302  return SCIP_OKAY;
6303 }
6304 
6305 /** sets method of constraint handler to transform constraint data into data belonging to the transformed problem
6306  *
6307  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6308  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6309  *
6310  * @pre This method can be called if SCIP is in one of the following stages:
6311  * - \ref SCIP_STAGE_INIT
6312  * - \ref SCIP_STAGE_PROBLEM
6313  */
6315  SCIP* scip, /**< SCIP data structure */
6316  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6317  SCIP_DECL_CONSTRANS ((*constrans)) /**< transform constraint data into data belonging to the transformed problem */
6318  )
6319 {
6320  assert(scip != NULL);
6321  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrTrans", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6322 
6323  SCIPconshdlrSetTrans(conshdlr, constrans);
6324 
6325  return SCIP_OKAY;
6326 }
6327 
6328 /** sets method of constraint handler to initialize LP with relaxations of "initial" constraints
6329  *
6330  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6331  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6332  *
6333  * @pre This method can be called if SCIP is in one of the following stages:
6334  * - \ref SCIP_STAGE_INIT
6335  * - \ref SCIP_STAGE_PROBLEM
6336  */
6338  SCIP* scip, /**< SCIP data structure */
6339  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6340  SCIP_DECL_CONSINITLP ((*consinitlp)) /**< initialize LP with relaxations of "initial" constraints */
6341  )
6342 {
6343  assert(scip != NULL);
6344  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrInitlp", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6345 
6346  SCIPconshdlrSetInitlp(conshdlr, consinitlp);
6347 
6348  return SCIP_OKAY;
6349 }
6350 
6351 /** sets propagation conflict resolving method of constraint handler
6352  *
6353  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6354  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6355  *
6356  * @pre This method can be called if SCIP is in one of the following stages:
6357  * - \ref SCIP_STAGE_INIT
6358  * - \ref SCIP_STAGE_PROBLEM
6359  */
6361  SCIP* scip, /**< SCIP data structure */
6362  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6363  SCIP_DECL_CONSRESPROP ((*consresprop)) /**< propagation conflict resolving method */
6364  )
6365 {
6366  assert(scip != NULL);
6367  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrResprop", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6368 
6369  SCIPconshdlrSetResprop(conshdlr, consresprop);
6370 
6371  return SCIP_OKAY;
6372 }
6373 
6374 /** sets activation notification method of constraint handler
6375  *
6376  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6377  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6378  *
6379  * @pre This method can be called if SCIP is in one of the following stages:
6380  * - \ref SCIP_STAGE_INIT
6381  * - \ref SCIP_STAGE_PROBLEM
6382  */
6384  SCIP* scip, /**< SCIP data structure */
6385  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6386  SCIP_DECL_CONSACTIVE ((*consactive)) /**< activation notification method */
6387  )
6388 {
6389  assert(scip != NULL);
6390  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrActive", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6391 
6392  SCIPconshdlrSetActive(conshdlr, consactive);
6393 
6394  return SCIP_OKAY;
6395 }
6396 
6397 /** sets deactivation notification method of constraint handler
6398  *
6399  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6400  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6401  *
6402  * @pre This method can be called if SCIP is in one of the following stages:
6403  * - \ref SCIP_STAGE_INIT
6404  * - \ref SCIP_STAGE_PROBLEM
6405  */
6407  SCIP* scip, /**< SCIP data structure */
6408  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6409  SCIP_DECL_CONSDEACTIVE((*consdeactive)) /**< deactivation notification method */
6410  )
6411 {
6412  assert(scip != NULL);
6413  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrDeactive", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6414 
6415  SCIPconshdlrSetDeactive(conshdlr, consdeactive);
6416 
6417  return SCIP_OKAY;
6418 }
6419 
6420 /** sets enabling notification method of constraint handler
6421  *
6422  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6423  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6424  *
6425  * @pre This method can be called if SCIP is in one of the following stages:
6426  * - \ref SCIP_STAGE_INIT
6427  * - \ref SCIP_STAGE_PROBLEM
6428  */
6430  SCIP* scip, /**< SCIP data structure */
6431  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6432  SCIP_DECL_CONSENABLE ((*consenable)) /**< enabling notification method */
6433  )
6434 {
6435  assert(scip != NULL);
6436  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrEnable", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6437 
6438  SCIPconshdlrSetEnable(conshdlr, consenable);
6439 
6440  return SCIP_OKAY;
6441 }
6442 
6443 /** sets disabling notification method of constraint handler
6444  *
6445  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6446  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6447  *
6448  * @pre This method can be called if SCIP is in one of the following stages:
6449  * - \ref SCIP_STAGE_INIT
6450  * - \ref SCIP_STAGE_PROBLEM
6451  */
6453  SCIP* scip, /**< SCIP data structure */
6454  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6455  SCIP_DECL_CONSDISABLE ((*consdisable)) /**< disabling notification method */
6456  )
6457 {
6458  assert(scip != NULL);
6459  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrDisable", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6460 
6461  SCIPconshdlrSetDisable(conshdlr, consdisable);
6462 
6463  return SCIP_OKAY;
6464 }
6465 
6466 /** sets variable deletion method of constraint handler
6467  *
6468  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6469  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6470  *
6471  * @pre This method can be called if SCIP is in one of the following stages:
6472  * - \ref SCIP_STAGE_INIT
6473  * - \ref SCIP_STAGE_PROBLEM
6474  */
6476  SCIP* scip, /**< SCIP data structure */
6477  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6478  SCIP_DECL_CONSDELVARS ((*consdelvars)) /**< variable deletion method */
6479  )
6480 {
6481  assert(scip != NULL);
6482  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrDelvars", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6483 
6484  SCIPconshdlrSetDelvars(conshdlr, consdelvars);
6485 
6486  return SCIP_OKAY;
6487 }
6488 
6489 /** sets constraint display method of constraint handler
6490  *
6491  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6492  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6493  *
6494  * @pre This method can be called if SCIP is in one of the following stages:
6495  * - \ref SCIP_STAGE_INIT
6496  * - \ref SCIP_STAGE_PROBLEM
6497  */
6499  SCIP* scip, /**< SCIP data structure */
6500  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6501  SCIP_DECL_CONSPRINT ((*consprint)) /**< constraint display method */
6502  )
6503 {
6504  assert(scip != NULL);
6505  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrPrint", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6506 
6507  SCIPconshdlrSetPrint(conshdlr, consprint);
6508 
6509  return SCIP_OKAY;
6510 }
6511 
6512 /** sets constraint parsing method of constraint handler
6513  *
6514  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6515  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6516  *
6517  * @pre This method can be called if SCIP is in one of the following stages:
6518  * - \ref SCIP_STAGE_INIT
6519  * - \ref SCIP_STAGE_PROBLEM
6520  */
6522  SCIP* scip, /**< SCIP data structure */
6523  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6524  SCIP_DECL_CONSPARSE ((*consparse)) /**< constraint parsing method */
6525  )
6526 {
6527  assert(scip != NULL);
6528  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrParse", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6529 
6530  SCIPconshdlrSetParse(conshdlr, consparse);
6531 
6532  return SCIP_OKAY;
6533 }
6534 
6535 /** sets constraint variable getter method of constraint handler
6536  *
6537  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6538  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6539  *
6540  * @pre This method can be called if SCIP is in one of the following stages:
6541  * - \ref SCIP_STAGE_INIT
6542  * - \ref SCIP_STAGE_PROBLEM
6543  */
6545  SCIP* scip, /**< SCIP data structure */
6546  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6547  SCIP_DECL_CONSGETVARS ((*consgetvars)) /**< constraint variable getter method */
6548  )
6549 {
6550  assert(scip != NULL);
6551  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrGetVars", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6552 
6553  SCIPconshdlrSetGetVars(conshdlr, consgetvars);
6554 
6555  return SCIP_OKAY;
6556 }
6557 
6558 /** sets constraint variable number getter method of constraint handler
6559  *
6560  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6561  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6562  *
6563  * @pre This method can be called if SCIP is in one of the following stages:
6564  * - \ref SCIP_STAGE_INIT
6565  * - \ref SCIP_STAGE_PROBLEM
6566  */
6568  SCIP* scip, /**< SCIP data structure */
6569  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6570  SCIP_DECL_CONSGETNVARS((*consgetnvars)) /**< constraint variable number getter method */
6571  )
6572 {
6573  assert(scip != NULL);
6574  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrGetNVars", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6575 
6576  SCIPconshdlrSetGetNVars(conshdlr, consgetnvars);
6577 
6578  return SCIP_OKAY;
6579 }
6580 
6581 /** sets diving bound change method of constraint handler
6582  *
6583  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6584  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6585  *
6586  * @pre This method can be called if SCIP is in one of the following stages:
6587  * - \ref SCIP_STAGE_INIT
6588  * - \ref SCIP_STAGE_PROBLEM
6589  */
6591  SCIP* scip, /**< SCIP data structure */
6592  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6593  SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)) /**< constraint handler diving solution enforcement method */
6594  )
6595 {
6596  assert(scip != NULL);
6597  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrGetDiveBdChgs", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6598 
6599  SCIPconshdlrSetGetDiveBdChgs(conshdlr, consgetdivebdchgs);
6600 
6601  return SCIP_OKAY;
6602 }
6603 /** returns the constraint handler of the given name, or NULL if not existing */
6605  SCIP* scip, /**< SCIP data structure */
6606  const char* name /**< name of constraint handler */
6607  )
6608 {
6609  assert(scip != NULL);
6610  assert(scip->set != NULL);
6611  assert(name != NULL);
6612 
6613  return SCIPsetFindConshdlr(scip->set, name);
6614 }
6615 
6616 /** returns the array of currently available constraint handlers */
6618  SCIP* scip /**< SCIP data structure */
6619  )
6620 {
6621  assert(scip != NULL);
6622  assert(scip->set != NULL);
6623 
6624  return scip->set->conshdlrs;
6625 }
6626 
6627 /** returns the number of currently available constraint handlers */
6629  SCIP* scip /**< SCIP data structure */
6630  )
6631 {
6632  assert(scip != NULL);
6633  assert(scip->set != NULL);
6634 
6635  return scip->set->nconshdlrs;
6636 }
6637 
6638 /** creates a conflict handler and includes it in SCIP
6639  *
6640  * @note method has all conflict handler callbacks as arguments and is thus changed every time a new
6641  * callback is added
6642  * in future releases; consider using SCIPincludeConflicthdlrBasic() and setter functions
6643  * if you seek for a method which is less likely to change in future releases
6644  */
6646  SCIP* scip, /**< SCIP data structure */
6647  const char* name, /**< name of conflict handler */
6648  const char* desc, /**< description of conflict handler */
6649  int priority, /**< priority of the conflict handler */
6650  SCIP_DECL_CONFLICTCOPY((*conflictcopy)), /**< copy method of conflict handler or NULL if you don't want to copy your plugin into sub-SCIPs */
6651  SCIP_DECL_CONFLICTFREE((*conflictfree)), /**< destructor of conflict handler */
6652  SCIP_DECL_CONFLICTINIT((*conflictinit)), /**< initialize conflict handler */
6653  SCIP_DECL_CONFLICTEXIT((*conflictexit)), /**< deinitialize conflict handler */
6654  SCIP_DECL_CONFLICTINITSOL((*conflictinitsol)),/**< solving process initialization method of conflict handler */
6655  SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol)),/**< solving process deinitialization method of conflict handler */
6656  SCIP_DECL_CONFLICTEXEC((*conflictexec)), /**< conflict processing method of conflict handler */
6657  SCIP_CONFLICTHDLRDATA* conflicthdlrdata /**< conflict handler data */
6658  )
6659 {
6660  SCIP_CONFLICTHDLR* conflicthdlr;
6661 
6662  SCIP_CALL( checkStage(scip, "SCIPincludeConflicthdlr", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6663 
6664  /* check whether conflict handler is already present */
6665  if( SCIPfindConflicthdlr(scip, name) != NULL )
6666  {
6667  SCIPerrorMessage("conflict handler <%s> already included.\n", name);
6668  return SCIP_INVALIDDATA;
6669  }
6670 
6671  SCIP_CALL( SCIPconflicthdlrCreate(&conflicthdlr, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority,
6672  conflictcopy,
6673  conflictfree, conflictinit, conflictexit, conflictinitsol, conflictexitsol, conflictexec,
6674  conflicthdlrdata) );
6675  SCIP_CALL( SCIPsetIncludeConflicthdlr(scip->set, conflicthdlr) );
6676 
6677  return SCIP_OKAY;
6678 }
6679 
6680 /** creates a conflict handler and includes it in SCIP with its most fundamental callbacks. All non-fundamental
6681  * (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL.
6682  * Optional callbacks can be set via specific setter functions SCIPsetConflicthdlrCopy(), SCIPsetConflicthdlrFree(),
6683  * SCIPsetConflicthdlrInit(), SCIPsetConflicthdlrExit(), SCIPsetConflicthdlrInitsol(),
6684  * and SCIPsetConflicthdlrExitsol()
6685  *
6686  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeConflicthdlr() instead
6687  */
6689  SCIP* scip, /**< SCIP data structure */
6690  SCIP_CONFLICTHDLR** conflicthdlrptr, /**< reference to a conflict handler pointer, or NULL */
6691  const char* name, /**< name of conflict handler */
6692  const char* desc, /**< description of conflict handler */
6693  int priority, /**< priority of the conflict handler */
6694  SCIP_DECL_CONFLICTEXEC((*conflictexec)), /**< conflict processing method of conflict handler */
6695  SCIP_CONFLICTHDLRDATA* conflicthdlrdata /**< conflict handler data */
6696  )
6697 {
6698  SCIP_CONFLICTHDLR* conflicthdlr;
6699 
6700  SCIP_CALL( checkStage(scip, "SCIPincludeConflicthdlrBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6701 
6702  /* check whether conflict handler is already present */
6703  if( SCIPfindConflicthdlr(scip, name) != NULL )
6704  {
6705  SCIPerrorMessage("conflict handler <%s> already included.\n", name);
6706  return SCIP_INVALIDDATA;
6707  }
6708 
6709  SCIP_CALL( SCIPconflicthdlrCreate(&conflicthdlr, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority,
6710  NULL, NULL, NULL, NULL, NULL, NULL, conflictexec, conflicthdlrdata) );
6711  SCIP_CALL( SCIPsetIncludeConflicthdlr(scip->set, conflicthdlr) );
6712 
6713  if( conflicthdlrptr != NULL )
6714  *conflicthdlrptr = conflicthdlr;
6715 
6716  return SCIP_OKAY;
6717 }
6718 
6719 /** set copy method of conflict handler */
6721  SCIP* scip, /**< SCIP data structure */
6722  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6723  SCIP_DECL_CONFLICTCOPY((*conflictcopy)) /**< copy method of conflict handler */
6724  )
6725 {
6726  assert(scip != NULL);
6727 
6728  SCIP_CALL( checkStage(scip, "SCIPsetConflicthdlrCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6729 
6730  SCIPconflicthdlrSetCopy(conflicthdlr, conflictcopy);
6731 
6732  return SCIP_OKAY;
6733 }
6734 
6735 /** set destructor of conflict handler */
6737  SCIP* scip, /**< SCIP data structure */
6738  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6739  SCIP_DECL_CONFLICTFREE((*conflictfree)) /**< destructor of conflict handler */
6740  )
6741 {
6742  assert(scip != NULL);
6743 
6744  SCIP_CALL( checkStage(scip, "SCIPsetConflicthdlrFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6745 
6746  SCIPconflicthdlrSetFree(conflicthdlr, conflictfree);
6747 
6748  return SCIP_OKAY;
6749 }
6750 
6751 /** set initialization method of conflict handler */
6753  SCIP* scip, /**< SCIP data structure */
6754  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6755  SCIP_DECL_CONFLICTINIT((*conflictinit)) /**< initialize conflict handler */
6756  )
6757 {
6758  assert(scip != NULL);
6759 
6760  SCIP_CALL( checkStage(scip, "SCIPsetConflicthdlrInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6761 
6762  SCIPconflicthdlrSetInit(conflicthdlr, conflictinit);
6763 
6764  return SCIP_OKAY;
6765 }
6766 
6767 /** set deinitialization method of conflict handler */
6769  SCIP* scip, /**< SCIP data structure */
6770  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6771  SCIP_DECL_CONFLICTEXIT((*conflictexit)) /**< deinitialize conflict handler */
6772  )
6773 {
6774  assert(scip != NULL);
6775 
6776  SCIP_CALL( checkStage(scip, "SCIPsetConflicthdlrExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6777 
6778  SCIPconflicthdlrSetExit(conflicthdlr, conflictexit);
6779 
6780  return SCIP_OKAY;
6781 }
6782 
6783 /** set solving process initialization method of conflict handler */
6785  SCIP* scip, /**< SCIP data structure */
6786  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6787  SCIP_DECL_CONFLICTINITSOL((*conflictinitsol))/**< solving process initialization method of conflict handler */
6788  )
6789 {
6790  assert(scip != NULL);
6791 
6792  SCIP_CALL( checkStage(scip, "SCIPsetConflicthdlrInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6793 
6794  SCIPconflicthdlrSetInitsol(conflicthdlr, conflictinitsol);
6795 
6796  return SCIP_OKAY;
6797 }
6798 
6799 /** set solving process deinitialization method of conflict handler */
6801  SCIP* scip, /**< SCIP data structure */
6802  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6803  SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol))/**< solving process deinitialization method of conflict handler */
6804  )
6805 {
6806  assert(scip != NULL);
6807 
6808  SCIP_CALL( checkStage(scip, "SCIPsetConflicthdlrExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6809 
6810  SCIPconflicthdlrSetExitsol(conflicthdlr, conflictexitsol);
6811 
6812  return SCIP_OKAY;
6813 }
6814 
6815 /** returns the conflict handler of the given name, or NULL if not existing */
6817  SCIP* scip, /**< SCIP data structure */
6818  const char* name /**< name of conflict handler */
6819  )
6820 {
6821  assert(scip != NULL);
6822  assert(scip->set != NULL);
6823  assert(name != NULL);
6824 
6825  return SCIPsetFindConflicthdlr(scip->set, name);
6826 }
6827 
6828 /** returns the array of currently available conflict handlers */
6830  SCIP* scip /**< SCIP data structure */
6831  )
6832 {
6833  assert(scip != NULL);
6834  assert(scip->set != NULL);
6835 
6837 
6838  return scip->set->conflicthdlrs;
6839 }
6840 
6841 /** returns the number of currently available conflict handlers */
6843  SCIP* scip /**< SCIP data structure */
6844  )
6845 {
6846  assert(scip != NULL);
6847  assert(scip->set != NULL);
6848 
6849  return scip->set->nconflicthdlrs;
6850 }
6851 
6852 /** sets the priority of a conflict handler */
6854  SCIP* scip, /**< SCIP data structure */
6855  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6856  int priority /**< new priority of the conflict handler */
6857  )
6858 {
6859  assert(scip != NULL);
6860  assert(scip->set != NULL);
6861 
6862  SCIPconflicthdlrSetPriority(conflicthdlr, scip->set, priority);
6863 
6864  return SCIP_OKAY;
6865 }
6866 
6867 /** creates a presolver and includes it in SCIP.
6868  *
6869  * @note method has all presolver callbacks as arguments and is thus changed every time a new
6870  * callback is added
6871  * in future releases; consider using SCIPincludePresolBasic() and setter functions
6872  * if you seek for a method which is less likely to change in future releases
6873  */
6875  SCIP* scip, /**< SCIP data structure */
6876  const char* name, /**< name of presolver */
6877  const char* desc, /**< description of presolver */
6878  int priority, /**< priority of the presolver (>= 0: before, < 0: after constraint handlers) */
6879  int maxrounds, /**< maximal number of presolving rounds the presolver participates in (-1: no limit) */
6880  SCIP_PRESOLTIMING timing, /**< timing mask of the presolver */
6881  SCIP_DECL_PRESOLCOPY ((*presolcopy)), /**< copy method of presolver or NULL if you don't want to copy your plugin into sub-SCIPs */
6882  SCIP_DECL_PRESOLFREE ((*presolfree)), /**< destructor of presolver to free user data (called when SCIP is exiting) */
6883  SCIP_DECL_PRESOLINIT ((*presolinit)), /**< initialization method of presolver (called after problem was transformed) */
6884  SCIP_DECL_PRESOLEXIT ((*presolexit)), /**< deinitialization method of presolver (called before transformed problem is freed) */
6885  SCIP_DECL_PRESOLINITPRE((*presolinitpre)),/**< presolving initialization method of presolver (called when presolving is about to begin) */
6886  SCIP_DECL_PRESOLEXITPRE((*presolexitpre)),/**< presolving deinitialization method of presolver (called after presolving has been finished) */
6887  SCIP_DECL_PRESOLEXEC ((*presolexec)), /**< execution method of presolver */
6888  SCIP_PRESOLDATA* presoldata /**< presolver data */
6889  )
6890 {
6891  SCIP_PRESOL* presol;
6892 
6893  SCIP_CALL( checkStage(scip, "SCIPincludePresol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6894 
6895  /* check whether presolver is already present */
6896  if( SCIPfindPresol(scip, name) != NULL )
6897  {
6898  SCIPerrorMessage("presolver <%s> already included.\n", name);
6899  return SCIP_INVALIDDATA;
6900  }
6901 
6902  SCIP_CALL( SCIPpresolCreate(&presol, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority,
6903  maxrounds, timing, presolcopy,
6904  presolfree, presolinit, presolexit, presolinitpre, presolexitpre, presolexec, presoldata) );
6905  SCIP_CALL( SCIPsetIncludePresol(scip->set, presol) );
6906 
6907  return SCIP_OKAY;
6908 }
6909 
6910 /** creates a presolver and includes it in SCIP with its fundamental callback. All non-fundamental (or optional)
6911  * callbacks as, e.g., init and exit callbacks, will be set to NULL. Optional callbacks can be set via specific setter
6912  * functions. These are SCIPsetPresolCopy(), SCIPsetPresolFree(), SCIPsetPresolInit(), SCIPsetPresolExit(),
6913  * SCIPsetPresolInitpre(), and SCIPsetPresolExitPre().
6914  *
6915  * @note if you want to set all callbacks with a single method call, consider using SCIPincludePresol() instead
6916  */
6918  SCIP* scip, /**< SCIP data structure */
6919  SCIP_PRESOL** presolptr, /**< reference to presolver, or NULL */
6920  const char* name, /**< name of presolver */
6921  const char* desc, /**< description of presolver */
6922  int priority, /**< priority of the presolver (>= 0: before, < 0: after constraint handlers) */
6923  int maxrounds, /**< maximal number of presolving rounds the presolver participates in (-1: no limit) */
6924  SCIP_PRESOLTIMING timing, /**< timing mask of the presolver */
6925  SCIP_DECL_PRESOLEXEC ((*presolexec)), /**< execution method of presolver */
6926  SCIP_PRESOLDATA* presoldata /**< presolver data */
6927  )
6928 {
6929  SCIP_PRESOL* presol;
6930 
6931  SCIP_CALL( checkStage(scip, "SCIPincludePresolBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6932 
6933  /* check whether presolver is already present */
6934  if( SCIPfindPresol(scip, name) != NULL )
6935  {
6936  SCIPerrorMessage("presolver <%s> already included.\n", name);
6937  return SCIP_INVALIDDATA;
6938  }
6939 
6940  SCIP_CALL( SCIPpresolCreate(&presol, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority, maxrounds, timing,
6941  NULL,
6942  NULL, NULL, NULL, NULL, NULL, presolexec, presoldata) );
6943  SCIP_CALL( SCIPsetIncludePresol(scip->set, presol) );
6944 
6945  if( presolptr != NULL )
6946  *presolptr = presol;
6947 
6948  return SCIP_OKAY;
6949 }
6950 
6951 /** sets copy method of presolver */
6953  SCIP* scip, /**< SCIP data structure */
6954  SCIP_PRESOL* presol, /**< presolver */
6955  SCIP_DECL_PRESOLCOPY ((*presolcopy)) /**< copy method of presolver or NULL if you don't want to copy your plugin into sub-SCIPs */
6956  )
6957 {
6958  SCIP_CALL( checkStage(scip, "SCIPsetPresolCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6959 
6960  assert(presol != NULL);
6961 
6962  SCIPpresolSetCopy(presol, presolcopy);
6963 
6964  return SCIP_OKAY;
6965 }
6966 
6967 /** sets destructor method of presolver */
6969  SCIP* scip, /**< SCIP data structure */
6970  SCIP_PRESOL* presol, /**< presolver */
6971  SCIP_DECL_PRESOLFREE ((*presolfree)) /**< destructor of presolver */
6972  )
6973 {
6974  SCIP_CALL( checkStage(scip, "SCIPsetPresolFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6975 
6976  assert(presol != NULL);
6977 
6978  SCIPpresolSetFree(presol, presolfree);
6979 
6980  return SCIP_OKAY;
6981 }
6982 
6983 /** sets initialization method of presolver */
6985  SCIP* scip, /**< SCIP data structure */
6986  SCIP_PRESOL* presol, /**< presolver */
6987  SCIP_DECL_PRESOLINIT ((*presolinit)) /**< initialize presolver */
6988  )
6989 {
6990  SCIP_CALL( checkStage(scip, "SCIPsetPresolInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6991 
6992  assert(presol != NULL);
6993 
6994  SCIPpresolSetInit(presol, presolinit);
6995 
6996  return SCIP_OKAY;
6997 }
6998 
6999 /** sets deinitialization method of presolver */
7001  SCIP* scip, /**< SCIP data structure */
7002  SCIP_PRESOL* presol, /**< presolver */
7003  SCIP_DECL_PRESOLEXIT ((*presolexit)) /**< deinitialize presolver */
7004  )
7005 {
7006  SCIP_CALL( checkStage(scip, "SCIPsetPresolExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7007 
7008  assert(presol != NULL);
7009 
7010  SCIPpresolSetExit(presol, presolexit);
7011 
7012  return SCIP_OKAY;
7013 }
7014 
7015 /** sets solving process initialization method of presolver */
7017  SCIP* scip, /**< SCIP data structure */
7018  SCIP_PRESOL* presol, /**< presolver */
7019  SCIP_DECL_PRESOLINITPRE ((*presolinitpre))/**< solving process initialization method of presolver */
7020  )
7021 {
7022  SCIP_CALL( checkStage(scip, "SCIPsetPresolInitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7023 
7024  assert(presol != NULL);
7025 
7026  SCIPpresolSetInitpre(presol, presolinitpre);
7027 
7028  return SCIP_OKAY;
7029 }
7030 
7031 /** sets solving process deinitialization method of presolver */
7033  SCIP* scip, /**< SCIP data structure */
7034  SCIP_PRESOL* presol, /**< presolver */
7035  SCIP_DECL_PRESOLEXITPRE ((*presolexitpre))/**< solving process deinitialization method of presolver */
7036  )
7037 {
7038  SCIP_CALL( checkStage(scip, "SCIPsetPresolExitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7039 
7040  assert(presol != NULL);
7041 
7042  SCIPpresolSetExitpre(presol, presolexitpre);
7043 
7044  return SCIP_OKAY;
7045 }
7046 
7047 /** returns the presolver of the given name, or NULL if not existing */
7049  SCIP* scip, /**< SCIP data structure */
7050  const char* name /**< name of presolver */
7051  )
7052 {
7053  assert(scip != NULL);
7054  assert(scip->set != NULL);
7055  assert(name != NULL);
7056 
7057  return SCIPsetFindPresol(scip->set, name);
7058 }
7059 
7060 /** returns the array of currently available presolvers */
7062  SCIP* scip /**< SCIP data structure */
7063  )
7064 {
7065  assert(scip != NULL);
7066  assert(scip->set != NULL);
7067 
7068  SCIPsetSortPresols(scip->set);
7069 
7070  return scip->set->presols;
7071 }
7072 
7073 /** returns the number of currently available presolvers */
7075  SCIP* scip /**< SCIP data structure */
7076  )
7077 {
7078  assert(scip != NULL);
7079  assert(scip->set != NULL);
7080 
7081  return scip->set->npresols;
7082 }
7083 
7084 /** sets the priority of a presolver */
7086  SCIP* scip, /**< SCIP data structure */
7087  SCIP_PRESOL* presol, /**< presolver */
7088  int priority /**< new priority of the presolver */
7089  )
7090 {
7091  assert(scip != NULL);
7092  assert(scip->set != NULL);
7093 
7094  SCIPpresolSetPriority(presol, scip->set, priority);
7095 
7096  return SCIP_OKAY;
7097 }
7098 
7099 /** creates a relaxation handler and includes it in SCIP
7100  *
7101  * @note method has all relaxation handler callbacks as arguments and is thus changed every time a new
7102  * callback is added
7103  * in future releases; consider using SCIPincludeRelaxBasic() and setter functions
7104  * if you seek for a method which is less likely to change in future releases
7105  */
7107  SCIP* scip, /**< SCIP data structure */
7108  const char* name, /**< name of relaxation handler */
7109  const char* desc, /**< description of relaxation handler */
7110  int priority, /**< priority of the relaxation handler (negative: after LP, non-negative: before LP) */
7111  int freq, /**< frequency for calling relaxation handler */
7112  SCIP_DECL_RELAXCOPY ((*relaxcopy)), /**< copy method of relaxation handler or NULL if you don't want to copy your plugin into sub-SCIPs */
7113  SCIP_DECL_RELAXFREE ((*relaxfree)), /**< destructor of relaxation handler */
7114  SCIP_DECL_RELAXINIT ((*relaxinit)), /**< initialize relaxation handler */
7115  SCIP_DECL_RELAXEXIT ((*relaxexit)), /**< deinitialize relaxation handler */
7116  SCIP_DECL_RELAXINITSOL((*relaxinitsol)), /**< solving process initialization method of relaxation handler */
7117  SCIP_DECL_RELAXEXITSOL((*relaxexitsol)), /**< solving process deinitialization method of relaxation handler */
7118  SCIP_DECL_RELAXEXEC ((*relaxexec)), /**< execution method of relaxation handler */
7119  SCIP_RELAXDATA* relaxdata /**< relaxation handler data */
7120  )
7121 {
7122  SCIP_RELAX* relax;
7123 
7124  SCIP_CALL( checkStage(scip, "SCIPincludeRelax", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7125 
7126  /* check whether relaxation handler is already present */
7127  if( SCIPfindRelax(scip, name) != NULL )
7128  {
7129  SCIPerrorMessage("relaxation handler <%s> already included.\n", name);
7130  return SCIP_INVALIDDATA;
7131  }
7132 
7133  SCIP_CALL( SCIPrelaxCreate(&relax, scip->set, scip->messagehdlr, scip->mem->setmem,
7134  name, desc, priority, freq, relaxcopy,
7135  relaxfree, relaxinit, relaxexit, relaxinitsol, relaxexitsol, relaxexec, relaxdata) );
7136  SCIP_CALL( SCIPsetIncludeRelax(scip->set, relax) );
7137 
7138  return SCIP_OKAY;
7139 }
7140 
7141 /** creates a relaxation handler and includes it in SCIP. All non fundamental
7142  * (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL.
7143  * Optional callbacks can be set via specific setter functions, see SCIPsetRelaxInit(), SCIPsetRelaxExit(),
7144  * SCIPsetRelaxCopy(), SCIPsetRelaxFree(), SCIPsetRelaxInitsol(), and SCIPsetRelaxExitsol()
7145  *
7146  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeRelax() instead
7147  */
7149  SCIP* scip, /**< SCIP data structure */
7150  SCIP_RELAX** relaxptr, /**< reference to relaxation pointer, or NULL */
7151  const char* name, /**< name of relaxation handler */
7152  const char* desc, /**< description of relaxation handler */
7153  int priority, /**< priority of the relaxation handler (negative: after LP, non-negative: before LP) */
7154  int freq, /**< frequency for calling relaxation handler */
7155  SCIP_DECL_RELAXEXEC ((*relaxexec)), /**< execution method of relaxation handler */
7156  SCIP_RELAXDATA* relaxdata /**< relaxation handler data */
7157  )
7158 {
7159  SCIP_RELAX* relax;
7160 
7161  SCIP_CALL( checkStage(scip, "SCIPincludeRelaxBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7162 
7163  /* check whether relaxation handler is already present */
7164  if( SCIPfindRelax(scip, name) != NULL )
7165  {
7166  SCIPerrorMessage("relaxation handler <%s> already included.\n", name);
7167  return SCIP_INVALIDDATA;
7168  }
7169 
7170  SCIP_CALL( SCIPrelaxCreate(&relax, scip->set, scip->messagehdlr, scip->mem->setmem,
7171  name, desc, priority, freq,
7172  NULL, NULL, NULL, NULL, NULL, NULL, relaxexec, relaxdata) );
7173  SCIP_CALL( SCIPsetIncludeRelax(scip->set, relax) );
7174 
7175  if( relaxptr != NULL )
7176  *relaxptr = relax;
7177 
7178  return SCIP_OKAY;
7179 }
7180 
7181 /** sets copy method of relaxation handler */
7183  SCIP* scip, /**< SCIP data structure */
7184  SCIP_RELAX* relax, /**< relaxation handler */
7185  SCIP_DECL_RELAXCOPY ((*relaxcopy)) /**< copy method of relaxation handler or NULL if you don't want to copy your plugin into sub-SCIPs */
7186  )
7187 {
7188  SCIP_CALL( checkStage(scip, "SCIPsetRelaxCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7189 
7190  assert(relax != NULL);
7191 
7192  SCIPrelaxSetCopy(relax, relaxcopy);
7193 
7194  return SCIP_OKAY;
7195 }
7196 
7197 /** sets destructor method of relaxation handler */
7199  SCIP* scip, /**< SCIP data structure */
7200  SCIP_RELAX* relax, /**< relaxation handler */
7201  SCIP_DECL_RELAXFREE ((*relaxfree)) /**< destructor of relaxation handler */
7202  )
7203 {
7204  SCIP_CALL( checkStage(scip, "SCIPsetRelaxFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7205 
7206  assert(relax != NULL);
7207 
7208  SCIPrelaxSetFree(relax, relaxfree);
7209 
7210  return SCIP_OKAY;
7211 }
7212 
7213 /** sets initialization method of relaxation handler */
7215  SCIP* scip, /**< SCIP data structure */
7216  SCIP_RELAX* relax, /**< relaxation handler */
7217  SCIP_DECL_RELAXINIT ((*relaxinit)) /**< initialize relaxation handler */
7218  )
7219 {
7220  SCIP_CALL( checkStage(scip, "SCIPsetRelaxInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7221 
7222  assert(relax != NULL);
7223 
7224  SCIPrelaxSetInit(relax, relaxinit);
7225 
7226  return SCIP_OKAY;
7227 }
7228 
7229 /** sets deinitialization method of relaxation handler */
7231  SCIP* scip, /**< SCIP data structure */
7232  SCIP_RELAX* relax, /**< relaxation handler */
7233  SCIP_DECL_RELAXEXIT ((*relaxexit)) /**< deinitialize relaxation handler */
7234  )
7235 {
7236  SCIP_CALL( checkStage(scip, "SCIPsetRelaxExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7237 
7238  assert(relax != NULL);
7239 
7240  SCIPrelaxSetExit(relax, relaxexit);
7241 
7242  return SCIP_OKAY;
7243 }
7244 
7245 /** sets solving process initialization method of relaxation handler */
7247  SCIP* scip, /**< SCIP data structure */
7248  SCIP_RELAX* relax, /**< relaxation handler */
7249  SCIP_DECL_RELAXINITSOL((*relaxinitsol)) /**< solving process initialization method of relaxation handler */
7250  )
7251 {
7252  SCIP_CALL( checkStage(scip, "SCIPsetRelaxInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7253 
7254  assert(relax != NULL);
7255 
7256  SCIPrelaxSetInitsol(relax, relaxinitsol);
7257 
7258  return SCIP_OKAY;
7259 }
7260 
7261 /** sets solving process deinitialization method of relaxation handler */
7263  SCIP* scip, /**< SCIP data structure */
7264  SCIP_RELAX* relax, /**< relaxation handler */
7265  SCIP_DECL_RELAXEXITSOL((*relaxexitsol)) /**< solving process deinitialization method of relaxation handler */
7266  )
7267 {
7268  SCIP_CALL( checkStage(scip, "SCIPsetRelaxExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7269 
7270  assert(relax != NULL);
7271 
7272  SCIPrelaxSetExitsol(relax, relaxexitsol);
7273 
7274  return SCIP_OKAY;
7275 }
7276 
7277 
7278 /** returns the relaxation handler of the given name, or NULL if not existing */
7280  SCIP* scip, /**< SCIP data structure */
7281  const char* name /**< name of relaxation handler */
7282  )
7283 {
7284  assert(scip != NULL);
7285  assert(scip->set != NULL);
7286  assert(name != NULL);
7287 
7288  return SCIPsetFindRelax(scip->set, name);
7289 }
7290 
7291 /** returns the array of currently available relaxation handlers */
7293  SCIP* scip /**< SCIP data structure */
7294  )
7295 {
7296  assert(scip != NULL);
7297  assert(scip->set != NULL);
7298 
7299  SCIPsetSortRelaxs(scip->set);
7300 
7301  return scip->set->relaxs;
7302 }
7303 
7304 /** returns the number of currently available relaxation handlers */
7306  SCIP* scip /**< SCIP data structure */
7307  )
7308 {
7309  assert(scip != NULL);
7310  assert(scip->set != NULL);
7311 
7312  return scip->set->nrelaxs;
7313 }
7314 
7315 /** sets the priority of a relaxation handler */
7317  SCIP* scip, /**< SCIP data structure */
7318  SCIP_RELAX* relax, /**< relaxation handler */
7319  int priority /**< new priority of the relaxation handler */
7320  )
7321 {
7322  assert(scip != NULL);
7323  assert(scip->set != NULL);
7324 
7325  SCIPrelaxSetPriority(relax, scip->set, priority);
7326 
7327  return SCIP_OKAY;
7328 }
7329 
7330 /** creates a separator and includes it in SCIP.
7331  *
7332  * @note method has all separator callbacks as arguments and is thus changed every time a new
7333  * callback is added
7334  * in future releases; consider using SCIPincludeSepaBasic() and setter functions
7335  * if you seek for a method which is less likely to change in future releases
7336  */
7338  SCIP* scip, /**< SCIP data structure */
7339  const char* name, /**< name of separator */
7340  const char* desc, /**< description of separator */
7341  int priority, /**< priority of separator (>= 0: before, < 0: after constraint handlers) */
7342  int freq, /**< frequency for calling separator */
7343  SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound compared
7344  * to best node's dual bound for applying separation */
7345  SCIP_Bool usessubscip, /**< does the separator use a secondary SCIP instance? */
7346  SCIP_Bool delay, /**< should separator be delayed, if other separators found cuts? */
7347  SCIP_DECL_SEPACOPY ((*sepacopy)), /**< copy method of separator or NULL if you don't want to copy your plugin into sub-SCIPs */
7348  SCIP_DECL_SEPAFREE ((*sepafree)), /**< destructor of separator */
7349  SCIP_DECL_SEPAINIT ((*sepainit)), /**< initialize separator */
7350  SCIP_DECL_SEPAEXIT ((*sepaexit)), /**< deinitialize separator */
7351  SCIP_DECL_SEPAINITSOL ((*sepainitsol)), /**< solving process initialization method of separator */
7352  SCIP_DECL_SEPAEXITSOL ((*sepaexitsol)), /**< solving process deinitialization method of separator */
7353  SCIP_DECL_SEPAEXECLP ((*sepaexeclp)), /**< LP solution separation method of separator */
7354  SCIP_DECL_SEPAEXECSOL ((*sepaexecsol)), /**< arbitrary primal solution separation method of separator */
7355  SCIP_SEPADATA* sepadata /**< separator data */
7356  )
7357 {
7358  SCIP_SEPA* sepa;
7359 
7360  SCIP_CALL( checkStage(scip, "SCIPincludeSepa", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7361 
7362  /* check whether separator is already present */
7363  if( SCIPfindSepa(scip, name) != NULL )
7364  {
7365  SCIPerrorMessage("separator <%s> already included.\n", name);
7366  return SCIP_INVALIDDATA;
7367  }
7368 
7369  SCIP_CALL( SCIPsepaCreate(&sepa, scip->set, scip->messagehdlr, scip->mem->setmem,
7370  name, desc, priority, freq, maxbounddist, usessubscip, delay,
7371  sepacopy,
7372  sepafree, sepainit, sepaexit, sepainitsol, sepaexitsol, sepaexeclp, sepaexecsol, sepadata) );
7373  SCIP_CALL( SCIPsetIncludeSepa(scip->set, sepa) );
7374 
7375  return SCIP_OKAY;
7376 }
7377 
7378 /** creates a separator and includes it in SCIP with its most fundamental callbacks. All non-fundamental
7379  * (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL.
7380  * Optional callbacks can be set via specific setter functions, see SCIPsetSepaInit(), SCIPsetSepaFree(),
7381  * SCIPsetSepaInitsol(), SCIPsetSepaExitsol(), SCIPsetSepaCopy(), SCIPsetExit().
7382  *
7383  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeSepa() instead
7384  */
7386  SCIP* scip, /**< SCIP data structure */
7387  SCIP_SEPA** sepa, /**< reference to a separator, or NULL */
7388  const char* name, /**< name of separator */
7389  const char* desc, /**< description of separator */
7390  int priority, /**< priority of separator (>= 0: before, < 0: after constraint handlers) */
7391  int freq, /**< frequency for calling separator */
7392  SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound compared
7393  * to best node's dual bound for applying separation */
7394  SCIP_Bool usessubscip, /**< does the separator use a secondary SCIP instance? */
7395  SCIP_Bool delay, /**< should separator be delayed, if other separators found cuts? */
7396  SCIP_DECL_SEPAEXECLP ((*sepaexeclp)), /**< LP solution separation method of separator */
7397  SCIP_DECL_SEPAEXECSOL ((*sepaexecsol)), /**< arbitrary primal solution separation method of separator */
7398  SCIP_SEPADATA* sepadata /**< separator data */
7399  )
7400 {
7401  SCIP_SEPA* sepaptr;
7402 
7403  SCIP_CALL( checkStage(scip, "SCIPincludeSepaBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7404 
7405  /* check whether separator is already present */
7406  if( SCIPfindSepa(scip, name) != NULL )
7407  {
7408  SCIPerrorMessage("separator <%s> already included.\n", name);
7409  return SCIP_INVALIDDATA;
7410  }
7411 
7412  SCIP_CALL( SCIPsepaCreate(&sepaptr, scip->set, scip->messagehdlr, scip->mem->setmem,
7413  name, desc, priority, freq, maxbounddist, usessubscip, delay,
7414  NULL, NULL, NULL, NULL, NULL, NULL, sepaexeclp, sepaexecsol, sepadata) );
7415 
7416  assert(sepaptr != NULL);
7417 
7418  SCIP_CALL( SCIPsetIncludeSepa(scip->set, sepaptr) );
7419 
7420  if( sepa != NULL)
7421  *sepa = sepaptr;
7422 
7423  return SCIP_OKAY;
7424 }
7425 
7426 /** sets copy method of separator */
7428  SCIP* scip, /**< SCIP data structure */
7429  SCIP_SEPA* sepa, /**< separator */
7430  SCIP_DECL_SEPACOPY ((*sepacopy)) /**< copy method of separator or NULL if you don't want to copy your plugin into sub-SCIPs */
7431  )
7432 {
7433  SCIP_CALL( checkStage(scip, "SCIPsetSepaCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7434 
7435  assert(sepa != NULL);
7436 
7437  SCIPsepaSetCopy(sepa, sepacopy);
7438 
7439  return SCIP_OKAY;
7440 }
7441 
7442 /** sets destructor method of separator */
7444  SCIP* scip, /**< SCIP data structure */
7445  SCIP_SEPA* sepa, /**< separator */
7446  SCIP_DECL_SEPAFREE ((*sepafree)) /**< destructor of separator */
7447  )
7448 {
7449  SCIP_CALL( checkStage(scip, "SCIPsetSepaFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7450 
7451  assert(sepa != NULL);
7452 
7453  SCIPsepaSetFree(sepa, sepafree);
7454 
7455  return SCIP_OKAY;
7456 }
7457 
7458 /** sets initialization method of separator */
7460  SCIP* scip, /**< SCIP data structure */
7461  SCIP_SEPA* sepa, /**< separator */
7462  SCIP_DECL_SEPAINIT ((*sepainit)) /**< initialize separator */
7463  )
7464 {
7465  SCIP_CALL( checkStage(scip, "SCIPsetSepaInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7466 
7467  assert(sepa != NULL);
7468 
7469  SCIPsepaSetInit(sepa, sepainit);
7470 
7471  return SCIP_OKAY;
7472 }
7473 
7474 /** sets deinitialization method of separator */
7476  SCIP* scip, /**< SCIP data structure */
7477  SCIP_SEPA* sepa, /**< separator */
7478  SCIP_DECL_SEPAEXIT ((*sepaexit)) /**< deinitialize separator */
7479  )
7480 {
7481  SCIP_CALL( checkStage(scip, "SCIPsetSepaExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7482 
7483  assert(sepa != NULL);
7484 
7485  SCIPsepaSetExit(sepa, sepaexit);
7486 
7487  return SCIP_OKAY;
7488 }
7489 
7490 /** sets solving process initialization method of separator */
7492  SCIP* scip, /**< SCIP data structure */
7493  SCIP_SEPA* sepa, /**< separator */
7494  SCIP_DECL_SEPAINITSOL ((*sepainitsol)) /**< solving process initialization method of separator */
7495  )
7496 {
7497  SCIP_CALL( checkStage(scip, "SCIPsetSepaInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7498 
7499  assert(sepa != NULL);
7500 
7501  SCIPsepaSetInitsol(sepa, sepainitsol);
7502 
7503  return SCIP_OKAY;
7504 }
7505 
7506 /** sets solving process deinitialization method of separator */
7508  SCIP* scip, /**< SCIP data structure */
7509  SCIP_SEPA* sepa, /**< separator */
7510  SCIP_DECL_SEPAEXITSOL ((*sepaexitsol)) /**< solving process deinitialization method of separator */
7511  )
7512 {
7513  SCIP_CALL( checkStage(scip, "SCIPsetSepaExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7514 
7515  assert(sepa != NULL);
7516 
7517  SCIPsepaSetExitsol(sepa, sepaexitsol);
7518 
7519  return SCIP_OKAY;
7520 }
7521 
7522 /** returns the separator of the given name, or NULL if not existing */
7524  SCIP* scip, /**< SCIP data structure */
7525  const char* name /**< name of separator */
7526  )
7527 {
7528  assert(scip != NULL);
7529  assert(scip->set != NULL);
7530  assert(name != NULL);
7531 
7532  return SCIPsetFindSepa(scip->set, name);
7533 }
7534 
7535 /** returns the array of currently available separators */
7537  SCIP* scip /**< SCIP data structure */
7538  )
7539 {
7540  assert(scip != NULL);
7541  assert(scip->set != NULL);
7542 
7543  SCIPsetSortSepas(scip->set);
7544 
7545  return scip->set->sepas;
7546 }
7547 
7548 /** returns the number of currently available separators */
7550  SCIP* scip /**< SCIP data structure */
7551  )
7552 {
7553  assert(scip != NULL);
7554  assert(scip->set != NULL);
7555 
7556  return scip->set->nsepas;
7557 }
7558 
7559 /** sets the priority of a separator */
7561  SCIP* scip, /**< SCIP data structure */
7562  SCIP_SEPA* sepa, /**< separator */
7563  int priority /**< new priority of the separator */
7564  )
7565 {
7566  assert(scip != NULL);
7567  assert(scip->set != NULL);
7568 
7569  SCIPsepaSetPriority(sepa, scip->set, priority);
7570 
7571  return SCIP_OKAY;
7572 }
7573 
7574 #undef SCIPgetSepaMinEfficacy
7575 
7576 /** gets value of minimal efficacy for a cut to enter the LP
7577  *
7578  * @pre This method can be called if @p scip is in one of the following stages:
7579  * - \ref SCIP_STAGE_SOLVING
7580  *
7581  * @return value of "separating/minefficacyroot" if at root node, otherwise value of "separating/minefficacy"
7582  */
7584  SCIP* scip /**< SCIP data structure */
7585  )
7586 {
7587  assert(scip != NULL);
7588  assert(scip->tree != NULL);
7589  assert(scip->set != NULL);
7590 
7591  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSepaMinEfficacy", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
7592 
7593  if( SCIPtreeGetCurrentDepth(scip->tree) != 0 )
7594  return scip->set->sepa_minefficacyroot;
7595  return scip->set->sepa_minefficacy;
7596 }
7597 
7598 
7599 /** creates a propagator and includes it in SCIP.
7600  *
7601  * @note method has all propagator callbacks as arguments and is thus changed every time a new
7602  * callback is added in future releases; consider using SCIPincludePropBasic() and setter functions
7603  * if you seek for a method which is less likely to change in future releases
7604  */
7606  SCIP* scip, /**< SCIP data structure */
7607  const char* name, /**< name of propagator */
7608  const char* desc, /**< description of propagator */
7609  int priority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */
7610  int freq, /**< frequency for calling propagator */
7611  SCIP_Bool delay, /**< should propagator be delayed, if other propagators found reductions? */
7612  SCIP_PROPTIMING timingmask, /**< positions in the node solving loop where propagator should be executed */
7613  int presolpriority, /**< presolving priority of the propagator (>= 0: before, < 0: after constraint handlers) */
7614  int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
7615  SCIP_PRESOLTIMING presoltiming, /**< timing mask of the propagator's presolving method */
7616  SCIP_DECL_PROPCOPY ((*propcopy)), /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
7617  SCIP_DECL_PROPFREE ((*propfree)), /**< destructor of propagator */
7618  SCIP_DECL_PROPINIT ((*propinit)), /**< initialize propagator */
7619  SCIP_DECL_PROPEXIT ((*propexit)), /**< deinitialize propagator */
7620  SCIP_DECL_PROPINITPRE ((*propinitpre)), /**< presolving initialization method of propagator */
7621  SCIP_DECL_PROPEXITPRE ((*propexitpre)), /**< presolving deinitialization method of propagator */
7622  SCIP_DECL_PROPINITSOL ((*propinitsol)), /**< solving process initialization method of propagator */
7623  SCIP_DECL_PROPEXITSOL ((*propexitsol)), /**< solving process deinitialization method of propagator */
7624  SCIP_DECL_PROPPRESOL ((*proppresol)), /**< presolving method */
7625  SCIP_DECL_PROPEXEC ((*propexec)), /**< execution method of propagator */
7626  SCIP_DECL_PROPRESPROP ((*propresprop)), /**< propagation conflict resolving method */
7627  SCIP_PROPDATA* propdata /**< propagator data */
7628  )
7629 {
7630  SCIP_PROP* prop;
7631 
7632  SCIP_CALL( checkStage(scip, "SCIPincludeProp", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7633 
7634  /* check whether propagator is already present */
7635  if( SCIPfindProp(scip, name) != NULL )
7636  {
7637  SCIPerrorMessage("propagator <%s> already included.\n", name);
7638  return SCIP_INVALIDDATA;
7639  }
7640 
7641  SCIP_CALL( SCIPpropCreate(&prop, scip->set, scip->messagehdlr, scip->mem->setmem,
7642  name, desc, priority, freq, delay, timingmask, presolpriority, presolmaxrounds, presoltiming,
7643  propcopy,
7644  propfree, propinit, propexit, propinitpre, propexitpre, propinitsol, propexitsol,
7645  proppresol, propexec, propresprop, propdata) );
7646  SCIP_CALL( SCIPsetIncludeProp(scip->set, prop) );
7647 
7648  return SCIP_OKAY;
7649 }
7650 
7651 /** creates a propagator and includes it in SCIP. All non-fundamental (or optional) callbacks will be set to NULL.
7652  * Optional callbacks can be set via specific setter functions, see SCIPsetPropInit(), SCIPsetPropExit(),
7653  * SCIPsetPropCopy(), SCIPsetPropFree(), SCIPsetPropInitsol(), SCIPsetPropExitsol(),
7654  * SCIPsetPropInitpre(), SCIPsetPropExitpre(), SCIPsetPropPresol(), and SCIPsetPropResprop().
7655  *
7656 * @note if you want to set all callbacks with a single method call, consider using SCIPincludeProp() instead
7657  */
7659  SCIP* scip, /**< SCIP data structure */
7660  SCIP_PROP** propptr, /**< reference to a propagator pointer, or NULL */
7661  const char* name, /**< name of propagator */
7662  const char* desc, /**< description of propagator */
7663  int priority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */
7664  int freq, /**< frequency for calling propagator */
7665  SCIP_Bool delay, /**< should propagator be delayed, if other propagators found reductions? */
7666  SCIP_PROPTIMING timingmask, /**< positions in the node solving loop where propagators should be executed */
7667  SCIP_DECL_PROPEXEC ((*propexec)), /**< execution method of propagator */
7668  SCIP_PROPDATA* propdata /**< propagator data */
7669  )
7670 {
7671  SCIP_PROP* prop;
7672 
7673  SCIP_CALL( checkStage(scip, "SCIPincludePropBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7674 
7675  /* check whether propagator is already present */
7676  if( SCIPfindProp(scip, name) != NULL )
7677  {
7678  SCIPerrorMessage("propagator <%s> already included.\n", name);
7679  return SCIP_INVALIDDATA;
7680  }
7681 
7682  SCIP_CALL( SCIPpropCreate(&prop, scip->set, scip->messagehdlr, scip->mem->setmem,
7683  name, desc, priority, freq, delay, timingmask, 0, -1, SCIP_PRESOLTIMING_ALWAYS,
7684  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
7685  NULL, propexec, NULL, propdata) );
7686  SCIP_CALL( SCIPsetIncludeProp(scip->set, prop) );
7687 
7688  if( propptr != NULL )
7689  *propptr = prop;
7690 
7691  return SCIP_OKAY;
7692 }
7693 
7694 /** sets copy method of propagator */
7696  SCIP* scip, /**< SCIP data structure */
7697  SCIP_PROP* prop, /**< propagator */
7698  SCIP_DECL_PROPCOPY ((*propcopy)) /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
7699  )
7700 {
7701  SCIP_CALL( checkStage(scip, "SCIPsetPropCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7702 
7703  assert(prop != NULL);
7704 
7705  SCIPpropSetCopy(prop, propcopy);
7706 
7707  return SCIP_OKAY;
7708 }
7709 
7710 /** sets destructor method of propagator */
7712  SCIP* scip, /**< SCIP data structure */
7713  SCIP_PROP* prop, /**< propagator */
7714  SCIP_DECL_PROPFREE ((*propfree)) /**< destructor of propagator */
7715  )
7716 {
7717  SCIP_CALL( checkStage(scip, "SCIPsetPropFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7718 
7719  assert(prop != NULL);
7720 
7721  SCIPpropSetFree(prop, propfree);
7722 
7723  return SCIP_OKAY;
7724 }
7725 
7726 /** sets initialization method of propagator */
7728  SCIP* scip, /**< SCIP data structure */
7729  SCIP_PROP* prop, /**< propagator */
7730  SCIP_DECL_PROPINIT ((*propinit)) /**< initialize propagator */
7731  )
7732 {
7733  SCIP_CALL( checkStage(scip, "SCIPsetPropInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7734 
7735  assert(prop != NULL);
7736 
7737  SCIPpropSetInit(prop, propinit);
7738 
7739  return SCIP_OKAY;
7740 }
7741 
7742 /** sets deinitialization method of propagator */
7744  SCIP* scip, /**< SCIP data structure */
7745  SCIP_PROP* prop, /**< propagator */
7746  SCIP_DECL_PROPEXIT ((*propexit)) /**< deinitialize propagator */
7747  )
7748 {
7749  SCIP_CALL( checkStage(scip, "SCIPsetPropExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7750 
7751  assert(prop != NULL);
7752 
7753  SCIPpropSetExit(prop, propexit);
7754 
7755  return SCIP_OKAY;
7756 }
7757 
7758 /** sets solving process initialization method of propagator */
7760  SCIP* scip, /**< SCIP data structure */
7761  SCIP_PROP* prop, /**< propagator */
7762  SCIP_DECL_PROPINITSOL((*propinitsol)) /**< solving process initialization method of propagator */
7763  )
7764 {
7765  SCIP_CALL( checkStage(scip, "SCIPsetPropInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7766 
7767  assert(prop != NULL);
7768 
7769  SCIPpropSetInitsol(prop, propinitsol);
7770 
7771  return SCIP_OKAY;
7772 }
7773 
7774 /** sets solving process deinitialization method of propagator */
7776  SCIP* scip, /**< SCIP data structure */
7777  SCIP_PROP* prop, /**< propagator */
7778  SCIP_DECL_PROPEXITSOL ((*propexitsol)) /**< solving process deinitialization method of propagator */
7779  )
7780 {
7781  SCIP_CALL( checkStage(scip, "SCIPsetPropExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7782 
7783  assert(prop != NULL);
7784 
7785  SCIPpropSetExitsol(prop, propexitsol);
7786 
7787  return SCIP_OKAY;
7788 }
7789 
7790 /** sets preprocessing initialization method of propagator */
7792  SCIP* scip, /**< SCIP data structure */
7793  SCIP_PROP* prop, /**< propagator */
7794  SCIP_DECL_PROPINITPRE((*propinitpre)) /**< preprocessing initialization method of propagator */
7795  )
7796 {
7797  SCIP_CALL( checkStage(scip, "SCIPsetPropInitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7798 
7799  assert(prop != NULL);
7800 
7801  SCIPpropSetInitpre(prop, propinitpre);
7802 
7803  return SCIP_OKAY;
7804 }
7805 
7806 /** sets preprocessing deinitialization method of propagator */
7808  SCIP* scip, /**< SCIP data structure */
7809  SCIP_PROP* prop, /**< propagator */
7810  SCIP_DECL_PROPEXITPRE((*propexitpre)) /**< preprocessing deinitialization method of propagator */
7811  )
7812 {
7813  SCIP_CALL( checkStage(scip, "SCIPsetPropExitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7814 
7815  assert(prop != NULL);
7816 
7817  SCIPpropSetExitpre(prop, propexitpre);
7818 
7819  return SCIP_OKAY;
7820 }
7821 
7822 /** sets presolving method of propagator */
7824  SCIP* scip, /**< SCIP data structure */
7825  SCIP_PROP* prop, /**< propagator */
7826  SCIP_DECL_PROPPRESOL((*proppresol)), /**< presolving method of propagator */
7827  int presolpriority, /**< presolving priority of the propagator (>= 0: before, < 0: after constraint handlers) */
7828  int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
7829  SCIP_PRESOLTIMING presoltiming /**< timing mask of the propagator's presolving method */
7830  )
7831 {
7832  const char* name;
7833  char paramname[SCIP_MAXSTRLEN];
7834 
7835  assert(scip != NULL);
7836  SCIP_CALL( checkStage(scip, "SCIPsetPropPresol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7837 
7838  assert(prop != NULL);
7839  SCIP_CALL( SCIPpropSetPresol(prop, proppresol, presolpriority, presolmaxrounds, presoltiming) );
7840 
7841  name = SCIPpropGetName(prop);
7842 
7843  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/maxprerounds", name);
7844  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, presolmaxrounds) );
7845 
7846  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/presolpriority", name);
7847  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, presolpriority) );
7848 
7849  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/presoltiming", name);
7850  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, (int) presoltiming) );
7851 
7852  return SCIP_OKAY;
7853 }
7854 
7855 /** sets propagation conflict resolving callback of propagator */
7857  SCIP* scip, /**< SCIP data structure */
7858  SCIP_PROP* prop, /**< propagator */
7859  SCIP_DECL_PROPRESPROP ((*propresprop)) /**< propagation conflict resolving callback */
7860  )
7861 {
7862  SCIP_CALL( checkStage(scip, "SCIPsetPropResprop", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7863 
7864  assert(prop != NULL);
7865 
7866  SCIPpropSetResprop(prop, propresprop);
7867 
7868  return SCIP_OKAY;
7869 }
7870 
7871 
7872 /** returns the propagator of the given name, or NULL if not existing */
7874  SCIP* scip, /**< SCIP data structure */
7875  const char* name /**< name of propagator */
7876  )
7877 {
7878  assert(scip != NULL);
7879  assert(scip->set != NULL);
7880  assert(name != NULL);
7881 
7882  return SCIPsetFindProp(scip->set, name);
7883 }
7884 
7885 /** returns the array of currently available propagators */
7887  SCIP* scip /**< SCIP data structure */
7888  )
7889 {
7890  assert(scip != NULL);
7891  assert(scip->set != NULL);
7892 
7893  SCIPsetSortProps(scip->set);
7894 
7895  return scip->set->props;
7896 }
7897 
7898 /** returns the number of currently available propagators */
7900  SCIP* scip /**< SCIP data structure */
7901  )
7902 {
7903  assert(scip != NULL);
7904  assert(scip->set != NULL);
7905 
7906  return scip->set->nprops;
7907 }
7908 
7909 /** sets the priority of a propagator */
7911  SCIP* scip, /**< SCIP data structure */
7912  SCIP_PROP* prop, /**< propagator */
7913  int priority /**< new priority of the propagator */
7914  )
7915 {
7916  assert(scip != NULL);
7917  assert(scip->set != NULL);
7918 
7919  SCIPpropSetPriority(prop, scip->set, priority);
7920 
7921  return SCIP_OKAY;
7922 }
7923 
7924 /** sets the presolving priority of a propagator */
7926  SCIP* scip, /**< SCIP data structure */
7927  SCIP_PROP* prop, /**< propagator */
7928  int presolpriority /**< new presol priority of the propagator */
7929  )
7930 {
7931  assert(scip != NULL);
7932  assert(scip->set != NULL);
7933 
7934  SCIPpropSetPresolPriority(prop, scip->set, presolpriority);
7935 
7936  return SCIP_OKAY;
7937 }
7938 
7939 /** creates a concurrent solver type and includes it in SCIP.
7940  *
7941  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
7942  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
7943  *
7944  * @pre This method can be called if @p scip is in one of the following stages:
7945  * - \ref SCIP_STAGE_INIT
7946  * - \ref SCIP_STAGE_PROBLEM
7947  */
7949  SCIP* scip, /**< SCIP data structure */
7950  const char* name, /**< name of concurrent_solver */
7951  SCIP_Real prefpriodefault, /**< the default preferred priority of this concurrent solver type */
7952  SCIP_DECL_CONCSOLVERCREATEINST ((*concsolvercreateinst)), /**< data copy method of concurrent solver */
7953  SCIP_DECL_CONCSOLVERDESTROYINST ((*concsolverdestroyinst)), /**< data copy method of concurrent solver */
7954  SCIP_DECL_CONCSOLVERINITSEEDS ((*concsolverinitseeds)), /**< initialize random seeds of concurrent solver */
7955  SCIP_DECL_CONCSOLVEREXEC ((*concsolverexec)), /**< execution method of concurrent solver */
7956  SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA ((*concsolvercopysolvdata)),/**< method to copy solving data */
7957  SCIP_DECL_CONCSOLVERSTOP ((*concsolverstop)), /**< terminate solving in concurrent solver */
7958  SCIP_DECL_CONCSOLVERSYNCWRITE ((*concsolversyncwrite)), /**< synchronization method of concurrent solver */
7959  SCIP_DECL_CONCSOLVERSYNCREAD ((*concsolversyncread)), /**< synchronization method of concurrent solver */
7960  SCIP_DECL_CONCSOLVERTYPEFREEDATA ((*concsolvertypefreedata)),/**< method to free data of concurrent solver type */
7961  SCIP_CONCSOLVERTYPEDATA* data /**< the concurent solver type's data */
7962  )
7963 {
7964  SCIP_CONCSOLVERTYPE* concsolvertype;
7965 
7966  SCIP_CALL( checkStage(scip, "SCIPincludeConcsolverType", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7967 
7968  /* check whether concurrent solver type is already present */
7969  if( SCIPfindConcsolverType(scip, name) != NULL )
7970  {
7971  SCIPerrorMessage("concurrent solver type <%s> already included.\n", name);
7972  return SCIP_INVALIDDATA;
7973  }
7974 
7975  SCIP_CALL( SCIPconcsolverTypeCreate(&concsolvertype, scip->set, scip->messagehdlr, scip->mem->setmem,
7976  name, prefpriodefault, concsolvercreateinst, concsolverdestroyinst,
7977  concsolverinitseeds, concsolverexec, concsolvercopysolvdata,
7978  concsolverstop, concsolversyncwrite, concsolversyncread,
7979  concsolvertypefreedata, data) );
7980 
7981  SCIP_CALL( SCIPsetIncludeConcsolverType(scip->set, concsolvertype) );
7982 
7983  return SCIP_OKAY;
7984 }
7985 
7986 /** returns the concurrent solver type with the given name, or NULL if not existing */
7988  SCIP* scip, /**< SCIP data structure */
7989  const char* name /**< name of concurrent_solver */
7990  )
7991 {
7992  assert(scip != NULL);
7993  assert(scip->set != NULL);
7994  assert(name != NULL);
7995 
7996  return SCIPsetFindConcsolverType(scip->set, name);
7997 }
7998 
7999 /** returns the array of included concurrent solver types */
8001  SCIP* scip /**< SCIP data structure */
8002  )
8003 {
8004  assert(scip != NULL);
8005  assert(scip->set != NULL);
8006 
8007  return scip->set->concsolvertypes;
8008 }
8009 
8010 /** returns the number of included concurrent solver types */
8012  SCIP* scip /**< SCIP data structure */
8013  )
8014 {
8015  assert(scip != NULL);
8016  assert(scip->set != NULL);
8017 
8018  return scip->set->nconcsolvertypes;
8019 }
8020 
8021 /** creates a primal heuristic and includes it in SCIP.
8022  *
8023  * @note method has all heuristic callbacks as arguments and is thus changed every time a new
8024  * callback is added in future releases; consider using SCIPincludeHeurBasic() and setter functions
8025  * if you seek for a method which is less likely to change in future releases
8026  *
8027  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
8028  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
8029  *
8030  * @pre This method can be called if @p scip is in one of the following stages:
8031  * - \ref SCIP_STAGE_INIT
8032  * - \ref SCIP_STAGE_PROBLEM
8033  */
8035  SCIP* scip, /**< SCIP data structure */
8036  const char* name, /**< name of primal heuristic */
8037  const char* desc, /**< description of primal heuristic */
8038  char dispchar, /**< display character of primal heuristic */
8039  int priority, /**< priority of the primal heuristic */
8040  int freq, /**< frequency for calling primal heuristic */
8041  int freqofs, /**< frequency offset for calling primal heuristic */
8042  int maxdepth, /**< maximal depth level to call heuristic at (-1: no limit) */
8043  SCIP_HEURTIMING timingmask, /**< positions in the node solving loop where heuristic should be executed;
8044  * see definition of SCIP_HEURTIMING for possible values */
8045  SCIP_Bool usessubscip, /**< does the heuristic use a secondary SCIP instance? */
8046  SCIP_DECL_HEURCOPY ((*heurcopy)), /**< copy method of primal heuristic or NULL if you don't want to copy your plugin into sub-SCIPs */
8047  SCIP_DECL_HEURFREE ((*heurfree)), /**< destructor of primal heuristic */
8048  SCIP_DECL_HEURINIT ((*heurinit)), /**< initialize primal heuristic */
8049  SCIP_DECL_HEUREXIT ((*heurexit)), /**< deinitialize primal heuristic */
8050  SCIP_DECL_HEURINITSOL ((*heurinitsol)), /**< solving process initialization method of primal heuristic */
8051  SCIP_DECL_HEUREXITSOL ((*heurexitsol)), /**< solving process deinitialization method of primal heuristic */
8052  SCIP_DECL_HEUREXEC ((*heurexec)), /**< execution method of primal heuristic */
8053  SCIP_HEURDATA* heurdata /**< primal heuristic data */
8054  )
8055 {
8056  SCIP_HEUR* heur;
8057 
8058  SCIP_CALL( checkStage(scip, "SCIPincludeHeur", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8059 
8060  /* check whether heuristic is already present */
8061  if( SCIPfindHeur(scip, name) != NULL )
8062  {
8063  SCIPerrorMessage("heuristic <%s> already included.\n", name);
8064  return SCIP_INVALIDDATA;
8065  }
8066 
8067  SCIP_CALL( SCIPheurCreate(&heur, scip->set, scip->messagehdlr, scip->mem->setmem,
8068  name, desc, dispchar, priority, freq, freqofs, maxdepth, timingmask, usessubscip,
8069  heurcopy, heurfree, heurinit, heurexit, heurinitsol, heurexitsol, heurexec, heurdata) );
8070 
8071  SCIP_CALL( SCIPsetIncludeHeur(scip->set, heur) );
8072 
8073  return SCIP_OKAY;
8074 }
8075 
8076 /** creates a primal heuristic and includes it in SCIP with its most fundamental callbacks.
8077  * All non-fundamental (or optional) callbacks
8078  * as, e. g., init and exit callbacks, will be set to NULL.
8079  * Optional callbacks can be set via specific setter functions, see SCIPsetHeurCopy(), SCIPsetHeurFree(),
8080  * SCIPsetHeurInit(), SCIPsetHeurExit(), SCIPsetHeurInitsol(), and SCIPsetHeurExitsol()
8081  *
8082 * @note if you want to set all callbacks with a single method call, consider using SCIPincludeHeur() instead
8083  */
8085  SCIP* scip, /**< SCIP data structure */
8086  SCIP_HEUR** heur, /**< pointer to primal heuristic */
8087  const char* name, /**< name of primal heuristic */
8088  const char* desc, /**< description of primal heuristic */
8089  char dispchar, /**< display character of primal heuristic */
8090  int priority, /**< priority of the primal heuristic */
8091  int freq, /**< frequency for calling primal heuristic */
8092  int freqofs, /**< frequency offset for calling primal heuristic */
8093  int maxdepth, /**< maximal depth level to call heuristic at (-1: no limit) */
8094  SCIP_HEURTIMING timingmask, /**< positions in the node solving loop where heuristic should be executed;
8095  * see definition of SCIP_HEURTIMING for possible values */
8096  SCIP_Bool usessubscip, /**< does the heuristic use a secondary SCIP instance? */
8097  SCIP_DECL_HEUREXEC ((*heurexec)), /**< execution method of primal heuristic */
8098  SCIP_HEURDATA* heurdata /**< primal heuristic data */
8099  )
8100 {
8101  SCIP_HEUR* heurptr;
8102 
8103  SCIP_CALL( checkStage(scip, "SCIPincludeHeurBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8104 
8105  /* check whether heuristic is already present */
8106  if( SCIPfindHeur(scip, name) != NULL )
8107  {
8108  SCIPerrorMessage("heuristic <%s> already included.\n", name);
8109  return SCIP_INVALIDDATA;
8110  }
8111 
8112  SCIP_CALL( SCIPheurCreate(&heurptr, scip->set, scip->messagehdlr, scip->mem->setmem,
8113  name, desc, dispchar, priority, freq, freqofs, maxdepth, timingmask, usessubscip,
8114  NULL, NULL, NULL, NULL, NULL, NULL, heurexec, heurdata) );
8115 
8116  assert(heurptr != NULL);
8117 
8118  SCIP_CALL( SCIPsetIncludeHeur(scip->set, heurptr) );
8119 
8120  if( heur != NULL )
8121  *heur = heurptr;
8122 
8123  return SCIP_OKAY;
8124 }
8125 
8126 /* new callback/method setter methods */
8127 
8128 /** sets copy method of primal heuristic */
8130  SCIP* scip, /**< SCIP data structure */
8131  SCIP_HEUR* heur, /**< primal heuristic */
8132  SCIP_DECL_HEURCOPY ((*heurcopy)) /**< copy method of primal heuristic or NULL if you don't want to copy your plugin into sub-SCIPs */
8133  )
8134 {
8135  SCIP_CALL( checkStage(scip, "SCIPsetHeurCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8136 
8137  assert(heur != NULL);
8138 
8139  SCIPheurSetCopy(heur, heurcopy);
8140 
8141  return SCIP_OKAY;
8142 }
8143 
8144 /** sets destructor method of primal heuristic */
8146  SCIP* scip, /**< SCIP data structure */
8147  SCIP_HEUR* heur, /**< primal heuristic */
8148  SCIP_DECL_HEURFREE ((*heurfree)) /**< destructor of primal heuristic */
8149  )
8150 {
8151  SCIP_CALL( checkStage(scip, "SCIPsetHeurFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8152 
8153  assert(heur != NULL);
8154 
8155  SCIPheurSetFree(heur, heurfree);
8156 
8157  return SCIP_OKAY;
8158 }
8159 
8160 /** sets initialization method of primal heuristic */
8162  SCIP* scip, /**< SCIP data structure */
8163  SCIP_HEUR* heur, /**< primal heuristic */
8164  SCIP_DECL_HEURINIT ((*heurinit)) /**< initialize primal heuristic */
8165  )
8166 {
8167  SCIP_CALL( checkStage(scip, "SCIPsetHeurInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8168 
8169  assert(heur != NULL);
8170 
8171  SCIPheurSetInit(heur, heurinit);
8172 
8173  return SCIP_OKAY;
8174 }
8175 
8176 /** sets deinitialization method of primal heuristic */
8178  SCIP* scip, /**< SCIP data structure */
8179  SCIP_HEUR* heur, /**< primal heuristic */
8180  SCIP_DECL_HEUREXIT ((*heurexit)) /**< deinitialize primal heuristic */
8181  )
8182 {
8183  SCIP_CALL( checkStage(scip, "SCIPsetHeurExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8184 
8185  assert(heur != NULL);
8186 
8187  SCIPheurSetExit(heur, heurexit);
8188 
8189  return SCIP_OKAY;
8190 }
8191 
8192 /** sets solving process initialization method of primal heuristic */
8194  SCIP* scip, /**< SCIP data structure */
8195  SCIP_HEUR* heur, /**< primal heuristic */
8196  SCIP_DECL_HEURINITSOL ((*heurinitsol)) /**< solving process initialization method of primal heuristic */
8197  )
8198 {
8199  SCIP_CALL( checkStage(scip, "SCIPsetHeurInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8200 
8201  assert(heur != NULL);
8202 
8203  SCIPheurSetInitsol(heur, heurinitsol);
8204 
8205  return SCIP_OKAY;
8206 }
8207 
8208 /** sets solving process deinitialization method of primal heuristic */
8210  SCIP* scip, /**< SCIP data structure */
8211  SCIP_HEUR* heur, /**< primal heuristic */
8212  SCIP_DECL_HEUREXITSOL ((*heurexitsol)) /**< solving process deinitialization method of primal heuristic */
8213  )
8214 {
8215  SCIP_CALL( checkStage(scip, "SCIPsetHeurExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8216 
8217  assert(heur != NULL);
8218 
8219  SCIPheurSetExitsol(heur, heurexitsol);
8220 
8221  return SCIP_OKAY;
8222 }
8223 
8224 /** returns the primal heuristic of the given name, or NULL if not existing */
8226  SCIP* scip, /**< SCIP data structure */
8227  const char* name /**< name of primal heuristic */
8228  )
8229 {
8230  assert(scip != NULL);
8231  assert(scip->set != NULL);
8232  assert(name != NULL);
8233 
8234  return SCIPsetFindHeur(scip->set, name);
8235 }
8236 
8237 /** returns the array of currently available primal heuristics */
8239  SCIP* scip /**< SCIP data structure */
8240  )
8241 {
8242  assert(scip != NULL);
8243  assert(scip->set != NULL);
8244 
8245  SCIPsetSortHeurs(scip->set);
8246 
8247  return scip->set->heurs;
8248 }
8249 
8250 /** returns the number of currently available primal heuristics */
8252  SCIP* scip /**< SCIP data structure */
8253  )
8254 {
8255  assert(scip != NULL);
8256  assert(scip->set != NULL);
8257 
8258  return scip->set->nheurs;
8259 }
8260 
8261 /** sets the priority of a primal heuristic */
8263  SCIP* scip, /**< SCIP data structure */
8264  SCIP_HEUR* heur, /**< primal heuristic */
8265  int priority /**< new priority of the primal heuristic */
8266  )
8267 {
8268  assert(scip != NULL);
8269  assert(scip->set != NULL);
8270 
8271  SCIPheurSetPriority(heur, scip->set, priority);
8272 
8273  return SCIP_OKAY;
8274 }
8275 
8276 /** creates a tree compression and includes it in SCIP.
8277  *
8278  * @note method has all compression callbacks as arguments and is thus changed every time a new
8279  * callback is added in future releases; consider using SCIPincludeComprBasic() and setter functions
8280  * if you seek for a method which is less likely to change in future releases
8281  */
8283  SCIP* scip, /**< SCIP data structure */
8284  const char* name, /**< name of tree compression */
8285  const char* desc, /**< description of tree compression */
8286  int priority, /**< priority of the tree compression */
8287  int minnnodes, /**< minimal number of nodes to call compression */
8288  SCIP_DECL_COMPRCOPY ((*comprcopy)), /**< copy method of tree compression or NULL if you don't want to copy your plugin into sub-SCIPs */
8289  SCIP_DECL_COMPRFREE ((*comprfree)), /**< destructor of tree compression */
8290  SCIP_DECL_COMPRINIT ((*comprinit)), /**< initialize tree compression */
8291  SCIP_DECL_COMPREXIT ((*comprexit)), /**< deinitialize tree compression */
8292  SCIP_DECL_COMPRINITSOL ((*comprinitsol)), /**< solving process initialization method of tree compression */
8293  SCIP_DECL_COMPREXITSOL ((*comprexitsol)), /**< solving process deinitialization method of tree compression */
8294  SCIP_DECL_COMPREXEC ((*comprexec)), /**< execution method of tree compression */
8295  SCIP_COMPRDATA* comprdata /**< tree compression data */
8296  )
8297 {
8298  SCIP_COMPR* compr;
8299 
8300  SCIP_CALL( checkStage(scip, "SCIPincludeCompr", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8301 
8302  /* check whether compression is already present */
8303  if( SCIPfindCompr(scip, name) != NULL )
8304  {
8305  SCIPerrorMessage("compression <%s> already included.\n", name);
8306  return SCIP_INVALIDDATA;
8307  }
8308 
8309  SCIP_CALL( SCIPcomprCreate(&compr, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority, minnnodes,
8310  comprcopy, comprfree, comprinit, comprexit, comprinitsol, comprexitsol, comprexec, comprdata) );
8311 
8312  SCIP_CALL( SCIPsetIncludeCompr(scip->set, compr) );
8313 
8314  return SCIP_OKAY;
8315 }
8316 
8317 /** creates a tree compression and includes it in SCIP with its most fundamental callbacks.
8318  * All non-fundamental (or optional) callbacks
8319  * as, e. g., init and exit callbacks, will be set to NULL.
8320  * Optional callbacks can be set via specific setter functions, see SCIPsetComprCopy(), SCIPsetComprFree(),
8321  * SCIPsetComprInit(), SCIPsetComprExit(), SCIPsetComprInitsol(), and SCIPsetComprExitsol()
8322  *
8323  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeCompr() instead
8324  */
8326  SCIP* scip, /**< SCIP data structure */
8327  SCIP_COMPR** compr, /**< pointer to tree compression */
8328  const char* name, /**< name of tree compression */
8329  const char* desc, /**< description of tree compression */
8330  int priority, /**< priority of the tree compression */
8331  int minnnodes, /**< minimal number of nodes to call the compression */
8332  SCIP_DECL_COMPREXEC ((*comprexec)), /**< execution method of tree compression */
8333  SCIP_COMPRDATA* comprdata /**< tree compression data */
8334  )
8335 {
8336  SCIP_COMPR* comprptr;
8337 
8338  SCIP_CALL( checkStage(scip, "SCIPincludeComprBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8339 
8340  /* check whether heuristic is already present */
8341  if( SCIPfindCompr(scip, name) != NULL )
8342  {
8343  SCIPerrorMessage("tree compression <%s> already included.\n", name);
8344  return SCIP_INVALIDDATA;
8345  }
8346 
8347  SCIP_CALL( SCIPcomprCreate(&comprptr, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority,
8348  minnnodes, NULL, NULL, NULL, NULL, NULL, NULL, comprexec, comprdata) );
8349 
8350  assert(comprptr != NULL);
8351 
8352  SCIP_CALL( SCIPsetIncludeCompr(scip->set, comprptr) );
8353 
8354  if( compr != NULL )
8355  *compr = comprptr;
8356 
8357  return SCIP_OKAY;
8358 }
8359 
8360 /* new callback/method setter methods */
8361 
8362 /** sets copy method of tree compression */
8364  SCIP* scip, /**< SCIP data structure */
8365  SCIP_COMPR* compr, /**< tree compression */
8366  SCIP_DECL_COMPRCOPY ((*comprcopy)) /**< copy method of tree compression or NULL if you don't want to copy your plugin into sub-SCIPs */
8367  )
8368 {
8369  SCIP_CALL( checkStage(scip, "SCIPsetComprCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8370 
8371  assert(compr != NULL);
8372 
8373  SCIPcomprSetCopy(compr, comprcopy);
8374 
8375  return SCIP_OKAY;
8376 }
8377 
8378 /** sets destructor method of tree compression */
8380  SCIP* scip, /**< SCIP data structure */
8381  SCIP_COMPR* compr, /**< tree compression */
8382  SCIP_DECL_COMPRFREE ((*comprfree)) /**< destructor of tree compression */
8383  )
8384 {
8385  SCIP_CALL( checkStage(scip, "SCIPsetComprFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8386 
8387  assert(compr != NULL);
8388 
8389  SCIPcomprSetFree(compr, comprfree);
8390 
8391  return SCIP_OKAY;
8392 }
8393 
8394 /** sets initialization method of tree compression */
8396  SCIP* scip, /**< SCIP data structure */
8397  SCIP_COMPR* compr, /**< tree compression */
8398  SCIP_DECL_COMPRINIT ((*comprinit)) /**< initialize tree compression */
8399  )
8400 {
8401  SCIP_CALL( checkStage(scip, "SCIPsetComprInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8402 
8403  assert(compr != NULL);
8404 
8405  SCIPcomprSetInit(compr, comprinit);
8406 
8407  return SCIP_OKAY;
8408 }
8409 
8410 /** sets deinitialization method of tree compression */
8412  SCIP* scip, /**< SCIP data structure */
8413  SCIP_COMPR* compr, /**< tree compression */
8414  SCIP_DECL_COMPREXIT ((*comprexit)) /**< deinitialize tree compression */
8415  )
8416 {
8417  SCIP_CALL( checkStage(scip, "SCIPsetComprExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8418 
8419  assert(compr != NULL);
8420 
8421  SCIPcomprSetExit(compr, comprexit);
8422 
8423  return SCIP_OKAY;
8424 }
8425 
8426 /** sets solving process initialization method of tree compression */
8428  SCIP* scip, /**< SCIP data structure */
8429  SCIP_COMPR* compr, /**< tree compression */
8430  SCIP_DECL_COMPRINITSOL ((*comprinitsol)) /**< solving process initialization method of tree compression */
8431  )
8432 {
8433  SCIP_CALL( checkStage(scip, "SCIPsetComprInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8434 
8435  assert(compr != NULL);
8436 
8437  SCIPcomprSetInitsol(compr, comprinitsol);
8438 
8439  return SCIP_OKAY;
8440 }
8441 
8442 /** sets solving process deinitialization method of tree compression */
8444  SCIP* scip, /**< SCIP data structure */
8445  SCIP_COMPR* compr, /**< tree compression */
8446  SCIP_DECL_COMPREXITSOL ((*comprexitsol)) /**< solving process deinitialization method of tree compression */
8447  )
8448 {
8449  SCIP_CALL( checkStage(scip, "SCIPsetComprExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8450 
8451  assert(compr != NULL);
8452 
8453  SCIPcomprSetExitsol(compr, comprexitsol);
8454 
8455  return SCIP_OKAY;
8456 }
8457 
8458 /** returns the tree compression of the given name, or NULL if not existing */
8460  SCIP* scip, /**< SCIP data structure */
8461  const char* name /**< name of tree compression */
8462  )
8463 {
8464  assert(scip != NULL);
8465  assert(scip->set != NULL);
8466  assert(name != NULL);
8467 
8468  return SCIPsetFindCompr(scip->set, name);
8469 }
8470 
8471 /** returns the array of currently available tree compression */
8473  SCIP* scip /**< SCIP data structure */
8474  )
8475 {
8476  assert(scip != NULL);
8477  assert(scip->set != NULL);
8478 
8479  SCIPsetSortComprs(scip->set);
8480 
8481  return scip->set->comprs;
8482 }
8483 
8484 /** returns the number of currently available tree compression */
8486  SCIP* scip /**< SCIP data structure */
8487  )
8488 {
8489  assert(scip != NULL);
8490  assert(scip->set != NULL);
8491 
8492  return scip->set->ncomprs;
8493 }
8494 
8495 /** set the priority of a tree compression method */
8497  SCIP* scip, /**< SCIP data structure */
8498  SCIP_COMPR* compr, /**< compression */
8499  int priority /**< new priority of the tree compression */
8500  )
8501 {
8502  assert(scip != NULL);
8503  assert(scip->set != NULL);
8504 
8505  SCIPcomprSetPriority(compr, scip->set, priority);
8506 
8507  return SCIP_OKAY;
8508 }
8509 
8510 /** create a diving set associated with a primal heuristic. The primal heuristic needs to be included
8511  * before this method can be called. The diveset is installed in the array of divesets of the heuristic
8512  * and can be retrieved later by accessing SCIPheurGetDivesets()
8513  *
8514  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
8515  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
8516  *
8517  * @pre This method can be called if @p scip is in one of the following stages:
8518  * - \ref SCIP_STAGE_INIT
8519  * - \ref SCIP_STAGE_PROBLEM
8520  */
8522  SCIP* scip, /**< SCIP data structure */
8523  SCIP_DIVESET** diveset, /**< pointer to created diving heuristic settings, or NULL if not needed */
8524  SCIP_HEUR* heur, /**< primal heuristic to which the diveset belongs */
8525  const char* name, /**< name for the diveset, or NULL if the name of the heuristic should be used */
8526  SCIP_Real minreldepth, /**< minimal relative depth to start diving */
8527  SCIP_Real maxreldepth, /**< maximal relative depth to start diving */
8528  SCIP_Real maxlpiterquot, /**< maximal fraction of diving LP iterations compared to node LP iterations */
8529  SCIP_Real maxdiveubquot, /**< maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound)
8530  * where diving is performed (0.0: no limit) */
8531  SCIP_Real maxdiveavgquot, /**< maximal quotient (curlowerbound - lowerbound)/(avglowerbound - lowerbound)
8532  * where diving is performed (0.0: no limit) */
8533  SCIP_Real maxdiveubquotnosol, /**< maximal UBQUOT when no solution was found yet (0.0: no limit) */
8534  SCIP_Real maxdiveavgquotnosol,/**< maximal AVGQUOT when no solution was found yet (0.0: no limit) */
8535  SCIP_Real lpresolvedomchgquot,/**< percentage of immediate domain changes during probing to trigger LP resolve */
8536  int lpsolvefreq, /**< LP solve frequency for (0: only if enough domain reductions are found by propagation)*/
8537  int maxlpiterofs, /**< additional number of allowed LP iterations */
8538  unsigned int initialseed, /**< initial seed for random number generation */
8539  SCIP_Bool backtrack, /**< use one level of backtracking if infeasibility is encountered? */
8540  SCIP_Bool onlylpbranchcands, /**< should only LP branching candidates be considered instead of the slower but
8541  * more general constraint handler diving variable selection? */
8542  SCIP_Bool specificsos1score, /**< should SOS1 variables be scored by the diving heuristics specific score function;
8543  * otherwise use the score function of the SOS1 constraint handler */
8544  SCIP_DECL_DIVESETGETSCORE((*divesetgetscore)) /**< method for candidate score and rounding direction */
8545  )
8546 {
8547  SCIP_DIVESET* divesetptr;
8548  SCIP_CALL( checkStage(scip, "SCIPcreateDiveset", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8549 
8550  divesetptr = NULL;
8551  /* create the diveset (this will add diving specific parameters for this heuristic) */
8552  SCIP_CALL( SCIPdivesetCreate(&divesetptr, heur, name, scip->set, scip->messagehdlr, scip->mem->setmem,
8553  minreldepth, maxreldepth, maxlpiterquot, maxdiveubquot, maxdiveavgquot, maxdiveubquotnosol,
8554  maxdiveavgquotnosol, lpresolvedomchgquot, lpsolvefreq, maxlpiterofs, initialseed, backtrack, onlylpbranchcands, specificsos1score, divesetgetscore) );
8555 
8556  assert(divesetptr != NULL);
8557  if( diveset != NULL )
8558  *diveset = divesetptr;
8559 
8560  return SCIP_OKAY;
8561 }
8562 
8563 /** creates an event handler and includes it in SCIP
8564  *
8565  * @note method has all event handler callbacks as arguments and is thus changed every time a new
8566  * callback is added in future releases; consider using SCIPincludeEventhdlrBasic() and setter functions
8567  * if you seek for a method which is less likely to change in future releases
8568  */
8570  SCIP* scip, /**< SCIP data structure */
8571  const char* name, /**< name of event handler */
8572  const char* desc, /**< description of event handler */
8573  SCIP_DECL_EVENTCOPY ((*eventcopy)), /**< copy method of event handler or NULL if you don't want to copy your plugin into sub-SCIPs */
8574  SCIP_DECL_EVENTFREE ((*eventfree)), /**< destructor of event handler */
8575  SCIP_DECL_EVENTINIT ((*eventinit)), /**< initialize event handler */
8576  SCIP_DECL_EVENTEXIT ((*eventexit)), /**< deinitialize event handler */
8577  SCIP_DECL_EVENTINITSOL((*eventinitsol)), /**< solving process initialization method of event handler */
8578  SCIP_DECL_EVENTEXITSOL((*eventexitsol)), /**< solving process deinitialization method of event handler */
8579  SCIP_DECL_EVENTDELETE ((*eventdelete)), /**< free specific event data */
8580  SCIP_DECL_EVENTEXEC ((*eventexec)), /**< execute event handler */
8581  SCIP_EVENTHDLRDATA* eventhdlrdata /**< event handler data */
8582  )
8583 {
8584  SCIP_EVENTHDLR* eventhdlr;
8585 
8586  SCIP_CALL( checkStage(scip, "SCIPincludeEventhdlr", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8587 
8588  /* check whether event handler is already present */
8589  if( SCIPfindEventhdlr(scip, name) != NULL )
8590  {
8591  SCIPerrorMessage("event handler <%s> already included.\n", name);
8592  return SCIP_INVALIDDATA;
8593  }
8594 
8595  SCIP_CALL( SCIPeventhdlrCreate(&eventhdlr, name, desc,
8596  eventcopy,
8597  eventfree, eventinit, eventexit, eventinitsol, eventexitsol, eventdelete, eventexec,
8598  eventhdlrdata) );
8599  SCIP_CALL( SCIPsetIncludeEventhdlr(scip->set, eventhdlr) );
8600 
8601  return SCIP_OKAY;
8602 }
8603 
8604 /** creates an event handler and includes it in SCIP with all its non-fundamental callbacks set
8605  * to NULL; if needed, non-fundamental callbacks can be set afterwards via setter functions
8606  * SCIPsetEventhdlrCopy(), SCIPsetEventhdlrFree(), SCIPsetEventhdlrInit(), SCIPsetEventhdlrExit(),
8607  * SCIPsetEventhdlrInitsol(), SCIPsetEventhdlrExitsol(), and SCIPsetEventhdlrDelete()
8608  *
8609  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeEventhdlr() instead
8610  */
8612  SCIP* scip, /**< SCIP data structure */
8613  SCIP_EVENTHDLR** eventhdlrptr, /**< reference to an event handler, or NULL */
8614  const char* name, /**< name of event handler */
8615  const char* desc, /**< description of event handler */
8616  SCIP_DECL_EVENTEXEC ((*eventexec)), /**< execute event handler */
8617  SCIP_EVENTHDLRDATA* eventhdlrdata /**< event handler data */
8618  )
8619 {
8620  SCIP_EVENTHDLR* eventhdlr;
8621 
8622  SCIP_CALL( checkStage(scip, "SCIPincludeEventhdlrBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8623 
8624  /* check whether event handler is already present */
8625  if( SCIPfindEventhdlr(scip, name) != NULL )
8626  {
8627  SCIPerrorMessage("event handler <%s> already included.\n", name);
8628  return SCIP_INVALIDDATA;
8629  }
8630 
8631  SCIP_CALL( SCIPeventhdlrCreate(&eventhdlr, name, desc,
8632  NULL, NULL, NULL, NULL, NULL, NULL, NULL, eventexec,
8633  eventhdlrdata) );
8634  SCIP_CALL( SCIPsetIncludeEventhdlr(scip->set, eventhdlr) );
8635 
8636  if( eventhdlrptr != NULL )
8637  *eventhdlrptr = eventhdlr;
8638 
8639  return SCIP_OKAY;
8640 }
8641 
8642 /** sets copy callback of the event handler */
8644  SCIP* scip, /**< scip instance */
8645  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
8646  SCIP_DECL_EVENTCOPY ((*eventcopy)) /**< copy callback of the event handler */
8647  )
8648 {
8649  assert(scip != NULL);
8650  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8651 
8652  SCIPeventhdlrSetCopy(eventhdlr, eventcopy);
8653  return SCIP_OKAY;
8654 }
8655 
8656 /** sets deinitialization callback of the event handler */
8658  SCIP* scip, /**< scip instance */
8659  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
8660  SCIP_DECL_EVENTFREE ((*eventfree)) /**< deinitialization callback of the event handler */
8661  )
8662 {
8663  assert(scip != NULL);
8664  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8665 
8666  SCIPeventhdlrSetFree(eventhdlr, eventfree);
8667  return SCIP_OKAY;
8668 }
8669 
8670 /** sets initialization callback of the event handler */
8672  SCIP* scip, /**< scip instance */
8673  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
8674  SCIP_DECL_EVENTINIT ((*eventinit)) /**< initialize event handler */
8675  )
8676 {
8677  assert(scip != NULL);
8678  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8679 
8680  SCIPeventhdlrSetInit(eventhdlr, eventinit);
8681  return SCIP_OKAY;
8682 }
8683 
8684 /** sets deinitialization callback of the event handler */
8686  SCIP* scip, /**< scip instance */
8687  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
8688  SCIP_DECL_EVENTEXIT ((*eventexit)) /**< deinitialize event handler */
8689  )
8690 {
8691  assert(scip != NULL);
8692  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8693 
8694  SCIPeventhdlrSetExit(eventhdlr, eventexit);
8695  return SCIP_OKAY;
8696 }
8697 
8698 /** sets solving process initialization callback of the event handler */
8700  SCIP* scip, /**< scip instance */
8701  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
8702  SCIP_DECL_EVENTINITSOL((*eventinitsol)) /**< solving process initialization callback of event handler */
8703  )
8704 {
8705  assert(scip != NULL);
8706  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8707 
8708  SCIPeventhdlrSetInitsol(eventhdlr, eventinitsol);
8709  return SCIP_OKAY;
8710 }
8711 
8712 /** sets solving process deinitialization callback of the event handler */
8714  SCIP* scip, /**< scip instance */
8715  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
8716  SCIP_DECL_EVENTEXITSOL((*eventexitsol)) /**< solving process deinitialization callback of event handler */
8717  )
8718 {
8719  assert(scip != NULL);
8720  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8721 
8722  SCIPeventhdlrSetExitsol(eventhdlr, eventexitsol);
8723  return SCIP_OKAY;
8724 }
8725 
8726 /** sets callback of the event handler to free specific event data */
8728  SCIP* scip, /**< scip instance */
8729  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
8730  SCIP_DECL_EVENTDELETE ((*eventdelete)) /**< free specific event data */
8731  )
8732 {
8733  assert(scip != NULL);
8734  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrDelete", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8735 
8736  SCIPeventhdlrSetDelete(eventhdlr, eventdelete);
8737  return SCIP_OKAY;
8738 }
8739 
8740 /** returns the event handler of the given name, or NULL if not existing */
8742  SCIP* scip, /**< SCIP data structure */
8743  const char* name /**< name of event handler */
8744  )
8745 {
8746  assert(scip != NULL);
8747  assert(scip->set != NULL);
8748  assert(name != NULL);
8749 
8750  return SCIPsetFindEventhdlr(scip->set, name);
8751 }
8752 
8753 /** returns the array of currently available event handlers */
8755  SCIP* scip /**< SCIP data structure */
8756  )
8757 {
8758  assert(scip != NULL);
8759  assert(scip->set != NULL);
8760 
8761  return scip->set->eventhdlrs;
8762 }
8763 
8764 /** returns the number of currently available event handlers */
8766  SCIP* scip /**< SCIP data structure */
8767  )
8768 {
8769  assert(scip != NULL);
8770  assert(scip->set != NULL);
8771 
8772  return scip->set->neventhdlrs;
8773 }
8774 
8775 /** creates a node selector and includes it in SCIP.
8776  *
8777  * @note method has all node selector callbacks as arguments and is thus changed every time a new
8778  * callback is added in future releases; consider using SCIPincludeNodeselBasic() and setter functions
8779  * if you seek for a method which is less likely to change in future releases
8780  */
8782  SCIP* scip, /**< SCIP data structure */
8783  const char* name, /**< name of node selector */
8784  const char* desc, /**< description of node selector */
8785  int stdpriority, /**< priority of the node selector in standard mode */
8786  int memsavepriority, /**< priority of the node selector in memory saving mode */
8787  SCIP_DECL_NODESELCOPY ((*nodeselcopy)), /**< copy method of node selector or NULL if you don't want to copy your plugin into sub-SCIPs */
8788  SCIP_DECL_NODESELFREE ((*nodeselfree)), /**< destructor of node selector */
8789  SCIP_DECL_NODESELINIT ((*nodeselinit)), /**< initialize node selector */
8790  SCIP_DECL_NODESELEXIT ((*nodeselexit)), /**< deinitialize node selector */
8791  SCIP_DECL_NODESELINITSOL((*nodeselinitsol)),/**< solving process initialization method of node selector */
8792  SCIP_DECL_NODESELEXITSOL((*nodeselexitsol)),/**< solving process deinitialization method of node selector */
8793  SCIP_DECL_NODESELSELECT((*nodeselselect)),/**< node selection method */
8794  SCIP_DECL_NODESELCOMP ((*nodeselcomp)), /**< node comparison method */
8795  SCIP_NODESELDATA* nodeseldata /**< node selector data */
8796  )
8797 {
8798  SCIP_NODESEL* nodesel;
8799 
8800  SCIP_CALL( checkStage(scip, "SCIPincludeNodesel", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8801 
8802  /* check whether node selector is already present */
8803  if( SCIPfindNodesel(scip, name) != NULL )
8804  {
8805  SCIPerrorMessage("node selector <%s> already included.\n", name);
8806  return SCIP_INVALIDDATA;
8807  }
8808 
8809  SCIP_CALL( SCIPnodeselCreate(&nodesel, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, stdpriority, memsavepriority,
8810  nodeselcopy,
8811  nodeselfree, nodeselinit, nodeselexit, nodeselinitsol, nodeselexitsol,
8812  nodeselselect, nodeselcomp, nodeseldata) );
8813  SCIP_CALL( SCIPsetIncludeNodesel(scip->set, nodesel) );
8814 
8815  return SCIP_OKAY;
8816 }
8817 
8818 /** Creates a node selector and includes it in SCIP with its most fundamental callbacks. All non-fundamental
8819  * (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL.
8820  * Optional callbacks can be set via specific setter functions, see SCIPsetNodeselCopy(), SCIPsetNodeselFree(),
8821  * SCIPsetNodeselInit(), SCIPsetNodeselExit(), SCIPsetNodeselInitsol(), and SCIPsetNodeselExitsol()
8822  *
8823  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeNodesel() instead
8824  */
8826  SCIP* scip, /**< SCIP data structure */
8827  SCIP_NODESEL** nodesel, /**< reference to a node selector, or NULL */
8828  const char* name, /**< name of node selector */
8829  const char* desc, /**< description of node selector */
8830  int stdpriority, /**< priority of the node selector in standard mode */
8831  int memsavepriority, /**< priority of the node selector in memory saving mode */
8832  SCIP_DECL_NODESELSELECT((*nodeselselect)),/**< node selection method */
8833  SCIP_DECL_NODESELCOMP ((*nodeselcomp)), /**< node comparison method */
8834  SCIP_NODESELDATA* nodeseldata /**< node selector data */
8835  )
8836 {
8837  SCIP_NODESEL* nodeselptr;
8838 
8839  SCIP_CALL( checkStage(scip, "SCIPincludeNodeselBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8840 
8841  /* check whether node selector is already present */
8842  if( SCIPfindNodesel(scip, name) != NULL )
8843  {
8844  SCIPerrorMessage("node selector <%s> already included.\n", name);
8845  return SCIP_INVALIDDATA;
8846  }
8847 
8848  SCIP_CALL( SCIPnodeselCreate(&nodeselptr, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, stdpriority, memsavepriority,
8849  NULL,
8850  NULL, NULL, NULL, NULL, NULL,
8851  nodeselselect, nodeselcomp, nodeseldata) );
8852  SCIP_CALL( SCIPsetIncludeNodesel(scip->set, nodeselptr) );
8853 
8854  if( nodesel != NULL )
8855  *nodesel = nodeselptr;
8856 
8857  return SCIP_OKAY;
8858 }
8859 
8860 /** sets copy method of node selector */
8862  SCIP* scip, /**< SCIP data structure */
8863  SCIP_NODESEL* nodesel, /**< node selector */
8864  SCIP_DECL_NODESELCOPY ((*nodeselcopy)) /**< copy method of node selector or NULL if you don't want to copy your plugin into sub-SCIPs */
8865  )
8866 {
8867  SCIP_CALL( checkStage(scip, "SCIPsetNodeselCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8868 
8869  assert(nodesel != NULL);
8870 
8871  SCIPnodeselSetCopy(nodesel, nodeselcopy);
8872 
8873  return SCIP_OKAY;
8874 }
8875 
8876 /** sets destructor method of node selector */
8878  SCIP* scip, /**< SCIP data structure */
8879  SCIP_NODESEL* nodesel, /**< node selector */
8880  SCIP_DECL_NODESELFREE ((*nodeselfree)) /**< destructor of node selector */
8881  )
8882 {
8883  SCIP_CALL( checkStage(scip, "SCIPsetNodeselFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8884 
8885  assert(nodesel != NULL);
8886 
8887  SCIPnodeselSetFree(nodesel, nodeselfree);
8888 
8889  return SCIP_OKAY;
8890 }
8891 
8892 /** sets initialization method of node selector */
8894  SCIP* scip, /**< SCIP data structure */
8895  SCIP_NODESEL* nodesel, /**< node selector */
8896  SCIP_DECL_NODESELINIT ((*nodeselinit)) /**< initialize node selector */
8897  )
8898 {
8899  SCIP_CALL( checkStage(scip, "SCIPsetNodeselInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8900 
8901  assert(nodesel != NULL);
8902 
8903  SCIPnodeselSetInit(nodesel, nodeselinit);
8904 
8905  return SCIP_OKAY;
8906 }
8907 
8908 /** sets deinitialization method of node selector */
8910  SCIP* scip, /**< SCIP data structure */
8911  SCIP_NODESEL* nodesel, /**< node selector */
8912  SCIP_DECL_NODESELEXIT ((*nodeselexit)) /**< deinitialize node selector */
8913  )
8914 {
8915  SCIP_CALL( checkStage(scip, "SCIPsetNodeselExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8916 
8917  assert(nodesel != NULL);
8918 
8919  SCIPnodeselSetExit(nodesel, nodeselexit);
8920 
8921  return SCIP_OKAY;
8922 }
8923 
8924 /** sets solving process initialization method of node selector */
8926  SCIP* scip, /**< SCIP data structure */
8927  SCIP_NODESEL* nodesel, /**< node selector */
8928  SCIP_DECL_NODESELINITSOL ((*nodeselinitsol))/**< solving process initialization method of node selector */
8929  )
8930 {
8931  SCIP_CALL( checkStage(scip, "SCIPsetNodeselInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8932 
8933  assert(nodesel != NULL);
8934 
8935  SCIPnodeselSetInitsol(nodesel, nodeselinitsol);
8936 
8937  return SCIP_OKAY;
8938 }
8939 
8940 /** sets solving process deinitialization method of node selector */
8942  SCIP* scip, /**< SCIP data structure */
8943  SCIP_NODESEL* nodesel, /**< node selector */
8944  SCIP_DECL_NODESELEXITSOL ((*nodeselexitsol))/**< solving process deinitialization method of node selector */
8945  )
8946 {
8947  SCIP_CALL( checkStage(scip, "SCIPsetNodeselExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8948 
8949  assert(nodesel != NULL);
8950 
8951  SCIPnodeselSetExitsol(nodesel, nodeselexitsol);
8952 
8953  return SCIP_OKAY;
8954 }
8955 
8956 /** returns the node selector of the given name, or NULL if not existing */
8958  SCIP* scip, /**< SCIP data structure */
8959  const char* name /**< name of node selector */
8960  )
8961 {
8962  assert(scip != NULL);
8963  assert(scip->set != NULL);
8964  assert(name != NULL);
8965 
8966  return SCIPsetFindNodesel(scip->set, name);
8967 }
8968 
8969 /** returns the array of currently available node selectors */
8971  SCIP* scip /**< SCIP data structure */
8972  )
8973 {
8974  assert(scip != NULL);
8975  assert(scip->set != NULL);
8976 
8977  return scip->set->nodesels;
8978 }
8979 
8980 /** returns the number of currently available node selectors */
8982  SCIP* scip /**< SCIP data structure */
8983  )
8984 {
8985  assert(scip != NULL);
8986  assert(scip->set != NULL);
8987 
8988  return scip->set->nnodesels;
8989 }
8990 
8991 /** sets the priority of a node selector in standard mode */
8993  SCIP* scip, /**< SCIP data structure */
8994  SCIP_NODESEL* nodesel, /**< node selector */
8995  int priority /**< new standard priority of the node selector */
8996  )
8997 {
8998  assert(scip != NULL);
8999  assert(scip->set != NULL);
9000 
9001  SCIPnodeselSetStdPriority(nodesel, scip->set, priority);
9002 
9003  return SCIP_OKAY;
9004 }
9005 
9006 /** sets the priority of a node selector in memory saving mode */
9008  SCIP* scip, /**< SCIP data structure */
9009  SCIP_NODESEL* nodesel, /**< node selector */
9010  int priority /**< new memory saving priority of the node selector */
9011  )
9012 {
9013  assert(scip != NULL);
9014  assert(scip->set != NULL);
9015 
9016  SCIPnodeselSetMemsavePriority(nodesel, scip->set, priority);
9017 
9018  return SCIP_OKAY;
9019 }
9020 
9021 /** returns the currently used node selector */
9023  SCIP* scip /**< SCIP data structure */
9024  )
9025 {
9026  assert(scip != NULL);
9027  assert(scip->set != NULL);
9028 
9029  return SCIPsetGetNodesel(scip->set, scip->stat);
9030 }
9031 
9032 /** creates a branching rule and includes it in SCIP
9033  *
9034  * @note method has all branching rule callbacks as arguments and is thus changed every time a new
9035  * callback is added in future releases; consider using SCIPincludeBranchruleBasic() and setter functions
9036  * if you seek for a method which is less likely to change in future releases
9037  */
9039  SCIP* scip, /**< SCIP data structure */
9040  const char* name, /**< name of branching rule */
9041  const char* desc, /**< description of branching rule */
9042  int priority, /**< priority of the branching rule */
9043  int maxdepth, /**< maximal depth level, up to which this branching rule should be used (or -1) */
9044  SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound
9045  * compared to best node's dual bound for applying branching rule
9046  * (0.0: only on current best node, 1.0: on all nodes) */
9047  SCIP_DECL_BRANCHCOPY ((*branchcopy)), /**< copy method of branching rule or NULL if you don't want to copy your plugin into sub-SCIPs */
9048  SCIP_DECL_BRANCHFREE ((*branchfree)), /**< destructor of branching rule */
9049  SCIP_DECL_BRANCHINIT ((*branchinit)), /**< initialize branching rule */
9050  SCIP_DECL_BRANCHEXIT ((*branchexit)), /**< deinitialize branching rule */
9051  SCIP_DECL_BRANCHINITSOL((*branchinitsol)),/**< solving process initialization method of branching rule */
9052  SCIP_DECL_BRANCHEXITSOL((*branchexitsol)),/**< solving process deinitialization method of branching rule */
9053  SCIP_DECL_BRANCHEXECLP((*branchexeclp)), /**< branching execution method for fractional LP solutions */
9054  SCIP_DECL_BRANCHEXECEXT((*branchexecext)),/**< branching execution method for external candidates */
9055  SCIP_DECL_BRANCHEXECPS((*branchexecps)), /**< branching execution method for not completely fixed pseudo solutions */
9056  SCIP_BRANCHRULEDATA* branchruledata /**< branching rule data */
9057  )
9058 {
9059  SCIP_BRANCHRULE* branchrule;
9060 
9061  SCIP_CALL( checkStage(scip, "SCIPincludeBranchrule", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9062 
9063  /* check whether branching rule is already present */
9064  if( SCIPfindBranchrule(scip, name) != NULL )
9065  {
9066  SCIPerrorMessage("branching rule <%s> already included.\n", name);
9067  return SCIP_INVALIDDATA;
9068  }
9069 
9070  SCIP_CALL( SCIPbranchruleCreate(&branchrule, scip->set, scip->messagehdlr, scip->mem->setmem,
9071  name, desc, priority, maxdepth,
9072  maxbounddist, branchcopy, branchfree, branchinit, branchexit, branchinitsol, branchexitsol,
9073  branchexeclp, branchexecext, branchexecps, branchruledata) );
9074  SCIP_CALL( SCIPsetIncludeBranchrule(scip->set, branchrule) );
9075 
9076  return SCIP_OKAY;
9077 }
9078 
9079 /** creates a branching rule and includes it in SCIP. All non-fundamental (or optional) callbacks will be set to NULL.
9080  * Optional callbacks can be set via specific setter functions, see SCIPsetBranchruleInit(), SCIPsetBranchruleExit(),
9081  * SCIPsetBranchruleCopy(), SCIPsetBranchruleFree(), SCIPsetBranchruleInitsol(), SCIPsetBranchruleExitsol(),
9082  * SCIPsetBranchruleExecLp(), SCIPsetBranchruleExecExt(), and SCIPsetBranchruleExecPs().
9083  *
9084  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeBranchrule() instead
9085  */
9087  SCIP* scip, /**< SCIP data structure */
9088  SCIP_BRANCHRULE** branchruleptr, /**< pointer to branching rule, or NULL */
9089  const char* name, /**< name of branching rule */
9090  const char* desc, /**< description of branching rule */
9091  int priority, /**< priority of the branching rule */
9092  int maxdepth, /**< maximal depth level, up to which this branching rule should be used (or -1) */
9093  SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound
9094  * compared to best node's dual bound for applying branching rule
9095  * (0.0: only on current best node, 1.0: on all nodes) */
9096  SCIP_BRANCHRULEDATA* branchruledata /**< branching rule data */
9097  )
9098 {
9099  SCIP_BRANCHRULE* branchrule;
9100 
9101  SCIP_CALL( checkStage(scip, "SCIPincludeBranchruleBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9102 
9103  /* check whether branching rule is already present */
9104  if( SCIPfindBranchrule(scip, name) != NULL )
9105  {
9106  SCIPerrorMessage("branching rule <%s> already included.\n", name);
9107  return SCIP_INVALIDDATA;
9108  }
9109 
9110  SCIP_CALL( SCIPbranchruleCreate(&branchrule, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority, maxdepth,
9111  maxbounddist, NULL, NULL, NULL, NULL, NULL, NULL,
9112  NULL, NULL, NULL, branchruledata) );
9113 
9114  SCIP_CALL( SCIPsetIncludeBranchrule(scip->set, branchrule) );
9115 
9116  if( branchruleptr != NULL )
9117  *branchruleptr = branchrule;
9118 
9119  return SCIP_OKAY;
9120 }
9121 
9122 /** sets copy method of branching rule */
9124  SCIP* scip, /**< SCIP data structure */
9125  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9126  SCIP_DECL_BRANCHCOPY ((*branchcopy)) /**< copy method of branching rule or NULL if you don't want to copy your plugin into sub-SCIPs */
9127  )
9128 {
9129  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9130 
9131  assert(branchrule != NULL);
9132 
9133  SCIPbranchruleSetCopy(branchrule, branchcopy);
9134 
9135  return SCIP_OKAY;
9136 }
9137 
9138 /** sets destructor method of branching rule */
9140  SCIP* scip, /**< SCIP data structure */
9141  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9142  SCIP_DECL_BRANCHFREE ((*branchfree)) /**< destructor of branching rule */
9143  )
9144 {
9145  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9146 
9147  assert(branchrule != NULL);
9148 
9149  SCIPbranchruleSetFree(branchrule, branchfree);
9150 
9151  return SCIP_OKAY;
9152 }
9153 
9154 /** sets initialization method of branching rule */
9156  SCIP* scip, /**< SCIP data structure */
9157  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9158  SCIP_DECL_BRANCHINIT ((*branchinit)) /**< initialize branching rule */
9159  )
9160 {
9161  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9162 
9163  assert(branchrule != NULL);
9164 
9165  SCIPbranchruleSetInit(branchrule, branchinit);
9166 
9167  return SCIP_OKAY;
9168 }
9169 
9170 /** sets deinitialization method of branching rule */
9172  SCIP* scip, /**< SCIP data structure */
9173  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9174  SCIP_DECL_BRANCHEXIT ((*branchexit)) /**< deinitialize branching rule */
9175  )
9176 {
9177  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9178 
9179  assert(branchrule != NULL);
9180 
9181  SCIPbranchruleSetExit(branchrule, branchexit);
9182 
9183  return SCIP_OKAY;
9184 }
9185 
9186 /** sets solving process initialization method of branching rule */
9188  SCIP* scip, /**< SCIP data structure */
9189  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9190  SCIP_DECL_BRANCHINITSOL((*branchinitsol)) /**< solving process initialization method of branching rule */
9191  )
9192 {
9193  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9194 
9195  assert(branchrule != NULL);
9196 
9197  SCIPbranchruleSetInitsol(branchrule, branchinitsol);
9198 
9199  return SCIP_OKAY;
9200 }
9201 
9202 /** sets solving process deinitialization method of branching rule */
9204  SCIP* scip, /**< SCIP data structure */
9205  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9206  SCIP_DECL_BRANCHEXITSOL((*branchexitsol)) /**< solving process deinitialization method of branching rule */
9207  )
9208 {
9209  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9210 
9211  assert(branchrule != NULL);
9212 
9213  SCIPbranchruleSetExitsol(branchrule, branchexitsol);
9214 
9215  return SCIP_OKAY;
9216 }
9217 
9218 
9219 
9220 /** sets branching execution method for fractional LP solutions */
9222  SCIP* scip, /**< SCIP data structure */
9223  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9224  SCIP_DECL_BRANCHEXECLP((*branchexeclp)) /**< branching execution method for fractional LP solutions */
9225  )
9226 {
9227  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleExecLp", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9228 
9229  assert(branchrule != NULL);
9230 
9231  SCIPbranchruleSetExecLp(branchrule, branchexeclp);
9232 
9233  return SCIP_OKAY;
9234 }
9235 
9236 /** sets branching execution method for external candidates */
9238  SCIP* scip, /**< SCIP data structure */
9239  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9240  SCIP_DECL_BRANCHEXECEXT((*branchexecext)) /**< branching execution method for external candidates */
9241  )
9242 {
9243  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleExecExt", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9244 
9245  assert(branchrule != NULL);
9246 
9247  SCIPbranchruleSetExecExt(branchrule, branchexecext);
9248 
9249  return SCIP_OKAY;
9250 }
9251 
9252 /** sets branching execution method for not completely fixed pseudo solutions */
9254  SCIP* scip, /**< SCIP data structure */
9255  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9256  SCIP_DECL_BRANCHEXECPS((*branchexecps)) /**< branching execution method for not completely fixed pseudo solutions */
9257  )
9258 {
9259  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleExecPs", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9260 
9261  assert(branchrule != NULL);
9262 
9263  SCIPbranchruleSetExecPs(branchrule, branchexecps);
9264 
9265  return SCIP_OKAY;
9266 }
9267 
9268 /** returns the branching rule of the given name, or NULL if not existing */
9270  SCIP* scip, /**< SCIP data structure */
9271  const char* name /**< name of branching rule */
9272  )
9273 {
9274  assert(scip != NULL);
9275  assert(scip->set != NULL);
9276  assert(name != NULL);
9277 
9278  SCIPsetSortBranchrules(scip->set);
9279 
9280  return SCIPsetFindBranchrule(scip->set, name);
9281 }
9282 
9283 /** returns the array of currently available branching rules */
9285  SCIP* scip /**< SCIP data structure */
9286  )
9287 {
9288  assert(scip != NULL);
9289  assert(scip->set != NULL);
9290 
9291  return scip->set->branchrules;
9292 }
9293 
9294 /** returns the number of currently available branching rules */
9296  SCIP* scip /**< SCIP data structure */
9297  )
9298 {
9299  assert(scip != NULL);
9300  assert(scip->set != NULL);
9301 
9302  return scip->set->nbranchrules;
9303 }
9304 
9305 /** sets the priority of a branching rule */
9307  SCIP* scip, /**< SCIP data structure */
9308  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9309  int priority /**< new priority of the branching rule */
9310  )
9311 {
9312  assert(scip != NULL);
9313  assert(scip->set != NULL);
9314 
9315  SCIPbranchruleSetPriority(branchrule, scip->set, priority);
9316 
9317  return SCIP_OKAY;
9318 }
9319 
9320 /** sets maximal depth level, up to which this branching rule should be used (-1 for no limit) */
9322  SCIP* scip, /**< SCIP data structure */
9323  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9324  int maxdepth /**< new maxdepth of the branching rule */
9325  )
9326 {
9327  assert(scip != NULL);
9328  assert(scip->set != NULL);
9329 
9330  SCIPbranchruleSetMaxdepth(branchrule, maxdepth);
9331 
9332  return SCIP_OKAY;
9333 }
9334 
9335 /** sets maximal relative distance from current node's dual bound to primal bound for applying branching rule */
9337  SCIP* scip, /**< SCIP data structure */
9338  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9339  SCIP_Real maxbounddist /**< new maxbounddist of the branching rule */
9340  )
9341 {
9342  assert(scip != NULL);
9343  assert(scip->set != NULL);
9344 
9345  SCIPbranchruleSetMaxbounddist(branchrule, maxbounddist);
9346 
9347  return SCIP_OKAY;
9348 }
9349 
9350 /** creates a display column and includes it in SCIP */
9352  SCIP* scip, /**< SCIP data structure */
9353  const char* name, /**< name of display column */
9354  const char* desc, /**< description of display column */
9355  const char* header, /**< head line of display column */
9356  SCIP_DISPSTATUS dispstatus, /**< display activation status of display column */
9357  SCIP_DECL_DISPCOPY ((*dispcopy)), /**< copy method of display column or NULL if you don't want to copy your plugin into sub-SCIPs */
9358  SCIP_DECL_DISPFREE ((*dispfree)), /**< destructor of display column */
9359  SCIP_DECL_DISPINIT ((*dispinit)), /**< initialize display column */
9360  SCIP_DECL_DISPEXIT ((*dispexit)), /**< deinitialize display column */
9361  SCIP_DECL_DISPINITSOL ((*dispinitsol)), /**< solving process initialization method of display column */
9362  SCIP_DECL_DISPEXITSOL ((*dispexitsol)), /**< solving process deinitialization method of display column */
9363  SCIP_DECL_DISPOUTPUT ((*dispoutput)), /**< output method */
9364  SCIP_DISPDATA* dispdata, /**< display column data */
9365  int width, /**< width of display column (no. of chars used) */
9366  int priority, /**< priority of display column */
9367  int position, /**< relative position of display column */
9368  SCIP_Bool stripline /**< should the column be separated with a line from its right neighbor? */
9369  )
9370 {
9371  SCIP_DISP* disp;
9372 
9373  SCIP_CALL( checkStage(scip, "SCIPincludeDisp", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9374 
9375  /* check whether display column is already present */
9376  if( SCIPfindDisp(scip, name) != NULL )
9377  {
9378  SCIPerrorMessage("display column <%s> already included.\n", name);
9379  return SCIP_INVALIDDATA;
9380  }
9381 
9382  SCIP_CALL( SCIPdispCreate(&disp, scip->set, scip->messagehdlr, scip->mem->setmem,
9383  name, desc, header, dispstatus,
9384  dispcopy,
9385  dispfree, dispinit, dispexit, dispinitsol, dispexitsol, dispoutput, dispdata,
9386  width, priority, position, stripline) );
9387  SCIP_CALL( SCIPsetIncludeDisp(scip->set, disp) );
9388 
9389  return SCIP_OKAY;
9390 }
9391 
9392 /** returns the display column of the given name, or NULL if not existing */
9394  SCIP* scip, /**< SCIP data structure */
9395  const char* name /**< name of display column */
9396  )
9397 {
9398  assert(scip != NULL);
9399  assert(scip->set != NULL);
9400  assert(name != NULL);
9401 
9402  return SCIPsetFindDisp(scip->set, name);
9403 }
9404 
9405 /** returns the array of currently available display columns */
9407  SCIP* scip /**< SCIP data structure */
9408  )
9409 {
9410  assert(scip != NULL);
9411  assert(scip->set != NULL);
9412 
9413  return scip->set->disps;
9414 }
9415 
9416 /** returns the number of currently available display columns */
9418  SCIP* scip /**< SCIP data structure */
9419  )
9420 {
9421  assert(scip != NULL);
9422  assert(scip->set != NULL);
9423 
9424  return scip->set->ndisps;
9425 }
9426 
9427 /** automatically selects display columns for being shown w.r.t. the display width parameter */
9429  SCIP* scip /**< SCIP data structure */
9430  )
9431 {
9432  assert(scip != NULL);
9433  assert(scip->set != NULL);
9434 
9436 
9437  return SCIP_OKAY;
9438 }
9439 
9440 /** changes the display column mode */
9442  SCIP_DISP* disp, /**< display column */
9443  SCIP_DISPMODE mode /**< the display column mode */
9444  )
9445 {
9446  assert(disp != NULL);
9447 
9448  SCIPdispChgMode(disp, mode);
9449 }
9450 
9451 /** creates a statistics table and includes it in SCIP */
9453  SCIP* scip, /**< SCIP data structure */
9454  const char* name, /**< name of statistics table */
9455  const char* desc, /**< description of statistics table */
9456  SCIP_Bool active, /**< should the table be activated by default? */
9457  SCIP_DECL_TABLECOPY ((*tablecopy)), /**< copy method of statistics table or NULL if you don't want to copy your plugin into sub-SCIPs */
9458  SCIP_DECL_TABLEFREE ((*tablefree)), /**< destructor of statistics table */
9459  SCIP_DECL_TABLEINIT ((*tableinit)), /**< initialize statistics table */
9460  SCIP_DECL_TABLEEXIT ((*tableexit)), /**< deinitialize statistics table */
9461  SCIP_DECL_TABLEINITSOL ((*tableinitsol)), /**< solving process initialization method of statistics table */
9462  SCIP_DECL_TABLEEXITSOL ((*tableexitsol)), /**< solving process deinitialization method of statistics table */
9463  SCIP_DECL_TABLEOUTPUT ((*tableoutput)), /**< output method */
9464  SCIP_TABLEDATA* tabledata, /**< statistics table data */
9465  int position, /**< position of statistics table */
9466  SCIP_STAGE earlieststage /**< output of the statistics table is only printed from this stage onwards */
9467  )
9468 {
9469  SCIP_TABLE* table;
9470 
9471  SCIP_CALL( checkStage(scip, "SCIPincludeTable", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9472 
9473  /* check whether statistics table is already present */
9474  if( SCIPfindTable(scip, name) != NULL )
9475  {
9476  SCIPerrorMessage("statistics table <%s> already included.\n", name);
9477  return SCIP_INVALIDDATA;
9478  }
9479 
9480  SCIP_CALL( SCIPtableCreate(&table, scip->set, scip->messagehdlr, scip->mem->setmem,
9481  name, desc, active, tablecopy,
9482  tablefree, tableinit, tableexit, tableinitsol, tableexitsol, tableoutput, tabledata,
9483  position, earlieststage) );
9484  SCIP_CALL( SCIPsetIncludeTable(scip->set, table) );
9485 
9486  return SCIP_OKAY;
9487 }
9488 
9489 /** returns the statistics table of the given name, or NULL if not existing */
9491  SCIP* scip, /**< SCIP data structure */
9492  const char* name /**< name of statistics table */
9493  )
9494 {
9495  assert(scip != NULL);
9496  assert(scip->set != NULL);
9497  assert(name != NULL);
9498 
9499  return SCIPsetFindTable(scip->set, name);
9500 }
9501 
9502 /** returns the array of currently available statistics tables */
9504  SCIP* scip /**< SCIP data structure */
9505  )
9506 {
9507  assert(scip != NULL);
9508  assert(scip->set != NULL);
9509 
9510  return scip->set->tables;
9511 }
9512 
9513 /** returns the number of currently available statistics tables */
9515  SCIP* scip /**< SCIP data structure */
9516  )
9517 {
9518  assert(scip != NULL);
9519  assert(scip->set != NULL);
9520 
9521  return scip->set->ntables;
9522 }
9523 
9524 /** method to call, when the priority of an NLPI was changed */
9525 static
9526 SCIP_DECL_PARAMCHGD(paramChgdNlpiPriority)
9527 { /*lint --e{715}*/
9528  SCIP_PARAMDATA* paramdata;
9529 
9530  paramdata = SCIPparamGetData(param);
9531  assert(paramdata != NULL);
9532 
9533  /* use SCIPsetSetPriorityNlpi() to mark the nlpis unsorted */
9534  SCIP_CALL( SCIPsetNlpiPriority(scip, (SCIP_NLPI*)paramdata, SCIPparamGetInt(param)) );
9535 
9536  return SCIP_OKAY;
9537 }
9538 
9539 /** includes an NLPI in SCIP */
9541  SCIP* scip, /**< SCIP data structure */
9542  SCIP_NLPI* nlpi /**< NLPI data structure */
9543  )
9544 {
9545  char paramname[SCIP_MAXSTRLEN];
9546  char paramdesc[SCIP_MAXSTRLEN];
9547 
9548  assert(scip != NULL);
9549  assert(nlpi != NULL);
9550 
9551  SCIP_CALL( checkStage(scip, "SCIPincludeNlpi", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9552 
9553  /* check whether NLPI is already present */
9554  if( SCIPfindNlpi(scip, SCIPnlpiGetName(nlpi)) != NULL )
9555  {
9556  SCIPerrorMessage("NLPI <%s> already included.\n", SCIPnlpiGetName(nlpi));
9557  return SCIP_INVALIDDATA;
9558  }
9559 
9560  SCIP_CALL( SCIPsetIncludeNlpi(scip->set, nlpi) );
9561 
9562  /* add parameters */
9563  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "nlpi/%s/priority", SCIPnlpiGetName(nlpi));
9564  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "priority of NLPI <%s>", SCIPnlpiGetName(nlpi));
9565  SCIP_CALL( SCIPaddIntParam(scip, paramname, paramdesc,
9566  NULL, FALSE, SCIPnlpiGetPriority(nlpi), INT_MIN/4, INT_MAX/4,
9567  paramChgdNlpiPriority, (SCIP_PARAMDATA*)nlpi) ); /*lint !e740*/
9568 
9569  /* pass message handler (may be NULL) */
9571 
9572  return SCIP_OKAY;
9573 }
9574 
9575 /** returns the NLPI of the given name, or NULL if not existing */
9577  SCIP* scip, /**< SCIP data structure */
9578  const char* name /**< name of NLPI */
9579  )
9580 {
9581  assert(scip != NULL);
9582  assert(scip->set != NULL);
9583  assert(name != NULL);
9584 
9585  return SCIPsetFindNlpi(scip->set, name);
9586 }
9587 
9588 /** returns the array of currently available NLPIs (sorted by priority) */
9590  SCIP* scip /**< SCIP data structure */
9591  )
9592 {
9593  assert(scip != NULL);
9594  assert(scip->set != NULL);
9595 
9596  SCIPsetSortNlpis(scip->set);
9597 
9598  return scip->set->nlpis;
9599 }
9600 
9601 /** returns the number of currently available NLPIs */
9603  SCIP* scip /**< SCIP data structure */
9604  )
9605 {
9606  assert(scip != NULL);
9607  assert(scip->set != NULL);
9608 
9609  return scip->set->nnlpis;
9610 }
9611 
9612 /** sets the priority of an NLPI */
9614  SCIP* scip, /**< SCIP data structure */
9615  SCIP_NLPI* nlpi, /**< NLPI */
9616  int priority /**< new priority of the NLPI */
9617  )
9618 {
9619  assert(scip != NULL);
9620  assert(scip->set != NULL);
9621 
9622  SCIPsetSetPriorityNlpi(scip->set, nlpi, priority);
9623 
9624  return SCIP_OKAY;
9625 }
9626 
9627 /** includes information about an external code linked into the SCIP library */
9629  SCIP* scip, /**< SCIP data structure */
9630  const char* name, /**< name of external code */
9631  const char* description /**< description of external code, or NULL */
9632  )
9633 {
9634  assert(scip != NULL);
9635  assert(name != NULL);
9636 
9637  SCIP_CALL( checkStage(scip, "SCIPincludeExternalCodeInformation", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9638 
9639  SCIP_CALL( SCIPsetIncludeExternalCode(scip->set, name, description) );
9640 
9641  return SCIP_OKAY;
9642 }
9643 
9644 /** returns an array of names of currently included external codes */
9646  SCIP* scip /**< SCIP data structure */
9647  )
9648 {
9649  assert(scip != NULL);
9650  assert(scip->set != NULL);
9651 
9652  return scip->set->extcodenames;
9653 }
9654 
9655 /** returns an array of the descriptions of currently included external codes
9656  *
9657  * @note some descriptions may be NULL
9658  */
9660  SCIP* scip /**< SCIP data structure */
9661  )
9662 {
9663  assert(scip != NULL);
9664  assert(scip->set != NULL);
9665 
9666  return scip->set->extcodedescs;
9667 }
9668 
9669 /** returns the number of currently included information on external codes */
9671  SCIP* scip /**< SCIP data structure */
9672  )
9673 {
9674  assert(scip != NULL);
9675  assert(scip->set != NULL);
9676 
9677  return scip->set->nextcodes;
9678 }
9679 
9680 /** prints information on external codes to a file stream via the message handler system
9681  *
9682  * @note If the message handler is set to a NULL pointer nothing will be printed
9683  */
9685  SCIP* scip, /**< SCIP data structure */
9686  FILE* file /**< output file (or NULL for standard output) */
9687  )
9688 {
9689  int i;
9690 
9691  SCIPmessageFPrintInfo(scip->messagehdlr, file, "External codes: ");
9692  if( scip->set->nextcodes == 0 )
9693  {
9694  SCIPinfoMessage(scip, file, "none\n");
9695  return;
9696  }
9697  SCIPinfoMessage(scip, file, "\n");
9698 
9699  for( i = 0; i < scip->set->nextcodes; ++i )
9700  {
9701  SCIPinfoMessage(scip, file, " %-20s %s\n", scip->set->extcodenames[i], scip->set->extcodedescs[i] != NULL ? scip->set->extcodedescs[i] : "");
9702  }
9703 }
9704 
9705 
9706 /*
9707  * user interactive dialog methods
9708  */
9709 
9710 /** creates and includes dialog
9711  *
9712  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
9713  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9714  */
9716  SCIP* scip, /**< SCIP data structure */
9717  SCIP_DIALOG** dialog, /**< pointer to store the dialog */
9718  SCIP_DECL_DIALOGCOPY ((*dialogcopy)), /**< copy method of dialog or NULL if you don't want to copy your plugin into sub-SCIPs */
9719  SCIP_DECL_DIALOGEXEC ((*dialogexec)), /**< execution method of dialog */
9720  SCIP_DECL_DIALOGDESC ((*dialogdesc)), /**< description output method of dialog, or NULL */
9721  SCIP_DECL_DIALOGFREE ((*dialogfree)), /**< destructor of dialog to free user data, or NULL */
9722  const char* name, /**< name of dialog: command name appearing in parent's dialog menu */
9723  const char* desc, /**< description of dialog used if description output method is NULL */
9724  SCIP_Bool issubmenu, /**< is the dialog a submenu? */
9725  SCIP_DIALOGDATA* dialogdata /**< user defined dialog data */
9726  )
9727 {
9728  assert(scip != NULL);
9729  assert(dialog != NULL);
9730 
9731  /* check whether display column is already present */
9732  if( dialogcopy != NULL && SCIPexistsDialog(scip, *dialog) )
9733  {
9734  SCIPerrorMessage("dialog <%s> already included.\n", name);
9735  return SCIP_INVALIDDATA;
9736  }
9737 
9738  SCIP_CALL( SCIPdialogCreate(dialog, dialogcopy, dialogexec, dialogdesc, dialogfree, name, desc, issubmenu, dialogdata) );
9739  SCIP_CALL( SCIPsetIncludeDialog(scip->set, *dialog) );
9740 
9741  return SCIP_OKAY;
9742 }
9743 
9744 /** returns if the dialog already exists
9745  *
9746  * @return TRUE is returned if the dialog exits, otherwise FALSE.
9747  */
9749  SCIP* scip, /**< SCIP data structure */
9750  SCIP_DIALOG* dialog /**< dialog */
9751  )
9752 {
9753  assert(scip != NULL);
9754 
9755  return SCIPsetExistsDialog(scip->set, dialog);
9756 }
9757 
9758 /** captures a dialog
9759  *
9760  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9761  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9762  */
9764  SCIP* scip, /**< SCIP data structure */
9765  SCIP_DIALOG* dialog /**< dialog */
9766  )
9767 {
9768  assert(scip != NULL);
9769 
9770  SCIPdialogCapture(dialog);
9771 
9772  return SCIP_OKAY;
9773 }
9774 
9775 /** releases a dialog
9776  *
9777  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9778  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9779  */
9781  SCIP* scip, /**< SCIP data structure */
9782  SCIP_DIALOG** dialog /**< pointer to the dialog */
9783  )
9784 {
9785  assert(scip != NULL);
9786 
9787  SCIP_CALL( SCIPdialogRelease(scip, dialog) );
9788 
9789  return SCIP_OKAY;
9790 }
9791 
9792 /** makes given dialog the root dialog of SCIP's interactive user shell; captures dialog and releases former root dialog
9793  *
9794  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9795  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9796  */
9798  SCIP* scip, /**< SCIP data structure */
9799  SCIP_DIALOG* dialog /**< dialog to be the root */
9800  )
9801 {
9802  assert(scip != NULL);
9803 
9804  SCIP_CALL( SCIPdialoghdlrSetRoot(scip, scip->dialoghdlr, dialog) );
9805 
9806  return SCIP_OKAY;
9807 }
9808 
9809 /** returns the root dialog of SCIP's interactive user shell
9810  *
9811  * @return the root dialog of SCIP's interactive user shell is returned.
9812  */
9814  SCIP* scip /**< SCIP data structure */
9815  )
9816 {
9817  assert(scip != NULL);
9818 
9819  return SCIPdialoghdlrGetRoot(scip->dialoghdlr);
9820 }
9821 
9822 /** adds a sub dialog to the given dialog as menu entry and captures it
9823  *
9824  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9825  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9826  */
9828  SCIP* scip, /**< SCIP data structure */
9829  SCIP_DIALOG* dialog, /**< dialog to extend, or NULL for root dialog */
9830  SCIP_DIALOG* subdialog /**< subdialog to add as menu entry in dialog */
9831  )
9832 {
9833  assert(scip != NULL);
9834 
9835  if( dialog == NULL )
9836  dialog = SCIPdialoghdlrGetRoot(scip->dialoghdlr);
9837 
9838  SCIP_CALL( SCIPdialogAddEntry(dialog, scip->set, subdialog) );
9839 
9840  return SCIP_OKAY;
9841 }
9842 
9843 /** adds a single line of input which is treated as if the user entered the command line
9844  *
9845  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9846  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9847  */
9849  SCIP* scip, /**< SCIP data structure */
9850  const char* inputline /**< input line to add */
9851  )
9852 {
9853  assert(scip != NULL);
9854 
9855  SCIP_CALL( SCIPdialoghdlrAddInputLine(scip->dialoghdlr, inputline) );
9856 
9857  return SCIP_OKAY;
9858 }
9859 
9860 /** adds a single line of input to the command history which can be accessed with the cursor keys
9861  *
9862  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9863  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9864  */
9866  SCIP* scip, /**< SCIP data structure */
9867  const char* inputline /**< input line to add */
9868  )
9869 {
9870  assert(scip != NULL);
9871 
9872  SCIP_CALL( SCIPdialoghdlrAddHistory(scip->dialoghdlr, NULL, inputline, FALSE) );
9873 
9874  return SCIP_OKAY;
9875 }
9876 
9877 /** starts interactive mode of SCIP by executing the root dialog
9878  *
9879  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9880  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9881  *
9882  * @pre This method can be called if @p scip is in one of the following stages:
9883  * - \ref SCIP_STAGE_INIT
9884  * - \ref SCIP_STAGE_FREE
9885  *
9886  * @post After calling this method \SCIP reaches one of the following stages depending on if and when the
9887  * interactive shell was closed:
9888  * - \ref SCIP_STAGE_PROBLEM if the interactive shell was closed after the problem was created
9889  * - \ref SCIP_STAGE_TRANSFORMED if the interactive shell was closed after the problem was transformed
9890  * - \ref SCIP_STAGE_PRESOLVING if the interactive shell was closed during presolving
9891  * - \ref SCIP_STAGE_PRESOLVED if the interactive shell was closed after presolve
9892  * - \ref SCIP_STAGE_SOLVING if the interactive shell was closed during the tree search
9893  * - \ref SCIP_STAGE_SOLVED if the interactive shell was closed after the problem was solved
9894  * - \ref SCIP_STAGE_FREE if the interactive shell was closed after the problem was freed
9895  *
9896  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
9897  */
9899  SCIP* scip /**< SCIP data structure */
9900  )
9901 {
9902  SCIP_CALL( checkStage(scip, "SCIPstartInteraction", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
9903 
9904  /* includes or updates the default dialog menus in SCIP */
9906 
9907  SCIP_CALL( SCIPdialoghdlrExec(scip->dialoghdlr, scip->set) );
9908 
9909  return SCIP_OKAY;
9910 }
9911 
9912 /*
9913  * global problem methods
9914  */
9915 
9916 /** creates empty problem and initializes all solving data structures (the objective sense is set to MINIMIZE)
9917  * If the problem type requires the use of variable pricers, these pricers should be added to the problem with calls
9918  * to SCIPactivatePricer(). These pricers are automatically deactivated, when the problem is freed.
9919  *
9920  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9921  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9922  *
9923  * @pre This method can be called if @p scip is in one of the following stages:
9924  * - \ref SCIP_STAGE_INIT
9925  * - \ref SCIP_STAGE_PROBLEM
9926  * - \ref SCIP_STAGE_TRANSFORMED
9927  * - \ref SCIP_STAGE_PRESOLVING
9928  * - \ref SCIP_STAGE_PRESOLVED
9929  * - \ref SCIP_STAGE_SOLVING
9930  * - \ref SCIP_STAGE_SOLVED
9931  * - \ref SCIP_STAGE_FREE
9932  *
9933  * @post After calling this method, \SCIP reaches the following stage:
9934  * - \ref SCIP_STAGE_PROBLEM
9935  */
9937  SCIP* scip, /**< SCIP data structure */
9938  const char* name, /**< problem name */
9939  SCIP_DECL_PROBDELORIG ((*probdelorig)), /**< frees user data of original problem */
9940  SCIP_DECL_PROBTRANS ((*probtrans)), /**< creates user data of transformed problem by transforming original user data */
9941  SCIP_DECL_PROBDELTRANS((*probdeltrans)), /**< frees user data of transformed problem */
9942  SCIP_DECL_PROBINITSOL ((*probinitsol)), /**< solving process initialization method of transformed data */
9943  SCIP_DECL_PROBEXITSOL ((*probexitsol)), /**< solving process deinitialization method of transformed data */
9944  SCIP_DECL_PROBCOPY ((*probcopy)), /**< copies user data if you want to copy it to a subscip, or NULL */
9945  SCIP_PROBDATA* probdata /**< user problem data set by the reader */
9946  )
9947 {
9948  SCIP_CALL( checkStage(scip, "SCIPcreateProb", TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE) );
9949 
9950  /* free old problem */
9951  SCIP_CALL( SCIPfreeProb(scip) );
9952  assert(scip->set->stage == SCIP_STAGE_INIT);
9953 
9954  /* switch stage to PROBLEM */
9955  scip->set->stage = SCIP_STAGE_PROBLEM;
9956 
9957  SCIP_CALL( SCIPstatCreate(&scip->stat, scip->mem->probmem, scip->set, NULL, NULL, scip->messagehdlr) );
9958 
9959  SCIP_CALL( SCIPprobCreate(&scip->origprob, scip->mem->probmem, scip->set, name,
9960  probdelorig, probtrans, probdeltrans, probinitsol, probexitsol, probcopy, probdata, FALSE) );
9961 
9962  /* create solution pool for original solution candidates */
9964 
9965  /* create conflict pool for storing conflict constraints */
9967 
9968  /* initialize reoptimization structure, if needed */
9970 
9971  return SCIP_OKAY;
9972 }
9973 
9974 /** creates empty problem and initializes all solving data structures (the objective sense is set to MINIMIZE)
9975  * all callback methods will be set to NULL and can be set afterwards, if needed, via SCIPsetProbDelorig(),
9976  * SCIPsetProbTrans(), SCIPsetProbDeltrans(), SCIPsetProbInitsol(), SCIPsetProbExitsol(), and
9977  * SCIPsetProbCopy()
9978  * If the problem type requires the use of variable pricers, these pricers should be added to the problem with calls
9979  * to SCIPactivatePricer(). These pricers are automatically deactivated, when the problem is freed.
9980  *
9981  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9982  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9983  *
9984  * @pre This method can be called if @p scip is in one of the following stages:
9985  * - \ref SCIP_STAGE_INIT
9986  * - \ref SCIP_STAGE_PROBLEM
9987  * - \ref SCIP_STAGE_TRANSFORMED
9988  * - \ref SCIP_STAGE_PRESOLVING
9989  * - \ref SCIP_STAGE_PRESOLVED
9990  * - \ref SCIP_STAGE_SOLVING
9991  * - \ref SCIP_STAGE_SOLVED
9992  * - \ref SCIP_STAGE_FREE
9993  *
9994  * @post After calling this method, \SCIP reaches the following stage:
9995  * - \ref SCIP_STAGE_PROBLEM
9996  */
9998  SCIP* scip, /**< SCIP data structure */
9999  const char* name /**< problem name */
10000  )
10001 {
10002  SCIP_CALL( checkStage(scip, "SCIPcreateProbBasic", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE) );
10003 
10004  SCIP_CALL( SCIPcreateProb(scip, name, NULL, NULL, NULL, NULL, NULL, NULL, NULL) );
10005 
10006  return SCIP_OKAY;
10007 }
10008 
10009 /** sets callback to free user data of original problem
10010  *
10011  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10012  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10013  *
10014  * @pre This method can be called if @p scip is in one of the following stages:
10015  * - \ref SCIP_STAGE_PROBLEM
10016  */
10018  SCIP* scip, /**< SCIP data structure */
10019  SCIP_DECL_PROBDELORIG ((*probdelorig)) /**< frees user data of original problem */
10020  )
10021 {
10022  assert(scip != NULL);
10023  SCIP_CALL( checkStage(scip, "SCIPsetProbDelorig", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
10024 
10025  SCIPprobSetDelorig(scip->origprob, probdelorig);
10026 
10027  return SCIP_OKAY;
10028 }
10029 
10030 /** sets callback to create user data of transformed problem by transforming original user data
10031  *
10032  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10033  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10034  *
10035  * @pre This method can be called if @p scip is in one of the following stages:
10036  * - \ref SCIP_STAGE_PROBLEM
10037  */
10039  SCIP* scip, /**< SCIP data structure */
10040  SCIP_DECL_PROBTRANS ((*probtrans)) /**< creates user data of transformed problem by transforming original user data */
10041  )
10042 {
10043  assert(scip != NULL);
10044  SCIP_CALL( checkStage(scip, "SCIPsetProbTrans", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
10045 
10046  SCIPprobSetTrans(scip->origprob, probtrans);
10047 
10048  return SCIP_OKAY;
10049 }
10050 
10051 /** sets callback to free user data of transformed problem
10052  *
10053  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10054  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10055  *
10056  * @pre This method can be called if @p scip is in one of the following stages:
10057  * - \ref SCIP_STAGE_PROBLEM
10058  */
10060  SCIP* scip, /**< SCIP data structure */
10061  SCIP_DECL_PROBDELTRANS((*probdeltrans)) /**< frees user data of transformed problem */
10062  )
10063 {
10064  assert(scip != NULL);
10065  SCIP_CALL( checkStage(scip, "SCIPsetProbDeltrans", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
10066 
10067  SCIPprobSetDeltrans(scip->origprob, probdeltrans);
10068 
10069  return SCIP_OKAY;
10070 }
10071 
10072 /** sets solving process initialization callback of transformed data
10073  *
10074  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10075  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10076  *
10077  * @pre This method can be called if @p scip is in one of the following stages:
10078  * - \ref SCIP_STAGE_PROBLEM
10079  */
10081  SCIP* scip, /**< SCIP data structure */
10082  SCIP_DECL_PROBINITSOL ((*probinitsol)) /**< solving process initialization method of transformed data */
10083  )
10084 {
10085  assert(scip != NULL);
10086 
10087  SCIP_CALL( checkStage(scip, "SCIPsetProbInitsol", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
10088 
10089  SCIPprobSetInitsol(scip->origprob, probinitsol);
10090 
10091  return SCIP_OKAY;
10092 }
10093 
10094 /** sets solving process deinitialization callback of transformed data
10095  *
10096  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10097  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10098  *
10099  * @pre This method can be called if @p scip is in one of the following stages:
10100  * - \ref SCIP_STAGE_PROBLEM
10101  */
10103  SCIP* scip, /**< SCIP data structure */
10104  SCIP_DECL_PROBEXITSOL ((*probexitsol)) /**< solving process deinitialization method of transformed data */
10105  )
10106 {
10107  assert(scip != NULL);
10108  SCIP_CALL( checkStage(scip, "SCIPsetProbExitsol", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
10109 
10110  SCIPprobSetExitsol(scip->origprob, probexitsol);
10111 
10112  return SCIP_OKAY;
10113 }
10114 
10115 /** sets callback to copy user data to a subscip
10116  *
10117  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10118  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10119  *
10120  * @pre This method can be called if @p scip is in one of the following stages:
10121  * - \ref SCIP_STAGE_PROBLEM
10122  */
10124  SCIP* scip, /**< SCIP data structure */
10125  SCIP_DECL_PROBCOPY ((*probcopy)) /**< copies user data if you want to copy it to a subscip, or NULL */
10126  )
10127 {
10128  assert(scip != NULL);
10129  SCIP_CALL( checkStage(scip, "SCIPsetProbCopy", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
10130 
10131  SCIPprobSetCopy(scip->origprob, probcopy);
10132 
10133  return SCIP_OKAY;
10134 }
10135 
10136 /** reads problem from file and initializes all solving data structures
10137  *
10138  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10139  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10140  *
10141  * @pre This method can be called if @p scip is in one of the following stages:
10142  * - \ref SCIP_STAGE_INIT
10143  * - \ref SCIP_STAGE_PROBLEM
10144  * - \ref SCIP_STAGE_TRANSFORMED
10145  * - \ref SCIP_STAGE_INITPRESOLVE
10146  * - \ref SCIP_STAGE_PRESOLVING
10147  * - \ref SCIP_STAGE_EXITPRESOLVE
10148  * - \ref SCIP_STAGE_PRESOLVED
10149  * - \ref SCIP_STAGE_SOLVING
10150  * - \ref SCIP_STAGE_EXITSOLVE
10151  *
10152  * @post After the method was called, \SCIP is in one of the following stages:
10153  * - \ref SCIP_STAGE_INIT if reading failed (usually, when a SCIP_READERROR occurs)
10154  * - \ref SCIP_STAGE_PROBLEM if the problem file was successfully read
10155  */
10157  SCIP* scip, /**< SCIP data structure */
10158  const char* filename, /**< problem file name */
10159  const char* extension /**< extension of the desired file reader,
10160  * or NULL if file extension should be used */
10161  )
10162 {
10163  SCIP_RETCODE retcode;
10164  SCIP_RESULT result;
10165  SCIP_Bool usevartable;
10166  SCIP_Bool useconstable;
10167  int i;
10168  char* tmpfilename;
10169  char* fileextension;
10170 
10171  assert(scip != NULL);
10172  assert(filename != NULL);
10173 
10174  SCIP_CALL( checkStage(scip, "SCIPreadProb", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
10175 
10176  SCIP_CALL( SCIPgetBoolParam(scip, "misc/usevartable", &usevartable) );
10177  SCIP_CALL( SCIPgetBoolParam(scip, "misc/useconstable", &useconstable) );
10178 
10179  if( !usevartable || !useconstable )
10180  {
10181  SCIPerrorMessage("Cannot read problem if vartable or constable is disabled. Make sure parameters 'misc/usevartable' and 'misc/useconstable' are set to TRUE.\n");
10182  return SCIP_READERROR;
10183  }
10184 
10185  /* try all readers until one could read the file */
10186  result = SCIP_DIDNOTRUN;
10187 
10188  /* copy filename */
10189  SCIP_CALL( SCIPduplicateBufferArray(scip, &tmpfilename, filename, (int)strlen(filename)+1) );
10190 
10191  fileextension = NULL;
10192  if( extension == NULL )
10193  {
10194  /* get extension from filename */
10195  SCIPsplitFilename(tmpfilename, NULL, NULL, &fileextension, NULL);
10196  }
10197 
10198  for( i = 0; i < scip->set->nreaders && result == SCIP_DIDNOTRUN; ++i )
10199  {
10200  retcode = SCIPreaderRead(scip->set->readers[i], scip->set, filename,
10201  extension != NULL ? extension : fileextension, &result);
10202 
10203  /* check for reader errors */
10204  if( retcode == SCIP_NOFILE || retcode == SCIP_READERROR )
10205  goto TERMINATE;
10206  SCIP_CALL( retcode );
10207  }
10208 
10209  switch( result )
10210  {
10211  case SCIP_DIDNOTRUN:
10212  retcode = SCIP_PLUGINNOTFOUND;
10213  break;
10214  case SCIP_SUCCESS:
10215  if( scip->origprob != NULL )
10216  {
10217  SCIP_Real readingtime;
10218 
10220  "original problem has %d variables (%d bin, %d int, %d impl, %d cont) and %d constraints\n",
10221  scip->origprob->nvars, scip->origprob->nbinvars, scip->origprob->nintvars,
10222  scip->origprob->nimplvars, scip->origprob->ncontvars,
10223  scip->origprob->nconss);
10224 
10225  /* in full verbose mode we will also print the number of constraints per constraint handler */
10226  if( scip->set->disp_verblevel == SCIP_VERBLEVEL_FULL )
10227  {
10228  int* nconss;
10229  int c;
10230  int h;
10231 
10232  SCIP_CALL( SCIPallocClearBufferArray(scip, &nconss, scip->set->nconshdlrs) );
10233 
10234  /* loop over all constraints and constraint-handlers to count for each type the amount of original
10235  * constraints
10236  */
10237  for( c = scip->origprob->nconss - 1; c >= 0; --c )
10238  {
10239  for( h = scip->set->nconshdlrs - 1; h >= 0; --h )
10240  {
10241  if( scip->origprob->conss[c]->conshdlr == scip->set->conshdlrs[h] )
10242  {
10243  ++(nconss[h]);
10244  break;
10245  }
10246  }
10247  /* constraint handler should be found */
10248  assert(h >= 0);
10249  }
10250 
10251  /* loop over all constraints handlers for printing the number of original constraints */
10252  for( h = 0; h < scip->set->nconshdlrs; ++h )
10253  {
10254  if( nconss[h] > 0 )
10255  {
10257  "%7d constraints of type <%s>\n", nconss[h], SCIPconshdlrGetName(scip->set->conshdlrs[h]));
10258  }
10259  }
10260 
10261  SCIPfreeBufferArray(scip, &nconss);
10262  }
10263 
10264  /* in case the permutation seed is different to 0, permute the original problem */
10265  if( scip->set->random_permutationseed > 0 )
10266  {
10267  SCIP_Bool permuteconss;
10268  SCIP_Bool permutevars;
10269  int permutationseed;
10270 
10271  permuteconss = scip->set->random_permuteconss;
10272  permutevars = scip->set->random_permutevars;
10273  permutationseed = scip->set->random_permutationseed;
10274 
10275  SCIP_CALL( SCIPpermuteProb(scip, (unsigned int)permutationseed, permuteconss, permutevars, permutevars, permutevars, permutevars) );
10276  }
10277 
10278  /* get reading time */
10279  readingtime = SCIPgetReadingTime(scip);
10280 
10281  /* display timing statistics */
10283  "Reading Time: %.2f\n", readingtime);
10284  }
10285  retcode = SCIP_OKAY;
10286  break;
10287  default:
10288  assert(i < scip->set->nreaders);
10289  SCIPerrorMessage("invalid result code <%d> from reader <%s> reading file <%s>\n",
10290  result, SCIPreaderGetName(scip->set->readers[i]), filename);
10291  retcode = SCIP_READERROR;
10292  } /*lint !e788*/
10293 
10294  TERMINATE:
10295  /* free buffer array */
10296  SCIPfreeBufferArray(scip, &tmpfilename);
10297 
10298  /* check if reading time should belong to solving time */
10299  if( scip->set->time_reading )
10300  {
10301  SCIP_Real readingtime;
10302 
10303  /* get reading time */
10304  readingtime = SCIPgetReadingTime(scip);
10305 
10306  /* add reading time to solving time */
10307  SCIPclockSetTime(scip->stat->solvingtime, readingtime);
10308  }
10309 
10310  return retcode;
10311 }
10312 
10313 /* write original or transformed problem */
10314 static
10316  SCIP* scip, /**< SCIP data structure */
10317  const char* filename, /**< output file (or NULL for standard output) */
10318  const char* extension, /**< extension of the desired file reader,
10319  * or NULL if file extension should be used */
10320  SCIP_Bool transformed, /**< output the transformed problem? */
10321  SCIP_Bool genericnames /**< using generic variable and constraint names? */
10322  )
10323 {
10324  SCIP_RETCODE retcode;
10325  char* tmpfilename;
10326  char* fileextension;
10327  char* compression;
10328  FILE* file;
10329 
10330  assert(scip != NULL );
10331 
10332  fileextension = NULL;
10333  compression = NULL;
10334  file = NULL;
10335  tmpfilename = NULL;
10336 
10337  if( filename != NULL && filename[0] != '\0' )
10338  {
10339  int success;
10340 
10341  file = fopen(filename, "w");
10342  if( file == NULL )
10343  {
10344  SCIPerrorMessage("cannot create file <%s> for writing\n", filename);
10345  SCIPprintSysError(filename);
10346  return SCIP_FILECREATEERROR;
10347  }
10348 
10349  /* get extension from filename,
10350  * if an error occurred, close the file before returning */
10351  if( BMSduplicateMemoryArray(&tmpfilename, filename, strlen(filename)+1) == NULL )
10352  {
10353  (void) fclose(file);
10354  SCIPerrorMessage("Error <%d> in function call\n", SCIP_NOMEMORY);
10355  return SCIP_NOMEMORY;
10356  }
10357 
10358  SCIPsplitFilename(tmpfilename, NULL, NULL, &fileextension, &compression);
10359 
10360  if( compression != NULL )
10361  {
10362  SCIPmessagePrintWarning(scip->messagehdlr, "currently it is not possible to write files with any compression\n");
10363  BMSfreeMemoryArray(&tmpfilename);
10364  (void) fclose(file);
10365  return SCIP_FILECREATEERROR;
10366  }
10367 
10368  if( extension == NULL && fileextension == NULL )
10369  {
10370  SCIPmessagePrintWarning(scip->messagehdlr, "filename <%s> has no file extension, select default <cip> format for writing\n", filename);
10371  }
10372 
10373  if( transformed )
10374  retcode = SCIPprintTransProblem(scip, file, extension != NULL ? extension : fileextension, genericnames);
10375  else
10376  retcode = SCIPprintOrigProblem(scip, file, extension != NULL ? extension : fileextension, genericnames);
10377 
10378  BMSfreeMemoryArray(&tmpfilename);
10379 
10380  success = fclose(file);
10381  if( success != 0 )
10382  {
10383  SCIPerrorMessage("An error occurred while closing file <%s>\n", filename);
10384  return SCIP_FILECREATEERROR;
10385  }
10386  }
10387  else
10388  {
10389  /* print to stdout */
10390  if( transformed )
10391  retcode = SCIPprintTransProblem(scip, NULL, extension, genericnames);
10392  else
10393  retcode = SCIPprintOrigProblem(scip, NULL, extension, genericnames);
10394  }
10395 
10396  /* check for write errors */
10397  if( retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
10398  return retcode;
10399  else
10400  {
10401  SCIP_CALL( retcode );
10402  }
10403 
10404  return SCIP_OKAY;
10405 }
10406 
10407 /** writes original problem to file
10408  *
10409  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10410  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10411  *
10412  * @pre This method can be called if @p scip is in one of the following stages:
10413  * - \ref SCIP_STAGE_PROBLEM
10414  * - \ref SCIP_STAGE_TRANSFORMING
10415  * - \ref SCIP_STAGE_TRANSFORMED
10416  * - \ref SCIP_STAGE_INITPRESOLVE
10417  * - \ref SCIP_STAGE_PRESOLVING
10418  * - \ref SCIP_STAGE_EXITPRESOLVE
10419  * - \ref SCIP_STAGE_PRESOLVED
10420  * - \ref SCIP_STAGE_INITSOLVE
10421  * - \ref SCIP_STAGE_SOLVING
10422  * - \ref SCIP_STAGE_SOLVED
10423  * - \ref SCIP_STAGE_EXITSOLVE
10424  * - \ref SCIP_STAGE_FREETRANS
10425  */
10427  SCIP* scip, /**< SCIP data structure */
10428  const char* filename, /**< output file (or NULL for standard output) */
10429  const char* extension, /**< extension of the desired file reader,
10430  * or NULL if file extension should be used */
10431  SCIP_Bool genericnames /**< using generic variable and constraint names? */
10432  )
10433 {
10434  SCIP_RETCODE retcode;
10435 
10436  SCIP_CALL( checkStage(scip, "SCIPwriteOrigProblem", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
10437 
10438  assert( scip != NULL );
10439  assert( scip->origprob != NULL );
10440 
10441  retcode = writeProblem(scip, filename, extension, FALSE, genericnames);
10442 
10443  /* check for write errors */
10444  if( retcode == SCIP_FILECREATEERROR || retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
10445  return retcode;
10446  else
10447  {
10448  SCIP_CALL( retcode );
10449  }
10450 
10451  return SCIP_OKAY;
10452 }
10453 
10454 /** writes transformed problem which are valid in the current node to file
10455  *
10456  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10457  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10458  *
10459  * @pre This method can be called if @p scip is in one of the following stages:
10460  * - \ref SCIP_STAGE_TRANSFORMED
10461  * - \ref SCIP_STAGE_INITPRESOLVE
10462  * - \ref SCIP_STAGE_PRESOLVING
10463  * - \ref SCIP_STAGE_EXITPRESOLVE
10464  * - \ref SCIP_STAGE_PRESOLVED
10465  * - \ref SCIP_STAGE_INITSOLVE
10466  * - \ref SCIP_STAGE_SOLVING
10467  * - \ref SCIP_STAGE_SOLVED
10468  * - \ref SCIP_STAGE_EXITSOLVE
10469  *
10470  * @note If you want the write all constraints (including the once which are redundant for example), you need to set
10471  * the parameter <write/allconss> to TRUE
10472  */
10474  SCIP* scip, /**< SCIP data structure */
10475  const char* filename, /**< output file (or NULL for standard output) */
10476  const char* extension, /**< extension of the desired file reader,
10477  * or NULL if file extension should be used */
10478  SCIP_Bool genericnames /**< using generic variable and constraint names? */
10479  )
10480 {
10481  SCIP_RETCODE retcode;
10482 
10483  SCIP_CALL( checkStage(scip, "SCIPwriteTransProblem", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
10484 
10485  assert( scip != NULL );
10486  assert( scip->transprob != NULL );
10487 
10488  retcode = writeProblem(scip, filename, extension, TRUE, genericnames);
10489 
10490  /* check for write errors */
10491  if( retcode == SCIP_FILECREATEERROR || retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
10492  return retcode;
10493  else
10494  {
10495  SCIP_CALL( retcode );
10496  }
10497 
10498  return SCIP_OKAY;
10499 }
10500 
10501 /** frees problem and solution process data
10502  *
10503  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10504  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10505  *
10506  * @pre This method can be called if @p scip is in one of the following stages:
10507  * - \ref SCIP_STAGE_INIT
10508  * - \ref SCIP_STAGE_PROBLEM
10509  * - \ref SCIP_STAGE_TRANSFORMED
10510  * - \ref SCIP_STAGE_PRESOLVING
10511  * - \ref SCIP_STAGE_PRESOLVED
10512  * - \ref SCIP_STAGE_SOLVING
10513  * - \ref SCIP_STAGE_SOLVED
10514  * - \ref SCIP_STAGE_FREE
10515  *
10516  * @post After this method was called, SCIP is in the following stage:
10517  * - \ref SCIP_STAGE_INIT
10518  */
10520  SCIP* scip /**< SCIP data structure */
10521  )
10522 {
10523  SCIP_Bool transsolorig;
10524 
10525  SCIP_CALL( checkStage(scip, "SCIPfreeProb", TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE) );
10526 
10527  /* if we free the problem, we do not have to transfer transformed solutions to the original space, so temporarily disable it */
10528  transsolorig = scip->set->misc_transsolsorig;
10529  scip->set->misc_transsolsorig = FALSE;
10530 
10531  /* release variables and constraints captured by reoptimization */
10532  if( scip->set->reopt_enable || scip->reopt != NULL)
10533  {
10534  SCIP_CALL( SCIPreoptReleaseData(scip->reopt, scip->set, scip->mem->probmem) );
10535  }
10536 
10537  SCIP_CALL( SCIPfreeTransform(scip) );
10538  /* for some reason the free transform can generate events caught in the globalbnd eventhander
10539  * which requires the concurrent so it must be freed afterwards this happened o instance fiber
10540  */
10541  SCIP_CALL( SCIPfreeConcurrent(scip) );
10542 
10543  assert(scip->set->stage == SCIP_STAGE_INIT || scip->set->stage == SCIP_STAGE_PROBLEM);
10544  scip->set->misc_transsolsorig = transsolorig;
10545 
10546  if( scip->set->stage == SCIP_STAGE_PROBLEM )
10547  {
10548  int i;
10549 
10550  /* free concsolvers and deinitialize the syncstore */
10551  if( scip->set->nconcsolvers > 0 )
10552  {
10553  assert(SCIPsyncstoreIsInitialized(scip->syncstore));
10554 
10557  }
10558 
10559  /* deactivate all pricers */
10560  for( i = scip->set->nactivepricers-1; i >= 0; --i )
10561  {
10562  SCIP_CALL( SCIPpricerDeactivate(scip->set->pricers[i], scip->set) );
10563  }
10564  assert(scip->set->nactivepricers == 0);
10565 
10566  /* free all debug data */
10568 
10569  /* free original primal solution candidate pool, original problem and problem statistics data structures */
10570  if( scip->set->reopt_enable || scip->reopt != NULL)
10571  {
10572  SCIP_CALL( SCIPreoptFree(&scip->reopt, scip->set, scip->origprimal, scip->mem->probmem) );
10573  }
10574  SCIP_CALL( SCIPconflictstoreFree(&scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->reopt) );
10575  SCIP_CALL( SCIPprimalFree(&scip->origprimal, scip->mem->probmem) );
10576  SCIP_CALL( SCIPprobFree(&scip->origprob, scip->messagehdlr, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
10577  SCIP_CALL( SCIPstatFree(&scip->stat, scip->mem->probmem) );
10578 
10579  /* readers */
10580  for( i = 0; i < scip->set->nreaders; ++i )
10581  {
10583  }
10584 
10585  /* switch stage to INIT */
10586  scip->set->stage = SCIP_STAGE_INIT;
10587  }
10588  assert(scip->set->stage == SCIP_STAGE_INIT);
10589 
10590  return SCIP_OKAY;
10591 }
10592 
10593 
10594 /** permutes parts of the problem data structure
10595  *
10596  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10597  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10598  *
10599  * @pre This method can be called if @p scip is in one of the following stages:
10600  * - \ref SCIP_STAGE_PROBLEM
10601  * - \ref SCIP_STAGE_TRANSFORMED
10602  *
10603  * @todo This need to be changed to use the new random number generator implemented in random.c
10604  */
10606  SCIP* scip, /**< SCIP data structure */
10607  unsigned int randseed, /**< seed value for random generator */
10608  SCIP_Bool permuteconss, /**< should the list of constraints in each constraint handler be permuted? */
10609  SCIP_Bool permutebinvars, /**< should the list of binary variables be permuted? */
10610  SCIP_Bool permuteintvars, /**< should the list of integer variables be permuted? */
10611  SCIP_Bool permuteimplvars, /**< should the list of implicit integer variables be permuted? */
10612  SCIP_Bool permutecontvars /**< should the list of continuous integer variables be permuted? */
10613  )
10614 {
10615  SCIP_VAR** vars;
10616  SCIP_CONSHDLR** conshdlrs;
10617  SCIP_RANDNUMGEN* randnumgen;
10618  SCIP_Bool permuted;
10619  int nconshdlrs;
10620  int nbinvars;
10621  int nintvars;
10622  int nimplvars;
10623  int nvars;
10624  int j;
10625 
10626  assert(scip != NULL);
10627  SCIP_CALL( checkStage(scip, "SCIPpermuteProb", FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
10628 
10629  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, &nbinvars, &nintvars, &nimplvars, NULL) );
10630 
10631  assert(nvars == 0 || vars != NULL);
10632  assert(nvars == nbinvars+nintvars+nimplvars+SCIPgetNContVars(scip));
10633 
10634  conshdlrs = SCIPgetConshdlrs(scip);
10635  nconshdlrs = SCIPgetNConshdlrs(scip);
10636  assert(nconshdlrs == 0 || conshdlrs != NULL);
10637 
10638  /* create a random number generator */
10639  SCIP_CALL( SCIPcreateRandom(scip, &randnumgen, randseed) );
10640 
10641  /* The constraint handler should not be permuted since they are called w.r.t. to certain properties; besides
10642  * that the "conshdlrs" array should stay in the order as it is since this array is used to copy the plugins for
10643  * sub-SCIPs and contains the dependencies between the constraint handlers; for example the linear constraint
10644  * handler stays in front of all constraint handler which can upgrade a linear constraint (such as logicor,
10645  * setppc, and knapsack).
10646  */
10647 
10648  permuted = FALSE;
10649 
10650  /* for each constraint handler, permute its constraints */
10651  if( permuteconss )
10652  {
10653  int i;
10654 
10655  /* we must only permute active constraints */
10656  if( SCIPisTransformed(scip) && !SCIPprobIsPermuted(scip->transprob) )
10657  {
10658  /* loop over all constraint handlers */
10659  for( i = 0; i < nconshdlrs; ++i )
10660  {
10661  SCIP_CONS** conss;
10662  int nconss;
10663 
10664  conss = SCIPconshdlrGetConss(conshdlrs[i]);
10665  nconss = SCIPconshdlrGetNActiveConss(conshdlrs[i]);
10666 
10667  assert(nconss == 0 || conss != NULL);
10668 
10669  SCIPrandomPermuteArray(randnumgen, (void**)conss, 0, nconss);
10670 
10671  /* readjust the mapping of constraints to array positions */
10672  for( j = 0; j < nconss; ++j )
10673  conss[j]->consspos = j;
10674 
10675  permuted = TRUE;
10676  }
10677  }
10678  else if( !SCIPisTransformed(scip) && !SCIPprobIsPermuted(scip->origprob) )
10679  {
10680  SCIP_CONS** conss = scip->origprob->conss;
10681  int nconss = scip->origprob->nconss;
10682 
10683  SCIPrandomPermuteArray(randnumgen, (void**)conss, 0, nconss);
10684 
10685  for( j = 0; j < nconss; ++j )
10686  {
10687  assert(conss[j]->consspos == -1);
10688  conss[j]->addarraypos = j;
10689  }
10690 
10691  permuted = TRUE;
10692  }
10693  }
10694 
10695  /* permute binary variables */
10696  if( permutebinvars && !SCIPprobIsPermuted(scip->origprob) )
10697  {
10698  SCIPrandomPermuteArray(randnumgen, (void**)vars, 0, nbinvars);
10699 
10700  /* readjust the mapping of variables to array positions */
10701  for( j = 0; j < nbinvars; ++j )
10702  vars[j]->probindex = j;
10703 
10704  permuted = TRUE;
10705  }
10706 
10707  /* permute general integer variables */
10708  if( permuteintvars && !SCIPprobIsPermuted(scip->origprob) )
10709  {
10710  SCIPrandomPermuteArray(randnumgen, (void**)vars, nbinvars, nbinvars+nintvars);
10711 
10712  /* readjust the mapping of variables to array positions */
10713  for( j = nbinvars; j < nbinvars+nintvars; ++j )
10714  vars[j]->probindex = j;
10715 
10716  permuted = TRUE;
10717  }
10718 
10719  /* permute general integer variables */
10720  if( permuteimplvars && !SCIPprobIsPermuted(scip->origprob) )
10721  {
10722  SCIPrandomPermuteArray(randnumgen, (void**)vars, nbinvars+nintvars, nbinvars+nintvars+nimplvars);
10723 
10724  /* readjust the mapping of variables to array positions */
10725  for( j = nbinvars+nintvars; j < nbinvars+nintvars+nimplvars; ++j )
10726  vars[j]->probindex = j;
10727 
10728  permuted = TRUE;
10729  }
10730 
10731  /* permute general integer variables */
10732  if( permutecontvars && !SCIPprobIsPermuted(scip->origprob) )
10733  {
10734  SCIPrandomPermuteArray(randnumgen, (void**)vars, nbinvars+nintvars+nimplvars, nvars);
10735 
10736  /* readjust the mapping of variables to array positions */
10737  for( j = nbinvars+nintvars+nimplvars; j < nvars; ++j )
10738  vars[j]->probindex = j;
10739 
10740  permuted = TRUE;
10741  }
10742 
10743  if( permuted && SCIPisTransformed(scip) )
10744  {
10745  assert(!SCIPprobIsPermuted(scip->transprob));
10746 
10747  /* mark tranformed problem as permuted */
10749 
10751  "permute transformed problem using random seed %u\n", randseed);
10752  }
10753  else if( permuted && !SCIPisTransformed(scip) )
10754  {
10755  assert(!SCIPprobIsPermuted(scip->origprob));
10756 
10757  /* mark original problem as permuted */
10759 
10761  "permute original problem using random seed %u\n", randseed);
10762  }
10763 
10764  /* free random number generator */
10765  SCIPfreeRandom(scip, &randnumgen);
10766 
10767  return SCIP_OKAY;
10768 }
10769 
10770 /** gets user problem data
10771  *
10772  * @return a SCIP_PROBDATA pointer, or NULL if no problem data was allocated
10773  *
10774  * @pre This method can be called if @p scip is in one of the following stages:
10775  * - \ref SCIP_STAGE_PROBLEM
10776  * - \ref SCIP_STAGE_TRANSFORMING
10777  * - \ref SCIP_STAGE_TRANSFORMED
10778  * - \ref SCIP_STAGE_INITPRESOLVE
10779  * - \ref SCIP_STAGE_PRESOLVING
10780  * - \ref SCIP_STAGE_EXITPRESOLVE
10781  * - \ref SCIP_STAGE_PRESOLVED
10782  * - \ref SCIP_STAGE_INITSOLVE
10783  * - \ref SCIP_STAGE_SOLVING
10784  * - \ref SCIP_STAGE_SOLVED
10785  * - \ref SCIP_STAGE_EXITSOLVE
10786  * - \ref SCIP_STAGE_FREETRANS
10787  */
10789  SCIP* scip /**< SCIP data structure */
10790  )
10791 {
10792  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetProbData", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
10793 
10794  switch( scip->set->stage )
10795  {
10796  case SCIP_STAGE_PROBLEM:
10797  return SCIPprobGetData(scip->origprob);
10798 
10802  case SCIP_STAGE_PRESOLVING:
10804  case SCIP_STAGE_PRESOLVED:
10805  case SCIP_STAGE_INITSOLVE:
10806  case SCIP_STAGE_SOLVING:
10807  case SCIP_STAGE_SOLVED:
10808  case SCIP_STAGE_EXITSOLVE:
10809  case SCIP_STAGE_FREETRANS:
10810  return SCIPprobGetData(scip->transprob);
10811 
10812  default:
10813  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
10814  SCIPABORT();
10815  return NULL; /*lint !e527*/
10816  } /*lint !e788*/
10817 }
10818 
10819 /** sets user problem data
10820  *
10821  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10822  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10823  *
10824  * @pre This method can be called if @p scip is in one of the following stages:
10825  * - \ref SCIP_STAGE_PROBLEM
10826  * - \ref SCIP_STAGE_TRANSFORMING
10827  * - \ref SCIP_STAGE_TRANSFORMED
10828  * - \ref SCIP_STAGE_INITPRESOLVE
10829  * - \ref SCIP_STAGE_PRESOLVING
10830  * - \ref SCIP_STAGE_EXITPRESOLVE
10831  * - \ref SCIP_STAGE_PRESOLVED
10832  * - \ref SCIP_STAGE_INITSOLVE
10833  * - \ref SCIP_STAGE_SOLVING
10834  * - \ref SCIP_STAGE_SOLVED
10835  * - \ref SCIP_STAGE_EXITSOLVE
10836  * - \ref SCIP_STAGE_FREETRANS
10837  */
10839  SCIP* scip, /**< SCIP data structure */
10840  SCIP_PROBDATA* probdata /**< user problem data to use */
10841  )
10842 {
10843  SCIP_CALL( checkStage(scip, "SCIPsetProbData", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
10844 
10845  switch( scip->set->stage )
10846  {
10847  case SCIP_STAGE_PROBLEM:
10848  SCIPprobSetData(scip->origprob, probdata);
10849  return SCIP_OKAY;
10850 
10854  case SCIP_STAGE_PRESOLVING:
10856  case SCIP_STAGE_PRESOLVED:
10857  case SCIP_STAGE_INITSOLVE:
10858  case SCIP_STAGE_SOLVING:
10859  case SCIP_STAGE_SOLVED:
10860  case SCIP_STAGE_EXITSOLVE:
10861  case SCIP_STAGE_FREETRANS:
10862  SCIPprobSetData(scip->transprob, probdata);
10863  return SCIP_OKAY;
10864 
10865  case SCIP_STAGE_INIT:
10866  case SCIP_STAGE_FREE:
10867  default:
10868  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
10869  return SCIP_INVALIDCALL;
10870  }
10871 }
10872 
10873 /** returns name of the current problem instance
10874  *
10875  * @return name of the current problem instance
10876  *
10877  * @pre This method can be called if @p scip is in one of the following stages:
10878  * - \ref SCIP_STAGE_PROBLEM
10879  * - \ref SCIP_STAGE_TRANSFORMING
10880  * - \ref SCIP_STAGE_TRANSFORMED
10881  * - \ref SCIP_STAGE_INITPRESOLVE
10882  * - \ref SCIP_STAGE_PRESOLVING
10883  * - \ref SCIP_STAGE_EXITPRESOLVE
10884  * - \ref SCIP_STAGE_PRESOLVED
10885  * - \ref SCIP_STAGE_INITSOLVE
10886  * - \ref SCIP_STAGE_SOLVING
10887  * - \ref SCIP_STAGE_SOLVED
10888  * - \ref SCIP_STAGE_EXITSOLVE
10889  * - \ref SCIP_STAGE_FREETRANS
10890  */
10891 const char* SCIPgetProbName(
10892  SCIP* scip /**< SCIP data structure */
10893  )
10894 {
10895  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetProbName", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
10896 
10897  return SCIPprobGetName(scip->origprob);
10898 }
10899 
10900 /** sets name of the current problem instance
10901  *
10902  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10903  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10904  *
10905  * @pre This method can be called if @p scip is in one of the following stages:
10906  * - \ref SCIP_STAGE_PROBLEM
10907  * - \ref SCIP_STAGE_TRANSFORMING
10908  * - \ref SCIP_STAGE_TRANSFORMED
10909  * - \ref SCIP_STAGE_INITPRESOLVE
10910  * - \ref SCIP_STAGE_PRESOLVING
10911  * - \ref SCIP_STAGE_EXITPRESOLVE
10912  * - \ref SCIP_STAGE_PRESOLVED
10913  * - \ref SCIP_STAGE_INITSOLVE
10914  * - \ref SCIP_STAGE_SOLVING
10915  * - \ref SCIP_STAGE_SOLVED
10916  * - \ref SCIP_STAGE_EXITSOLVE
10917  * - \ref SCIP_STAGE_FREETRANS
10918  */
10920  SCIP* scip, /**< SCIP data structure */
10921  const char* name /**< name to be set */
10922  )
10923 {
10924  SCIP_CALL( checkStage(scip, "SCIPsetProbName", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
10925 
10926  return SCIPprobSetName(scip->origprob, name);
10927 }
10928 
10929 /** changes the objective function of the original problem.
10930  *
10931  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10932  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10933  *
10934  * @pre This method can be called if @p scip is in one of the following stages:
10935  * - \ref SCIP_STAGE_PROBLEM
10936  * - \ref SCIP_STAGE_PRESOLVED
10937  *
10938  * @note This method should be only used to change the objective function during two reoptimization runs and is only
10939  * recommended to an experienced user.
10940  *
10941  * @note All variables not given in \p vars array are assumed to have an objective coefficient of zero.
10942  */
10944  SCIP* scip, /**< SCIP data structure */
10945  SCIP_OBJSENSE objsense, /**< new objective function */
10946  SCIP_VAR** vars, /**< original problem variables */
10947  SCIP_Real* coefs, /**< objective coefficients */
10948  int nvars /**< variables in vars array */
10949  )
10950 {
10951  SCIP_VAR** origvars;
10952  int norigvars;
10953  int i;
10954 
10955  SCIP_CALL( checkStage(scip, "SCIPchgReoptObjective", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
10956 
10957  assert(nvars == 0 || vars != NULL);
10958  assert(nvars == 0 || coefs != NULL);
10959 
10960  origvars = scip->origprob->vars;
10961  norigvars = scip->origprob->nvars;
10962 
10963 #ifdef SCIP_MORE_DEBUG
10964  SCIPdebugMsg(scip, "objective function need to be set:\n");
10965  for( i = 0; i < nvars; i++ )
10966  {
10967  if( !SCIPisZero(scip, coefs[i]) )
10968  SCIPdebugMsg(scip, "%s%g <%s> ", SCIPisPositive(scip, coefs[i]) ? "+" : "", coefs[i], SCIPvarGetName(vars[i]));
10969  }
10970  SCIPdebugMsg(scip, "\n");
10971 #endif
10972 
10973  /* Set all coefficients of original variables to 0, since we will add the new objective coefficients later. */
10974  for( i = 0; i < norigvars; i++ )
10975  {
10976  SCIP_CALL( SCIPchgVarObj(scip, origvars[i], 0.0) );
10977  }
10978 
10979  if( scip->set->stage >= SCIP_STAGE_TRANSFORMED )
10980  {
10981  /* In order to avoid numerical troubles, also explicitly set all transformed objective coefficients to 0. */
10982  for( i = 0; i < scip->transprob->nvars; i++ )
10983  {
10984  SCIP_CALL( SCIPchgVarObj(scip, scip->transprob->vars[i], 0.0) );
10985  }
10986  }
10987 
10988  /* reset objective data of original problem */
10989  scip->origprob->objscale = 1.0;
10990  scip->origprob->objsense = objsense;
10991  scip->origprob->objoffset = 0.0;
10992  scip->origprob->objisintegral = FALSE;
10993 
10994  if( scip->set->stage >= SCIP_STAGE_TRANSFORMED )
10995  {
10996  /* reset objective data of transformed problem */
10997  scip->transprob->objscale = 1.0;
10998  scip->transprob->objsense = objsense;
10999  scip->transprob->objoffset = 0.0;
11000  scip->transprob->objisintegral = FALSE;
11001  }
11002 
11003  /* set new objective values */
11004  for( i = 0; i < nvars; ++i )
11005  {
11006  if( !SCIPvarIsOriginal(vars[i]) )
11007  {
11008  SCIPerrorMessage("Cannot handle variable <%s> (status: %d) in SCIPchgReoptObjective().\n",
11009  SCIPvarGetName(vars[i]), SCIPvarGetStatus(vars[i]));
11010  return SCIP_INVALIDDATA;
11011  }
11012 
11013  /* Add coefficients because this gets transferred to the transformed problem (the coefficients were set to 0 above). */
11014  SCIP_CALL( SCIPaddVarObj(scip, vars[i], coefs[i]) );
11015  }
11016 
11017 #ifdef SCIP_MORE_DEBUG
11018  SCIPdebugMsg(scip, "new objective function:\n");
11019  for( i = 0; i < norigvars; i++ )
11020  {
11021  SCIP_Real objval = SCIPvarGetObj(origvars[i]);
11022  if( !SCIPisZero(scip, objval) )
11023  SCIPdebugMsg(scip, "%s%g <%s> ", SCIPisPositive(scip, objval) ? "+" : "", objval, SCIPvarGetName(origvars[i]));
11024  }
11025  SCIPdebugMsg(scip, "\n");
11026 #endif
11027 
11028  return SCIP_OKAY;
11029 }
11030 
11031 /** returns objective sense of original problem
11032  *
11033  * @return objective sense of original problem
11034  *
11035  * @pre This method can be called if @p scip is in one of the following stages:
11036  * - \ref SCIP_STAGE_PROBLEM
11037  * - \ref SCIP_STAGE_TRANSFORMING
11038  * - \ref SCIP_STAGE_TRANSFORMED
11039  * - \ref SCIP_STAGE_INITPRESOLVE
11040  * - \ref SCIP_STAGE_PRESOLVING
11041  * - \ref SCIP_STAGE_EXITPRESOLVE
11042  * - \ref SCIP_STAGE_PRESOLVED
11043  * - \ref SCIP_STAGE_INITSOLVE
11044  * - \ref SCIP_STAGE_SOLVING
11045  * - \ref SCIP_STAGE_SOLVED
11046  * - \ref SCIP_STAGE_EXITSOLVE
11047  * - \ref SCIP_STAGE_FREETRANS
11048  */
11050  SCIP* scip /**< SCIP data structure */
11051  )
11052 {
11053  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetObjsense", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
11054 
11055  return scip->origprob->objsense;
11056 }
11057 
11058 /** sets objective sense of problem
11059  *
11060  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
11061  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11062  *
11063  * @pre This method can be called if @p scip is in one of the following stages:
11064  * - \ref SCIP_STAGE_PROBLEM
11065  */
11067  SCIP* scip, /**< SCIP data structure */
11068  SCIP_OBJSENSE objsense /**< new objective sense */
11069  )
11070 {
11071  SCIP_CALL( checkStage(scip, "SCIPsetObjsense", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
11072 
11073  if( objsense != SCIP_OBJSENSE_MAXIMIZE && objsense != SCIP_OBJSENSE_MINIMIZE )
11074  {
11075  SCIPerrorMessage("invalid objective sense\n");
11076  return SCIP_INVALIDDATA;
11077  }
11078 
11079  SCIPprobSetObjsense(scip->origprob, objsense);
11080 
11081  return SCIP_OKAY;
11082 }
11083 
11084 /** adds offset of objective function
11085  *
11086  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
11087  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11088  *
11089  * @pre This method can be called if @p scip is in one of the following stages:
11090  * - \ref SCIP_STAGE_PRESOLVING
11091  */
11093  SCIP* scip, /**< SCIP data structure */
11094  SCIP_Real addval /**< value to add to objective offset */
11095  )
11096 {
11097  SCIP_CALL( checkStage(scip, "SCIPaddObjoffset", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
11098 
11099  SCIPprobAddObjoffset(scip->transprob, addval);
11100  SCIP_CALL( SCIPprimalUpdateObjoffset(scip->primal, SCIPblkmem(scip), scip->set, scip->stat,
11101  scip->eventqueue, scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
11102 
11103  return SCIP_OKAY;
11104 }
11105 
11106 /** adds offset of objective function to original problem and to all existing solution in original space
11107  *
11108  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
11109  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11110  *
11111  * @pre This method can be called if @p scip is in one of the following stages:
11112  * - \ref SCIP_STAGE_PROBLEM
11113  */
11115  SCIP* scip, /**< SCIP data structure */
11116  SCIP_Real addval /**< value to add to objective offset */
11117  )
11118 {
11119  SCIP_CALL( checkStage(scip, "SCIPaddOrigObjoffset", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
11120 
11121  scip->origprob->objoffset += addval;
11122  SCIPprimalAddOrigObjoffset(scip->origprimal, scip->set, addval);
11123 
11124  return SCIP_OKAY;
11125 }
11126 
11127 /** returns the objective offset of the original problem
11128  *
11129  * @return the objective offset of the original problem
11130  *
11131  * @pre This method can be called if @p scip is in one of the following stages:
11132  * - \ref SCIP_STAGE_PROBLEM
11133  * - \ref SCIP_STAGE_TRANSFORMING
11134  * - \ref SCIP_STAGE_TRANSFORMED
11135  * - \ref SCIP_STAGE_INITPRESOLVE
11136  * - \ref SCIP_STAGE_PRESOLVING
11137  * - \ref SCIP_STAGE_EXITPRESOLVE
11138  * - \ref SCIP_STAGE_PRESOLVED
11139  * - \ref SCIP_STAGE_INITSOLVE
11140  * - \ref SCIP_STAGE_SOLVING
11141  * - \ref SCIP_STAGE_SOLVED
11142  */
11144  SCIP* scip /**< SCIP data structure */
11145  )
11146 {
11147  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetOrigObjoffset", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11148 
11149  return scip->origprob->objoffset;
11150 }
11151 
11152 /** returns the objective scale of the original problem
11153  *
11154  * @return the objective scale of the original problem
11155  *
11156  * @pre This method can be called if @p scip is in one of the following stages:
11157  * - \ref SCIP_STAGE_PROBLEM
11158  * - \ref SCIP_STAGE_TRANSFORMING
11159  * - \ref SCIP_STAGE_TRANSFORMED
11160  * - \ref SCIP_STAGE_INITPRESOLVE
11161  * - \ref SCIP_STAGE_PRESOLVING
11162  * - \ref SCIP_STAGE_EXITPRESOLVE
11163  * - \ref SCIP_STAGE_PRESOLVED
11164  * - \ref SCIP_STAGE_INITSOLVE
11165  * - \ref SCIP_STAGE_SOLVING
11166  * - \ref SCIP_STAGE_SOLVED
11167  */
11169  SCIP* scip /**< SCIP data structure */
11170  )
11171 {
11172  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetOrigObjscale", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11173 
11174  return scip->origprob->objscale;
11175 }
11176 
11177 /** returns the objective offset of the transformed problem
11178  *
11179  * @return the objective offset of the transformed problem
11180  *
11181  * @pre This method can be called if @p scip is in one of the following stages:
11182  * - \ref SCIP_STAGE_TRANSFORMED
11183  * - \ref SCIP_STAGE_INITPRESOLVE
11184  * - \ref SCIP_STAGE_PRESOLVING
11185  * - \ref SCIP_STAGE_EXITPRESOLVE
11186  * - \ref SCIP_STAGE_PRESOLVED
11187  * - \ref SCIP_STAGE_INITSOLVE
11188  * - \ref SCIP_STAGE_SOLVING
11189  * - \ref SCIP_STAGE_SOLVED
11190  */
11192  SCIP* scip /**< SCIP data structure */
11193  )
11194 {
11195  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetTransObjoffset", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11196 
11197  return scip->transprob->objoffset;
11198 }
11199 
11200 /** returns the objective scale of the transformed problem
11201  *
11202  * @return the objective scale of the transformed problem
11203  *
11204  * @pre This method can be called if @p scip is in one of the following stages:
11205  * - \ref SCIP_STAGE_TRANSFORMED
11206  * - \ref SCIP_STAGE_INITPRESOLVE
11207  * - \ref SCIP_STAGE_PRESOLVING
11208  * - \ref SCIP_STAGE_EXITPRESOLVE
11209  * - \ref SCIP_STAGE_PRESOLVED
11210  * - \ref SCIP_STAGE_INITSOLVE
11211  * - \ref SCIP_STAGE_SOLVING
11212  * - \ref SCIP_STAGE_SOLVED
11213  */
11215  SCIP* scip /**< SCIP data structure */
11216  )
11217 {
11218  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetTransObjscale", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11219 
11220  return scip->transprob->objscale;
11221 }
11222 
11223 /** sets limit on objective function, such that only solutions better than this limit are accepted
11224  *
11225  * @note SCIP will only look for solutions with a strictly better objective value, thus, e.g., prune
11226  * all branch-and-bound nodes with dual bound equal or worse to the objective limit.
11227  * However, SCIP will also collect solutions with objective value worse than the objective limit and
11228  * use them to run improvement heuristics on them.
11229  * @note If SCIP can prove that there exists no solution with a strictly better objective value, the solving status
11230  * will normally be infeasible (the objective limit is interpreted as part of the problem).
11231  * The only exception is that by chance, SCIP found a solution with the same objective value and thus
11232  * proved the optimality of this solution, resulting in solution status optimal.
11233  *
11234  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
11235  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11236  *
11237  * @pre This method can be called if @p scip is in one of the following stages:
11238  * - \ref SCIP_STAGE_PROBLEM
11239  * - \ref SCIP_STAGE_TRANSFORMED
11240  * - \ref SCIP_STAGE_INITPRESOLVE
11241  * - \ref SCIP_STAGE_PRESOLVING
11242  * - \ref SCIP_STAGE_EXITPRESOLVE
11243  * - \ref SCIP_STAGE_PRESOLVED
11244  * - \ref SCIP_STAGE_SOLVING
11245  */
11247  SCIP* scip, /**< SCIP data structure */
11248  SCIP_Real objlimit /**< new primal objective limit */
11249  )
11250 {
11251  SCIP_Real oldobjlimit;
11252 
11253  SCIP_CALL( checkStage(scip, "SCIPsetObjlimit", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
11254 
11255  switch( scip->set->stage )
11256  {
11257  case SCIP_STAGE_PROBLEM:
11258  SCIPprobSetObjlim(scip->origprob, objlimit);
11259  break;
11260  case SCIP_STAGE_PRESOLVED:
11261  oldobjlimit = SCIPprobGetObjlim(scip->origprob, scip->set);
11262  assert(oldobjlimit == SCIPprobGetObjlim(scip->transprob, scip->set)); /*lint !e777*/
11263  if( SCIPtransformObj(scip, objlimit) > SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, oldobjlimit) && ! scip->set->reopt_enable)
11264  {
11265  SCIPerrorMessage("cannot relax objective limit from %.15g to %.15g in presolved stage.\n", oldobjlimit, objlimit);
11266  return SCIP_INVALIDDATA;
11267  }
11268  SCIPprobSetObjlim(scip->origprob, objlimit);
11269  SCIPprobSetObjlim(scip->transprob, objlimit);
11270  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
11271  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
11272  break;
11273 
11276  case SCIP_STAGE_PRESOLVING:
11278  case SCIP_STAGE_SOLVING:
11279  oldobjlimit = SCIPprobGetObjlim(scip->origprob, scip->set);
11280  assert(oldobjlimit == SCIPprobGetObjlim(scip->transprob, scip->set)); /*lint !e777*/
11281  if( SCIPtransformObj(scip, objlimit) > SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, oldobjlimit) )
11282  {
11283  SCIPerrorMessage("cannot relax objective limit from %.15g to %.15g after problem was transformed.\n", oldobjlimit, objlimit);
11284  return SCIP_INVALIDDATA;
11285  }
11286  SCIPprobSetObjlim(scip->origprob, objlimit);
11287  SCIPprobSetObjlim(scip->transprob, objlimit);
11288  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
11289  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
11290  break;
11291 
11292  default:
11293  SCIPerrorMessage("method is not callable in SCIP stage <%d>\n", scip->set->stage);
11294  return SCIP_INVALIDCALL;
11295  } /*lint !e788*/
11296 
11297  return SCIP_OKAY;
11298 }
11299 
11300 /** returns current limit on objective function
11301  *
11302  * @return the current objective limit of the original problem
11303  *
11304  * @pre This method can be called if @p scip is in one of the following stages:
11305  * - \ref SCIP_STAGE_PROBLEM
11306  * - \ref SCIP_STAGE_TRANSFORMING
11307  * - \ref SCIP_STAGE_TRANSFORMED
11308  * - \ref SCIP_STAGE_INITPRESOLVE
11309  * - \ref SCIP_STAGE_PRESOLVING
11310  * - \ref SCIP_STAGE_EXITPRESOLVE
11311  * - \ref SCIP_STAGE_PRESOLVED
11312  * - \ref SCIP_STAGE_INITSOLVE
11313  * - \ref SCIP_STAGE_SOLVING
11314  * - \ref SCIP_STAGE_SOLVED
11315  */
11317  SCIP* scip /**< SCIP data structure */
11318  )
11319 {
11320  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetObjlimit", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11321 
11322  return SCIPprobGetObjlim(scip->origprob, scip->set);
11323 }
11324 
11325 /** informs SCIP, that the objective value is always integral in every feasible solution
11326  *
11327  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
11328  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11329  *
11330  * @pre This method can be called if @p scip is in one of the following stages:
11331  * - \ref SCIP_STAGE_PROBLEM
11332  * - \ref SCIP_STAGE_TRANSFORMING
11333  * - \ref SCIP_STAGE_INITPRESOLVE
11334  * - \ref SCIP_STAGE_EXITPRESOLVE
11335  * - \ref SCIP_STAGE_SOLVING
11336  *
11337  * @note This function should be used to inform SCIP that the objective function is integral, helping to improve the
11338  * performance. This is useful when using column generation. If no column generation (pricing) is used, SCIP
11339  * automatically detects whether the objective function is integral or can be scaled to be integral. However, in
11340  * any case, the user has to make sure that no variable is added during the solving process that destroys this
11341  * property.
11342  */
11344  SCIP* scip /**< SCIP data structure */
11345  )
11346 {
11347  SCIP_CALL( checkStage(scip, "SCIPsetObjIntegral", FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
11348 
11349  switch( scip->set->stage )
11350  {
11351  case SCIP_STAGE_PROBLEM:
11353  return SCIP_OKAY;
11354 
11356  case SCIP_STAGE_PRESOLVING:
11357  case SCIP_STAGE_PRESOLVED:
11358  case SCIP_STAGE_SOLVING:
11360  return SCIP_OKAY;
11361 
11362  default:
11363  SCIPerrorMessage("method is not callable in SCIP stage <%d>\n", scip->set->stage);
11364  return SCIP_INVALIDCALL;
11365  } /*lint !e788*/
11366 }
11367 
11368 /** returns whether the objective value is known to be integral in every feasible solution
11369  *
11370  * @return TRUE, if objective value is known to be always integral, otherwise FALSE
11371  *
11372  * @pre This method can be called if @p scip is in one of the following stages:
11373  * - \ref SCIP_STAGE_PROBLEM
11374  * - \ref SCIP_STAGE_TRANSFORMING
11375  * - \ref SCIP_STAGE_INITPRESOLVE
11376  * - \ref SCIP_STAGE_PRESOLVING
11377  * - \ref SCIP_STAGE_EXITPRESOLVE
11378  * - \ref SCIP_STAGE_PRESOLVED
11379  * - \ref SCIP_STAGE_SOLVING
11380  *
11381  * @note If no pricing is performed, SCIP automatically detects whether the objective function is integral or can be
11382  * scaled to be integral, helping to improve performance. This function returns the result. Otherwise
11383  * SCIPsetObjIntegral() can be used to inform SCIP. However, in any case, the user has to make sure that no
11384  * variable is added during the solving process that destroys this property.
11385  */
11387  SCIP* scip /**< SCIP data structure */
11388  )
11389 {
11390  int v;
11391 
11392  SCIP_CALL_ABORT( checkStage(scip, "SCIPisObjIntegral", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
11393 
11394  switch( scip->set->stage )
11395  {
11396  case SCIP_STAGE_PROBLEM:
11397  /* if the user explicitly added the information that there is an integral objective, return TRUE */
11398  if( SCIPprobIsObjIntegral(scip->origprob) )
11399  return TRUE;
11400 
11401  /* if there exist unknown variables, we cannot conclude that the objective value is always integral */
11402  if ( scip->set->nactivepricers != 0 )
11403  return FALSE;
11404 
11405  /* if the objective value offset is fractional, the value itself is possibly fractional */
11406  if ( ! SCIPisIntegral(scip, scip->origprob->objoffset) )
11407  return FALSE;
11408 
11409  /* scan through the variables */
11410  for (v = 0; v < scip->origprob->nvars; ++v)
11411  {
11412  SCIP_Real obj;
11413 
11414  /* get objective value of variable */
11415  obj = SCIPvarGetObj(scip->origprob->vars[v]);
11416 
11417  /* check, if objective value is non-zero */
11418  if ( ! SCIPisZero(scip, obj) )
11419  {
11420  /* if variable's objective value is fractional, the problem's objective value may also be fractional */
11421  if ( ! SCIPisIntegral(scip, obj) )
11422  break;
11423 
11424  /* if variable with non-zero objective value is continuous, the problem's objective value may be fractional */
11426  break;
11427  }
11428  }
11429 
11430  /* we do not store the result, since we assume that the original problem might be changed */
11431  if ( v == scip->origprob->nvars )
11432  return TRUE;
11433  return FALSE;
11434 
11437  case SCIP_STAGE_PRESOLVING:
11439  case SCIP_STAGE_PRESOLVED:
11440  case SCIP_STAGE_SOLVING:
11441  return SCIPprobIsObjIntegral(scip->transprob);
11442 
11443  default:
11444  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11445  SCIPABORT();
11446  return FALSE; /*lint !e527*/
11447  } /*lint !e788*/
11448 }
11449 
11450 /** returns the Euclidean norm of the objective function vector (available only for transformed problem)
11451  *
11452  * @return the Euclidean norm of the transformed objective function vector
11453  *
11454  * @pre This method can be called if @p scip is in one of the following stages:
11455  * - \ref SCIP_STAGE_TRANSFORMED
11456  * - \ref SCIP_STAGE_INITPRESOLVE
11457  * - \ref SCIP_STAGE_PRESOLVING
11458  * - \ref SCIP_STAGE_EXITPRESOLVE
11459  * - \ref SCIP_STAGE_PRESOLVED
11460  * - \ref SCIP_STAGE_INITSOLVE
11461  * - \ref SCIP_STAGE_SOLVING
11462  * - \ref SCIP_STAGE_SOLVED
11463  * - \ref SCIP_STAGE_EXITSOLVE
11464  */
11466  SCIP* scip /**< SCIP data structure */
11467  )
11468 {
11469  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetObjNorm", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11470 
11471  if( scip->lp->objsqrnormunreliable )
11472  SCIPlpRecalculateObjSqrNorm(scip->set, scip->lp);
11473  assert(!scip->lp->objsqrnormunreliable);
11474 
11475  return SCIPlpGetObjNorm(scip->lp);
11476 }
11477 
11478 /** adds variable to the problem
11479  *
11480  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
11481  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11482  *
11483  * @pre This method can be called if @p scip is in one of the following stages:
11484  * - \ref SCIP_STAGE_PROBLEM
11485  * - \ref SCIP_STAGE_TRANSFORMING
11486  * - \ref SCIP_STAGE_INITPRESOLVE
11487  * - \ref SCIP_STAGE_PRESOLVING
11488  * - \ref SCIP_STAGE_EXITPRESOLVE
11489  * - \ref SCIP_STAGE_PRESOLVED
11490  * - \ref SCIP_STAGE_SOLVING
11491  */
11493  SCIP* scip, /**< SCIP data structure */
11494  SCIP_VAR* var /**< variable to add */
11495  )
11496 {
11497  SCIP_CALL( checkStage(scip, "SCIPaddVar", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
11498 
11499  /* avoid inserting the same variable twice */
11500  if( SCIPvarGetProbindex(var) != -1 )
11501  return SCIP_OKAY;
11502 
11503  /* insert the negation variable x instead of the negated variable x' in x' = offset - x */
11505  {
11506  assert(SCIPvarGetNegationVar(var) != NULL);
11508  return SCIP_OKAY;
11509  }
11510 
11511  switch( scip->set->stage )
11512  {
11513  case SCIP_STAGE_PROBLEM:
11515  {
11516  SCIPerrorMessage("cannot add transformed variables to original problem\n");
11517  return SCIP_INVALIDDATA;
11518  }
11519  SCIP_CALL( SCIPprobAddVar(scip->origprob, scip->mem->probmem, scip->set, scip->lp, scip->branchcand,
11520  scip->eventfilter, scip->eventqueue, var) );
11521  return SCIP_OKAY;
11522 
11525  case SCIP_STAGE_PRESOLVING:
11527  case SCIP_STAGE_PRESOLVED:
11528  case SCIP_STAGE_SOLVING:
11529  /* check variable's status */
11531  {
11532  SCIPerrorMessage("cannot add original variables to transformed problem\n");
11533  return SCIP_INVALIDDATA;
11534  }
11536  {
11537  SCIPerrorMessage("cannot add fixed or aggregated variables to transformed problem\n");
11538  return SCIP_INVALIDDATA;
11539  }
11540  SCIP_CALL( SCIPprobAddVar(scip->transprob, scip->mem->probmem, scip->set, scip->lp,
11541  scip->branchcand, scip->eventfilter, scip->eventqueue, var) );
11542  return SCIP_OKAY;
11543 
11544  default:
11545  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11546  return SCIP_INVALIDCALL;
11547  } /*lint !e788*/
11548 }
11549 
11550 /** adds variable to the problem and uses it as pricing candidate to enter the LP
11551  *
11552  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
11553  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11554  *
11555  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
11556  */
11558  SCIP* scip, /**< SCIP data structure */
11559  SCIP_VAR* var, /**< variable to add */
11560  SCIP_Real score /**< pricing score of variable (the larger, the better the variable) */
11561  )
11562 {
11563  SCIP_CALL( checkStage(scip, "SCIPaddPricedVar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
11564 
11565  /* insert the negation variable x instead of the negated variable x' in x' = offset - x */
11567  {
11568  assert(SCIPvarGetNegationVar(var) != NULL);
11569  SCIP_CALL( SCIPaddPricedVar(scip, SCIPvarGetNegationVar(var), score) );
11570  return SCIP_OKAY;
11571  }
11572 
11573  /* add variable to problem if not yet inserted */
11574  if( SCIPvarGetProbindex(var) == -1 )
11575  {
11576  /* check variable's status */
11578  {
11579  SCIPerrorMessage("cannot add original variables to transformed problem\n");
11580  return SCIP_INVALIDDATA;
11581  }
11583  {
11584  SCIPerrorMessage("cannot add fixed or aggregated variables to transformed problem\n");
11585  return SCIP_INVALIDDATA;
11586  }
11587  SCIP_CALL( SCIPprobAddVar(scip->transprob, scip->mem->probmem, scip->set, scip->lp,
11588  scip->branchcand, scip->eventfilter, scip->eventqueue, var) );
11589  }
11590 
11591  /* add variable to pricing storage */
11592  SCIP_CALL( SCIPpricestoreAddVar(scip->pricestore, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, var, score,
11593  (SCIPtreeGetCurrentDepth(scip->tree) == 0)) );
11594 
11595  return SCIP_OKAY;
11596 }
11597 
11598 /** removes variable from the problem
11599  *
11600  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
11601  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11602  *
11603  * @pre This method can be called if @p scip is in one of the following stages:
11604  * - \ref SCIP_STAGE_PROBLEM
11605  * - \ref SCIP_STAGE_TRANSFORMING
11606  * - \ref SCIP_STAGE_TRANSFORMED
11607  * - \ref SCIP_STAGE_PRESOLVING
11608  * - \ref SCIP_STAGE_FREETRANS
11609  */
11611  SCIP* scip, /**< SCIP data structure */
11612  SCIP_VAR* var, /**< variable to delete */
11613  SCIP_Bool* deleted /**< pointer to store whether marking variable to be deleted was successful */
11614  )
11615 {
11616  assert(scip != NULL);
11617  assert(var != NULL);
11618  assert(deleted != NULL);
11619 
11620  SCIP_CALL( checkStage(scip, "SCIPdelVar", FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE) );
11621 
11622  switch( scip->set->stage )
11623  {
11624  case SCIP_STAGE_PROBLEM:
11626  {
11627  SCIPerrorMessage("cannot remove transformed variables from original problem\n");
11628  return SCIP_INVALIDDATA;
11629  }
11630  SCIP_CALL( SCIPprobDelVar(scip->origprob, scip->mem->probmem, scip->set, scip->eventqueue, var, deleted) );
11631 
11632  /* delete the variables from the problems that were marked to be deleted */
11633  SCIP_CALL( SCIPprobPerformVarDeletions(scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp, scip->branchcand) );
11634 
11635  return SCIP_OKAY;
11636 
11639  case SCIP_STAGE_PRESOLVING:
11640  /* check variable's status */
11642  {
11643  SCIPerrorMessage("cannot remove original variables from transformed problem\n");
11644  return SCIP_INVALIDDATA;
11645  }
11647  {
11648  SCIPerrorMessage("cannot remove fixed or aggregated variables from transformed problem\n");
11649  return SCIP_INVALIDDATA;
11650  }
11651 
11652  SCIP_CALL( SCIPprobDelVar(scip->transprob, scip->mem->probmem, scip->set, scip->eventqueue, var, deleted) );
11653 
11654  return SCIP_OKAY;
11655  case SCIP_STAGE_FREETRANS:
11656  /* in FREETRANS stage, we don't need to remove the variable, because the transformed problem is freed anyways */
11657  *deleted = FALSE;
11658 
11659  return SCIP_OKAY;
11660  default:
11661  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11662  return SCIP_INVALIDCALL;
11663  } /*lint !e788*/
11664 }
11665 
11666 /** gets variables of the problem along with the numbers of different variable types; data may become invalid after
11667  * calls to SCIPchgVarType(), SCIPfixVar(), SCIPaggregateVars(), and SCIPmultiaggregateVar()
11668  *
11669  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
11670  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11671  *
11672  * @pre This method can be called if @p scip is in one of the following stages:
11673  * - \ref SCIP_STAGE_PROBLEM
11674  * - \ref SCIP_STAGE_TRANSFORMED
11675  * - \ref SCIP_STAGE_INITPRESOLVE
11676  * - \ref SCIP_STAGE_PRESOLVING
11677  * - \ref SCIP_STAGE_EXITPRESOLVE
11678  * - \ref SCIP_STAGE_PRESOLVED
11679  * - \ref SCIP_STAGE_INITSOLVE
11680  * - \ref SCIP_STAGE_SOLVING
11681  * - \ref SCIP_STAGE_SOLVED
11682  * - \ref SCIP_STAGE_EXITSOLVE
11683  *
11684  * @note Variables in the vars array are ordered: binaries first, then integers, implicit integers and continuous last.
11685  */
11687  SCIP* scip, /**< SCIP data structure */
11688  SCIP_VAR*** vars, /**< pointer to store variables array or NULL if not needed */
11689  int* nvars, /**< pointer to store number of variables or NULL if not needed */
11690  int* nbinvars, /**< pointer to store number of binary variables or NULL if not needed */
11691  int* nintvars, /**< pointer to store number of integer variables or NULL if not needed */
11692  int* nimplvars, /**< pointer to store number of implicit integral vars or NULL if not needed */
11693  int* ncontvars /**< pointer to store number of continuous variables or NULL if not needed */
11694  )
11695 {
11696  SCIP_CALL( checkStage(scip, "SCIPgetVarsData", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11697 
11698  switch( scip->set->stage )
11699  {
11700  case SCIP_STAGE_PROBLEM:
11701  if( vars != NULL )
11702  *vars = scip->origprob->vars;
11703  if( nvars != NULL )
11704  *nvars = scip->origprob->nvars;
11705  if( nbinvars != NULL )
11706  *nbinvars = scip->origprob->nbinvars;
11707  if( nintvars != NULL )
11708  *nintvars = scip->origprob->nintvars;
11709  if( nimplvars != NULL )
11710  *nimplvars = scip->origprob->nimplvars;
11711  if( ncontvars != NULL )
11712  *ncontvars = scip->origprob->ncontvars;
11713  return SCIP_OKAY;
11714 
11717  case SCIP_STAGE_PRESOLVING:
11719  case SCIP_STAGE_PRESOLVED:
11720  case SCIP_STAGE_INITSOLVE:
11721  case SCIP_STAGE_SOLVING:
11722  case SCIP_STAGE_SOLVED:
11723  case SCIP_STAGE_EXITSOLVE:
11724  if( vars != NULL )
11725  *vars = scip->transprob->vars;
11726  if( nvars != NULL )
11727  *nvars = scip->transprob->nvars;
11728  if( nbinvars != NULL )
11729  *nbinvars = scip->transprob->nbinvars;
11730  if( nintvars != NULL )
11731  *nintvars = scip->transprob->nintvars;
11732  if( nimplvars != NULL )
11733  *nimplvars = scip->transprob->nimplvars;
11734  if( ncontvars != NULL )
11735  *ncontvars = scip->transprob->ncontvars;
11736  return SCIP_OKAY;
11737 
11738  default:
11739  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11740  return SCIP_INVALIDCALL;
11741  } /*lint !e788*/
11742 }
11743 
11744 /** gets array with active problem variables
11745  *
11746  * @return array with active problem variables
11747  *
11748  * @pre This method can be called if @p scip is in one of the following stages:
11749  * - \ref SCIP_STAGE_PROBLEM
11750  * - \ref SCIP_STAGE_TRANSFORMED
11751  * - \ref SCIP_STAGE_INITPRESOLVE
11752  * - \ref SCIP_STAGE_PRESOLVING
11753  * - \ref SCIP_STAGE_EXITPRESOLVE
11754  * - \ref SCIP_STAGE_PRESOLVED
11755  * - \ref SCIP_STAGE_INITSOLVE
11756  * - \ref SCIP_STAGE_SOLVING
11757  * - \ref SCIP_STAGE_SOLVED
11758  * - \ref SCIP_STAGE_EXITSOLVE
11759  *
11760  * @note Variables in the array are ordered: binaries first, then integers, implicit integers and continuous last.
11761  *
11762  * @warning If your are using the methods which add or change bound of variables (e.g., SCIPchgVarType(), SCIPfixVar(),
11763  * SCIPaggregateVars(), and SCIPmultiaggregateVar()), it can happen that the internal variable array (which is
11764  * accessed via this method) gets resized and/or resorted. This can invalid the data pointer which is returned
11765  * by this method.
11766  */
11768  SCIP* scip /**< SCIP data structure */
11769  )
11770 {
11771  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11772 
11773  switch( scip->set->stage )
11774  {
11775  case SCIP_STAGE_PROBLEM:
11776  return scip->origprob->vars;
11777 
11780  case SCIP_STAGE_PRESOLVING:
11782  case SCIP_STAGE_PRESOLVED:
11783  case SCIP_STAGE_INITSOLVE:
11784  case SCIP_STAGE_SOLVING:
11785  case SCIP_STAGE_SOLVED:
11786  case SCIP_STAGE_EXITSOLVE:
11787  return scip->transprob->vars;
11788 
11789  default:
11790  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11791  SCIPABORT();
11792  return NULL; /*lint !e527*/
11793  } /*lint !e788*/
11794 }
11795 
11796 /** gets number of active problem variables
11797  *
11798  * @return the number of active problem variables
11799  *
11800  * @pre This method can be called if @p scip is in one of the following stages:
11801  * - \ref SCIP_STAGE_PROBLEM
11802  * - \ref SCIP_STAGE_TRANSFORMED
11803  * - \ref SCIP_STAGE_INITPRESOLVE
11804  * - \ref SCIP_STAGE_PRESOLVING
11805  * - \ref SCIP_STAGE_EXITPRESOLVE
11806  * - \ref SCIP_STAGE_PRESOLVED
11807  * - \ref SCIP_STAGE_INITSOLVE
11808  * - \ref SCIP_STAGE_SOLVING
11809  * - \ref SCIP_STAGE_SOLVED
11810  * - \ref SCIP_STAGE_EXITSOLVE
11811  */
11813  SCIP* scip /**< SCIP data structure */
11814  )
11815 {
11816  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11817 
11818  switch( scip->set->stage )
11819  {
11820  case SCIP_STAGE_PROBLEM:
11821  return scip->origprob->nvars;
11822 
11825  case SCIP_STAGE_PRESOLVING:
11827  case SCIP_STAGE_PRESOLVED:
11828  case SCIP_STAGE_INITSOLVE:
11829  case SCIP_STAGE_SOLVING:
11830  case SCIP_STAGE_SOLVED:
11831  case SCIP_STAGE_EXITSOLVE:
11832  return scip->transprob->nvars;
11833 
11834  default:
11835  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11836  SCIPABORT();
11837  return 0; /*lint !e527*/
11838  } /*lint !e788*/
11839 }
11840 
11841 /** gets number of binary active problem variables
11842  *
11843  * @return the number of binary active problem variables
11844  *
11845  * @pre This method can be called if @p scip is in one of the following stages:
11846  * - \ref SCIP_STAGE_PROBLEM
11847  * - \ref SCIP_STAGE_TRANSFORMED
11848  * - \ref SCIP_STAGE_INITPRESOLVE
11849  * - \ref SCIP_STAGE_PRESOLVING
11850  * - \ref SCIP_STAGE_EXITPRESOLVE
11851  * - \ref SCIP_STAGE_PRESOLVED
11852  * - \ref SCIP_STAGE_INITSOLVE
11853  * - \ref SCIP_STAGE_SOLVING
11854  * - \ref SCIP_STAGE_SOLVED
11855  * - \ref SCIP_STAGE_EXITSOLVE
11856  */
11858  SCIP* scip /**< SCIP data structure */
11859  )
11860 {
11861  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBinVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11862 
11863  switch( scip->set->stage )
11864  {
11865  case SCIP_STAGE_PROBLEM:
11866  return scip->origprob->nbinvars;
11867 
11870  case SCIP_STAGE_PRESOLVING:
11872  case SCIP_STAGE_PRESOLVED:
11873  case SCIP_STAGE_INITSOLVE:
11874  case SCIP_STAGE_SOLVING:
11875  case SCIP_STAGE_SOLVED:
11876  case SCIP_STAGE_EXITSOLVE:
11877  return scip->transprob->nbinvars;
11878 
11879  default:
11880  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11881  SCIPABORT();
11882  return 0; /*lint !e527*/
11883  } /*lint !e788*/
11884 }
11885 
11886 /** gets number of integer active problem variables
11887  *
11888  * @return the number of integer active problem variables
11889  *
11890  * @pre This method can be called if @p scip is in one of the following stages:
11891  * - \ref SCIP_STAGE_PROBLEM
11892  * - \ref SCIP_STAGE_TRANSFORMED
11893  * - \ref SCIP_STAGE_INITPRESOLVE
11894  * - \ref SCIP_STAGE_PRESOLVING
11895  * - \ref SCIP_STAGE_EXITPRESOLVE
11896  * - \ref SCIP_STAGE_PRESOLVED
11897  * - \ref SCIP_STAGE_INITSOLVE
11898  * - \ref SCIP_STAGE_SOLVING
11899  * - \ref SCIP_STAGE_SOLVED
11900  * - \ref SCIP_STAGE_EXITSOLVE
11901  */
11903  SCIP* scip /**< SCIP data structure */
11904  )
11905 {
11906  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNIntVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11907 
11908  switch( scip->set->stage )
11909  {
11910  case SCIP_STAGE_PROBLEM:
11911  return scip->origprob->nintvars;
11912 
11915  case SCIP_STAGE_PRESOLVING:
11917  case SCIP_STAGE_PRESOLVED:
11918  case SCIP_STAGE_INITSOLVE:
11919  case SCIP_STAGE_SOLVING:
11920  case SCIP_STAGE_SOLVED:
11921  case SCIP_STAGE_EXITSOLVE:
11922  return scip->transprob->nintvars;
11923 
11924  default:
11925  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11926  SCIPABORT();
11927  return 0; /*lint !e527*/
11928  } /*lint !e788*/
11929 }
11930 
11931 /** gets number of implicit integer active problem variables
11932  *
11933  * @return the number of implicit integer active problem variables
11934  *
11935  * @pre This method can be called if @p scip is in one of the following stages:
11936  * - \ref SCIP_STAGE_PROBLEM
11937  * - \ref SCIP_STAGE_TRANSFORMED
11938  * - \ref SCIP_STAGE_INITPRESOLVE
11939  * - \ref SCIP_STAGE_PRESOLVING
11940  * - \ref SCIP_STAGE_EXITPRESOLVE
11941  * - \ref SCIP_STAGE_PRESOLVED
11942  * - \ref SCIP_STAGE_INITSOLVE
11943  * - \ref SCIP_STAGE_SOLVING
11944  * - \ref SCIP_STAGE_SOLVED
11945  * - \ref SCIP_STAGE_EXITSOLVE
11946  */
11948  SCIP* scip /**< SCIP data structure */
11949  )
11950 {
11951  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNImplVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11952 
11953  switch( scip->set->stage )
11954  {
11955  case SCIP_STAGE_PROBLEM:
11956  return scip->origprob->nimplvars;
11957 
11960  case SCIP_STAGE_PRESOLVING:
11962  case SCIP_STAGE_PRESOLVED:
11963  case SCIP_STAGE_INITSOLVE:
11964  case SCIP_STAGE_SOLVING:
11965  case SCIP_STAGE_SOLVED:
11966  case SCIP_STAGE_EXITSOLVE:
11967  return scip->transprob->nimplvars;
11968 
11969  default:
11970  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11971  SCIPABORT();
11972  return 0; /*lint !e527*/
11973  } /*lint !e788*/
11974 }
11975 
11976 /** gets number of continuous active problem variables
11977  *
11978  * @return the number of continuous active problem variables
11979  *
11980  * @pre This method can be called if @p scip is in one of the following stages:
11981  * - \ref SCIP_STAGE_PROBLEM
11982  * - \ref SCIP_STAGE_TRANSFORMED
11983  * - \ref SCIP_STAGE_INITPRESOLVE
11984  * - \ref SCIP_STAGE_PRESOLVING
11985  * - \ref SCIP_STAGE_EXITPRESOLVE
11986  * - \ref SCIP_STAGE_PRESOLVED
11987  * - \ref SCIP_STAGE_INITSOLVE
11988  * - \ref SCIP_STAGE_SOLVING
11989  * - \ref SCIP_STAGE_SOLVED
11990  * - \ref SCIP_STAGE_EXITSOLVE
11991  */
11993  SCIP* scip /**< SCIP data structure */
11994  )
11995 {
11996  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNContVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11997 
11998  switch( scip->set->stage )
11999  {
12000  case SCIP_STAGE_PROBLEM:
12001  return scip->origprob->ncontvars;
12002 
12005  case SCIP_STAGE_PRESOLVING:
12007  case SCIP_STAGE_PRESOLVED:
12008  case SCIP_STAGE_INITSOLVE:
12009  case SCIP_STAGE_SOLVING:
12010  case SCIP_STAGE_SOLVED:
12011  case SCIP_STAGE_EXITSOLVE:
12012  return scip->transprob->ncontvars;
12013 
12014  default:
12015  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12016  SCIPABORT();
12017  return 0; /*lint !e527*/
12018  } /*lint !e788*/
12019 }
12020 
12021 
12022 /** gets number of active problem variables with a non-zero objective coefficient
12023  *
12024  * @note In case of the original problem the number of variables is counted. In case of the transformed problem the
12025  * number of variables is just returned since it is stored internally
12026  *
12027  * @return the number of active problem variables with a non-zero objective coefficient
12028  *
12029  * @pre This method can be called if @p scip is in one of the following stages:
12030  * - \ref SCIP_STAGE_PROBLEM
12031  * - \ref SCIP_STAGE_TRANSFORMED
12032  * - \ref SCIP_STAGE_INITPRESOLVE
12033  * - \ref SCIP_STAGE_PRESOLVING
12034  * - \ref SCIP_STAGE_EXITPRESOLVE
12035  * - \ref SCIP_STAGE_PRESOLVED
12036  * - \ref SCIP_STAGE_INITSOLVE
12037  * - \ref SCIP_STAGE_SOLVING
12038  * - \ref SCIP_STAGE_SOLVED
12039  */
12041  SCIP* scip /**< SCIP data structure */
12042  )
12043 {
12044  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNObjVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
12045 
12046  switch( scip->set->stage )
12047  {
12048  case SCIP_STAGE_PROBLEM:
12049  return SCIPprobGetNObjVars(scip->origprob, scip->set);
12050 
12053  case SCIP_STAGE_PRESOLVING:
12055  case SCIP_STAGE_PRESOLVED:
12056  case SCIP_STAGE_INITSOLVE:
12057  case SCIP_STAGE_SOLVING:
12058  case SCIP_STAGE_SOLVED:
12059  return SCIPprobGetNObjVars(scip->transprob, scip->set);
12060 
12061  default:
12062  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12063  SCIPABORT();
12064  return 0; /*lint !e527*/
12065  } /*lint !e788*/
12066 }
12067 
12068 
12069 /** gets array with fixed and aggregated problem variables; data may become invalid after
12070  * calls to SCIPfixVar(), SCIPaggregateVars(), and SCIPmultiaggregateVar()
12071  *
12072  * @return an array with fixed and aggregated problem variables; data may become invalid after
12073  * calls to SCIPfixVar(), SCIPaggregateVars(), and SCIPmultiaggregateVar()
12074  *
12075  * @pre This method can be called if @p scip is in one of the following stages:
12076  * - \ref SCIP_STAGE_PROBLEM
12077  * - \ref SCIP_STAGE_TRANSFORMED
12078  * - \ref SCIP_STAGE_INITPRESOLVE
12079  * - \ref SCIP_STAGE_PRESOLVING
12080  * - \ref SCIP_STAGE_EXITPRESOLVE
12081  * - \ref SCIP_STAGE_PRESOLVED
12082  * - \ref SCIP_STAGE_INITSOLVE
12083  * - \ref SCIP_STAGE_SOLVING
12084  * - \ref SCIP_STAGE_SOLVED
12085  */
12087  SCIP* scip /**< SCIP data structure */
12088  )
12089 {
12090  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFixedVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
12091 
12092  switch( scip->set->stage )
12093  {
12094  case SCIP_STAGE_PROBLEM:
12095  return NULL;
12096 
12099  case SCIP_STAGE_PRESOLVING:
12101  case SCIP_STAGE_PRESOLVED:
12102  case SCIP_STAGE_INITSOLVE:
12103  case SCIP_STAGE_SOLVING:
12104  case SCIP_STAGE_SOLVED:
12105  return scip->transprob->fixedvars;
12106 
12107  default:
12108  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12109  SCIPABORT();
12110  return NULL; /*lint !e527*/
12111  } /*lint !e788*/
12112 }
12113 
12114 /** gets number of fixed or aggregated problem variables
12115  *
12116  * @return the number of fixed or aggregated problem variables
12117  *
12118  * @pre This method can be called if @p scip is in one of the following stages:
12119  * - \ref SCIP_STAGE_PROBLEM
12120  * - \ref SCIP_STAGE_TRANSFORMED
12121  * - \ref SCIP_STAGE_INITPRESOLVE
12122  * - \ref SCIP_STAGE_PRESOLVING
12123  * - \ref SCIP_STAGE_EXITPRESOLVE
12124  * - \ref SCIP_STAGE_PRESOLVED
12125  * - \ref SCIP_STAGE_INITSOLVE
12126  * - \ref SCIP_STAGE_SOLVING
12127  * - \ref SCIP_STAGE_SOLVED
12128  */
12130  SCIP* scip /**< SCIP data structure */
12131  )
12132 {
12133  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNFixedVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
12134 
12135  switch( scip->set->stage )
12136  {
12137  case SCIP_STAGE_PROBLEM:
12138  return 0;
12139 
12142  case SCIP_STAGE_PRESOLVING:
12144  case SCIP_STAGE_PRESOLVED:
12145  case SCIP_STAGE_INITSOLVE:
12146  case SCIP_STAGE_SOLVING:
12147  case SCIP_STAGE_SOLVED:
12148  return scip->transprob->nfixedvars;
12149 
12150  default:
12151  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12152  SCIPABORT();
12153  return 0; /*lint !e527*/
12154  } /*lint !e788*/
12155 }
12156 
12157 /** gets variables of the original problem along with the numbers of different variable types; data may become invalid
12158  * after a call to SCIPchgVarType()
12159  *
12160  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12161  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12162  *
12163  * @pre This method can be called if @p scip is in one of the following stages:
12164  * - \ref SCIP_STAGE_PROBLEM
12165  * - \ref SCIP_STAGE_TRANSFORMING
12166  * - \ref SCIP_STAGE_TRANSFORMED
12167  * - \ref SCIP_STAGE_INITPRESOLVE
12168  * - \ref SCIP_STAGE_PRESOLVING
12169  * - \ref SCIP_STAGE_EXITPRESOLVE
12170  * - \ref SCIP_STAGE_PRESOLVED
12171  * - \ref SCIP_STAGE_INITSOLVE
12172  * - \ref SCIP_STAGE_SOLVING
12173  * - \ref SCIP_STAGE_SOLVED
12174  * - \ref SCIP_STAGE_EXITSOLVE
12175  * - \ref SCIP_STAGE_FREETRANS
12176  */
12178  SCIP* scip, /**< SCIP data structure */
12179  SCIP_VAR*** vars, /**< pointer to store variables array or NULL if not needed */
12180  int* nvars, /**< pointer to store number of variables or NULL if not needed */
12181  int* nbinvars, /**< pointer to store number of binary variables or NULL if not needed */
12182  int* nintvars, /**< pointer to store number of integer variables or NULL if not needed */
12183  int* nimplvars, /**< pointer to store number of implicit integral vars or NULL if not needed */
12184  int* ncontvars /**< pointer to store number of continuous variables or NULL if not needed */
12185  )
12186 {
12187  SCIP_CALL( checkStage(scip, "SCIPgetOrigVarsData", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12188 
12189  if( vars != NULL )
12190  *vars = scip->origprob->vars;
12191  if( nvars != NULL )
12192  *nvars = scip->origprob->nvars;
12193  if( nbinvars != NULL )
12194  *nbinvars = scip->origprob->nbinvars;
12195  if( nintvars != NULL )
12196  *nintvars = scip->origprob->nintvars;
12197  if( nimplvars != NULL )
12198  *nimplvars = scip->origprob->nimplvars;
12199  if( ncontvars != NULL )
12200  *ncontvars = scip->origprob->ncontvars;
12201 
12202  return SCIP_OKAY;
12203 }
12204 
12205 /** gets array with original problem variables; data may become invalid after
12206  * a call to SCIPchgVarType()
12207  *
12208  * @return an array with original problem variables; data may become invalid after
12209  * a call to SCIPchgVarType()
12210  *
12211  * @pre This method can be called if @p scip is in one of the following stages:
12212  * - \ref SCIP_STAGE_PROBLEM
12213  * - \ref SCIP_STAGE_TRANSFORMING
12214  * - \ref SCIP_STAGE_TRANSFORMED
12215  * - \ref SCIP_STAGE_INITPRESOLVE
12216  * - \ref SCIP_STAGE_PRESOLVING
12217  * - \ref SCIP_STAGE_EXITPRESOLVE
12218  * - \ref SCIP_STAGE_PRESOLVED
12219  * - \ref SCIP_STAGE_INITSOLVE
12220  * - \ref SCIP_STAGE_SOLVING
12221  * - \ref SCIP_STAGE_SOLVED
12222  * - \ref SCIP_STAGE_EXITSOLVE
12223  * - \ref SCIP_STAGE_FREETRANS
12224  */
12226  SCIP* scip /**< SCIP data structure */
12227  )
12228 {
12229  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetOrigVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12230 
12231  return scip->origprob->vars;
12232 }
12233 
12234 /** gets number of original problem variables
12235  *
12236  * @return the number of original problem variables
12237  *
12238  * @pre This method can be called if @p scip is in one of the following stages:
12239  * - \ref SCIP_STAGE_PROBLEM
12240  * - \ref SCIP_STAGE_TRANSFORMING
12241  * - \ref SCIP_STAGE_TRANSFORMED
12242  * - \ref SCIP_STAGE_INITPRESOLVE
12243  * - \ref SCIP_STAGE_PRESOLVING
12244  * - \ref SCIP_STAGE_EXITPRESOLVE
12245  * - \ref SCIP_STAGE_PRESOLVED
12246  * - \ref SCIP_STAGE_INITSOLVE
12247  * - \ref SCIP_STAGE_SOLVING
12248  * - \ref SCIP_STAGE_SOLVED
12249  * - \ref SCIP_STAGE_EXITSOLVE
12250  * - \ref SCIP_STAGE_FREETRANS
12251  */
12253  SCIP* scip /**< SCIP data structure */
12254  )
12255 {
12256  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12257 
12258  return scip->origprob->nvars;
12259 }
12260 
12261 /** gets number of binary variables in the original problem
12262  *
12263  * @return the number of binary variables in the original problem
12264  *
12265  * @pre This method can be called if @p scip is in one of the following stages:
12266  * - \ref SCIP_STAGE_PROBLEM
12267  * - \ref SCIP_STAGE_TRANSFORMING
12268  * - \ref SCIP_STAGE_TRANSFORMED
12269  * - \ref SCIP_STAGE_INITPRESOLVE
12270  * - \ref SCIP_STAGE_PRESOLVING
12271  * - \ref SCIP_STAGE_EXITPRESOLVE
12272  * - \ref SCIP_STAGE_PRESOLVED
12273  * - \ref SCIP_STAGE_INITSOLVE
12274  * - \ref SCIP_STAGE_SOLVING
12275  * - \ref SCIP_STAGE_SOLVED
12276  * - \ref SCIP_STAGE_EXITSOLVE
12277  * - \ref SCIP_STAGE_FREETRANS
12278  */
12280  SCIP* scip /**< SCIP data structure */
12281  )
12282 {
12283  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigBinVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12284 
12285  return scip->origprob->nbinvars;
12286 }
12287 
12288 /** gets the number of integer variables in the original problem
12289  *
12290  * @return the number of integer variables in the original problem
12291  *
12292  * @pre This method can be called if @p scip is in one of the following stages:
12293  * - \ref SCIP_STAGE_PROBLEM
12294  * - \ref SCIP_STAGE_TRANSFORMING
12295  * - \ref SCIP_STAGE_TRANSFORMED
12296  * - \ref SCIP_STAGE_INITPRESOLVE
12297  * - \ref SCIP_STAGE_PRESOLVING
12298  * - \ref SCIP_STAGE_EXITPRESOLVE
12299  * - \ref SCIP_STAGE_PRESOLVED
12300  * - \ref SCIP_STAGE_INITSOLVE
12301  * - \ref SCIP_STAGE_SOLVING
12302  * - \ref SCIP_STAGE_SOLVED
12303  * - \ref SCIP_STAGE_EXITSOLVE
12304  * - \ref SCIP_STAGE_FREETRANS
12305  */
12307  SCIP* scip /**< SCIP data structure */
12308  )
12309 {
12310  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigIntVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12311 
12312  return scip->origprob->nintvars;
12313 }
12314 
12315 /** gets number of implicit integer variables in the original problem
12316  *
12317  * @return the number of implicit integer variables in the original problem
12318  *
12319  * @pre This method can be called if @p scip is in one of the following stages:
12320  * - \ref SCIP_STAGE_PROBLEM
12321  * - \ref SCIP_STAGE_TRANSFORMING
12322  * - \ref SCIP_STAGE_TRANSFORMED
12323  * - \ref SCIP_STAGE_INITPRESOLVE
12324  * - \ref SCIP_STAGE_PRESOLVING
12325  * - \ref SCIP_STAGE_EXITPRESOLVE
12326  * - \ref SCIP_STAGE_PRESOLVED
12327  * - \ref SCIP_STAGE_INITSOLVE
12328  * - \ref SCIP_STAGE_SOLVING
12329  * - \ref SCIP_STAGE_SOLVED
12330  * - \ref SCIP_STAGE_EXITSOLVE
12331  * - \ref SCIP_STAGE_FREETRANS
12332  */
12334  SCIP* scip /**< SCIP data structure */
12335  )
12336 {
12337  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigImplVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12338 
12339  return scip->origprob->nimplvars;
12340 }
12341 
12342 /** gets number of continuous variables in the original problem
12343  *
12344  * @return the number of continuous variables in the original problem
12345  *
12346  * @pre This method can be called if @p scip is in one of the following stages:
12347  * - \ref SCIP_STAGE_PROBLEM
12348  * - \ref SCIP_STAGE_TRANSFORMING
12349  * - \ref SCIP_STAGE_TRANSFORMED
12350  * - \ref SCIP_STAGE_INITPRESOLVE
12351  * - \ref SCIP_STAGE_PRESOLVING
12352  * - \ref SCIP_STAGE_EXITPRESOLVE
12353  * - \ref SCIP_STAGE_PRESOLVED
12354  * - \ref SCIP_STAGE_INITSOLVE
12355  * - \ref SCIP_STAGE_SOLVING
12356  * - \ref SCIP_STAGE_SOLVED
12357  * - \ref SCIP_STAGE_EXITSOLVE
12358  * - \ref SCIP_STAGE_FREETRANS
12359  */
12361  SCIP* scip /**< SCIP data structure */
12362  )
12363 {
12364  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigContVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12365 
12366  return scip->origprob->ncontvars;
12367 }
12368 
12369 /** gets number of all problem variables created during creation and solving of problem;
12370  * this includes also variables that were deleted in the meantime
12371  *
12372  * @return the number of all problem variables created during creation and solving of problem;
12373  * this includes also variables that were deleted in the meantime
12374  *
12375  * @pre This method can be called if @p scip is in one of the following stages:
12376  * - \ref SCIP_STAGE_PROBLEM
12377  * - \ref SCIP_STAGE_TRANSFORMING
12378  * - \ref SCIP_STAGE_TRANSFORMED
12379  * - \ref SCIP_STAGE_INITPRESOLVE
12380  * - \ref SCIP_STAGE_PRESOLVING
12381  * - \ref SCIP_STAGE_EXITPRESOLVE
12382  * - \ref SCIP_STAGE_PRESOLVED
12383  * - \ref SCIP_STAGE_INITSOLVE
12384  * - \ref SCIP_STAGE_SOLVING
12385  * - \ref SCIP_STAGE_SOLVED
12386  * - \ref SCIP_STAGE_EXITSOLVE
12387  * - \ref SCIP_STAGE_FREETRANS
12388  */
12390  SCIP* scip /**< SCIP data structure */
12391  )
12392 {
12393  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNTotalVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12394 
12395  assert(scip->stat != NULL);
12396 
12397  switch( scip->set->stage )
12398  {
12399  case SCIP_STAGE_PROBLEM:
12403  case SCIP_STAGE_PRESOLVING:
12405  case SCIP_STAGE_PRESOLVED:
12406  case SCIP_STAGE_INITSOLVE:
12407  case SCIP_STAGE_SOLVING:
12408  case SCIP_STAGE_SOLVED:
12409  case SCIP_STAGE_EXITSOLVE:
12410  case SCIP_STAGE_FREETRANS:
12411  return scip->stat->nvaridx;
12412 
12413  default:
12414  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12415  SCIPABORT();
12416  return 0; /*lint !e527*/
12417  } /*lint !e788*/
12418 
12419 }
12420 
12421 
12422 /** gets variables of the original or transformed problem along with the numbers of different variable types;
12423  * the returned problem space (original or transformed) corresponds to the given solution;
12424  * data may become invalid after calls to SCIPchgVarType(), SCIPfixVar(), SCIPaggregateVars(), and
12425  * SCIPmultiaggregateVar()
12426  *
12427  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12428  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12429  *
12430  * @pre This method can be called if @p scip is in one of the following stages:
12431  * - \ref SCIP_STAGE_PROBLEM
12432  * - \ref SCIP_STAGE_TRANSFORMED
12433  * - \ref SCIP_STAGE_INITPRESOLVE
12434  * - \ref SCIP_STAGE_PRESOLVING
12435  * - \ref SCIP_STAGE_EXITPRESOLVE
12436  * - \ref SCIP_STAGE_PRESOLVED
12437  * - \ref SCIP_STAGE_INITSOLVE
12438  * - \ref SCIP_STAGE_SOLVING
12439  * - \ref SCIP_STAGE_SOLVED
12440  */
12442  SCIP* scip, /**< SCIP data structure */
12443  SCIP_SOL* sol, /**< primal solution that selects the problem space, NULL for current solution */
12444  SCIP_VAR*** vars, /**< pointer to store variables array or NULL if not needed */
12445  int* nvars, /**< pointer to store number of variables or NULL if not needed */
12446  int* nbinvars, /**< pointer to store number of binary variables or NULL if not needed */
12447  int* nintvars, /**< pointer to store number of integer variables or NULL if not needed */
12448  int* nimplvars, /**< pointer to store number of implicit integral vars or NULL if not needed */
12449  int* ncontvars /**< pointer to store number of continuous variables or NULL if not needed */
12450  )
12451 {
12452  SCIP_CALL( checkStage(scip, "SCIPgetSolVarsData", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
12453 
12454  if( scip->set->stage == SCIP_STAGE_PROBLEM || (sol != NULL && SCIPsolIsOriginal(sol)) )
12455  {
12456  if( vars != NULL )
12457  *vars = scip->origprob->vars;
12458  if( nvars != NULL )
12459  *nvars = scip->origprob->nvars;
12460  if( nbinvars != NULL )
12461  *nbinvars = scip->origprob->nbinvars;
12462  if( nintvars != NULL )
12463  *nintvars = scip->origprob->nintvars;
12464  if( nimplvars != NULL )
12465  *nimplvars = scip->origprob->nimplvars;
12466  if( ncontvars != NULL )
12467  *ncontvars = scip->origprob->ncontvars;
12468  }
12469  else
12470  {
12471  if( vars != NULL )
12472  *vars = scip->transprob->vars;
12473  if( nvars != NULL )
12474  *nvars = scip->transprob->nvars;
12475  if( nbinvars != NULL )
12476  *nbinvars = scip->transprob->nbinvars;
12477  if( nintvars != NULL )
12478  *nintvars = scip->transprob->nintvars;
12479  if( nimplvars != NULL )
12480  *nimplvars = scip->transprob->nimplvars;
12481  if( ncontvars != NULL )
12482  *ncontvars = scip->transprob->ncontvars;
12483  }
12484 
12485  return SCIP_OKAY;
12486 }
12487 
12488 /** returns variable of given name in the problem, or NULL if not existing
12489  *
12490  * @return variable of given name in the problem, or NULL if not existing
12491  *
12492  * @pre This method can be called if @p scip is in one of the following stages:
12493  * - \ref SCIP_STAGE_PROBLEM
12494  * - \ref SCIP_STAGE_TRANSFORMING
12495  * - \ref SCIP_STAGE_TRANSFORMED
12496  * - \ref SCIP_STAGE_INITPRESOLVE
12497  * - \ref SCIP_STAGE_PRESOLVING
12498  * - \ref SCIP_STAGE_EXITPRESOLVE
12499  * - \ref SCIP_STAGE_PRESOLVED
12500  * - \ref SCIP_STAGE_INITSOLVE
12501  * - \ref SCIP_STAGE_SOLVING
12502  * - \ref SCIP_STAGE_SOLVED
12503  * - \ref SCIP_STAGE_EXITSOLVE
12504  * - \ref SCIP_STAGE_FREETRANS
12505  */
12507  SCIP* scip, /**< SCIP data structure */
12508  const char* name /**< name of variable to find */
12509  )
12510 {
12511  SCIP_VAR* var;
12512 
12513  assert(name != NULL);
12514 
12515  SCIP_CALL_ABORT( checkStage(scip, "SCIPfindVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12516 
12517  switch( scip->set->stage )
12518  {
12519  case SCIP_STAGE_PROBLEM:
12520  return SCIPprobFindVar(scip->origprob, name);
12521 
12525  case SCIP_STAGE_PRESOLVING:
12527  case SCIP_STAGE_PRESOLVED:
12528  case SCIP_STAGE_INITSOLVE:
12529  case SCIP_STAGE_SOLVING:
12530  case SCIP_STAGE_SOLVED:
12531  case SCIP_STAGE_EXITSOLVE:
12532  case SCIP_STAGE_FREETRANS:
12533  var = SCIPprobFindVar(scip->transprob, name);
12534  if( var == NULL )
12535  return SCIPprobFindVar(scip->origprob, name);
12536  else
12537  return var;
12538 
12539  default:
12540  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12541  SCIPABORT();
12542  return NULL; /*lint !e527*/
12543  } /*lint !e788*/
12544 }
12545 
12546 /** returns TRUE iff all potential variables exist in the problem, and FALSE, if there may be additional variables,
12547  * that will be added in pricing and improve the objective value
12548  *
12549  * @return TRUE, if all potential variables exist in the problem; FALSE, otherwise
12550  *
12551  * @pre This method can be called if @p scip is in one of the following stages:
12552  * - \ref SCIP_STAGE_TRANSFORMING
12553  * - \ref SCIP_STAGE_TRANSFORMED
12554  * - \ref SCIP_STAGE_INITPRESOLVE
12555  * - \ref SCIP_STAGE_PRESOLVING
12556  * - \ref SCIP_STAGE_EXITPRESOLVE
12557  * - \ref SCIP_STAGE_PRESOLVED
12558  * - \ref SCIP_STAGE_INITSOLVE
12559  * - \ref SCIP_STAGE_SOLVING
12560  * - \ref SCIP_STAGE_SOLVED
12561  * - \ref SCIP_STAGE_EXITSOLVE
12562  * - \ref SCIP_STAGE_FREETRANS
12563  */
12565  SCIP* scip /**< SCIP data structure */
12566  )
12567 {
12568  SCIP_CALL_ABORT( checkStage(scip, "SCIPallVarsInProb", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12569 
12570  return (scip->set->nactivepricers == 0);
12571 }
12572 
12573 /** adds constraint to the problem; if constraint is only valid locally, it is added to the local subproblem of the
12574  * current node (and all of its subnodes); otherwise it is added to the global problem;
12575  * if a local constraint is added at the root node, it is automatically upgraded into a global constraint
12576  *
12577  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12578  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12579  *
12580  * @pre This method can be called if @p scip is in one of the following stages:
12581  * - \ref SCIP_STAGE_PROBLEM
12582  * - \ref SCIP_STAGE_TRANSFORMED
12583  * - \ref SCIP_STAGE_INITPRESOLVE
12584  * - \ref SCIP_STAGE_PRESOLVING
12585  * - \ref SCIP_STAGE_EXITPRESOLVE
12586  * - \ref SCIP_STAGE_PRESOLVED
12587  * - \ref SCIP_STAGE_INITSOLVE
12588  * - \ref SCIP_STAGE_SOLVING
12589  * - \ref SCIP_STAGE_EXITSOLVE
12590  */
12592  SCIP* scip, /**< SCIP data structure */
12593  SCIP_CONS* cons /**< constraint to add */
12594  )
12595 {
12596  assert(cons != NULL);
12597 
12598  SCIP_CALL( checkStage(scip, "SCIPaddCons", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
12599 
12600  switch( scip->set->stage )
12601  {
12602  case SCIP_STAGE_PROBLEM:
12603  {
12604  SCIP_CALL( SCIPprobAddCons(scip->origprob, scip->set, scip->stat, cons) );
12605 
12606  if( scip->set->reopt_enable )
12607  {
12608  SCIP_CALL( SCIPreoptAddCons(scip->reopt, scip->set, scip->mem->probmem, cons) );
12609  }
12610  }
12611  return SCIP_OKAY;
12612 
12614  SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
12615  return SCIP_OKAY;
12616 
12618  case SCIP_STAGE_PRESOLVING:
12620  case SCIP_STAGE_PRESOLVED:
12621  case SCIP_STAGE_INITSOLVE:
12622  case SCIP_STAGE_SOLVING:
12623  assert( SCIPtreeGetCurrentDepth(scip->tree) >= 0 || scip->set->stage == SCIP_STAGE_PRESOLVED );
12625  SCIPconsSetLocal(cons, FALSE);
12626  if( SCIPconsIsGlobal(cons) )
12627  {
12628  SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
12629  }
12630  else
12631  {
12633  SCIP_CALL( SCIPnodeAddCons(SCIPtreeGetCurrentNode(scip->tree), scip->mem->probmem, scip->set, scip->stat,
12634  scip->tree, cons) );
12635  }
12636  return SCIP_OKAY;
12637 
12638  case SCIP_STAGE_EXITSOLVE:
12639  SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
12640  return SCIP_OKAY;
12641 
12642  default:
12643  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12644  return SCIP_INVALIDCALL;
12645  } /*lint !e788*/
12646 }
12647 
12648 /** globally removes constraint from all subproblems; removes constraint from the constraint set change data of the
12649  * node, where it was added, or from the problem, if it was a problem constraint
12650  *
12651  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12652  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12653  *
12654  * @pre This method can be called if @p scip is in one of the following stages:
12655  * - \ref SCIP_STAGE_PROBLEM
12656  * - \ref SCIP_STAGE_INITPRESOLVE
12657  * - \ref SCIP_STAGE_PRESOLVING
12658  * - \ref SCIP_STAGE_EXITPRESOLVE
12659  * - \ref SCIP_STAGE_INITSOLVE
12660  * - \ref SCIP_STAGE_SOLVING
12661  * - \ref SCIP_STAGE_EXITSOLVE
12662  */
12664  SCIP* scip, /**< SCIP data structure */
12665  SCIP_CONS* cons /**< constraint to delete */
12666  )
12667 {
12668  assert(cons != NULL);
12669 
12670  SCIP_CALL( checkStage(scip, "SCIPdelCons", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
12671 
12672  switch( scip->set->stage )
12673  {
12674  case SCIP_STAGE_PROBLEM:
12675  assert(cons->addconssetchg == NULL);
12676  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->reopt) );
12677  return SCIP_OKAY;
12678 
12679  /* only added constraints can be removed in (de-)initialization process of presolving, otherwise the reduction
12680  * might be wrong
12681  */
12684  assert(SCIPconsIsAdded(cons));
12685  /*lint -fallthrough*/
12686 
12687  case SCIP_STAGE_PRESOLVING:
12688  case SCIP_STAGE_INITSOLVE:
12689  case SCIP_STAGE_SOLVING:
12690  case SCIP_STAGE_EXITSOLVE:
12691  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->reopt) );
12692  return SCIP_OKAY;
12693 
12694  default:
12695  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12696  return SCIP_INVALIDCALL;
12697  } /*lint !e788*/
12698 }
12699 
12700 /** returns original constraint of given name in the problem, or NULL if not existing
12701  *
12702  * @return original constraint of given name in the problem, or NULL if not existing
12703  *
12704  * @pre This method can be called if @p scip is in one of the following stages:
12705  * - \ref SCIP_STAGE_PROBLEM
12706  * - \ref SCIP_STAGE_TRANSFORMING
12707  * - \ref SCIP_STAGE_TRANSFORMED
12708  * - \ref SCIP_STAGE_INITPRESOLVE
12709  * - \ref SCIP_STAGE_PRESOLVING
12710  * - \ref SCIP_STAGE_EXITPRESOLVE
12711  * - \ref SCIP_STAGE_PRESOLVED
12712  * - \ref SCIP_STAGE_INITSOLVE
12713  * - \ref SCIP_STAGE_SOLVING
12714  * - \ref SCIP_STAGE_SOLVED
12715  * - \ref SCIP_STAGE_EXITSOLVE
12716  * - \ref SCIP_STAGE_FREETRANS
12717  */
12719  SCIP* scip, /**< SCIP data structure */
12720  const char* name /**< name of constraint to find */
12721  )
12722 {
12723  assert(name != NULL);
12724 
12725  SCIP_CALL_ABORT( checkStage(scip, "SCIPfindOrigCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12726 
12727  switch( scip->set->stage )
12728  {
12729  case SCIP_STAGE_PROBLEM:
12733  case SCIP_STAGE_PRESOLVING:
12735  case SCIP_STAGE_PRESOLVED:
12736  case SCIP_STAGE_SOLVING:
12737  case SCIP_STAGE_SOLVED:
12738  case SCIP_STAGE_EXITSOLVE:
12739  case SCIP_STAGE_FREETRANS:
12740  return SCIPprobFindCons(scip->origprob, name);
12741 
12742  default:
12743  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12744  SCIPABORT();
12745  return NULL; /*lint !e527*/
12746  } /*lint !e788*/
12747 }
12748 
12749 /** returns constraint of given name in the problem, or NULL if not existing
12750  *
12751  * @return constraint of given name in the problem, or NULL if not existing
12752  *
12753  * @pre This method can be called if @p scip is in one of the following stages:
12754  * - \ref SCIP_STAGE_PROBLEM
12755  * - \ref SCIP_STAGE_TRANSFORMING
12756  * - \ref SCIP_STAGE_TRANSFORMED
12757  * - \ref SCIP_STAGE_INITPRESOLVE
12758  * - \ref SCIP_STAGE_PRESOLVING
12759  * - \ref SCIP_STAGE_EXITPRESOLVE
12760  * - \ref SCIP_STAGE_PRESOLVED
12761  * - \ref SCIP_STAGE_INITSOLVE
12762  * - \ref SCIP_STAGE_SOLVING
12763  * - \ref SCIP_STAGE_SOLVED
12764  * - \ref SCIP_STAGE_EXITSOLVE
12765  * - \ref SCIP_STAGE_FREETRANS
12766  */
12768  SCIP* scip, /**< SCIP data structure */
12769  const char* name /**< name of constraint to find */
12770  )
12771 {
12772  SCIP_CONS* cons;
12773 
12774  assert(name != NULL);
12775 
12776  SCIP_CALL_ABORT( checkStage(scip, "SCIPfindCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12777 
12778  switch( scip->set->stage )
12779  {
12780  case SCIP_STAGE_PROBLEM:
12781  return SCIPprobFindCons(scip->origprob, name);
12782 
12786  case SCIP_STAGE_PRESOLVING:
12788  case SCIP_STAGE_PRESOLVED:
12789  case SCIP_STAGE_SOLVING:
12790  case SCIP_STAGE_SOLVED:
12791  case SCIP_STAGE_EXITSOLVE:
12792  case SCIP_STAGE_FREETRANS:
12793  cons = SCIPprobFindCons(scip->transprob, name);
12794  if( cons == NULL )
12795  return SCIPprobFindCons(scip->origprob, name);
12796  else
12797  return cons;
12798 
12799  default:
12800  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12801  SCIPABORT();
12802  return NULL; /*lint !e527*/
12803  } /*lint !e788*/
12804 }
12805 
12806 /** gets number of upgraded constraints
12807  *
12808  * @return number of upgraded constraints
12809  *
12810  * @pre This method can be called if @p scip is in one of the following stages:
12811  * - \ref SCIP_STAGE_PROBLEM
12812  * - \ref SCIP_STAGE_TRANSFORMED
12813  * - \ref SCIP_STAGE_INITPRESOLVE
12814  * - \ref SCIP_STAGE_PRESOLVING
12815  * - \ref SCIP_STAGE_PRESOLVED
12816  * - \ref SCIP_STAGE_EXITPRESOLVE
12817  * - \ref SCIP_STAGE_SOLVING
12818  * - \ref SCIP_STAGE_SOLVED
12819  */
12821  SCIP* scip /**< SCIP data structure */
12822  )
12823 {
12824  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNUpgrConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
12825 
12826  switch( scip->set->stage )
12827  {
12828  case SCIP_STAGE_PROBLEM:
12829  return 0;
12830 
12833  case SCIP_STAGE_PRESOLVING:
12835  case SCIP_STAGE_PRESOLVED:
12836  case SCIP_STAGE_SOLVING:
12837  case SCIP_STAGE_SOLVED:
12838  return scip->stat->npresolupgdconss;
12839 
12840  default:
12841  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12842  SCIPABORT();
12843  return 0; /*lint !e527*/
12844  } /*lint !e788*/
12845 }
12846 
12847 /** gets total number of globally valid constraints currently in the problem
12848  *
12849  * @return total number of globally valid constraints currently in the problem
12850  *
12851  * @pre This method can be called if @p scip is in one of the following stages:
12852  * - \ref SCIP_STAGE_PROBLEM
12853  * - \ref SCIP_STAGE_TRANSFORMED
12854  * - \ref SCIP_STAGE_INITPRESOLVE
12855  * - \ref SCIP_STAGE_PRESOLVING
12856  * - \ref SCIP_STAGE_EXITPRESOLVE
12857  * - \ref SCIP_STAGE_PRESOLVED
12858  * - \ref SCIP_STAGE_INITSOLVE
12859  * - \ref SCIP_STAGE_SOLVING
12860  * - \ref SCIP_STAGE_SOLVED
12861  */
12863  SCIP* scip /**< SCIP data structure */
12864  )
12865 {
12866  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
12867 
12868  switch( scip->set->stage )
12869  {
12870  case SCIP_STAGE_PROBLEM:
12871  return scip->origprob->nconss;
12872 
12875  case SCIP_STAGE_PRESOLVING:
12877  case SCIP_STAGE_PRESOLVED:
12878  case SCIP_STAGE_INITSOLVE:
12879  case SCIP_STAGE_SOLVING:
12880  case SCIP_STAGE_SOLVED:
12881  return scip->transprob->nconss;
12882 
12883  default:
12884  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12885  SCIPABORT();
12886  return 0; /*lint !e527*/
12887  } /*lint !e788*/
12888 }
12889 
12890 /** gets array of globally valid constraints currently in the problem
12891  *
12892  * @return array of globally valid constraints currently in the problem
12893  *
12894  * @pre This method can be called if @p scip is in one of the following stages:
12895  * - \ref SCIP_STAGE_PROBLEM
12896  * - \ref SCIP_STAGE_TRANSFORMED
12897  * - \ref SCIP_STAGE_INITPRESOLVE
12898  * - \ref SCIP_STAGE_PRESOLVING
12899  * - \ref SCIP_STAGE_EXITPRESOLVE
12900  * - \ref SCIP_STAGE_PRESOLVED
12901  * - \ref SCIP_STAGE_INITSOLVE
12902  * - \ref SCIP_STAGE_SOLVING
12903  * - \ref SCIP_STAGE_SOLVED
12904  *
12905  * @warning If your are using the method SCIPaddCons(), it can happen that the internal constraint array (which is
12906  * accessed via this method) gets resized. This can invalid the pointer which is returned by this method.
12907  */
12909  SCIP* scip /**< SCIP data structure */
12910  )
12911 {
12912  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
12913 
12914  switch( scip->set->stage )
12915  {
12916  case SCIP_STAGE_PROBLEM:
12917  return scip->origprob->conss;
12918 
12921  case SCIP_STAGE_PRESOLVING:
12923  case SCIP_STAGE_PRESOLVED:
12924  case SCIP_STAGE_INITSOLVE:
12925  case SCIP_STAGE_SOLVING:
12926  case SCIP_STAGE_SOLVED:
12927  return scip->transprob->conss;
12928 
12929  default:
12930  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12931  SCIPABORT();
12932  return NULL; /*lint !e527*/
12933  } /*lint !e788*/
12934 }
12935 
12936 /** gets total number of constraints in the original problem
12937  *
12938  * @return total number of constraints in the original problem
12939  *
12940  * @pre This method can be called if @p scip is in one of the following stages:
12941  * - \ref SCIP_STAGE_PROBLEM
12942  * - \ref SCIP_STAGE_TRANSFORMING
12943  * - \ref SCIP_STAGE_TRANSFORMED
12944  * - \ref SCIP_STAGE_INITPRESOLVE
12945  * - \ref SCIP_STAGE_PRESOLVING
12946  * - \ref SCIP_STAGE_EXITPRESOLVE
12947  * - \ref SCIP_STAGE_PRESOLVED
12948  * - \ref SCIP_STAGE_INITSOLVE
12949  * - \ref SCIP_STAGE_SOLVING
12950  * - \ref SCIP_STAGE_SOLVED
12951  * - \ref SCIP_STAGE_EXITSOLVE
12952  * - \ref SCIP_STAGE_FREETRANS
12953  */
12955  SCIP* scip /**< SCIP data structure */
12956  )
12957 {
12958  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigConss", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12959 
12960  return scip->origprob->nconss;
12961 }
12962 
12963 /** gets array of constraints in the original problem
12964  *
12965  * @return array of constraints in the original problem
12966  *
12967  * @pre This method can be called if @p scip is in one of the following stages:
12968  * - \ref SCIP_STAGE_PROBLEM
12969  * - \ref SCIP_STAGE_TRANSFORMING
12970  * - \ref SCIP_STAGE_TRANSFORMED
12971  * - \ref SCIP_STAGE_INITPRESOLVE
12972  * - \ref SCIP_STAGE_PRESOLVING
12973  * - \ref SCIP_STAGE_EXITPRESOLVE
12974  * - \ref SCIP_STAGE_PRESOLVED
12975  * - \ref SCIP_STAGE_INITSOLVE
12976  * - \ref SCIP_STAGE_SOLVING
12977  * - \ref SCIP_STAGE_SOLVED
12978  * - \ref SCIP_STAGE_EXITSOLVE
12979  * - \ref SCIP_STAGE_FREETRANS
12980  */
12982  SCIP* scip /**< SCIP data structure */
12983  )
12984 {
12985  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetOrigConss", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12986 
12987  return scip->origprob->conss;
12988 }
12989 
12990 /** computes the number of check constraint in the current node (loop over all constraint handler and cumulates the
12991  * number of check constraints)
12992  *
12993  * @return returns the number of check constraints
12994  *
12995  * @pre This method can be called if @p scip is in one of the following stages:
12996  * - \ref SCIP_STAGE_TRANSFORMED
12997  * - \ref SCIP_STAGE_INITPRESOLVE
12998  * - \ref SCIP_STAGE_PRESOLVING
12999  * - \ref SCIP_STAGE_EXITPRESOLVE
13000  * - \ref SCIP_STAGE_PRESOLVED
13001  * - \ref SCIP_STAGE_INITSOLVE
13002  * - \ref SCIP_STAGE_SOLVING
13003  */
13005  SCIP* scip /**< SCIP data structure */
13006  )
13007 {
13008  SCIP_CONSHDLR** conshdlrs;
13009  int nconshdlrs;
13010  int ncheckconss;
13011  int c;
13012 
13013  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCheckConss", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13014 
13015  nconshdlrs = SCIPgetNConshdlrs(scip);
13016  conshdlrs = SCIPgetConshdlrs(scip);
13017  assert(conshdlrs != NULL);
13018 
13019  ncheckconss = 0;
13020 
13021  /* loop over all constraint handler and collect the number of constraints which need to be checked */
13022  for( c = 0; c < nconshdlrs; ++c )
13023  {
13024  assert(conshdlrs[c] != NULL);
13025  ncheckconss += SCIPconshdlrGetNCheckConss(conshdlrs[c]);
13026  }
13027 
13028  return ncheckconss;
13029 
13030 }
13031 
13032 /*
13033  * local subproblem methods
13034  */
13035 
13036 /** adds a conflict to a given node or globally to the problem if @p node == NULL.
13037  *
13038  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13039  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13040  *
13041  * @pre this method can be called in one of the following stages of the SCIP solving process:
13042  * - \ref SCIP_STAGE_INITPRESOLVE
13043  * - \ref SCIP_STAGE_PRESOLVING
13044  * - \ref SCIP_STAGE_EXITPRESOLVE
13045  * - \ref SCIP_STAGE_SOLVING
13046  *
13047  * @note this method will release the constraint
13048  */
13050  SCIP* scip, /**< SCIP data structure */
13051  SCIP_NODE* node, /**< node to add conflict (or NULL if global) */
13052  SCIP_CONS* cons, /**< constraint representing the conflict */
13053  SCIP_NODE* validnode, /**< node at whichaddConf the constraint is valid (or NULL) */
13054  SCIP_CONFTYPE conftype, /**< type of the conflict */
13055  SCIP_Bool iscutoffinvolved /**< is a cutoff bound involved in this conflict */
13056  )
13057 {
13058  SCIP_Real primalbound;
13059 
13060  assert(scip != NULL);
13061  assert(cons != NULL);
13062  assert(scip->conflictstore != NULL);
13063  assert(scip->set->conf_enable);
13064  assert(conftype != SCIP_CONFTYPE_UNKNOWN);
13065  assert(conftype != SCIP_CONFTYPE_BNDEXCEEDING || iscutoffinvolved);
13066 
13067  SCIP_CALL( checkStage(scip, "SCIPaddConflict", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13068 
13069  if( iscutoffinvolved )
13070  primalbound = SCIPgetCutoffbound(scip);
13071  else
13072  primalbound = -SCIPinfinity(scip);
13073 
13074  /* add a global conflict */
13075  if( node == NULL )
13076  {
13077  SCIP_CALL( SCIPaddCons(scip, cons) );
13078  }
13079  /* add a local conflict */
13080  else
13081  {
13082  SCIP_CALL( SCIPaddConsNode(scip, node, cons, validnode) );
13083  }
13084 
13085  if( node == NULL || SCIPnodeGetType(node) != SCIP_NODETYPE_PROBINGNODE )
13086  {
13087  /* add the conflict to the conflict store */
13088  SCIP_CALL( SCIPconflictstoreAddConflict(scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->tree,
13089  scip->transprob, scip->reopt, cons, conftype, iscutoffinvolved, primalbound) );
13090  }
13091 
13092  /* mark constraint to be a conflict */
13093  SCIPconsMarkConflict(cons);
13094 
13095  SCIP_CALL( SCIPreleaseCons(scip, &cons) );
13096 
13097  return SCIP_OKAY;
13098 }
13099 
13100 /** tries to remove conflicts depending on an old cutoff bound if the improvement of the new incumbent is good enough
13101  *
13102  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13103  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13104  *
13105  * @pre this method can be called in one of the following stages of the SCIP solving process:
13106  * - \ref SCIP_STAGE_PRESOLVING
13107  * - \ref SCIP_STAGE_SOLVING
13108  */
13110  SCIP* scip, /**< SCIP data structure */
13111  SCIP_EVENT* event /**< event data */
13112  )
13113 {
13114  assert(scip != NULL);
13115  assert(event != NULL);
13117  assert(SCIPeventGetSol(event) != NULL);
13118 
13119  SCIP_CALL( checkStage(scip, "SCIPclearConflictStore", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13120 
13122  scip->transprob, scip->reopt, scip->primal->cutoffbound) );
13123 
13124  return SCIP_OKAY;
13125 }
13126 
13127 /** adds constraint to the given node (and all of its subnodes), even if it is a global constraint;
13128  * It is sometimes desirable to add the constraint to a more local node (i.e., a node of larger depth) even if
13129  * the constraint is also valid higher in the tree, for example, if one wants to produce a constraint which is
13130  * only active in a small part of the tree although it is valid in a larger part.
13131  * In this case, one should pass the more global node where the constraint is valid as "validnode".
13132  * Note that the same constraint cannot be added twice to the branching tree with different "validnode" parameters.
13133  * If the constraint is valid at the same node as it is inserted (the usual case), one should pass NULL as "validnode".
13134  * If the "validnode" is the root node, it is automatically upgraded into a global constraint, but still only added to
13135  * the given node. If a local constraint is added to the root node, it is added to the global problem instead.
13136  *
13137  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13138  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13139  *
13140  * @pre this method can be called in one of the following stages of the SCIP solving process:
13141  * - \ref SCIP_STAGE_INITPRESOLVE
13142  * - \ref SCIP_STAGE_PRESOLVING
13143  * - \ref SCIP_STAGE_EXITPRESOLVE
13144  * - \ref SCIP_STAGE_SOLVING
13145  */
13147  SCIP* scip, /**< SCIP data structure */
13148  SCIP_NODE* node, /**< node to add constraint to */
13149  SCIP_CONS* cons, /**< constraint to add */
13150  SCIP_NODE* validnode /**< node at which the constraint is valid, or NULL */
13151  )
13152 {
13153  assert(cons != NULL);
13154  assert(node != NULL);
13155 
13156  SCIP_CALL( checkStage(scip, "SCIPaddConsNode", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13157 
13158  if( validnode != NULL )
13159  {
13160  int validdepth;
13161 
13162  validdepth = SCIPnodeGetDepth(validnode);
13163  if( validdepth > SCIPnodeGetDepth(node) )
13164  {
13165  SCIPerrorMessage("cannot add constraint <%s> valid in depth %d to a node of depth %d\n",
13166  SCIPconsGetName(cons), validdepth, SCIPnodeGetDepth(node));
13167  return SCIP_INVALIDDATA;
13168  }
13169  if( cons->validdepth != -1 && cons->validdepth != validdepth )
13170  {
13171  SCIPerrorMessage("constraint <%s> is already marked to be valid in depth %d - cannot mark it to be valid in depth %d\n",
13172  SCIPconsGetName(cons), cons->validdepth, validdepth);
13173  return SCIP_INVALIDDATA;
13174  }
13175  if( validdepth <= SCIPtreeGetEffectiveRootDepth(scip->tree) )
13176  SCIPconsSetLocal(cons, FALSE);
13177  else
13178  cons->validdepth = validdepth;
13179  }
13180 
13182  {
13183  SCIPconsSetLocal(cons, FALSE);
13184  SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
13185  }
13186  else
13187  {
13188  SCIP_CALL( SCIPnodeAddCons(node, scip->mem->probmem, scip->set, scip->stat, scip->tree, cons) );
13189  }
13190 
13191  return SCIP_OKAY;
13192 }
13193 
13194 /** adds constraint locally to the current node (and all of its subnodes), even if it is a global constraint;
13195  * It is sometimes desirable to add the constraint to a more local node (i.e., a node of larger depth) even if
13196  * the constraint is also valid higher in the tree, for example, if one wants to produce a constraint which is
13197  * only active in a small part of the tree although it is valid in a larger part.
13198  *
13199  * If the constraint is valid at the same node as it is inserted (the usual case), one should pass NULL as "validnode".
13200  * If the "validnode" is the root node, it is automatically upgraded into a global constraint, but still only added to
13201  * the given node. If a local constraint is added to the root node, it is added to the global problem instead.
13202  *
13203  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13204  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13205  *
13206  * @pre this method can be called in one of the following stages of the SCIP solving process:
13207  * - \ref SCIP_STAGE_INITPRESOLVE
13208  * - \ref SCIP_STAGE_PRESOLVING
13209  * - \ref SCIP_STAGE_EXITPRESOLVE
13210  * - \ref SCIP_STAGE_SOLVING
13211  *
13212  * @note The same constraint cannot be added twice to the branching tree with different "validnode" parameters. This is
13213  * the case due to internal data structures and performance issues. In such a case you should try to realize your
13214  * issue using the method SCIPdisableCons() and SCIPenableCons() and control these via the event system of SCIP.
13215  */
13217  SCIP* scip, /**< SCIP data structure */
13218  SCIP_CONS* cons, /**< constraint to add */
13219  SCIP_NODE* validnode /**< node at which the constraint is valid, or NULL */
13220  )
13221 {
13222  assert(cons != NULL);
13223 
13224  SCIP_CALL( checkStage(scip, "SCIPaddConsLocal", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13225 
13226  SCIP_CALL( SCIPaddConsNode(scip, SCIPtreeGetCurrentNode(scip->tree), cons, validnode) );
13227 
13228  return SCIP_OKAY;
13229 }
13230 
13231 /** disables constraint's separation, enforcing, and propagation capabilities at the given node (and all subnodes);
13232  * if the method is called at the root node, the constraint is globally deleted from the problem;
13233  * the constraint deletion is being remembered at the given node, s.t. after leaving the node's subtree, the constraint
13234  * is automatically enabled again, and after entering the node's subtree, it is automatically disabled;
13235  * this may improve performance because redundant checks on this constraint are avoided, but it consumes memory;
13236  * alternatively, use SCIPdisableCons()
13237  *
13238  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13239  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13240  *
13241  * @pre this method can be called in one of the following stages of the SCIP solving process:
13242  * - \ref SCIP_STAGE_INITPRESOLVE
13243  * - \ref SCIP_STAGE_PRESOLVING
13244  * - \ref SCIP_STAGE_EXITPRESOLVE
13245  * - \ref SCIP_STAGE_SOLVING
13246  */
13248  SCIP* scip, /**< SCIP data structure */
13249  SCIP_NODE* node, /**< node to disable constraint in */
13250  SCIP_CONS* cons /**< constraint to locally delete */
13251  )
13252 {
13253  assert(cons != NULL);
13254 
13255  SCIP_CALL( checkStage(scip, "SCIPdelConsNode", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13256 
13257  /* only added constraints can be removed in (de-)initialization process of presolving, otherwise the reduction
13258  * might be wrong
13259  */
13260  if( scip->set->stage == SCIP_STAGE_INITPRESOLVE || scip->set->stage == SCIP_STAGE_EXITPRESOLVE )
13261  assert(SCIPconsIsAdded(cons));
13262 
13264  {
13265  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->reopt) );
13266  }
13267  else
13268  {
13269  SCIP_CALL( SCIPnodeDelCons(node, scip->mem->probmem, scip->set, scip->stat, scip->tree, cons) );
13270  }
13271 
13272  return SCIP_OKAY;
13273 }
13274 
13275 /** disables constraint's separation, enforcing, and propagation capabilities at the current node (and all subnodes);
13276  * if the method is called during problem modification or at the root node, the constraint is globally deleted from
13277  * the problem;
13278  * the constraint deletion is being remembered at the current node, s.t. after leaving the current subtree, the
13279  * constraint is automatically enabled again, and after reentering the current node's subtree, it is automatically
13280  * disabled again;
13281  * this may improve performance because redundant checks on this constraint are avoided, but it consumes memory;
13282  * alternatively, use SCIPdisableCons()
13283  *
13284  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13285  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13286  *
13287  * @pre this method can be called in one of the following stages of the SCIP solving process:
13288  * - \ref SCIP_STAGE_PROBLEM
13289  * - \ref SCIP_STAGE_INITPRESOLVE
13290  * - \ref SCIP_STAGE_PRESOLVING
13291  * - \ref SCIP_STAGE_EXITPRESOLVE
13292  * - \ref SCIP_STAGE_SOLVING
13293  *
13294  * @note SCIP stage does not get changed
13295  *
13296  */
13298  SCIP* scip, /**< SCIP data structure */
13299  SCIP_CONS* cons /**< constraint to locally delete */
13300  )
13301 {
13302  SCIP_NODE* node;
13303 
13304  assert(cons != NULL);
13305 
13306  SCIP_CALL( checkStage(scip, "SCIPdelConsLocal", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13307 
13308  switch( scip->set->stage )
13309  {
13310  case SCIP_STAGE_PROBLEM:
13311  assert(cons->addconssetchg == NULL);
13312  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->reopt) );
13313  return SCIP_OKAY;
13314 
13315  /* only added constraints can be removed in (de-)initialization process of presolving, otherwise the reduction
13316  * might be wrong
13317  */
13320  assert(SCIPconsIsAdded(cons));
13321  /*lint -fallthrough*/
13322 
13323  case SCIP_STAGE_PRESOLVING:
13324  case SCIP_STAGE_SOLVING:
13325  node = SCIPtreeGetCurrentNode(scip->tree);
13326 
13328  {
13329  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->reopt) );
13330  }
13331  else
13332  {
13333  SCIP_CALL( SCIPnodeDelCons(node, scip->mem->probmem, scip->set, scip->stat, scip->tree, cons) );
13334  }
13335  return SCIP_OKAY;
13336 
13337  default:
13338  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
13339  return SCIP_INVALIDCALL;
13340  } /*lint !e788*/
13341 }
13342 
13343 /** gets estimate of best primal solution w.r.t. original problem contained in current subtree
13344  *
13345  * @return estimate of best primal solution w.r.t. original problem contained in current subtree
13346  *
13347  * @pre this method can be called in one of the following stages of the SCIP solving process:
13348  * - \ref SCIP_STAGE_SOLVING
13349  */
13351  SCIP* scip /**< SCIP data structure */
13352  )
13353 {
13354  SCIP_NODE* node;
13355 
13356  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLocalOrigEstimate", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13357 
13358  node = SCIPtreeGetCurrentNode(scip->tree);
13359  return node != NULL ? SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPnodeGetEstimate(node)) : SCIP_INVALID;
13360 }
13361 
13362 /** gets estimate of best primal solution w.r.t. transformed problem contained in current subtree
13363  *
13364  * @return estimate of best primal solution w.r.t. transformed problem contained in current subtree
13365  *
13366  * @pre this method can be called in one of the following stages of the SCIP solving process:
13367  * - \ref SCIP_STAGE_SOLVING
13368  */
13370  SCIP* scip /**< SCIP data structure */
13371  )
13372 {
13373  SCIP_NODE* node;
13374 
13375  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLocalTransEstimate", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13376 
13377  node = SCIPtreeGetCurrentNode(scip->tree);
13378 
13379  return node != NULL ? SCIPnodeGetEstimate(node) : SCIP_INVALID;
13380 }
13381 
13382 /** gets dual bound of current node
13383  *
13384  * @return dual bound of current node
13385  *
13386  * @pre this method can be called in one of the following stages of the SCIP solving process:
13387  * - \ref SCIP_STAGE_SOLVING
13388  */
13390  SCIP* scip /**< SCIP data structure */
13391  )
13392 {
13393  SCIP_NODE* node;
13394 
13395  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLocalDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13396 
13397  node = SCIPtreeGetCurrentNode(scip->tree);
13398  return node != NULL ? SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPnodeGetLowerbound(node)) : SCIP_INVALID;
13399 }
13400 
13401 /** gets lower bound of current node in transformed problem
13402  *
13403  * @return lower bound of current node in transformed problem
13404  *
13405  * @pre this method can be called in one of the following stages of the SCIP solving process:
13406  * - \ref SCIP_STAGE_SOLVING
13407  */
13409  SCIP* scip /**< SCIP data structure */
13410  )
13411 {
13412  SCIP_NODE* node;
13413 
13414  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLocalLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13415 
13416  node = SCIPtreeGetCurrentNode(scip->tree);
13417 
13418  return node != NULL ? SCIPnodeGetLowerbound(node) : SCIP_INVALID;
13419 }
13420 
13421 /** gets dual bound of given node
13422  *
13423  * @return dual bound of a given node
13424  *
13425  * @pre this method can be called in one of the following stages of the SCIP solving process:
13426  * - \ref SCIP_STAGE_SOLVING
13427  */
13429  SCIP* scip, /**< SCIP data structure */
13430  SCIP_NODE* node /**< node to get dual bound for */
13431  )
13432 {
13433  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNodeDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13434 
13435  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPnodeGetLowerbound(node));
13436 }
13437 
13438 /** gets lower bound of given node in transformed problem
13439  *
13440  * @return lower bound of given node in transformed problem
13441  *
13442  * @pre this method can be called in one of the following stages of the SCIP solving process:
13443  * - \ref SCIP_STAGE_SOLVING
13444  */
13446  SCIP* scip, /**< SCIP data structure */
13447  SCIP_NODE* node /**< node to get dual bound for */
13448  )
13449 {
13450  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNodeLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13451 
13452  return SCIPnodeGetLowerbound(node);
13453 }
13454 
13455 /** if given value is tighter (larger for minimization, smaller for maximization) than the current node's dual bound (in
13456  * original problem space), sets the current node's dual bound to the new value
13457  *
13458  * @note the given new bound has to be a dual bound, i.e., it has to be valid for the original problem.
13459  *
13460  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13461  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13462  *
13463  * @pre this method can be called in one of the following stages of the SCIP solving process:
13464  * - \ref SCIP_STAGE_PROBLEM
13465  * - \ref SCIP_STAGE_PRESOLVING
13466  * - \ref SCIP_STAGE_PRESOLVED
13467  * - \ref SCIP_STAGE_SOLVING
13468  */
13470  SCIP* scip, /**< SCIP data structure */
13471  SCIP_Real newbound /**< new dual bound for the node (if it's tighter than the old one) */
13472  )
13473 {
13474  SCIP_CALL( checkStage(scip, "SCIPupdateLocalDualbound", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13475 
13476  switch( scip->set->stage )
13477  {
13478  case SCIP_STAGE_PROBLEM:
13479  /* since no root node, for which we could update the dual bound, has been create yet, update the dual bound stored in
13480  * the problem data
13481  */
13482  SCIPprobUpdateDualbound(scip->origprob, newbound);
13483  break;
13484 
13485  case SCIP_STAGE_PRESOLVING:
13486  case SCIP_STAGE_PRESOLVED:
13487  /* since no root node, for which we could update the dual bound, has been create yet, update the dual bound stored in
13488  * the problem data
13489  */
13490  SCIPprobUpdateDualbound(scip->transprob, SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, newbound));
13491  break;
13492 
13493  case SCIP_STAGE_SOLVING:
13495  break;
13496 
13497  default:
13498  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
13499  SCIPABORT();
13500  return SCIP_INVALIDCALL; /*lint !e527*/
13501  } /*lint !e788*/
13502 
13503  return SCIP_OKAY;
13504 }
13505 
13506 /** if given value is larger than the current node's lower bound (in transformed problem), sets the current node's
13507  * lower bound to the new value
13508  *
13509  * @note the given new bound has to be a lower bound, i.e., it has to be valid for the transformed problem.
13510  *
13511  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13512  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13513  *
13514  * @pre this method can be called in one of the following stages of the SCIP solving process:
13515  * - \ref SCIP_STAGE_PRESOLVING
13516  * - \ref SCIP_STAGE_PRESOLVED
13517  * - \ref SCIP_STAGE_SOLVING
13518  */
13520  SCIP* scip, /**< SCIP data structure */
13521  SCIP_Real newbound /**< new lower bound for the node (if it's larger than the old one) */
13522  )
13523 {
13524  SCIP_CALL( checkStage(scip, "SCIPupdateLocalLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13525 
13526  switch( scip->set->stage )
13527  {
13528  case SCIP_STAGE_PRESOLVING:
13529  case SCIP_STAGE_PRESOLVED:
13530  /* since no root node, for which we could update the lower bound, has been created yet, update the dual bound stored
13531  * in the problem data
13532  */
13533  SCIPprobUpdateDualbound(scip->transprob, SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, newbound));
13534  break;
13535 
13536  case SCIP_STAGE_SOLVING:
13538  break;
13539 
13540  default:
13541  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
13542  SCIPABORT();
13543  return SCIP_INVALIDCALL; /*lint !e527*/
13544  } /*lint !e788*/
13545 
13546  return SCIP_OKAY;
13547 }
13548 
13549 /** if given value is tighter (larger for minimization, smaller for maximization) than the node's dual bound,
13550  * sets the node's dual bound to the new value
13551  *
13552  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13553  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13554  *
13555  * @pre this method can be called in one of the following stages of the SCIP solving process:
13556  * - \ref SCIP_STAGE_SOLVING
13557  */
13559  SCIP* scip, /**< SCIP data structure */
13560  SCIP_NODE* node, /**< node to update dual bound for */
13561  SCIP_Real newbound /**< new dual bound for the node (if it's tighter than the old one) */
13562  )
13563 {
13564  SCIP_CALL( checkStage(scip, "SCIPupdateNodeDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13565 
13566  SCIP_CALL( SCIPupdateNodeLowerbound(scip, node, SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, newbound)) );
13567 
13568  return SCIP_OKAY;
13569 }
13570 
13571 /** if given value is larger than the node's lower bound (in transformed problem), sets the node's lower bound
13572  * to the new value
13573  *
13574  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13575  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13576  *
13577  * @pre this method can be called in one of the following stages of the SCIP solving process:
13578  * - \ref SCIP_STAGE_SOLVING
13579  */
13581  SCIP* scip, /**< SCIP data structure */
13582  SCIP_NODE* node, /**< node to update lower bound for */
13583  SCIP_Real newbound /**< new lower bound for the node (if it's larger than the old one) */
13584  )
13585 {
13586  SCIP_CALL( checkStage(scip, "SCIPupdateNodeLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13587 
13588  SCIPnodeUpdateLowerbound(node, scip->stat, scip->set, scip->tree, scip->transprob, scip->origprob, newbound);
13589 
13590  /* if lowerbound exceeds the cutoffbound the node will be marked to be cutoff
13591  *
13592  * If the node is an inner node (,not a child node,) we need to cutoff the node manually if we exceed the
13593  * cutoffbound. This is only relevant if a user updates the lower bound; in the main solving process of SCIP the
13594  * lowerbound is only changed before branching and the given node is always a child node. Therefore, we only check
13595  * for a cutoff here in the user function instead of in SCIPnodeUpdateLowerbound().
13596  */
13597  if( SCIPisGE(scip, newbound, scip->primal->cutoffbound) )
13598  {
13599  SCIP_CALL( SCIPnodeCutoff(node, scip->set, scip->stat, scip->tree, scip->transprob, scip->origprob, scip->reopt,
13600  scip->lp, scip->mem->probmem) );
13601  }
13602 
13603  return SCIP_OKAY;
13604 }
13605 
13606 /** change the node selection priority of the given child
13607  *
13608  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13609  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13610  *
13611  * @pre this method can be called in one of the following stages of the SCIP solving process:
13612  * - \ref SCIP_STAGE_SOLVING
13613  */
13615  SCIP* scip, /**< SCIP data structure */
13616  SCIP_NODE* child, /**< child to update the node selection priority */
13617  SCIP_Real priority /**< node selection priority value */
13618  )
13619 {
13620  SCIP_CALL( checkStage(scip, "SCIPchgChildPrio", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13621 
13622  if( SCIPnodeGetType(child) != SCIP_NODETYPE_CHILD )
13623  return SCIP_INVALIDDATA;
13624 
13625  SCIPchildChgNodeselPrio(scip->tree, child, priority);
13626 
13627  return SCIP_OKAY;
13628 }
13629 
13630 
13631 
13632 /*
13633  * solve methods
13634  */
13635 
13636 /** checks solution for feasibility in original problem without adding it to the solution store; to improve the
13637  * performance we use the following order when checking for violations:
13638  *
13639  * 1. constraint handlers which don't need constraints (e.g. integral constraint handler)
13640  * 2. variable bounds
13641  * 3. original constraints
13642  */
13643 static
13645  SCIP* scip, /**< SCIP data structure */
13646  SCIP_SOL* sol, /**< primal CIP solution */
13647  SCIP_Bool* feasible, /**< stores whether given solution is feasible */
13648  SCIP_Bool printreason, /**< Should the reason for the violation be printed? */
13649  SCIP_Bool completely, /**< Should all violations be checked? */
13650  SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
13651  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
13652  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
13653  SCIP_Bool checkmodifiable /**< have modifiable constraint to be checked? */
13654  )
13655 {
13656  SCIP_RESULT result;
13657  int v;
13658  int c;
13659  int h;
13660 
13661  assert(scip != NULL);
13662  assert(sol != NULL);
13663  assert(feasible != NULL);
13664 
13665  SCIP_CALL( checkStage(scip, "checkSolOrig", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
13666 
13667  *feasible = TRUE;
13668 
13670 
13671  if( !printreason )
13672  completely = FALSE;
13673 
13674  /* check bounds */
13675  if( checkbounds )
13676  {
13677  for( v = 0; v < scip->origprob->nvars; ++v )
13678  {
13679  SCIP_VAR* var;
13680  SCIP_Real solval;
13681  SCIP_Real lb;
13682  SCIP_Real ub;
13683 
13684  var = scip->origprob->vars[v];
13685  solval = SCIPsolGetVal(sol, scip->set, scip->stat, var);
13686 
13687  lb = SCIPvarGetLbOriginal(var);
13688  ub = SCIPvarGetUbOriginal(var);
13689 
13690  SCIPupdateSolBoundViolation(scip, sol, lb - solval, SCIPrelDiff(lb, solval));
13691  SCIPupdateSolBoundViolation(scip, sol, solval - ub, SCIPrelDiff(solval, ub));
13692 
13693  if( SCIPsetIsFeasLT(scip->set, solval, lb) || SCIPsetIsFeasGT(scip->set, solval, ub) )
13694  {
13695  *feasible = FALSE;
13696 
13697  if( printreason )
13698  {
13699  SCIPmessagePrintInfo(scip->messagehdlr, "solution violates original bounds of variable <%s> [%g,%g] solution value <%g>\n",
13700  SCIPvarGetName(var), lb, ub, solval);
13701  }
13702 
13703  if( !completely )
13704  return SCIP_OKAY;
13705  }
13706  }
13707  }
13708 
13709  /* call constraint handlers that don't need constraints */
13710  for( h = 0; h < scip->set->nconshdlrs; ++h )
13711  {
13712  if( !SCIPconshdlrNeedsCons(scip->set->conshdlrs[h]) )
13713  {
13714  SCIP_CALL( SCIPconshdlrCheck(scip->set->conshdlrs[h], scip->mem->probmem, scip->set, scip->stat, sol,
13715  checkintegrality, checklprows, printreason, completely, &result) );
13716 
13717  if( result != SCIP_FEASIBLE )
13718  {
13719  *feasible = FALSE;
13720 
13721  if( !completely )
13722  return SCIP_OKAY;
13723  }
13724  }
13725  }
13726 
13727  /* check original constraints
13728  *
13729  * in general modifiable constraints can not be checked, because the variables to fulfill them might be missing in
13730  * the original problem; however, if the solution comes from a heuristic during presolving modifiable constraints
13731  * have to be checked;
13732  */
13733  for( c = 0; c < scip->origprob->nconss; ++c )
13734  {
13735  if( SCIPconsIsChecked(scip->origprob->conss[c]) && (checkmodifiable || !SCIPconsIsModifiable(scip->origprob->conss[c])) )
13736  {
13737  /* check solution */
13738  SCIP_CALL( SCIPconsCheck(scip->origprob->conss[c], scip->set, sol,
13739  checkintegrality, checklprows, printreason, &result) );
13740 
13741  if( result != SCIP_FEASIBLE )
13742  {
13743  *feasible = FALSE;
13744 
13745  if( !completely )
13746  return SCIP_OKAY;
13747  }
13748  }
13749  }
13750 
13751  return SCIP_OKAY;
13752 }
13753 
13754 /** update integrality violation of a solution */
13756  SCIP* scip, /**< SCIP data structure */
13757  SCIP_SOL* sol, /**< primal CIP solution */
13758  SCIP_Real absviol /**< absolute violation */
13759  )
13760 {
13762  SCIPsolUpdateIntegralityViolation(sol, absviol);
13763 }
13764 
13765 /** update bound violation of a solution */
13767  SCIP* scip, /**< SCIP data structure */
13768  SCIP_SOL* sol, /**< primal CIP solution */
13769  SCIP_Real absviol, /**< absolute violation */
13770  SCIP_Real relviol /**< relative violation */
13771  )
13772 {
13774  SCIPsolUpdateBoundViolation(sol, absviol, relviol);
13775 }
13776 
13777 /** update LP row violation of a solution */
13779  SCIP* scip, /**< SCIP data structure */
13780  SCIP_SOL* sol, /**< primal CIP solution */
13781  SCIP_Real absviol, /**< absolute violation */
13782  SCIP_Real relviol /**< relative violation */
13783  )
13784 {
13786  SCIPsolUpdateLPRowViolation(sol, absviol, relviol);
13787 }
13788 
13789 /** update constraint violation of a solution */
13791  SCIP* scip, /**< SCIP data structure */
13792  SCIP_SOL* sol, /**< primal CIP solution */
13793  SCIP_Real absviol, /**< absolute violation */
13794  SCIP_Real relviol /**< relative violation */
13795  )
13796 {
13798  SCIPsolUpdateConsViolation(sol, absviol, relviol);
13799 }
13800 
13801 /** update LP row and constraint violations of a solution */
13803  SCIP* scip, /**< SCIP data structure */
13804  SCIP_SOL* sol, /**< primal CIP solution */
13805  SCIP_Real absviol, /**< absolute violation */
13806  SCIP_Real relviol /**< relative violation */
13807  )
13808 {
13810  SCIPsolUpdateLPConsViolation(sol, absviol, relviol);
13811 }
13812 
13813 /** allow violation updates */
13815  SCIP* scip /**< SCIP data structure */
13816  )
13817 {
13819 }
13820 
13821 /** disallow violation updates */
13823  SCIP* scip /**< SCIP data structure */
13824  )
13825 {
13827 }
13828 
13829 /** calculates number of nonzeros in problem */
13830 static
13832  SCIP* scip, /**< SCIP data structure */
13833  SCIP_Longint* nchecknonzeros, /**< pointer to store number of non-zeros in all check constraints */
13834  SCIP_Longint* nactivenonzeros, /**< pointer to store number of non-zeros in all active constraints */
13835  SCIP_Bool* approxchecknonzeros,/**< pointer to store if the number of non-zeros in all check constraints
13836  * is only a lowerbound
13837  */
13838  SCIP_Bool* approxactivenonzeros/**< pointer to store if the number of non-zeros in all active constraints
13839  * is only a lowerbound
13840  */
13841  )
13842 {
13843  SCIP_CONS** conss;
13844  SCIP_Bool success;
13845  SCIP_Bool ischeck;
13846  int nconss;
13847  int nvars;
13848  int c;
13849  int h;
13850 
13851  *nchecknonzeros = 0LL;
13852  *nactivenonzeros = 0LL;
13853  *approxchecknonzeros = FALSE;
13854  *approxactivenonzeros = FALSE;
13855 
13856  /* computes number of non-zeros over all active constraints */
13857  for( h = scip->set->nconshdlrs - 1; h >= 0; --h )
13858  {
13859  nconss = SCIPconshdlrGetNActiveConss(scip->set->conshdlrs[h]);
13860 
13861  if( nconss > 0 )
13862  {
13863  conss = SCIPconshdlrGetConss(scip->set->conshdlrs[h]);
13864 
13865  /* calculate all active constraints */
13866  for( c = nconss - 1; c >= 0; --c )
13867  {
13868  SCIP_CALL( SCIPconsGetNVars(conss[c], scip->set, &nvars, &success) );
13869  ischeck = SCIPconsIsChecked(conss[c]);
13870 
13871  if( !success )
13872  {
13873  *approxactivenonzeros = TRUE;
13874  if( ischeck )
13875  *approxchecknonzeros = TRUE;
13876  }
13877  else
13878  {
13879  *nactivenonzeros += nvars;
13880  if( ischeck )
13881  *nchecknonzeros += nvars;
13882  }
13883  }
13884  }
13885 
13886  /* add nonzeros on inactive check constraints */
13887  nconss = SCIPconshdlrGetNCheckConss(scip->set->conshdlrs[h]);
13888  if( nconss > 0 )
13889  {
13890  conss = SCIPconshdlrGetCheckConss(scip->set->conshdlrs[h]);
13891 
13892  for( c = nconss - 1; c >= 0; --c )
13893  {
13894  if( !SCIPconsIsActive(conss[c]) )
13895  {
13896  SCIP_CALL( SCIPconsGetNVars(conss[c], scip->set, &nvars, &success) );
13897 
13898  if( !success )
13899  *approxchecknonzeros = TRUE;
13900  else
13901  *nchecknonzeros += nvars;
13902  }
13903  }
13904  }
13905  }
13906 
13907  return SCIP_OKAY;
13908 }
13909 
13910 
13911 /** initializes solving data structures and transforms problem
13912  *
13913  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13914  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13915  *
13916  * @pre This method can be called if @p scip is in one of the following stages:
13917  * - \ref SCIP_STAGE_PROBLEM
13918  * - \ref SCIP_STAGE_TRANSFORMED
13919  * - \ref SCIP_STAGE_INITPRESOLVE
13920  * - \ref SCIP_STAGE_PRESOLVING
13921  * - \ref SCIP_STAGE_EXITPRESOLVE
13922  * - \ref SCIP_STAGE_PRESOLVED
13923  * - \ref SCIP_STAGE_INITSOLVE
13924  * - \ref SCIP_STAGE_SOLVING
13925  * - \ref SCIP_STAGE_SOLVED
13926  * - \ref SCIP_STAGE_EXITSOLVE
13927  * - \ref SCIP_STAGE_FREETRANS
13928  * - \ref SCIP_STAGE_FREE
13929  *
13930  * @post When calling this method in the \ref SCIP_STAGE_PROBLEM stage, the \SCIP stage is changed to \ref
13931  * SCIP_STAGE_TRANSFORMED; otherwise, the stage is not changed
13932  *
13933  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
13934  */
13936  SCIP* scip /**< SCIP data structure */
13937  )
13938 {
13939  SCIP_Longint oldnsolsfound;
13940  int nfeassols;
13941  int ncandsols;
13942  int h;
13943  int s;
13944 
13945  SCIP_CALL( checkStage(scip, "SCIPtransformProb", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
13946 
13947  /* check, if the problem was already transformed */
13948  if( scip->set->stage >= SCIP_STAGE_TRANSFORMED )
13949  return SCIP_OKAY;
13950 
13951  assert(scip->stat->status == SCIP_STATUS_UNKNOWN);
13952 
13953  /* check, if a node selector exists */
13954  if( SCIPsetGetNodesel(scip->set, scip->stat) == NULL )
13955  {
13956  SCIPerrorMessage("no node selector available\n");
13957  return SCIP_PLUGINNOTFOUND;
13958  }
13959 
13960  /* call garbage collector on original problem and parameter settings memory spaces */
13963 
13964  /* remember number of constraints */
13966 
13967  /* switch stage to TRANSFORMING */
13969 
13970  /* mark statistics before solving */
13971  SCIPstatMark(scip->stat);
13972 
13973  /* init solve data structures */
13977  SCIP_CALL( SCIPlpCreate(&scip->lp, scip->set, scip->messagehdlr, scip->stat, SCIPprobGetName(scip->origprob)) );
13978  SCIP_CALL( SCIPprimalCreate(&scip->primal) );
13979  SCIP_CALL( SCIPtreeCreate(&scip->tree, scip->mem->probmem, scip->set, SCIPsetGetNodesel(scip->set, scip->stat)) );
13980  SCIP_CALL( SCIPrelaxationCreate(&scip->relaxation, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree) );
13981  SCIP_CALL( SCIPconflictCreate(&scip->conflict, scip->mem->probmem, scip->set) );
13982  SCIP_CALL( SCIPcliquetableCreate(&scip->cliquetable, scip->set, scip->mem->probmem) );
13983 
13984  /* copy problem in solve memory */
13985  SCIP_CALL( SCIPprobTransform(scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree,
13986  scip->reopt, scip->lp, scip->branchcand, scip->eventfilter, scip->eventqueue, scip->conflictstore,
13987  &scip->transprob) );
13988 
13989  /* switch stage to TRANSFORMED */
13990  scip->set->stage = SCIP_STAGE_TRANSFORMED;
13991 
13992  /* check, whether objective value is always integral by inspecting the problem, if it is the case adjust the
13993  * cutoff bound if primal solution is already known
13994  */
13995  SCIP_CALL( SCIPprobCheckObjIntegral(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
13996  scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
13997 
13998  /* if possible, scale objective function such that it becomes integral with gcd 1 */
13999  SCIP_CALL( SCIPprobScaleObj(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
14000  scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
14001 
14002  /* check solution of solution candidate storage */
14003  nfeassols = 0;
14004  ncandsols = scip->origprimal->nsols;
14005  oldnsolsfound = 0;
14006 
14007  /* update upper bound and cutoff bound due to objective limit in primal data */
14008  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
14009  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
14010 
14011  if( !scip->set->reopt_enable )
14012  {
14013  oldnsolsfound = scip->primal->nsolsfound;
14014  for( s = scip->origprimal->nsols - 1; s >= 0; --s )
14015  {
14016  SCIP_Bool feasible;
14017  SCIP_SOL* sol;
14018 
14019  sol = scip->origprimal->sols[s];
14020 
14021  /* recompute objective function, since the objective might have changed in the meantime */
14022  SCIPsolRecomputeObj(sol, scip->set, scip->stat, scip->origprob);
14023 
14024  /* SCIPprimalTrySol() can only be called on transformed solutions; therefore check solutions in original problem
14025  * including modifiable constraints
14026  */
14027  SCIP_CALL( checkSolOrig(scip, sol, &feasible,
14029  FALSE, TRUE, TRUE, TRUE, TRUE) );
14030 
14031  if( feasible )
14032  {
14033  SCIP_Real abssolobj;
14034 
14035  abssolobj = REALABS(SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
14036 
14037  /* we do not want to add solutions with objective value +infinity */
14038  if( !SCIPisInfinity(scip, abssolobj) )
14039  {
14040  SCIP_SOL* bestsol = SCIPgetBestSol(scip);
14041  SCIP_Bool stored;
14042 
14043  /* add primal solution to solution storage by copying it */
14044  SCIP_CALL( SCIPprimalAddSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->origprob, scip->transprob,
14045  scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, sol, &stored) );
14046 
14047  if( stored )
14048  {
14049  nfeassols++;
14050 
14051  if( bestsol != SCIPgetBestSol(scip) )
14052  SCIPstoreSolutionGap(scip);
14053  }
14054  }
14055  }
14056 
14057  SCIP_CALL( SCIPsolFree(&sol, scip->mem->probmem, scip->origprimal) );
14058  scip->origprimal->nsols--;
14059  }
14060  }
14061 
14062  assert(scip->origprimal->nsols == 0);
14063 
14064  scip->stat->nexternalsolsfound += scip->primal->nsolsfound - oldnsolsfound;
14065 
14066  if( nfeassols > 0 )
14067  {
14069  "%d/%d feasible solution%s given by solution candidate storage, new primal bound %.6e\n\n",
14070  nfeassols, ncandsols, (nfeassols > 1 ? "s" : ""), SCIPgetSolOrigObj(scip, SCIPgetBestSol(scip)));
14071  }
14072  else if( ncandsols > 0 && !scip->set->reopt_enable )
14073  {
14075  "all %d solutions given by solution candidate storage are infeasible\n\n", ncandsols);
14076  }
14077 
14078  /* print transformed problem statistics */
14080  "transformed problem has %d variables (%d bin, %d int, %d impl, %d cont) and %d constraints\n",
14081  scip->transprob->nvars, scip->transprob->nbinvars, scip->transprob->nintvars, scip->transprob->nimplvars,
14082  scip->transprob->ncontvars, scip->transprob->nconss);
14083 
14084  for( h = 0; h < scip->set->nconshdlrs; ++h )
14085  {
14086  int nactiveconss;
14087 
14088  nactiveconss = SCIPconshdlrGetNActiveConss(scip->set->conshdlrs[h]);
14089  if( nactiveconss > 0 )
14090  {
14092  "%7d constraints of type <%s>\n", nactiveconss, SCIPconshdlrGetName(scip->set->conshdlrs[h]));
14093  }
14094  }
14096 
14097  {
14098  SCIP_Real maxnonzeros;
14099  SCIP_Longint nchecknonzeros;
14100  SCIP_Longint nactivenonzeros;
14101  SCIP_Bool approxchecknonzeros;
14102  SCIP_Bool approxactivenonzeros;
14103 
14104  /* determine number of non-zeros */
14105  maxnonzeros = (SCIP_Real)SCIPgetNConss(scip) * SCIPgetNVars(scip);
14106  maxnonzeros = MAX(maxnonzeros, 1.0);
14107  SCIP_CALL( calcNonZeros(scip, &nchecknonzeros, &nactivenonzeros, &approxchecknonzeros, &approxactivenonzeros) );
14108  scip->stat->nnz = nactivenonzeros;
14109  scip->stat->avgnnz = (SCIPgetNConss(scip) == 0 ? 0.0 : (SCIP_Real) nactivenonzeros / ((SCIP_Real) SCIPgetNConss(scip)));
14110 
14112  "original problem has %s%" SCIP_LONGINT_FORMAT " active (%g%%) nonzeros and %s%" SCIP_LONGINT_FORMAT " (%g%%) check nonzeros\n",
14113  approxactivenonzeros ? "more than " : "", nactivenonzeros, nactivenonzeros/maxnonzeros * 100,
14114  approxchecknonzeros ? "more than " : "", nchecknonzeros, nchecknonzeros/maxnonzeros * 100);
14116  }
14117 
14118  /* call initialization methods of plugins */
14119  SCIP_CALL( SCIPsetInitPlugins(scip->set, scip->mem->probmem, scip->stat) );
14120 
14121  /* in case the permutation seed is different to 0, permute the transformed problem */
14122  if( scip->set->random_permutationseed > 0 )
14123  {
14124  SCIP_Bool permuteconss;
14125  SCIP_Bool permutevars;
14126  int permutationseed;
14127 
14128  permuteconss = scip->set->random_permuteconss;
14129  permutevars = scip->set->random_permutevars;
14130  permutationseed = scip->set->random_permutationseed;
14131 
14132  SCIP_CALL( SCIPpermuteProb(scip, (unsigned int)permutationseed, permuteconss, permutevars, permutevars, permutevars, permutevars) );
14133  }
14134 
14135  if( scip->set->misc_estimexternmem )
14136  {
14137  if( scip->set->limit_memory < SCIP_MEM_NOLIMIT )
14138  {
14139  SCIP_Longint memused = SCIPgetMemUsed(scip);
14140 
14141  /* if the memory limit is set, we take 1% as the minimum external memory storage */
14142  scip->stat->externmemestim = MAX(memused, (SCIP_Longint) (0.01 * scip->set->limit_memory * 1048576.0));
14143  }
14144  else
14145  scip->stat->externmemestim = SCIPgetMemUsed(scip);
14146  SCIPdebugMsg(scip, "external memory usage estimated to %" SCIP_LONGINT_FORMAT " byte\n", scip->stat->externmemestim);
14147  }
14148 
14149  return SCIP_OKAY;
14150 }
14151 
14152 /** initializes presolving */
14153 static
14155  SCIP* scip /**< SCIP data structure */
14156  )
14157 {
14158 #ifndef NDEBUG
14159  size_t nusedbuffers;
14160  size_t nusedcleanbuffers;
14161 #endif
14162 
14163  assert(scip != NULL);
14164  assert(scip->mem != NULL);
14165  assert(scip->set != NULL);
14166  assert(scip->stat != NULL);
14167  assert(scip->transprob != NULL);
14168  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
14169 
14170  /* retransform all existing solutions to original problem space, because the transformed problem space may
14171  * get modified in presolving and the solutions may become invalid for the transformed problem
14172  */
14173  SCIP_CALL( SCIPprimalRetransformSolutions(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
14174  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp) );
14175 
14176  /* reset statistics for presolving and current branch and bound run */
14177  SCIPstatResetPresolving(scip->stat, scip->set, scip->transprob, scip->origprob);
14178 
14179  /* increase number of branch and bound runs */
14180  scip->stat->nruns++;
14181 
14182  /* remember problem size of previous run */
14183  scip->stat->prevrunnvars = scip->transprob->nvars;
14184 
14185  /* switch stage to INITPRESOLVE */
14187 
14188  /* create temporary presolving root node */
14189  SCIP_CALL( SCIPtreeCreatePresolvingRoot(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->messagehdlr,
14190  scip->stat, scip->transprob, scip->origprob, scip->primal, scip->lp, scip->branchcand, scip->conflict,
14191  scip->conflictstore, scip->eventfilter, scip->eventqueue, scip->cliquetable) );
14192 
14193  /* GCG wants to perform presolving during the reading process of a file reader;
14194  * hence the number of used buffers does not need to be zero, however, it should not
14195  * change by calling SCIPsetInitprePlugins()
14196  */
14197 #ifndef NDEBUG
14198  nusedbuffers = BMSgetNUsedBufferMemory(SCIPbuffer(scip));
14199  nusedcleanbuffers = BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip));
14200 #endif
14201 
14202  /* inform plugins that the presolving is abound to begin */
14203  SCIP_CALL( SCIPsetInitprePlugins(scip->set, scip->mem->probmem, scip->stat) );
14204  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
14205  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
14206 
14207  /* delete the variables from the problems that were marked to be deleted */
14208  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp, scip->branchcand) );
14209 
14210  /* switch stage to PRESOLVING */
14211  scip->set->stage = SCIP_STAGE_PRESOLVING;
14212 
14213  return SCIP_OKAY;
14214 }
14215 
14216 /** deinitializes presolving */
14217 static
14219  SCIP* scip, /**< SCIP data structure */
14220  SCIP_Bool solved, /**< is problem already solved? */
14221  SCIP_Bool* infeasible /**< pointer to store if the clique clean up detects an infeasibility */
14222  )
14223 {
14224  SCIP_VAR** vars;
14225  int nvars;
14226  int v;
14227 #ifndef NDEBUG
14228  size_t nusedbuffers;
14229  size_t nusedcleanbuffers;
14230 #endif
14231 
14232  assert(scip != NULL);
14233  assert(scip->mem != NULL);
14234  assert(scip->set != NULL);
14235  assert(scip->stat != NULL);
14236  assert(scip->transprob != NULL);
14237  assert(scip->set->stage == SCIP_STAGE_PRESOLVING);
14238  assert(infeasible != NULL);
14239 
14240  *infeasible = FALSE;
14241 
14242  /* switch stage to EXITPRESOLVE */
14244 
14245  if( !solved )
14246  {
14247  /* flatten all variables */
14248  vars = SCIPgetFixedVars(scip);
14249  nvars = SCIPgetNFixedVars(scip);
14250  assert(nvars == 0 || vars != NULL);
14251 
14252  for( v = nvars - 1; v >= 0; --v )
14253  {
14254  SCIP_VAR* var;
14255 #ifndef NDEBUG
14256  SCIP_VAR** multvars;
14257  int i;
14258 #endif
14259  var = vars[v]; /*lint !e613*/
14260  assert(var != NULL);
14261 
14263  {
14264  /* flattens aggregation graph of multi-aggregated variable in order to avoid exponential recursion later-on */
14265  SCIP_CALL( SCIPvarFlattenAggregationGraph(var, scip->mem->probmem, scip->set) );
14266 
14267 #ifndef NDEBUG
14268  multvars = SCIPvarGetMultaggrVars(var);
14269  for( i = SCIPvarGetMultaggrNVars(var) - 1; i >= 0; --i)
14270  assert(SCIPvarGetStatus(multvars[i]) != SCIP_VARSTATUS_MULTAGGR);
14271 #endif
14272  }
14273  }
14274  }
14275 
14276  /* exitPresolve() might be called during the reading process of a file reader;
14277  * hence the number of used buffers does not need to be zero, however, it should not
14278  * change by calling SCIPsetExitprePlugins() or SCIPprobExitPresolve()
14279  */
14280 #ifndef NDEBUG
14281  nusedbuffers = BMSgetNUsedBufferMemory(SCIPbuffer(scip));
14282  nusedcleanbuffers = BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip));
14283 #endif
14284 
14285  /* inform plugins that the presolving is finished, and perform final modifications */
14286  SCIP_CALL( SCIPsetExitprePlugins(scip->set, scip->mem->probmem, scip->stat) );
14287  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
14288  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
14289 
14290  /* remove empty and single variable cliques from the clique table, and convert all two variable cliques
14291  * into implications
14292  * delete the variables from the problems that were marked to be deleted
14293  */
14294  if( !solved )
14295  {
14296  int nlocalbdchgs = 0;
14297 
14298  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
14299  scip->cliquetable, scip->lp, scip->branchcand) );
14300 
14301  SCIP_CALL( SCIPcliquetableCleanup(scip->cliquetable, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
14302  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, &nlocalbdchgs,
14303  infeasible) );
14304 
14306  "clique table cleanup detected %d bound changes%s\n", nlocalbdchgs, *infeasible ? " and infeasibility" : "");
14307  }
14308 
14309  /* exit presolving */
14310  SCIP_CALL( SCIPprobExitPresolve(scip->transprob, scip->set) );
14311  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
14312  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
14313 
14314  if( !solved )
14315  {
14316  /* check, whether objective value is always integral by inspecting the problem, if it is the case adjust the
14317  * cutoff bound if primal solution is already known
14318  */
14319  SCIP_CALL( SCIPprobCheckObjIntegral(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
14320  scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
14321 
14322  /* if possible, scale objective function such that it becomes integral with gcd 1 */
14323  SCIP_CALL( SCIPprobScaleObj(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
14324  scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
14325 
14326  scip->stat->lastlowerbound = SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, scip->transprob->dualbound);
14327 
14328  /* we need to update the primal dual integral here to update the last{upper/dual}bound values after a restart */
14329  if( scip->set->misc_calcintegral )
14330  {
14332  }
14333  }
14334 
14335  /* free temporary presolving root node */
14336  SCIP_CALL( SCIPtreeFreePresolvingRoot(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->messagehdlr,
14337  scip->stat, scip->transprob, scip->origprob, scip->primal, scip->lp, scip->branchcand, scip->conflict,
14338  scip->conflictstore, scip->eventfilter, scip->eventqueue, scip->cliquetable) );
14339 
14340  /* switch stage to PRESOLVED */
14341  scip->set->stage = SCIP_STAGE_PRESOLVED;
14342 
14343  return SCIP_OKAY;
14344 }
14345 
14346 /** applies one round of presolving with the given presolving timing
14347  *
14348  * This method will always be called with presoltiming fast first. It iterates over all presolvers, propagators, and
14349  * constraint handlers and calls their presolving callbacks with timing fast. If enough reductions are found, it
14350  * returns and the next presolving round will be started (again with timing fast). If the fast presolving does not
14351  * find enough reductions, this methods calls itself recursively with presoltiming medium. Again, it calls the
14352  * presolving callbacks of all presolvers, propagators, and constraint handlers with timing medium. If enough
14353  * reductions are found, it returns and the next presolving round will be started (with timing fast). Otherwise, it is
14354  * called recursively with presoltiming exhaustive. In exhaustive presolving, presolvers, propagators, and constraint
14355  * handlers are called w.r.t. their priority, but this time, we stop as soon as enough reductions were found and do not
14356  * necessarily call all presolving methods. If we stop, we return and another presolving round is started with timing
14357  * fast.
14358  *
14359  * @todo check if we want to do the following (currently disabled):
14360  * In order to avoid calling the same expensive presolving methods again and again (which is possibly ineffective
14361  * for the current instance), we continue the loop for exhaustive presolving where we stopped it the last time. The
14362  * {presol/prop/cons}start pointers are used to this end: they provide the plugins to start the loop with in the
14363  * current presolving round (if we reach exhaustive presolving), and are updated in this case to the next ones to be
14364  * called in the next round. In case we reach the end of the loop in exhaustive presolving, we call the method again
14365  * with exhaustive timing, now starting with the first presolving steps in the loop until we reach the ones we started
14366  * the last call with. This way, we won't stop until all exhaustive presolvers were called without finding enough
14367  * reductions (in sum).
14368  */
14369 static
14371  SCIP* scip, /**< SCIP data structure */
14372  SCIP_PRESOLTIMING* timing, /**< pointer to current presolving timing */
14373  SCIP_Bool* unbounded, /**< pointer to store whether presolving detected unboundedness */
14374  SCIP_Bool* infeasible, /**< pointer to store whether presolving detected infeasibility */
14375  SCIP_Bool lastround, /**< is this the last presolving round due to a presolving round limit? */
14376  int* presolstart, /**< pointer to get the presolver to start exhaustive presolving with in
14377  * the current round and store the one to start with in the next round */
14378  int presolend, /**< last presolver to treat in exhaustive presolving */
14379  int* propstart, /**< pointer to get the propagator to start exhaustive presolving with in
14380  * the current round and store the one to start with in the next round */
14381  int propend, /**< last propagator to treat in exhaustive presolving */
14382  int* consstart, /**< pointer to get the constraint handler to start exhaustive presolving with in
14383  * the current round and store the one to start with in the next round */
14384  int consend /**< last constraint handler to treat in exhaustive presolving */
14385  )
14386 {
14387  SCIP_RESULT result;
14388  SCIP_EVENT event;
14389  SCIP_Bool aborted;
14390  SCIP_Bool lastranpresol;
14391 #if 0
14392  int oldpresolstart = 0;
14393  int oldpropstart = 0;
14394  int oldconsstart = 0;
14395 #endif
14396  int priopresol;
14397  int prioprop;
14398  int i;
14399  int j;
14400  int k;
14401 #ifndef NDEBUG
14402  size_t nusedbuffers;
14403  size_t nusedcleanbuffers;
14404 #endif
14405 
14406  assert(scip != NULL);
14407  assert(scip->set != NULL);
14408  assert(unbounded != NULL);
14409  assert(infeasible != NULL);
14410  assert(presolstart != NULL);
14411  assert(propstart != NULL);
14412  assert(consstart != NULL);
14413 
14414  assert((presolend == scip->set->npresols && propend == scip->set->nprops && consend == scip->set->nconshdlrs)
14415  || (*presolstart == 0 && *propstart == 0 && *consstart == 0));
14416 
14417  *unbounded = FALSE;
14418  *infeasible = FALSE;
14419  aborted = FALSE;
14420 
14421  assert( scip->set->propspresolsorted );
14422 
14423  /* GCG wants to perform presolving during the reading process of a file reader;
14424  * hence the number of used buffers does not need to be zero, however, it should not
14425  * change by calling the presolving callbacks
14426  */
14427 #ifndef NDEBUG
14428  nusedbuffers = BMSgetNUsedBufferMemory(SCIPbuffer(scip));
14429  nusedcleanbuffers = BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip));
14430 #endif
14431 
14432 
14433  if( *timing == SCIP_PRESOLTIMING_EXHAUSTIVE )
14434  {
14435  /* In exhaustive presolving, we continue the loop where we stopped last time to avoid calling the same
14436  * (possibly ineffective) presolving step again and again. If we reach the end of the arrays of presolvers,
14437  * propagators, and constraint handlers without having made enough reductions, we start again from the beginning
14438  */
14439  i = *presolstart;
14440  j = *propstart;
14441  k = *consstart;
14442 #if 0
14443  oldpresolstart = i;
14444  oldpropstart = j;
14445  oldconsstart = k;
14446 #endif
14447  if( i >= presolend && j >= propend && k >= consend )
14448  return SCIP_OKAY;
14449 
14450  if( i == 0 && j == 0 && k == 0 )
14451  ++(scip->stat->npresolroundsext);
14452  }
14453  else
14454  {
14455  /* in fast and medium presolving, we always iterate over all presolvers, propagators, and constraint handlers */
14456  assert(presolend == scip->set->npresols);
14457  assert(propend == scip->set->nprops);
14458  assert(consend == scip->set->nconshdlrs);
14459 
14460  i = 0;
14461  j = 0;
14462  k = 0;
14463 
14464  if( *timing == SCIP_PRESOLTIMING_FAST )
14465  ++(scip->stat->npresolroundsfast);
14466  if( *timing == SCIP_PRESOLTIMING_MEDIUM )
14467  ++(scip->stat->npresolroundsmed);
14468  }
14469 
14470  SCIPdebugMsg(scip, "starting presolving round %d (%d/%d/%d), timing = %u\n",
14472  scip->stat->npresolroundsext, *timing);
14473 
14474  /* call included presolvers with nonnegative priority */
14475  while( !(*unbounded) && !(*infeasible) && !aborted && (i < presolend || j < propend) )
14476  {
14477  if( i < presolend )
14478  priopresol = SCIPpresolGetPriority(scip->set->presols[i]);
14479  else
14480  priopresol = -1;
14481 
14482  if( j < propend )
14483  prioprop = SCIPpropGetPresolPriority(scip->set->props_presol[j]);
14484  else
14485  prioprop = -1;
14486 
14487  /* call next propagator */
14488  if( prioprop >= priopresol )
14489  {
14490  /* only presolving methods which have non-negative priority will be called before constraint handlers */
14491  if( prioprop < 0 )
14492  break;
14493 
14494  SCIPdebugMsg(scip, "executing presolving of propagator <%s>\n", SCIPpropGetName(scip->set->props_presol[j]));
14495  SCIP_CALL( SCIPpropPresol(scip->set->props_presol[j], scip->set, *timing, scip->stat->npresolrounds,
14497  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
14498  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
14499  &scip->stat->npresolchgsides, &result) );
14500  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
14501  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
14502 
14503  lastranpresol = FALSE;
14504  ++j;
14505  }
14506  /* call next presolver */
14507  else
14508  {
14509  /* only presolving methods which have non-negative priority will be called before constraint handlers */
14510  if( priopresol < 0 )
14511  break;
14512 
14513  SCIPdebugMsg(scip, "executing presolver <%s>\n", SCIPpresolGetName(scip->set->presols[i]));
14514  SCIP_CALL( SCIPpresolExec(scip->set->presols[i], scip->set, *timing, scip->stat->npresolrounds,
14516  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
14517  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
14518  &scip->stat->npresolchgsides, &result) );
14519  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
14520  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
14521 
14522  lastranpresol = TRUE;
14523  ++i;
14524  }
14525 
14526  if( result == SCIP_CUTOFF )
14527  {
14528  *infeasible = TRUE;
14529 
14530  if( lastranpresol )
14532  "presolver <%s> detected infeasibility\n", SCIPpresolGetName(scip->set->presols[i-1]));
14533  else
14535  "propagator <%s> detected infeasibility\n", SCIPpropGetName(scip->set->props_presol[j-1]));
14536  }
14537  else if( result == SCIP_UNBOUNDED )
14538  {
14539  *unbounded = TRUE;
14540 
14541  if( lastranpresol )
14543  "presolver <%s> detected unboundedness (or infeasibility)\n", SCIPpresolGetName(scip->set->presols[i-1]));
14544  else
14546  "propagator <%s> detected unboundedness (or infeasibility)\n", SCIPpropGetName(scip->set->props_presol[j-1]));
14547  }
14548 
14549  /* delete the variables from the problems that were marked to be deleted */
14550  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp,
14551  scip->branchcand) );
14552 
14553  SCIPdebugMsg(scip, "presolving callback returned result <%d>\n", result);
14554 
14555  /* if we work off the exhaustive presolvers, we stop immediately if a reduction was found */
14556  if( (*timing == SCIP_PRESOLTIMING_EXHAUSTIVE) && !lastround && !SCIPisPresolveFinished(scip) )
14557  {
14558  assert(*consstart == 0);
14559 
14560  if( lastranpresol )
14561  {
14562  *presolstart = i + 1;
14563  *propstart = j;
14564  }
14565  else
14566  {
14567  *presolstart = i;
14568  *propstart = j + 1;
14569  }
14570  aborted = TRUE;
14571 
14572  break;
14573  }
14574  }
14575 
14576  /* call presolve methods of constraint handlers */
14577  while( k < consend && !(*unbounded) && !(*infeasible) && !aborted )
14578  {
14579  SCIPdebugMsg(scip, "executing presolve method of constraint handler <%s>\n",
14580  SCIPconshdlrGetName(scip->set->conshdlrs[k]));
14581  SCIP_CALL( SCIPconshdlrPresolve(scip->set->conshdlrs[k], scip->mem->probmem, scip->set, scip->stat,
14582  *timing, scip->stat->npresolrounds,
14584  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
14585  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
14586  &scip->stat->npresolchgsides, &result) );
14587  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
14588  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
14589 
14590  ++k;
14591 
14592  if( result == SCIP_CUTOFF )
14593  {
14594  *infeasible = TRUE;
14596  "constraint handler <%s> detected infeasibility\n", SCIPconshdlrGetName(scip->set->conshdlrs[k-1]));
14597  }
14598  else if( result == SCIP_UNBOUNDED )
14599  {
14600  *unbounded = TRUE;
14602  "constraint handler <%s> detected unboundedness (or infeasibility)\n",
14603  SCIPconshdlrGetName(scip->set->conshdlrs[k-1]));
14604  }
14605 
14606  /* delete the variables from the problems that were marked to be deleted */
14607  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp,
14608  scip->branchcand) );
14609 
14610  SCIPdebugMsg(scip, "presolving callback returned with result <%d>\n", result);
14611 
14612  /* if we work off the exhaustive presolvers, we stop immediately if a reduction was found */
14613  if( (*timing == SCIP_PRESOLTIMING_EXHAUSTIVE) && !lastround && !SCIPisPresolveFinished(scip) )
14614  {
14615  *presolstart = i;
14616  *propstart = j;
14617  *consstart = k + 1;
14618  aborted = TRUE;
14619 
14620  break;
14621  }
14622  }
14623 
14624  assert( scip->set->propspresolsorted );
14625 
14626  /* call included presolvers with negative priority */
14627  while( !(*unbounded) && !(*infeasible) && !aborted && (i < presolend || j < propend) )
14628  {
14629  if( i < scip->set->npresols )
14630  priopresol = SCIPpresolGetPriority(scip->set->presols[i]);
14631  else
14632  priopresol = -INT_MAX;
14633 
14634  if( j < scip->set->nprops )
14635  prioprop = SCIPpropGetPresolPriority(scip->set->props_presol[j]);
14636  else
14637  prioprop = -INT_MAX;
14638 
14639  /* choose presolving */
14640  if( prioprop >= priopresol )
14641  {
14642  assert(prioprop <= 0);
14643 
14644  SCIPdebugMsg(scip, "executing presolving of propagator <%s>\n", SCIPpropGetName(scip->set->props_presol[j]));
14645  SCIP_CALL( SCIPpropPresol(scip->set->props_presol[j], scip->set, *timing, scip->stat->npresolrounds,
14647  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
14648  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
14649  &scip->stat->npresolchgsides, &result) );
14650  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
14651  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
14652 
14653  lastranpresol = FALSE;
14654  ++j;
14655  }
14656  else
14657  {
14658  assert(priopresol < 0);
14659 
14660  SCIPdebugMsg(scip, "executing presolver <%s>\n", SCIPpresolGetName(scip->set->presols[i]));
14661  SCIP_CALL( SCIPpresolExec(scip->set->presols[i], scip->set, *timing, scip->stat->npresolrounds,
14663  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
14664  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
14665  &scip->stat->npresolchgsides, &result) );
14666  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
14667  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
14668 
14669  lastranpresol = TRUE;
14670  ++i;
14671  }
14672 
14673  if( result == SCIP_CUTOFF )
14674  {
14675  *infeasible = TRUE;
14676 
14677  if( lastranpresol )
14679  "presolver <%s> detected infeasibility\n", SCIPpresolGetName(scip->set->presols[i-1]));
14680  else
14682  "propagator <%s> detected infeasibility\n", SCIPpropGetName(scip->set->props_presol[j-1]));
14683  }
14684  else if( result == SCIP_UNBOUNDED )
14685  {
14686  *unbounded = TRUE;
14687 
14688  if( lastranpresol )
14690  "presolver <%s> detected unboundedness (or infeasibility)\n", SCIPpresolGetName(scip->set->presols[i-1]));
14691  else
14693  "propagator <%s> detected unboundedness (or infeasibility)\n", SCIPpropGetName(scip->set->props_presol[j-1]));
14694  }
14695 
14696  /* delete the variables from the problems that were marked to be deleted */
14697  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp,
14698  scip->branchcand) );
14699 
14700  SCIPdebugMsg(scip, "presolving callback return with result <%d>\n", result);
14701 
14702  /* if we work off the exhaustive presolvers, we stop immediately if a reduction was found */
14703  if( (*timing == SCIP_PRESOLTIMING_EXHAUSTIVE) && !lastround && !SCIPisPresolveFinished(scip) )
14704  {
14705  assert(k == consend);
14706 
14707  if( lastranpresol )
14708  {
14709  *presolstart = i + 1;
14710  *propstart = j;
14711  }
14712  else
14713  {
14714  *presolstart = i;
14715  *propstart = j + 1;
14716  }
14717  *consstart = k;
14718 
14719  break;
14720  }
14721  }
14722 
14723  /* remove empty and single variable cliques from the clique table */
14724  if( !(*unbounded) && !(*infeasible) )
14725  {
14726  int nlocalbdchgs = 0;
14727 
14728  SCIP_CALL( SCIPcliquetableCleanup(scip->cliquetable, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
14729  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, &nlocalbdchgs,
14730  infeasible) );
14731 
14732  if( nlocalbdchgs > 0 || *infeasible )
14734  "clique table cleanup detected %d bound changes%s\n", nlocalbdchgs, *infeasible ? " and infeasibility" : "");
14735 
14736  scip->stat->npresolfixedvars += nlocalbdchgs;
14737 
14738  if( !*infeasible && scip->set->nheurs > 0 )
14739  {
14740  /* call primal heuristics that are applicable during presolving */
14741  SCIP_Bool foundsol;
14742 
14743  SCIPdebugMsg(scip, "calling primal heuristics during presolving\n");
14744 
14745  /* call primal heuristics */
14746  SCIP_CALL( SCIPprimalHeuristics(scip->set, scip->stat, scip->transprob, scip->primal, NULL, NULL, NULL,
14747  SCIP_HEURTIMING_DURINGPRESOLLOOP, FALSE, &foundsol, unbounded) );
14748 
14749  /* output a message, if a solution was found */
14750  if( foundsol )
14751  {
14752  SCIP_SOL* sol;
14753 
14754  assert(SCIPgetNSols(scip) > 0);
14755  sol = SCIPgetBestSol(scip);
14756  assert(sol != NULL);
14757  assert(SCIPgetSolOrigObj(scip,sol) != SCIP_INVALID); /*lint !e777*/
14758 
14760  "feasible solution found by %s heuristic after %.1f seconds, objective value %.6e\n",
14762  }
14763  }
14764  }
14765 
14766  if( !(*unbounded) && !(*infeasible) )
14767  {
14768  /* call more expensive presolvers */
14769  if( (SCIPisPresolveFinished(scip) || lastround) )
14770  {
14771  if( *timing != SCIP_PRESOLTIMING_FINAL )
14772  {
14773  assert((*timing == SCIP_PRESOLTIMING_FAST) || (*timing == SCIP_PRESOLTIMING_MEDIUM) || (*timing == SCIP_PRESOLTIMING_EXHAUSTIVE));
14774 
14775  SCIPdebugMsg(scip, "not enough reductions in %s presolving, running %s presolving now...\n",
14776  *timing == SCIP_PRESOLTIMING_FAST ? "fast" : *timing == SCIP_PRESOLTIMING_MEDIUM ? "medium" : "exhaustive",
14777  *timing == SCIP_PRESOLTIMING_FAST ? "medium" : *timing == SCIP_PRESOLTIMING_MEDIUM ? "exhaustive" : "final");
14778 
14779  /* increase timing */
14781 
14782  /* computational experiments showed that always starting the loop of exhaustive presolvers from the beginning
14783  * performs better than continuing from the last processed presolver. Therefore, we start from 0, but keep
14784  * the mechanisms to possibly change this back later.
14785  * @todo try starting from the last processed exhaustive presolver
14786  */
14787  *presolstart = 0;
14788  *propstart = 0;
14789  *consstart = 0;
14790 
14791  SCIP_CALL( presolveRound(scip, timing, unbounded, infeasible, lastround, presolstart, presolend,
14792  propstart, propend, consstart, consend) );
14793  }
14794 #if 0
14795  /* run remaining exhaustive presolvers (if we did not start from the beginning anyway) */
14796  else if( (oldpresolstart > 0 || oldpropstart > 0 || oldconsstart > 0) && presolend == scip->set->npresols
14797  && propend == scip->set->nprops && consend == scip->set->nconshdlrs )
14798  {
14799  int newpresolstart = 0;
14800  int newpropstart = 0;
14801  int newconsstart = 0;
14802 
14803  SCIPdebugMsg(scip, "reached end of exhaustive presolving loop, starting from the beginning...\n");
14804 
14805  SCIP_CALL( presolveRound(scip, timing, unbounded, infeasible, lastround, &newpresolstart,
14806  oldpresolstart, &newpropstart, oldpropstart, &newconsstart, oldconsstart) );
14807 
14808  *presolstart = newpresolstart;
14809  *propstart = newpropstart;
14810  *consstart = newconsstart;
14811  }
14812 #endif
14813  }
14814  }
14815 
14816  /* issue PRESOLVEROUND event */
14818  SCIP_CALL( SCIPeventProcess(&event, scip->set, NULL, NULL, NULL, scip->eventfilter) );
14819 
14820  return SCIP_OKAY;
14821 }
14822 
14823 
14824 /** loops through the included presolvers and constraint's presolve methods, until changes are too few */
14825 static
14827  SCIP* scip, /**< SCIP data structure */
14828  SCIP_Bool* unbounded, /**< pointer to store whether presolving detected unboundedness */
14829  SCIP_Bool* infeasible /**< pointer to store whether presolving detected infeasibility */
14830  )
14831 {
14832  SCIP_PRESOLTIMING presoltiming;
14833  SCIP_Bool finished;
14834  SCIP_Bool stopped;
14835  SCIP_Bool lastround;
14836  int presolstart = 0;
14837  int propstart = 0;
14838  int consstart = 0;
14839 #ifndef NDEBUG
14840  size_t nusedbuffers;
14841  size_t nusedcleanbuffers;
14842 #endif
14843 
14844  assert(scip != NULL);
14845  assert(scip->mem != NULL);
14846  assert(scip->primal != NULL);
14847  assert(scip->set != NULL);
14848  assert(scip->stat != NULL);
14849  assert(scip->transprob != NULL);
14850  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED || scip->set->stage == SCIP_STAGE_PRESOLVING);
14851  assert(unbounded != NULL);
14852  assert(infeasible != NULL);
14853 
14854  *unbounded = FALSE;
14855 
14856  /* GCG wants to perform presolving during the reading process of a file reader;
14857  * hence the number of used buffers does not need to be zero, however, it should
14858  * be the same again after presolve is finished
14859  */
14860 #ifndef NDEBUG
14861  nusedbuffers = BMSgetNUsedBufferMemory(SCIPbuffer(scip));
14862  nusedcleanbuffers = BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip));
14863 #endif
14864 
14865 
14866  /* switch status to unknown */
14867  scip->stat->status = SCIP_STATUS_UNKNOWN;
14868 
14869  /* update upper bound and cutoff bound due to objective limit in primal data */
14870  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
14871  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
14872 
14873  /* start presolving timer */
14874  SCIPclockStart(scip->stat->presolvingtime, scip->set);
14876 
14877  /* initialize presolving */
14878  if( scip->set->stage == SCIP_STAGE_TRANSFORMED )
14879  {
14880  SCIP_CALL( initPresolve(scip) );
14881  }
14882  assert(scip->set->stage == SCIP_STAGE_PRESOLVING);
14883 
14884  /* call primal heuristics that are applicable before presolving */
14885  if( scip->set->nheurs > 0 )
14886  {
14887  SCIP_Bool foundsol;
14888 
14889  SCIPdebugMsg(scip, "calling primal heuristics before presolving\n");
14890 
14891  /* call primal heuristics */
14892  SCIP_CALL( SCIPprimalHeuristics(scip->set, scip->stat, scip->transprob, scip->primal, NULL, NULL, NULL,
14893  SCIP_HEURTIMING_BEFOREPRESOL, FALSE, &foundsol, unbounded) );
14894 
14895  /* output a message, if a solution was found */
14896  if( foundsol )
14897  {
14898  SCIP_SOL* sol;
14899 
14900  assert(SCIPgetNSols(scip) > 0);
14901  sol = SCIPgetBestSol(scip);
14902  assert(sol != NULL);
14903  assert(SCIPgetSolOrigObj(scip,sol) != SCIP_INVALID); /*lint !e777*/
14904 
14906  "feasible solution found by %s heuristic after %.1f seconds, objective value %.6e\n",
14908  }
14909  }
14910 
14912 
14913  *infeasible = FALSE;
14914  *unbounded = (*unbounded) || (SCIPgetNSols(scip) > 0 && SCIPisInfinity(scip, -SCIPgetSolOrigObj(scip, SCIPgetBestSol(scip))));
14915 
14916  finished = (scip->set->presol_maxrounds != -1 && scip->stat->npresolrounds >= scip->set->presol_maxrounds)
14917  || (*unbounded) || (scip->set->reopt_enable && scip->stat->nreoptruns >= 1);
14918  stopped = SCIPsolveIsStopped(scip->set, scip->stat, TRUE);
14919 
14920  /* perform presolving rounds */
14921  while( !finished && !stopped )
14922  {
14923  /* store current number of reductions */
14925  scip->stat->lastnpresolaggrvars = scip->stat->npresolaggrvars;
14927  scip->stat->lastnpresolchgbds = scip->stat->npresolchgbds;
14928  scip->stat->lastnpresoladdholes = scip->stat->npresoladdholes;
14929  scip->stat->lastnpresoldelconss = scip->stat->npresoldelconss;
14930  scip->stat->lastnpresoladdconss = scip->stat->npresoladdconss;
14932  scip->stat->lastnpresolchgcoefs = scip->stat->npresolchgcoefs;
14933  scip->stat->lastnpresolchgsides = scip->stat->npresolchgsides;
14934 #ifdef SCIP_DISABLED_CODE
14935  scip->stat->lastnpresolimplications = scip->stat->nimplications;
14936  scip->stat->lastnpresolcliques = SCIPcliquetableGetNCliques(scip->cliquetable);
14937 #endif
14938 
14939  /* set presolving flag */
14940  scip->stat->performpresol = TRUE;
14941 
14942  /* sort propagators */
14943  SCIPsetSortPropsPresol(scip->set);
14944 
14945  /* sort presolvers by priority */
14946  SCIPsetSortPresols(scip->set);
14947 
14948  /* check if this will be the last presolving round (in that case, we want to run all presolvers) */
14949  lastround = (scip->set->presol_maxrounds == -1 ? FALSE : (scip->stat->npresolrounds + 1 >= scip->set->presol_maxrounds));
14950 
14951  presoltiming = SCIP_PRESOLTIMING_FAST;
14952 
14953  /* perform the presolving round by calling the presolvers, propagators, and constraint handlers */
14954  assert(!(*unbounded));
14955  assert(!(*infeasible));
14956  SCIP_CALL( presolveRound(scip, &presoltiming, unbounded, infeasible, lastround,
14957  &presolstart, scip->set->npresols, &propstart, scip->set->nprops, &consstart, scip->set->nconshdlrs) );
14958 
14959  /* check, if we should abort presolving due to not enough changes in the last round */
14960  finished = SCIPisPresolveFinished(scip) || presoltiming == SCIP_PRESOLTIMING_FINAL;
14961 
14962  SCIPdebugMsg(scip, "presolving round %d returned with unbounded = %u, infeasible = %u, finished = %u\n", scip->stat->npresolrounds, *unbounded, *infeasible, finished);
14963 
14964  /* check whether problem is infeasible or unbounded */
14965  finished = finished || *unbounded || *infeasible;
14966 
14967  /* increase round number */
14968  scip->stat->npresolrounds++;
14969 
14970  if( !finished )
14971  {
14972  /* print presolving statistics */
14974  "(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",
14975  scip->stat->npresolrounds, ( presoltiming == SCIP_PRESOLTIMING_FAST ? "fast)" :
14976  (presoltiming == SCIP_PRESOLTIMING_MEDIUM ? "medium)" :
14977  (presoltiming == SCIP_PRESOLTIMING_EXHAUSTIVE ?"exhaustive)" :
14978  "final)")) ),
14979  scip->stat->npresolfixedvars + scip->stat->npresolaggrvars,
14980  scip->stat->npresoldelconss, scip->stat->npresoladdconss,
14981  scip->stat->npresolchgbds, scip->stat->npresolchgsides,
14982  scip->stat->npresolchgcoefs, scip->stat->npresolupgdconss,
14984  }
14985 
14986  /* abort if time limit was reached or user interrupted */
14987  stopped = SCIPsolveIsStopped(scip->set, scip->stat, TRUE);
14988  }
14989 
14990  if( *infeasible || *unbounded )
14991  {
14992  /* first change status of scip, so that all plugins in their exitpre callbacks can ask SCIP for the correct status */
14993  if( *infeasible )
14994  {
14995  /* switch status to OPTIMAL */
14996  if( scip->primal->nlimsolsfound > 0 )
14997  {
14998  scip->stat->status = SCIP_STATUS_OPTIMAL;
14999  }
15000  else /* switch status to INFEASIBLE */
15002  }
15003  else if( scip->primal->nsols >= 1 ) /* switch status to UNBOUNDED */
15005  else /* switch status to INFORUNBD */
15007  }
15008 
15009  /* deinitialize presolving */
15010  if( finished && (!stopped || *unbounded || *infeasible) )
15011  {
15012  SCIP_Real maxnonzeros;
15013  SCIP_Longint nchecknonzeros;
15014  SCIP_Longint nactivenonzeros;
15015  SCIP_Bool approxchecknonzeros;
15016  SCIP_Bool approxactivenonzeros;
15017  SCIP_Bool infeas;
15018 
15019  SCIP_CALL( exitPresolve(scip, *unbounded || *infeasible, &infeas) );
15020  *infeasible = *infeasible || infeas;
15021 
15022  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
15023 
15024  /* resort variables if we are not already done */
15025  if( !(*infeasible) && !(*unbounded) )
15026  {
15027  /* (Re)Sort the variables, which appear in the four categories (binary, integer, implicit, continuous) after
15028  * presolve with respect to their original index (within their categories). Adjust the problem index afterwards
15029  * which is supposed to reflect the position in the variable array. This additional (re)sorting is supposed to
15030  * get more robust against the order presolving fixed variables. (We also reobtain a possible block structure
15031  * induced by the user model)
15032  */
15034  }
15035 
15036  /* determine number of non-zeros */
15037  maxnonzeros = (SCIP_Real)SCIPgetNConss(scip) * SCIPgetNVars(scip);
15038  maxnonzeros = MAX(maxnonzeros, 1.0);
15039  SCIP_CALL( calcNonZeros(scip, &nchecknonzeros, &nactivenonzeros, &approxchecknonzeros, &approxactivenonzeros) );
15040  scip->stat->nnz = nactivenonzeros;
15041 
15044  "presolved problem has %s%" SCIP_LONGINT_FORMAT " active (%g%%) nonzeros and %s%" SCIP_LONGINT_FORMAT " (%g%%) check nonzeros\n",
15045  approxactivenonzeros ? "more than " : "", nactivenonzeros, nactivenonzeros/maxnonzeros * 100,
15046  approxchecknonzeros ? "more than " : "", nchecknonzeros, nchecknonzeros/maxnonzeros * 100);
15048  }
15049  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
15050  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
15051 
15052  /* stop presolving time */
15053  SCIPclockStop(scip->stat->presolvingtime, scip->set);
15055 
15056  /* print presolving statistics */
15058  "presolving (%d rounds: %d fast, %d medium, %d exhaustive):\n", scip->stat->npresolrounds,
15061  " %d deleted vars, %d deleted constraints, %d added constraints, %d tightened bounds, %d added holes, %d changed sides, %d changed coefficients\n",
15065  " %d implications, %d cliques\n", scip->stat->nimplications, SCIPcliquetableGetNCliques(scip->cliquetable));
15066 
15067  /* remember number of constraints */
15069 
15070  return SCIP_OKAY;
15071 }
15072 
15073 /** tries to transform original solutions to the transformed problem space */
15074 static
15076  SCIP* scip /**< SCIP data structure */
15077  )
15078 {
15079  SCIP_SOL** sols;
15080  SCIP_SOL** scipsols;
15081  SCIP_SOL* sol;
15082  SCIP_Real* solvals;
15083  SCIP_Bool* solvalset;
15084  SCIP_Bool added;
15085  SCIP_Longint oldnsolsfound;
15086  int nsols;
15087  int ntransvars;
15088  int naddedsols;
15089  int s;
15090 
15091  nsols = SCIPgetNSols(scip);
15092  oldnsolsfound = scip->primal->nsolsfound;
15093 
15094  /* no solution to transform */
15095  if( nsols == 0 )
15096  return SCIP_OKAY;
15097 
15098  SCIPdebugMsg(scip, "try to transfer %d original solutions into the transformed problem space\n", nsols);
15099 
15100  ntransvars = scip->transprob->nvars;
15101  naddedsols = 0;
15102 
15103  /* It might happen, that the added transferred solution does not equal the corresponding original one, which might
15104  * result in the array of solutions being changed. Thus we temporarily copy the array and traverse it in reverse
15105  * order to ensure that the regarded solution in the copied array was not already freed when new solutions were added
15106  * and the worst solutions were freed.
15107  */
15108  scipsols = SCIPgetSols(scip);
15109  SCIP_CALL( SCIPduplicateBufferArray(scip, &sols, scipsols, nsols) );
15110  SCIP_CALL( SCIPallocBufferArray(scip, &solvals, ntransvars) );
15111  SCIP_CALL( SCIPallocBufferArray(scip, &solvalset, ntransvars) );
15112 
15113  for( s = nsols-1; s >= 0; --s )
15114  {
15115  sol = sols[s];
15116 
15117  /* it might happen that a transferred original solution has a better objective than its original counterpart
15118  * (e.g., because multi-aggregated variables get another value, but the solution is still feasible);
15119  * in this case, it might happen that the solution is not an original one and we just skip this solution
15120  */
15121  if( !SCIPsolIsOriginal(sol) )
15122  continue;
15123 
15124  SCIP_CALL( SCIPprimalTransformSol(scip->primal, sol, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
15125  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, solvals,
15126  solvalset, ntransvars, &added) );
15127 
15128  if( added )
15129  ++naddedsols;
15130  }
15131 
15132  if( naddedsols > 0 )
15133  {
15135  "transformed %d/%d original solutions to the transformed problem space\n",
15136  naddedsols, nsols);
15137 
15138  scip->stat->nexternalsolsfound += scip->primal->nsolsfound - oldnsolsfound;
15139  }
15140 
15141  SCIPfreeBufferArray(scip, &solvalset);
15142  SCIPfreeBufferArray(scip, &solvals);
15143  SCIPfreeBufferArray(scip, &sols);
15144 
15145  return SCIP_OKAY;
15146 }
15147 
15148 /** initializes solution process data structures */
15149 static
15151  SCIP* scip, /**< SCIP data structure */
15152  SCIP_Bool solved /**< is problem already solved? */
15153  )
15154 {
15155  assert(scip != NULL);
15156  assert(scip->mem != NULL);
15157  assert(scip->set != NULL);
15158  assert(scip->stat != NULL);
15159  assert(scip->nlp == NULL);
15160  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
15161 
15162  /**@todo check whether other methodscan be skipped if problem has been solved */
15163  /* if problem has been solved, several time consuming tasks must not be performed */
15164  if( !solved )
15165  {
15166  /* reset statistics for current branch and bound run */
15167  SCIPstatResetCurrentRun(scip->stat, scip->set, scip->transprob, scip->origprob, solved);
15169 
15170  /* LP is empty anyway; mark empty LP to be solved and update validsollp counter */
15171  SCIP_CALL( SCIPlpReset(scip->lp, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->eventfilter) );
15172 
15173  /* update upper bound and cutoff bound due to objective limit in primal data */
15174  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
15175  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
15176  }
15177 
15178  /* switch stage to INITSOLVE */
15179  scip->set->stage = SCIP_STAGE_INITSOLVE;
15180 
15181  /* initialize NLP if there are nonlinearities */
15182  if( scip->transprob->nlpenabled && !scip->set->nlp_disable )
15183  {
15184  SCIPdebugMsg(scip, "constructing empty NLP\n");
15185 
15186  SCIP_CALL( SCIPnlpCreate(&scip->nlp, scip->mem->probmem, scip->set, scip->stat, SCIPprobGetName(scip->transprob), scip->transprob->nvars) );
15187  assert(scip->nlp != NULL);
15188 
15189  SCIP_CALL( SCIPnlpAddVars(scip->nlp, scip->mem->probmem, scip->set, scip->transprob->nvars, scip->transprob->vars) );
15190  }
15191 
15192  /* possibly create visualization output file */
15193  SCIP_CALL( SCIPvisualInit(scip->stat->visual, scip->mem->probmem, scip->set, scip->messagehdlr) );
15194 
15195  /* initialize solution process data structures */
15199  SCIP_CALL( SCIPcutpoolCreate(&scip->cutpool, scip->mem->probmem, scip->set, scip->set->sepa_cutagelimit, TRUE) );
15200  SCIP_CALL( SCIPcutpoolCreate(&scip->delayedcutpool, scip->mem->probmem, scip->set, scip->set->sepa_cutagelimit, FALSE) );
15201  SCIP_CALL( SCIPtreeCreateRoot(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
15202  scip->lp) );
15203 
15204  /* update dual bound of the root node if a valid dual bound is at hand */
15205  if( scip->transprob->dualbound < SCIP_INVALID )
15206  {
15207  SCIP_Real internobjval = SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, scip->transprob->dualbound);
15208 
15209  scip->stat->lastlowerbound = internobjval;
15210 
15211  SCIPnodeUpdateLowerbound(SCIPtreeGetRootNode(scip->tree), scip->stat, scip->set, scip->tree, scip->transprob,
15212  scip->origprob, internobjval);
15213  }
15214 
15215  /* try to transform original solutions to the transformed problem space */
15216  if( scip->set->misc_transorigsols )
15217  {
15218  SCIP_CALL( transformSols(scip) );
15219  }
15220 
15221  /* inform the transformed problem that the branch and bound process starts now */
15222  SCIP_CALL( SCIPprobInitSolve(scip->transprob, scip->set) );
15223 
15224  /* inform plugins that the branch and bound process starts now */
15225  SCIP_CALL( SCIPsetInitsolPlugins(scip->set, scip->mem->probmem, scip->stat) );
15226 
15227  /* remember number of constraints */
15229 
15230  /* if all variables are known, calculate a trivial primal bound by setting all variables to their worst bound */
15231  if( scip->set->nactivepricers == 0 )
15232  {
15233  SCIP_VAR* var;
15234  SCIP_Real obj;
15235  SCIP_Real objbound;
15236  SCIP_Real bd;
15237  int v;
15238 
15239  objbound = 0.0;
15240  for( v = 0; v < scip->transprob->nvars && !SCIPsetIsInfinity(scip->set, objbound); ++v )
15241  {
15242  var = scip->transprob->vars[v];
15243  obj = SCIPvarGetObj(var);
15244  if( !SCIPsetIsZero(scip->set, obj) )
15245  {
15246  bd = SCIPvarGetWorstBoundGlobal(var);
15247  if( SCIPsetIsInfinity(scip->set, REALABS(bd)) )
15248  objbound = SCIPsetInfinity(scip->set);
15249  else
15250  objbound += obj * bd;
15251  }
15252  }
15253 
15254  /* adjust primal bound, such that solution with worst bound may be found */
15255  if( objbound + SCIPsetCutoffbounddelta(scip->set) != objbound ) /*lint !e777*/
15256  objbound += SCIPsetCutoffbounddelta(scip->set);
15257  /* if objbound is very large, adding the cutoffbounddelta may not change the number; in this case, we are using
15258  * SCIPnextafter to ensure that the cutoffbound is really larger than the best possible solution value
15259  */
15260  else
15261  objbound = SCIPnextafter(objbound, SCIP_REAL_MAX);
15262 
15263  /* update cutoff bound */
15264  if( !SCIPsetIsInfinity(scip->set, objbound) && SCIPsetIsLT(scip->set, objbound, scip->primal->cutoffbound) )
15265  {
15266  /* adjust cutoff bound */
15267  SCIP_CALL( SCIPprimalSetCutoffbound(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
15268  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, objbound, FALSE) );
15269  }
15270  }
15271 
15272  /* switch stage to SOLVING */
15273  scip->set->stage = SCIP_STAGE_SOLVING;
15274 
15275  return SCIP_OKAY;
15276 }
15277 
15278 /** frees solution process data structures */
15279 static
15281  SCIP* scip, /**< SCIP data structure */
15282  SCIP_Bool restart /**< was this free solve call triggered by a restart? */
15283  )
15284 {
15285  assert(scip != NULL);
15286  assert(scip->mem != NULL);
15287  assert(scip->set != NULL);
15288  assert(scip->stat != NULL);
15289  assert(scip->set->stage == SCIP_STAGE_SOLVING || scip->set->stage == SCIP_STAGE_SOLVED);
15290 
15291  /* mark that we are currently restarting */
15292  if( restart )
15293  {
15294  scip->stat->inrestart = TRUE;
15295 
15296  /* copy the current dual bound into the problem data structure such that it can be used initialize the new search
15297  * tree
15298  */
15300  }
15301 
15302  /* remove focus from the current focus node */
15303  if( SCIPtreeGetFocusNode(scip->tree) != NULL )
15304  {
15305  SCIP_NODE* node = NULL;
15306  SCIP_Bool cutoff;
15307 
15308  SCIP_CALL( SCIPnodeFocus(&node, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->transprob,
15309  scip->origprob, scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->conflict,
15310  scip->conflictstore, scip->eventfilter, scip->eventqueue, scip->cliquetable, &cutoff, FALSE, TRUE) );
15311  assert(!cutoff);
15312  }
15313 
15314  /* switch stage to EXITSOLVE */
15315  scip->set->stage = SCIP_STAGE_EXITSOLVE;
15316 
15317  /* cleanup the conflict storage */
15318  SCIP_CALL( SCIPconflictstoreClean(scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->reopt) );
15319 
15320  /* inform plugins that the branch and bound process is finished */
15321  SCIP_CALL( SCIPsetExitsolPlugins(scip->set, scip->mem->probmem, scip->stat, restart) );
15322 
15323  /* free the NLP, if there is one, and reset the flags indicating nonlinearity */
15324  if( scip->nlp != NULL )
15325  {
15326  SCIP_CALL( SCIPnlpFree(&scip->nlp, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
15327  }
15328  scip->transprob->nlpenabled = FALSE;
15329 
15330  /* clear the LP, and flush the changes to clear the LP of the solver */
15331  SCIP_CALL( SCIPlpReset(scip->lp, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->eventfilter) );
15333 
15334  /* resets the debug environment */
15335  SCIP_CALL( SCIPdebugReset(scip->set) ); /*lint !e506 !e774*/
15336 
15337  /* clear all row references in internal data structures */
15338  SCIP_CALL( SCIPcutpoolClear(scip->cutpool, scip->mem->probmem, scip->set, scip->lp) );
15339  SCIP_CALL( SCIPcutpoolClear(scip->delayedcutpool, scip->mem->probmem, scip->set, scip->lp) );
15340 
15341  /* we have to clear the tree prior to the problem deinitialization, because the rows stored in the forks and
15342  * subroots have to be released
15343  */
15344  SCIP_CALL( SCIPtreeClear(scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
15345 
15346  /* deinitialize transformed problem */
15347  SCIP_CALL( SCIPprobExitSolve(scip->transprob, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, restart) );
15348 
15349  /* free solution process data structures */
15350  SCIP_CALL( SCIPcutpoolFree(&scip->cutpool, scip->mem->probmem, scip->set, scip->lp) );
15351  SCIP_CALL( SCIPcutpoolFree(&scip->delayedcutpool, scip->mem->probmem, scip->set, scip->lp) );
15355 
15356  /* possibly close visualization output file */
15357  SCIPvisualExit(scip->stat->visual, scip->set, scip->messagehdlr);
15358 
15359  /* reset statistics for current branch and bound run */
15361  SCIPstatResetCurrentRun(scip->stat, scip->set, scip->transprob, scip->origprob, TRUE);
15362  else
15363  SCIPstatResetCurrentRun(scip->stat, scip->set, scip->transprob, scip->origprob, FALSE);
15364 
15365  /* switch stage to TRANSFORMED */
15366  scip->set->stage = SCIP_STAGE_TRANSFORMED;
15367 
15368  /* restart finished */
15369  assert( ! restart || scip->stat->inrestart );
15370  scip->stat->inrestart = FALSE;
15371 
15372  return SCIP_OKAY;
15373 }
15374 
15375 /** frees solution process data structures when reoptimization is used
15376  *
15377  * in contrast to a freeSolve() this method will preserve the transformed problem such that another presolving round
15378  * after changing the problem (modifying the objective function) is not necessary.
15379  */
15380 static
15382  SCIP* scip /**< SCIP data structure */
15383  )
15384 {
15385  assert(scip != NULL);
15386  assert(scip->mem != NULL);
15387  assert(scip->set != NULL);
15388  assert(scip->stat != NULL);
15389  assert(scip->set->stage == SCIP_STAGE_SOLVING || scip->set->stage == SCIP_STAGE_SOLVED);
15390 
15391  /* remove focus from the current focus node */
15392  if( SCIPtreeGetFocusNode(scip->tree) != NULL )
15393  {
15394  SCIP_NODE* node = NULL;
15395  SCIP_Bool cutoff;
15396 
15397  SCIP_CALL( SCIPnodeFocus(&node, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->transprob,
15398  scip->origprob, scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->conflict,
15399  scip->conflictstore, scip->eventfilter, scip->eventqueue, scip->cliquetable, &cutoff, FALSE, TRUE) );
15400  assert(!cutoff);
15401  }
15402 
15403  /* deinitialize conflict store */
15404  SCIP_CALL( SCIPconflictstoreClear(scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->reopt) );
15405 
15406  /* invalidate the dual bound */
15408 
15409  /* switch stage to EXITSOLVE */
15410  scip->set->stage = SCIP_STAGE_EXITSOLVE;
15411 
15412  /* inform plugins that the branch and bound process is finished */
15413  SCIP_CALL( SCIPsetExitsolPlugins(scip->set, scip->mem->probmem, scip->stat, FALSE) );
15414 
15415  /* call exit methods of plugins */
15416  SCIP_CALL( SCIPsetExitPlugins(scip->set, scip->mem->probmem, scip->stat) );
15417 
15418  /* free the NLP, if there is one, and reset the flags indicating nonlinearity */
15419  if( scip->nlp != NULL )
15420  {
15421  SCIP_CALL( SCIPnlpFree(&scip->nlp, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
15422  }
15423  scip->transprob->nlpenabled = FALSE;
15424 
15425  /* clear the LP, and flush the changes to clear the LP of the solver */
15426  SCIP_CALL( SCIPlpReset(scip->lp, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->eventfilter) );
15428 
15429  /* resets the debug environment */
15430  SCIP_CALL( SCIPdebugReset(scip->set) ); /*lint !e506 !e774*/
15431 
15432  /* clear all row references in internal data structures */
15433  SCIP_CALL( SCIPcutpoolClear(scip->cutpool, scip->mem->probmem, scip->set, scip->lp) );
15434  SCIP_CALL( SCIPcutpoolClear(scip->delayedcutpool, scip->mem->probmem, scip->set, scip->lp) );
15435 
15436  /* we have to clear the tree prior to the problem deinitialization, because the rows stored in the forks and
15437  * subroots have to be released
15438  */
15439  SCIP_CALL( SCIPtreeClear(scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
15440 
15441  /* deinitialize transformed problem */
15442  SCIP_CALL( SCIPprobExitSolve(scip->transprob, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, FALSE) );
15443 
15444  /* free solution process data structures */
15446 
15447  SCIP_CALL( SCIPcutpoolFree(&scip->cutpool, scip->mem->probmem, scip->set, scip->lp) );
15448  SCIP_CALL( SCIPcutpoolFree(&scip->delayedcutpool, scip->mem->probmem, scip->set, scip->lp) );
15452 
15453  /* possibly close visualization output file */
15454  SCIPvisualExit(scip->stat->visual, scip->set, scip->messagehdlr);
15455 
15456  /* reset statistics for current branch and bound run */
15457  SCIPstatResetCurrentRun(scip->stat, scip->set, scip->transprob, scip->origprob, FALSE);
15458 
15459  /* switch stage to PRESOLVED */
15460  scip->set->stage = SCIP_STAGE_PRESOLVED;
15461 
15462  /* restart finished */
15463  scip->stat->inrestart = FALSE;
15464 
15465  /* reset solving specific paramters */
15466  if( scip->set->reopt_enable )
15467  {
15468  assert(scip->reopt != NULL);
15469  SCIP_CALL( SCIPreoptReset(scip->reopt, scip->set, scip->mem->probmem) );
15470  }
15471 
15472  /* free the debug solution which might live in transformed primal data structure */
15473  SCIP_CALL( SCIPprimalClear(&scip->primal, scip->mem->probmem) );
15474 
15475  if( scip->set->misc_resetstat )
15476  {
15477  /* reset statistics to the point before the problem was transformed */
15478  SCIPstatReset(scip->stat, scip->set, scip->transprob, scip->origprob);
15479  }
15480  else
15481  {
15482  /* even if statistics are not completely reset, a partial reset of the primal-dual integral is necessary */
15484  }
15485 
15486  /* reset objective limit */
15488 
15489  return SCIP_OKAY;
15490 }
15491 
15492 /** free transformed problem */
15493 static
15495  SCIP* scip /**< SCIP data structure */
15496  )
15497 {
15498  SCIP_Bool reducedfree;
15499 
15500  assert(scip != NULL);
15501  assert(scip->mem != NULL);
15502  assert(scip->stat != NULL);
15503  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED || scip->set->stage == SCIP_STAGE_PRESOLVING ||
15504  (scip->set->stage == SCIP_STAGE_PRESOLVED && scip->set->reopt_enable));
15505 
15506  /* If the following evaluates to true, SCIPfreeReoptSolve() has already called the exit-callbacks of the plugins.
15507  * We can skip calling some of the following methods. This can happen if a new objective function was
15508  * installed but the solve was not started.
15509  */
15510  reducedfree = (scip->set->stage == SCIP_STAGE_PRESOLVED && scip->set->reopt_enable);
15511 
15512  if( !reducedfree )
15513  {
15514  /* call exit methods of plugins */
15515  SCIP_CALL( SCIPsetExitPlugins(scip->set, scip->mem->probmem, scip->stat) );
15516  }
15517 
15518  /* copy best primal solutions to original solution candidate list */
15519  if( !scip->set->reopt_enable && scip->set->limit_maxorigsol > 0 && scip->set->misc_transsolsorig )
15520  {
15521  SCIP_Bool stored;
15522  SCIP_Bool hasinfval;
15523  int maxsols;
15524  int nsols;
15525  int s;
15526 
15527  assert(scip->origprimal->nsols == 0);
15528 
15529  nsols = scip->primal->nsols;
15530  maxsols = scip->set->limit_maxorigsol;
15531  stored = TRUE;
15532  s = 0;
15533 
15534  /* iterate over all solutions as long as the original solution candidate store size limit is not reached */
15535  while( s < nsols && scip->origprimal->nsols < maxsols )
15536  {
15537  SCIP_SOL* sol;
15538 
15539  sol = scip->primal->sols[s];
15540  assert(sol != NULL);
15541 
15542  if( !SCIPsolIsOriginal(sol) )
15543  {
15544  /* retransform solution into the original problem space */
15545  SCIP_CALL( SCIPsolRetransform(sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
15546  }
15547  else
15548  hasinfval = FALSE;
15549 
15550  /* removing infinite fixings is turned off by the corresponding parameter */
15551  if( !scip->set->misc_finitesolstore )
15552  hasinfval = FALSE;
15553 
15554  if( !hasinfval )
15555  {
15556  /* add solution to original candidate solution storage */
15557  SCIP_CALL( SCIPprimalAddOrigSol(scip->origprimal, scip->mem->probmem, scip->set, scip->stat, scip->origprob, sol, &stored) );
15558  }
15559  else
15560  {
15561  SCIP_SOL* newsol;
15562  SCIP_Bool success;
15563 
15564  SCIP_CALL( SCIPcreateFiniteSolCopy(scip, &newsol, sol, &success) );
15565 
15566  /* infinite fixing could be removed */
15567  if( newsol != NULL )
15568  {
15569  /* add solution to original candidate solution storage; we must not use SCIPprimalAddOrigSolFree()
15570  * because we want to create a copy of the solution in the origprimal solution store, but newsol was
15571  * created in the (transformed) primal
15572  */
15573  SCIP_CALL( SCIPprimalAddOrigSol(scip->origprimal, scip->mem->probmem, scip->set, scip->stat, scip->origprob, newsol, &stored) );
15574 
15575  /* free solution in (transformed) primal where it was created */
15576  SCIP_CALL( SCIPsolFree(&newsol, scip->mem->probmem, scip->primal) );
15577  }
15578  }
15579  ++s;
15580  }
15581 
15582  if( scip->origprimal->nsols > 1 )
15583  {
15585  "stored the %d best primal solutions in the original solution candidate list\n", scip->origprimal->nsols);
15586  }
15587  else if( scip->origprimal->nsols == 1 )
15588  {
15590  "stored the best primal solution in the original solution candidate list\n");
15591  }
15592  }
15593 
15594  /* switch stage to FREETRANS */
15595  scip->set->stage = SCIP_STAGE_FREETRANS;
15596 
15597  /* reset solving specific paramters */
15598  if( scip->set->reopt_enable )
15599  {
15600  assert(scip->reopt != NULL);
15601  SCIP_CALL( SCIPreoptReset(scip->reopt, scip->set, scip->mem->probmem) );
15602  }
15603 
15604  /* @todo if a variable was removed from the problem during solving, its locks were not reduced;
15605  * we might want to remove locks also in that case
15606  */
15607  /* remove var locks set to avoid dual reductions */
15608  if( scip->set->reopt_enable || !scip->set->misc_allowdualreds )
15609  {
15610  int v;
15611 
15612  /* unlock all variables */
15613  for(v = 0; v < scip->transprob->nvars; v++)
15614  {
15615  SCIP_CALL( SCIPaddVarLocks(scip, scip->transprob->vars[v], -1, -1) );
15616  }
15617  }
15618 
15619  if( !reducedfree )
15620  {
15621  /* clear the conflict store
15622  *
15623  * since the conflict store can contain transformed constraints we need to remove them. the store will be finally
15624  * freed in SCIPfreeProb().
15625  */
15626  SCIP_CALL( SCIPconflictstoreClear(scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->reopt) );
15627 
15628  }
15629 
15630  /* free transformed problem data structures */
15631  SCIP_CALL( SCIPprobFree(&scip->transprob, scip->messagehdlr, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
15633  SCIP_CALL( SCIPconflictFree(&scip->conflict, scip->mem->probmem) );
15634 
15635  if( !reducedfree )
15636  {
15638  }
15639  SCIP_CALL( SCIPtreeFree(&scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
15640 
15641  /* free the debug solution which might live in transformed primal data structure */
15642  SCIP_CALL( SCIPdebugFreeSol(scip->set) ); /*lint !e506 !e774*/
15643  SCIP_CALL( SCIPprimalFree(&scip->primal, scip->mem->probmem) );
15644 
15645  SCIP_CALL( SCIPlpFree(&scip->lp, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter) );
15647  SCIP_CALL( SCIPeventfilterFree(&scip->eventfilter, scip->mem->probmem, scip->set) );
15649 
15650  if( scip->set->misc_resetstat && !reducedfree )
15651  {
15652  /* reset statistics to the point before the problem was transformed */
15653  SCIPstatReset(scip->stat, scip->set, scip->transprob, scip->origprob);
15654  }
15655  else
15656  {
15657  /* even if statistics are not completely reset, a partial reset of the primal-dual integral is necessary */
15659  }
15660 
15661  /* switch stage to PROBLEM */
15662  scip->set->stage = SCIP_STAGE_PROBLEM;
15663 
15664  /* reset objective limit */
15666 
15667  /* reset original variable's local and global bounds to their original values */
15668  SCIP_CALL( SCIPprobResetBounds(scip->origprob, scip->mem->probmem, scip->set, scip->stat) );
15669 
15670  return SCIP_OKAY;
15671 }
15672 
15673 /** displays most relevant statistics after problem was solved */
15674 static
15676  SCIP* scip /**< SCIP data structure */
15677  )
15678 {
15679  assert(scip != NULL);
15680 
15681  /* display most relevant statistics */
15682  if( scip->set->disp_verblevel >= SCIP_VERBLEVEL_NORMAL )
15683  {
15684  SCIP_Bool objlimitreached = FALSE;
15685 
15686  if( SCIPgetStage(scip) == SCIP_STAGE_SOLVED && scip->primal->nlimsolsfound == 0
15687  && !SCIPisInfinity(scip, getPrimalbound(scip)) )
15688  objlimitreached = TRUE;
15689 
15690  SCIPmessagePrintInfo(scip->messagehdlr, "\n");
15691  SCIPmessagePrintInfo(scip->messagehdlr, "SCIP Status : ");
15692  SCIP_CALL( SCIPprintStage(scip, NULL) );
15693  SCIPmessagePrintInfo(scip->messagehdlr, "\n");
15694  if( scip->set->reopt_enable )
15695  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Time (sec) : %.2f (over %d runs: %.2f)\n", SCIPclockGetTime(scip->stat->solvingtime), scip->stat->nreoptruns, SCIPclockGetTime(scip->stat->solvingtimeoverall));
15696  else
15697  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Time (sec) : %.2f\n", SCIPclockGetTime(scip->stat->solvingtime));
15698  if( scip->stat->nruns > 1 )
15699  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Nodes : %" SCIP_LONGINT_FORMAT " (total of %" SCIP_LONGINT_FORMAT " nodes in %d runs)\n",
15700  scip->stat->nnodes, scip->stat->ntotalnodes, scip->stat->nruns);
15701  else if( scip->set->reopt_enable )
15702  {
15703  SCIP_BRANCHRULE* branchrule;
15704 
15705  branchrule = SCIPfindBranchrule(scip, "nodereopt");
15706  assert(branchrule != NULL);
15707 
15708  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Nodes : %" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " reactivated)\n", scip->stat->nnodes, SCIPbranchruleGetNChildren(branchrule));
15709  }
15710  else
15711  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Nodes : %" SCIP_LONGINT_FORMAT "\n", scip->stat->nnodes);
15712  if( scip->set->stage >= SCIP_STAGE_TRANSFORMED && scip->set->stage <= SCIP_STAGE_EXITSOLVE )
15713  {
15714  if( objlimitreached )
15715  {
15716  SCIPmessagePrintInfo(scip->messagehdlr, "Primal Bound : %+.14e (%" SCIP_LONGINT_FORMAT " solutions)\n",
15717  SCIPinfinity(scip), scip->primal->nsolsfound);
15718  }
15719  else
15720  {
15721  char limsolstring[SCIP_MAXSTRLEN];
15722  if( scip->primal->nsolsfound != scip->primal->nlimsolsfound )
15723  (void) SCIPsnprintf(limsolstring, SCIP_MAXSTRLEN, ", %" SCIP_LONGINT_FORMAT " respecting the objective limit", scip->primal->nlimsolsfound);
15724  else
15725  (void) SCIPsnprintf(limsolstring, SCIP_MAXSTRLEN,"");
15726 
15727  SCIPmessagePrintInfo(scip->messagehdlr, "Primal Bound : %+.14e (%" SCIP_LONGINT_FORMAT " solutions%s)\n",
15728  getPrimalbound(scip), scip->primal->nsolsfound, limsolstring);
15729  }
15730  }
15731  if( scip->set->stage >= SCIP_STAGE_SOLVING && scip->set->stage <= SCIP_STAGE_SOLVED )
15732  {
15733  if( objlimitreached )
15734  {
15735  SCIPmessagePrintInfo(scip->messagehdlr, "Dual Bound : %+.14e\n", SCIPinfinity(scip));
15736  }
15737  else
15738  {
15739  SCIPmessagePrintInfo(scip->messagehdlr, "Dual Bound : %+.14e\n", getDualbound(scip));
15740  }
15741  SCIPmessagePrintInfo(scip->messagehdlr, "Gap : ");
15742  if( SCIPsetIsInfinity(scip->set, SCIPgetGap(scip)) )
15743  SCIPmessagePrintInfo(scip->messagehdlr, "infinite\n");
15744  else
15745  SCIPmessagePrintInfo(scip->messagehdlr, "%.2f %%\n", 100.0*SCIPgetGap(scip));
15746  }
15747 
15748  /* check solution for feasibility in original problem */
15749  if( scip->set->stage >= SCIP_STAGE_TRANSFORMED )
15750  {
15751  SCIP_SOL* sol;
15752 
15753  sol = SCIPgetBestSol(scip);
15754  if( sol != NULL )
15755  {
15756  SCIP_Real checkfeastolfac;
15757  SCIP_Real oldfeastol;
15758  SCIP_Bool dispallviols;
15759  SCIP_Bool feasible;
15760 
15761  oldfeastol = SCIPfeastol(scip);
15762  SCIP_CALL( SCIPgetRealParam(scip, "numerics/checkfeastolfac", &checkfeastolfac) );
15763  SCIP_CALL( SCIPgetBoolParam(scip, "display/allviols", &dispallviols) );
15764 
15765  /* scale feasibility tolerance by set->num_checkfeastolfac */
15766  if( !SCIPisEQ(scip, checkfeastolfac, 1.0) )
15767  {
15768  SCIP_CALL( SCIPchgFeastol(scip, oldfeastol * checkfeastolfac) );
15769  }
15770 
15771  SCIP_CALL( SCIPcheckSolOrig(scip, sol, &feasible, TRUE, dispallviols) );
15772 
15773  /* restore old feasibilty tolerance */
15774  if( !SCIPisEQ(scip, checkfeastolfac, 1.0) )
15775  {
15776  SCIP_CALL( SCIPchgFeastol(scip, oldfeastol) );
15777  }
15778 
15779  if( !feasible )
15780  {
15781  SCIPmessagePrintInfo(scip->messagehdlr, "best solution is not feasible in original problem\n");
15782  }
15783  }
15784  }
15785  }
15786 
15787  return SCIP_OKAY;
15788 }
15789 
15790 /** calls compression based on the reoptimization structure after the presolving */
15791 static
15793  SCIP* scip /**< global SCIP settings */
15794  )
15795 {
15796  SCIP_RESULT result;
15797  int c;
15798  int noldnodes;
15799  int nnewnodes;
15800 
15801  result = SCIP_DIDNOTFIND;
15802 
15803  noldnodes = SCIPreoptGetNNodes(scip->reopt, scip->tree->root);
15804 
15805  /* do not run if there exists only the root node */
15806  if( noldnodes <= 1 )
15807  return SCIP_OKAY;
15808 
15809  /* do not run a tree compression if the problem contains (implicit) integer variables */
15810  if( scip->transprob->nintvars > 0 || scip->transprob->nimplvars > 0 )
15811  return SCIP_OKAY;
15812 
15814  "tree compression:\n");
15816  " given tree has %d nodes.\n", noldnodes);
15817 
15818  /* sort compressions by priority */
15819  SCIPsetSortComprs(scip->set);
15820 
15821  for(c = 0; c < scip->set->ncomprs; c++)
15822  {
15823  assert(result == SCIP_DIDNOTFIND || result == SCIP_DIDNOTRUN);
15824 
15825  /* call tree compression technique */
15826  SCIP_CALL( SCIPcomprExec(scip->set->comprs[c], scip->set, scip->reopt, &result) );
15827 
15828  if( result == SCIP_SUCCESS )
15829  {
15830  nnewnodes = SCIPreoptGetNNodes(scip->reopt, scip->tree->root);
15832  " <%s> compressed the search tree to %d nodes (rate %g).\n", SCIPcomprGetName(scip->set->comprs[c]),
15833  nnewnodes, ((SCIP_Real)nnewnodes)/noldnodes);
15834 
15835  break;
15836  }
15837  }
15838 
15839  if( result != SCIP_SUCCESS )
15840  {
15841  assert(result == SCIP_DIDNOTFIND || result == SCIP_DIDNOTRUN);
15843  " search tree could not be compressed.\n");
15844  }
15845 
15846  return SCIP_OKAY;
15847 }
15848 
15849 /* prepare all plugins and data structures for a reoptimization run */
15850 static
15852  SCIP* scip /**< SCIP data structure */
15853  )
15854 {
15855  SCIP_Bool reoptrestart;
15856 
15857  assert(scip != NULL);
15858  assert(scip->set->reopt_enable);
15859 
15860  /* @ todo: we could check if the problem is feasible, eg, by backtracking */
15861 
15862  /* increase number of reopt_runs */
15863  ++scip->stat->nreoptruns;
15864 
15865  /* inform the reoptimization plugin that a new iteration starts */
15866  SCIP_CALL( SCIPreoptAddRun(scip->reopt, scip->set, scip->mem->probmem, scip->origprob->vars,
15867  scip->origprob->nvars, scip->set->limit_maxsol) );
15868 
15869  /* check whether we need to add globally valid constraints */
15870  if( scip->set->reopt_sepaglbinfsubtrees || scip->set->reopt_sepabestsol )
15871  {
15872  SCIP_CALL( SCIPreoptApplyGlbConss(scip, scip->reopt, scip->set, scip->stat, scip->mem->probmem) );
15873  }
15874 
15875  /* after presolving the problem the first time we remember all global bounds and active constraints. bounds and
15876  * constraints will be restored within SCIPreoptInstallBounds() and SCIPreoptResetActiveConss().
15877  */
15878  if( scip->stat->nreoptruns == 1 )
15879  {
15880  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
15881 
15882  SCIP_CALL( SCIPreoptSaveGlobalBounds(scip->reopt, scip->transprob, scip->mem->probmem) );
15883 
15884  SCIP_CALL( SCIPreoptSaveActiveConss(scip->reopt, scip->transprob, scip->mem->probmem) );
15885  }
15886  /* we are at least in the second run */
15887  else
15888  {
15889  assert(scip->transprob != NULL);
15890 
15891  SCIP_CALL( SCIPreoptMergeVarHistory(scip->reopt, scip->set, scip->stat, scip->origprob->vars, scip->origprob->nvars) );
15892 
15893  SCIP_CALL( SCIPrelaxationCreate(&scip->relaxation, scip->mem->probmem, scip->set, scip->stat, scip->primal,
15894  scip->tree) );
15895 
15896  /* mark statistics before solving */
15897  SCIPstatMark(scip->stat);
15898 
15900 
15901  SCIP_CALL( SCIPreoptResetActiveConss(scip->reopt, scip->set, scip->stat) );
15902 
15903  /* check whether we want to restart the tree search */
15904  SCIP_CALL( SCIPreoptCheckRestart(scip->reopt, scip->set, scip->mem->probmem, NULL, scip->transprob->vars,
15905  scip->transprob->nvars, &reoptrestart) );
15906 
15907  /* call initialization methods of plugins */
15908  SCIP_CALL( SCIPsetInitPlugins(scip->set, scip->mem->probmem, scip->stat) );
15909 
15910  /* install globally valid lower and upper bounds */
15911  SCIP_CALL( SCIPreoptInstallBounds(scip->reopt, scip->set, scip->stat, scip->transprob, scip->lp, scip->branchcand,
15912  scip->eventqueue, scip->cliquetable, scip->mem->probmem) );
15913 
15914  /* check, whether objective value is always integral by inspecting the problem, if it is the case adjust the
15915  * cutoff bound if primal solution is already known
15916  */
15917  SCIP_CALL( SCIPprobCheckObjIntegral(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat,
15918  scip->primal, scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
15919 
15920  /* if possible, scale objective function such that it becomes integral with gcd 1 */
15921  SCIP_CALL( SCIPprobScaleObj(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
15922  scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
15923 
15925  }
15926 
15927  /* try to compress the search tree */
15928  if( scip->set->compr_enable )
15929  {
15930  SCIP_CALL( compressReoptTree(scip) );
15931  }
15932 
15933  return SCIP_OKAY;
15934 }
15935 
15936 /** transforms and presolves problem
15937  *
15938  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15939  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15940  *
15941  * @pre This method can be called if @p scip is in one of the following stages:
15942  * - \ref SCIP_STAGE_PROBLEM
15943  * - \ref SCIP_STAGE_TRANSFORMED
15944  * - \ref SCIP_STAGE_PRESOLVING
15945  * - \ref SCIP_STAGE_PRESOLVED
15946  *
15947  * @post After calling this method \SCIP reaches one of the following stages:
15948  * - \ref SCIP_STAGE_PRESOLVING if the presolving process was interrupted
15949  * - \ref SCIP_STAGE_PRESOLVED if the presolving process was finished and did not solve the problem
15950  * - \ref SCIP_STAGE_SOLVED if the problem was solved during presolving
15951  *
15952  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
15953  */
15955  SCIP* scip /**< SCIP data structure */
15956  )
15957 {
15958  SCIP_Bool unbounded;
15959  SCIP_Bool infeasible;
15960 
15961  SCIP_CALL( checkStage(scip, "SCIPpresolve", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
15962 
15963  /* start solving timer */
15964  SCIPclockStart(scip->stat->solvingtime, scip->set);
15965  SCIPclockStart(scip->stat->solvingtimeoverall, scip->set);
15966 
15967  /* capture the CTRL-C interrupt */
15968  if( scip->set->misc_catchctrlc )
15970 
15971  /* reset the user interrupt flag */
15972  scip->stat->userinterrupt = FALSE;
15973 
15974  switch( scip->set->stage )
15975  {
15976  case SCIP_STAGE_PROBLEM:
15977  /* initialize solving data structures and transform problem */
15978  SCIP_CALL( SCIPtransformProb(scip) );
15979  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
15980 
15981  /*lint -fallthrough*/
15982 
15984  case SCIP_STAGE_PRESOLVING:
15985  /* presolve problem */
15986  SCIP_CALL( presolve(scip, &unbounded, &infeasible) );
15987  assert(scip->set->stage == SCIP_STAGE_PRESOLVED || scip->set->stage == SCIP_STAGE_PRESOLVING);
15988 
15989  if( infeasible || unbounded )
15990  {
15991  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
15992 
15993  /* initialize solving process data structures to be able to switch to SOLVED stage */
15994  SCIP_CALL( initSolve(scip, TRUE) );
15995 
15996  /* switch stage to SOLVED */
15997  scip->set->stage = SCIP_STAGE_SOLVED;
15998 
15999  /* print solution message */
16000  switch( scip->stat->status )/*lint --e{788}*/
16001  {
16002  case SCIP_STATUS_OPTIMAL:
16003  /* remove the root node from the tree, s.t. the lower bound is set to +infinity ???????????? (see initSolve())*/
16004  SCIP_CALL( SCIPtreeClear(scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
16005  break;
16006 
16009  "presolving detected infeasibility\n");
16010  break;
16011 
16012  case SCIP_STATUS_UNBOUNDED:
16014  "presolving detected unboundedness\n");
16015  break;
16016 
16017  case SCIP_STATUS_INFORUNBD:
16019  "presolving detected unboundedness (or infeasibility)\n");
16020  break;
16021 
16022  default:
16023  /* note that this is in an internal SCIP error since the status is corrupted */
16024  SCIPerrorMessage("invalid SCIP status <%d>\n", scip->stat->status);
16025  SCIPABORT();
16026  return SCIP_ERROR; /*lint !e527*/
16027  }
16028  }
16029  else if( scip->set->stage == SCIP_STAGE_PRESOLVED )
16030  {
16031  int h;
16032 
16033  /* print presolved problem statistics */
16035  "presolved problem has %d variables (%d bin, %d int, %d impl, %d cont) and %d constraints\n",
16036  scip->transprob->nvars, scip->transprob->nbinvars, scip->transprob->nintvars, scip->transprob->nimplvars,
16037  scip->transprob->ncontvars, scip->transprob->nconss);
16038 
16039  for( h = 0; h < scip->set->nconshdlrs; ++h )
16040  {
16041  int nactiveconss;
16042 
16043  nactiveconss = SCIPconshdlrGetNActiveConss(scip->set->conshdlrs[h]);
16044  if( nactiveconss > 0 )
16045  {
16047  "%7d constraints of type <%s>\n", nactiveconss, SCIPconshdlrGetName(scip->set->conshdlrs[h]));
16048  }
16049  }
16050 
16051  if( SCIPprobIsObjIntegral(scip->transprob) )
16052  {
16054  "transformed objective value is always integral (scale: %.15g)\n", scip->transprob->objscale);
16055  }
16056  }
16057  else
16058  {
16059  assert(scip->set->stage == SCIP_STAGE_PRESOLVING);
16060  SCIPmessagePrintVerbInfo(scip->messagehdlr, scip->set->disp_verblevel, SCIP_VERBLEVEL_HIGH, "presolving was interrupted.\n");
16061  }
16062 
16063  /* display timing statistics */
16065  "Presolving Time: %.2f\n", SCIPclockGetTime(scip->stat->presolvingtime));
16066  break;
16067 
16068  case SCIP_STAGE_PRESOLVED:
16069  case SCIP_STAGE_SOLVED:
16070  break;
16071 
16072  default:
16073  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
16074  return SCIP_INVALIDCALL;
16075  } /*lint !e788*/
16076 
16077  /* release the CTRL-C interrupt */
16078  if( scip->set->misc_catchctrlc )
16080 
16081  /* stop solving timer */
16082  SCIPclockStop(scip->stat->solvingtime, scip->set);
16083  SCIPclockStop(scip->stat->solvingtimeoverall, scip->set);
16084 
16085  if( scip->set->stage == SCIP_STAGE_SOLVED )
16086  {
16087  /* display most relevant statistics */
16089  }
16090 
16091  return SCIP_OKAY;
16092 }
16093 
16094 /** transforms, presolves, and solves problem
16095  *
16096  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16097  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16098  *
16099  * @pre This method can be called if @p scip is in one of the following stages:
16100  * - \ref SCIP_STAGE_PROBLEM
16101  * - \ref SCIP_STAGE_TRANSFORMED
16102  * - \ref SCIP_STAGE_PRESOLVING
16103  * - \ref SCIP_STAGE_PRESOLVED
16104  * - \ref SCIP_STAGE_SOLVING
16105  * - \ref SCIP_STAGE_SOLVED
16106  *
16107  * @post After calling this method \SCIP reaches one of the following stages depending on if and when the solution
16108  * process was interrupted:
16109  * - \ref SCIP_STAGE_PRESOLVING if the solution process was interrupted during presolving
16110  * - \ref SCIP_STAGE_SOLVING if the solution process was interrupted during the tree search
16111  * - \ref SCIP_STAGE_SOLVED if the solving process was not interrupted
16112  *
16113  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
16114  */
16116  SCIP* scip /**< SCIP data structure */
16117  )
16118 {
16119  SCIP_Bool statsprinted = FALSE;
16120  SCIP_Bool restart;
16121 
16122  SCIP_CALL( checkStage(scip, "SCIPsolve", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16123 
16124  /* if the stage is already SCIP_STAGE_SOLVED do nothing */
16125  if( scip->set->stage == SCIP_STAGE_SOLVED )
16126  return SCIP_OKAY;
16127 
16129  {
16130  SCIPwarningMessage(scip, "SCIPsolve() was called, but problem is already solved\n");
16131  return SCIP_OKAY;
16132  }
16133 
16134  /* check, if a node selector exists */
16135  if( SCIPsetGetNodesel(scip->set, scip->stat) == NULL )
16136  {
16137  SCIPerrorMessage("no node selector available\n");
16138  return SCIP_PLUGINNOTFOUND;
16139  }
16140 
16141  /* check, if an integrality constraint handler exists if there are integral variables */
16142  if( (SCIPgetNBinVars(scip) >= 0 || SCIPgetNIntVars(scip) >= 0) && SCIPfindConshdlr(scip, "integral") == NULL )
16143  {
16144  SCIPwarningMessage(scip, "integrality constraint handler not available\n");
16145  }
16146 
16147  /* initialize presolving flag (may be modified in SCIPpresolve()) */
16148  scip->stat->performpresol = FALSE;
16149 
16150  /* start solving timer */
16151  SCIPclockStart(scip->stat->solvingtime, scip->set);
16152  SCIPclockStart(scip->stat->solvingtimeoverall, scip->set);
16153 
16154  /* capture the CTRL-C interrupt */
16155  if( scip->set->misc_catchctrlc )
16157 
16158  /* reset the user interrupt flag */
16159  scip->stat->userinterrupt = FALSE;
16160 
16161  /* automatic restarting loop */
16162  restart = scip->stat->userrestart;
16163 
16164  do
16165  {
16166  if( restart )
16167  {
16168  /* free the solving process data in order to restart */
16169  assert(scip->set->stage == SCIP_STAGE_SOLVING);
16170  if( scip->stat->userrestart )
16172  "(run %d, node %" SCIP_LONGINT_FORMAT ") performing user restart\n",
16173  scip->stat->nruns, scip->stat->nnodes, scip->stat->nrootintfixingsrun);
16174  else
16176  "(run %d, node %" SCIP_LONGINT_FORMAT ") restarting after %d global fixings of integer variables\n",
16177  scip->stat->nruns, scip->stat->nnodes, scip->stat->nrootintfixingsrun);
16178  /* an extra blank line should be printed separately since the buffer message handler only handles up to one line
16179  * correctly */
16180  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "\n");
16181  /* reset relaxation solution, so that the objective value is recomputed from scratch next time, using the new
16182  * fixings which may be produced during the presolving after the restart */
16184 
16185  SCIP_CALL( freeSolve(scip, TRUE) );
16186  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
16187  }
16188  restart = FALSE;
16189  scip->stat->userrestart = FALSE;
16190 
16191  switch( scip->set->stage )
16192  {
16193  case SCIP_STAGE_PROBLEM:
16195  case SCIP_STAGE_PRESOLVING:
16196  /* initialize solving data structures, transform and problem */
16197 
16198  SCIP_CALL( SCIPpresolve(scip) );
16199  /* remember that we already printed the relevant statistics */
16200  if( scip->set->stage == SCIP_STAGE_SOLVED )
16201  statsprinted = TRUE;
16202 
16203  if( scip->set->stage == SCIP_STAGE_SOLVED || scip->set->stage == SCIP_STAGE_PRESOLVING )
16204  break;
16205  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
16206 
16207  /*lint -fallthrough*/
16208 
16209  case SCIP_STAGE_PRESOLVED:
16210  /* check if reoptimization is enabled and global constraints are saved */
16211  if( scip->set->reopt_enable )
16212  {
16214  }
16215 
16216  /* initialize solving process data structures */
16217  SCIP_CALL( initSolve(scip, FALSE) );
16218  assert(scip->set->stage == SCIP_STAGE_SOLVING);
16220 
16221  /*lint -fallthrough*/
16222 
16223  case SCIP_STAGE_SOLVING:
16224  /* reset display */
16225  SCIPstatResetDisplay(scip->stat);
16226 
16227  /* continue solution process */
16228  SCIP_CALL( SCIPsolveCIP(scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->mem, scip->origprob, scip->transprob,
16229  scip->primal, scip->tree, scip->reopt, scip->lp, scip->relaxation, scip->pricestore, scip->sepastore,
16230  scip->cutpool, scip->delayedcutpool, scip->branchcand, scip->conflict, scip->conflictstore,
16231  scip->eventfilter, scip->eventqueue, scip->cliquetable, &restart) );
16232 
16233  /* detect, whether problem is solved */
16234  if( SCIPtreeGetNNodes(scip->tree) == 0 && SCIPtreeGetCurrentNode(scip->tree) == NULL )
16235  {
16236  assert(scip->stat->status == SCIP_STATUS_OPTIMAL
16237  || scip->stat->status == SCIP_STATUS_INFEASIBLE
16238  || scip->stat->status == SCIP_STATUS_UNBOUNDED
16239  || scip->stat->status == SCIP_STATUS_INFORUNBD);
16240  assert(!restart);
16241 
16242  /* tree is empty, and no current node exists -> problem is solved */
16243  scip->set->stage = SCIP_STAGE_SOLVED;
16244  }
16245  break;
16246 
16247  case SCIP_STAGE_SOLVED:
16248  assert(scip->stat->status == SCIP_STATUS_OPTIMAL
16249  || scip->stat->status == SCIP_STATUS_INFEASIBLE
16250  || scip->stat->status == SCIP_STATUS_UNBOUNDED
16251  || scip->stat->status == SCIP_STATUS_INFORUNBD);
16252 
16253  break;
16254 
16255  default:
16256  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
16257  return SCIP_INVALIDCALL;
16258  } /*lint !e788*/
16259  }
16260  while( restart && !SCIPsolveIsStopped(scip->set, scip->stat, TRUE) );
16261 
16262  /* we have to store all unprocessed nodes if reoptimization is enabled */
16263  if( scip->set->reopt_enable && scip->set->stage != SCIP_STAGE_PRESOLVING
16264  && SCIPsolveIsStopped(scip->set, scip->stat, TRUE) )
16265  {
16266  /* save unprocessed nodes */
16267  if( SCIPgetNNodesLeft(scip) > 0 )
16268  {
16269  SCIP_NODE** leaves;
16270  SCIP_NODE** children;
16271  SCIP_NODE** siblings;
16272  int nleaves;
16273  int nchildren;
16274  int nsiblings;
16275 
16276  /* get all open leave nodes */
16277  SCIP_CALL( SCIPgetLeaves(scip, &leaves, &nleaves) );
16278 
16279  /* get all open children nodes */
16280  SCIP_CALL( SCIPgetChildren(scip, &children, &nchildren) );
16281 
16282  /* get all open sibling nodes */
16283  SCIP_CALL( SCIPgetSiblings(scip, &siblings, &nsiblings) );
16284 
16285  /* add all open node to the reoptimization tree */
16286  SCIP_CALL( SCIPreoptSaveOpenNodes(scip->reopt, scip->set, scip->lp, scip->mem->probmem, leaves, nleaves,
16287  children, nchildren, siblings, nsiblings) );
16288  }
16289  }
16290 
16291  /* release the CTRL-C interrupt */
16292  if( scip->set->misc_catchctrlc )
16294 
16295  if( scip->set->reopt_enable )
16296  {
16297  /* save found solutions */
16298  int nsols;
16299  int s;
16300 
16301  nsols = scip->set->reopt_savesols == -1 ? INT_MAX : MAX(scip->set->reopt_savesols, 1);
16302  nsols = MIN(scip->primal->nsols, nsols);
16303 
16304  for( s = 0; s < nsols; s++ )
16305  {
16306  SCIP_SOL* sol;
16307  SCIP_Bool added;
16308 
16309  sol = scip->primal->sols[s];
16310  assert(sol != NULL);
16311 
16312  if( !SCIPsolIsOriginal(sol) )
16313  {
16314  SCIP_Bool hasinfval;
16315 
16316  /* retransform solution into the original problem space */
16317  SCIP_CALL( SCIPsolRetransform(sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
16318  }
16319 
16320  if( SCIPsolGetNodenum(sol) > 0 || SCIPsolGetHeur(sol) != NULL || (s == 0 && scip->set->reopt_sepabestsol) )
16321  {
16322  /* if the best solution should be separated, we must not store it in the solution tree */
16323  if( s == 0 && scip->set->reopt_sepabestsol )
16324  {
16325  SCIP_CALL( SCIPreoptAddOptSol(scip->reopt, sol, scip->mem->probmem, scip->set, scip->stat, scip->origprimal,
16326  scip->origprob->vars, scip->origprob->nvars) );
16327  }
16328  /* add solution to solution tree */
16329  else
16330  {
16331  SCIPdebugMsg(scip, "try to add solution to the solution tree:\n");
16332  SCIPdebug( SCIP_CALL( SCIPsolPrint(sol, scip->set, scip->messagehdlr, scip->stat, scip->origprob, \
16333  scip->transprob, NULL, FALSE, FALSE) ); );
16334 
16335  SCIP_CALL( SCIPreoptAddSol(scip->reopt, scip->set, scip->stat, scip->origprimal, scip->mem->probmem,
16336  sol, s == 0, &added, scip->origprob->vars, scip->origprob->nvars, scip->stat->nreoptruns) );
16337  }
16338  }
16339  }
16340 
16341  SCIPdebugMsg(scip, "-> saved %d solution.\n", nsols);
16342 
16343  /* store variable history */
16344  if( scip->set->reopt_storevarhistory )
16345  {
16346  SCIP_CALL( SCIPreoptUpdateVarHistory(scip->reopt, scip->set, scip->stat, scip->mem->probmem,
16347  scip->origprob->vars, scip->origprob->nvars) );
16348  }
16349  }
16350 
16351  /* stop solving timer */
16352  SCIPclockStop(scip->stat->solvingtime, scip->set);
16353  SCIPclockStop(scip->stat->solvingtimeoverall, scip->set);
16354 
16355  /* decrease time limit during reoptimization */
16356  if( scip->set->reopt_enable && scip->set->reopt_commontimelimit )
16357  {
16358  SCIP_Real timelimit;
16359  SCIP_Real usedtime;
16360 
16361  SCIP_CALL( SCIPgetRealParam(scip, "limits/time", &timelimit) );
16362  usedtime = SCIPgetSolvingTime(scip);
16363  timelimit = timelimit - usedtime;
16364  timelimit = MAX(0, timelimit);
16365 
16366  SCIP_CALL( SCIPsetRealParam(scip, "limits/time", timelimit) );
16367  }
16368 
16369  if( !statsprinted )
16370  {
16371  /* display most relevant statistics */
16373  }
16374 
16375  return SCIP_OKAY;
16376 }
16377 
16378 /** transforms, presolves, and solves problem using the configured concurrent solvers
16379  *
16380  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16381  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16382  *
16383  * @pre This method can be called if @p scip is in one of the following stages:
16384  * - \ref SCIP_STAGE_PROBLEM
16385  * - \ref SCIP_STAGE_TRANSFORMED
16386  * - \ref SCIP_STAGE_PRESOLVING
16387  * - \ref SCIP_STAGE_PRESOLVED
16388  * - \ref SCIP_STAGE_SOLVING
16389  * - \ref SCIP_STAGE_SOLVED
16390  *
16391  * @post After calling this method \SCIP reaches one of the following stages depending on if and when the solution
16392  * process was interrupted:
16393  * - \ref SCIP_STAGE_PRESOLVING if the solution process was interrupted during presolving
16394  * - \ref SCIP_STAGE_SOLVING if the solution process was interrupted during the tree search
16395  * - \ref SCIP_STAGE_SOLVED if the solving process was not interrupted
16396  *
16397  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
16398  *
16399  * @deprecated Please use SCIPsolveConcurrent() instead.
16400  */
16402  SCIP* scip /**< SCIP data structure */
16403  )
16404 {
16405  SCIP_CALL( checkStage(scip, "SCIPsolveParallel", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16406 
16407  return SCIPsolveConcurrent(scip);
16408 }
16409 
16410 /** transforms, presolves, and solves problem using the configured concurrent solvers
16411  *
16412  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16413  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16414  *
16415  * @pre This method can be called if @p scip is in one of the following stages:
16416  * - \ref SCIP_STAGE_PROBLEM
16417  * - \ref SCIP_STAGE_TRANSFORMED
16418  * - \ref SCIP_STAGE_PRESOLVING
16419  * - \ref SCIP_STAGE_PRESOLVED
16420  * - \ref SCIP_STAGE_SOLVING
16421  * - \ref SCIP_STAGE_SOLVED
16422  *
16423  * @post After calling this method \SCIP reaches one of the following stages depending on if and when the solution
16424  * process was interrupted:
16425  * - \ref SCIP_STAGE_PRESOLVING if the solution process was interrupted during presolving
16426  * - \ref SCIP_STAGE_SOLVING if the solution process was interrupted during the tree search
16427  * - \ref SCIP_STAGE_SOLVED if the solving process was not interrupted
16428  *
16429  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
16430  */
16432  SCIP* scip /**< SCIP data structure */
16433  )
16434 {
16435 #ifdef TPI_NONE
16436  SCIPinfoMessage(scip, NULL, "SCIP was compiled without task processing interface. Parallel solve not possible\n");
16437  return SCIP_OKAY;
16438 #else
16439  SCIP_RETCODE retcode;
16440  int i;
16441  SCIP_RANDNUMGEN* rndgen;
16442  int minnthreads;
16443  int maxnthreads;
16444 
16445  SCIP_CALL( checkStage(scip, "SCIPsolveConcurrent", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16446 
16447  SCIP_CALL( SCIPsetIntParam(scip, "timing/clocktype", SCIP_CLOCKTYPE_WALL) );
16448 
16449  minnthreads = scip->set->parallel_minnthreads;
16450  maxnthreads = scip->set->parallel_maxnthreads;
16451 
16452  if( minnthreads > maxnthreads )
16453  {
16454  SCIPerrorMessage("minimum number of threads greater than maximum number of threads\n");
16455  return SCIP_INVALIDDATA;
16456  }
16457  if( scip->concurrent == NULL )
16458  {
16459  int nconcsolvertypes;
16460  SCIP_CONCSOLVERTYPE** concsolvertypes;
16461  SCIP_Longint nthreads;
16462  SCIP_Real memorylimit;
16463  int* solvertypes;
16464  SCIP_Longint* weights;
16465  SCIP_Real* prios;
16466  int ncandsolvertypes;
16467  SCIP_Real prefpriosum;
16468 
16469  /* check if concurrent solve is configured to presolve the problem
16470  * before setting up the concurrent solvers
16471  */
16472  if( scip->set->concurrent_presolvebefore )
16473  {
16474  /* if yes, then presolve the problem */
16475  SCIP_CALL( SCIPpresolve(scip) );
16476  }
16477  else
16478  {
16479  SCIP_Bool infeas;
16480 
16481  /* if not, transform the problem and switch stage to presolved */
16482  SCIP_CALL( SCIPtransformProb(scip) );
16483  SCIP_CALL( initPresolve(scip) );
16484  SCIP_CALL( exitPresolve(scip, TRUE, &infeas) );
16485  assert(!infeas);
16486  }
16487 
16488  /* the presolving must have run into a limit, so we stop here */
16489  if( scip->set->stage < SCIP_STAGE_PRESOLVED )
16490  {
16492  return SCIP_OKAY;
16493  }
16494 
16495  nthreads = INT_MAX;
16496  /* substract the memory already used by the main SCIP and the estimated memory usage of external software */
16497  memorylimit = scip->set->limit_memory;
16498  if( memorylimit < SCIP_MEM_NOLIMIT )
16499  {
16500  memorylimit -= SCIPgetMemUsed(scip)/1048576.0;
16501  memorylimit -= SCIPgetMemExternEstim(scip)/1048576.0;
16502  /* estimate maximum number of copies that be created based on memory limit */
16503  nthreads = MAX(1, memorylimit / (4.0*SCIPgetMemExternEstim(scip)/1048576.0));
16504  SCIPverbMessage(scip, SCIP_VERBLEVEL_FULL, NULL, "estimated a maximum of %lli threads based on memory limit\n", nthreads);
16505  }
16506  nconcsolvertypes = SCIPgetNConcsolverTypes(scip);
16507  concsolvertypes = SCIPgetConcsolverTypes(scip);
16508 
16509  if( minnthreads > nthreads )
16510  {
16511  SCIP_CALL( initSolve(scip, TRUE) );
16512  scip->stat->status = SCIP_STATUS_MEMLIMIT;
16514  SCIPwarningMessage(scip, "requested minimum number of threads could not be satisfied with given memory limit\n");
16516  return SCIP_OKAY;
16517  }
16518 
16519  if( nthreads == 1 )
16520  {
16521  SCIPwarningMessage(scip, "can only use 1 thread, doing sequential solve instead\n");
16522  SCIP_CALL( SCIPfreeConcurrent(scip) );
16523  return SCIPsolve(scip);
16524  }
16525  nthreads = MIN(nthreads, maxnthreads);
16526  SCIPverbMessage(scip, SCIP_VERBLEVEL_FULL, NULL, "using %lli threads for concurrent solve\n", nthreads);
16527 
16528  /* now set up nthreads many concurrent solvers that will be used for the concurrent solve
16529  * using the preferred priorities of each concurrent solver
16530  */
16531  prefpriosum = 0.0;
16532  for( i = 0; i < nconcsolvertypes; ++i )
16533  prefpriosum += SCIPconcsolverTypeGetPrefPrio(concsolvertypes[i]);
16534 
16535  ncandsolvertypes = 0;
16536  SCIP_CALL( SCIPallocBufferArray(scip, &solvertypes, nthreads + nconcsolvertypes) );
16537  SCIP_CALL( SCIPallocBufferArray(scip, &weights, nthreads + nconcsolvertypes) );
16538  SCIP_CALL( SCIPallocBufferArray(scip, &prios, nthreads + nconcsolvertypes) );
16539  for( i = 0; i < nconcsolvertypes; ++i )
16540  {
16541  int j;
16542  SCIP_Real prio;
16543  prio = nthreads * SCIPconcsolverTypeGetPrefPrio(concsolvertypes[i]) / prefpriosum;
16544  while( prio > 0.0 )
16545  {
16546  j = ncandsolvertypes++;
16547  assert(j < 2*nthreads);
16548  weights[j] = 1;
16549  solvertypes[j] = i;
16550  prios[j] = MIN(1.0, prio);
16551  prio = prio - 1.0;
16552  }
16553  }
16554  /* select nthreads many concurrent solver types to create instances
16555  * according to the preferred prioriteis the user has set
16556  * This basically corresponds to a knapsack problem
16557  * with unit weights and capacity nthreads, where the profits are
16558  * the unrounded fraction of the total number of threads to be used.
16559  */
16560  SCIPselectDownRealInt(prios, solvertypes, nthreads, ncandsolvertypes);
16561 
16562  SCIP_CALL( SCIPcreateRandom(scip, &rndgen, scip->set->concurrent_initseed) );
16563  for( i = 0; i < nthreads; ++i )
16564  {
16565  SCIP_CONCSOLVER* concsolver;
16566 
16567  SCIP_CALL( SCIPconcsolverCreateInstance(scip->set, concsolvertypes[solvertypes[i]], &concsolver) );
16568  if( scip->set->concurrent_changeseeds && SCIPgetNConcurrentSolvers(scip) > 1 )
16569  SCIP_CALL( SCIPconcsolverInitSeeds(concsolver, SCIPrandomGetInt(rndgen, 0, INT_MAX)) );
16570  }
16571  SCIPfreeRandom(scip, &rndgen);
16572  SCIPfreeBufferArray(scip, &prios);
16573  SCIPfreeBufferArray(scip, &weights);
16574  SCIPfreeBufferArray(scip, &solvertypes);
16575 
16576  assert(SCIPgetNConcurrentSolvers(scip) == nthreads);
16577 
16578  SCIP_CALL( SCIPsyncstoreInit(scip) );
16579  }
16580 
16581  if( SCIPgetStage(scip) == SCIP_STAGE_PRESOLVED )
16582  {
16583  /* switch stage to solving */
16584  SCIP_CALL( initSolve(scip, TRUE) );
16585  }
16586 
16587  SCIPclockStart(scip->stat->solvingtime, scip->set);
16588  retcode = SCIPconcurrentSolve(scip);
16589  SCIPclockStop(scip->stat->solvingtime, scip->set);
16591 
16592  return retcode;
16593 #endif
16594 }
16595 
16596 /** include specific heuristics and branching rules for reoptimization
16597  *
16598  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16599  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16600  *
16601  * @pre This method can be called if @p scip is in one of the following stages:
16602  * - \ref SCIP_STAGE_PROBLEM
16603  */
16605  SCIP* scip, /**< SCIP data structure */
16606  SCIP_Bool enable /**< enable reoptimization (TRUE) or disable it (FALSE) */
16607  )
16608 {
16609  assert(scip != NULL);
16610 
16611  /* we want to skip if nothing has changed */
16612  if( (enable && scip->set->reopt_enable && scip->reopt != NULL)
16613  || (!enable && !scip->set->reopt_enable && scip->reopt == NULL) )
16614  return SCIP_OKAY;
16615 
16616  /* check stage and throw an error if we try to disable reoptimization during the solving process.
16617  *
16618  * @note the case that we will disable the reoptimization and have already performed presolving can only happen if
16619  * we are try to solve a general MIP
16620  *
16621  * @note this fix is only for the bugfix release 3.2.1, in the next major release reoptimization can be used for
16622  * general MIPs, too.
16623  */
16624  if( scip->set->stage > SCIP_STAGE_PROBLEM && !(!enable && scip->set->stage == SCIP_STAGE_PRESOLVED) )
16625  {
16626  SCIPerrorMessage("reoptimization cannot be %s after starting the (pre)solving process\n", enable ? "enabled" : "disabled");
16627  return SCIP_INVALIDCALL;
16628  }
16629 
16630  /* if the current stage is SCIP_STAGE_PROBLEM we have to include the heuristics and branching rule */
16631  if( scip->set->stage == SCIP_STAGE_PROBLEM || (!enable && scip->set->stage == SCIP_STAGE_PRESOLVED) )
16632  {
16633  /* initialize all reoptimization data structures */
16634  if( enable && scip->reopt == NULL )
16635  {
16636  /* set enable flag */
16637  scip->set->reopt_enable = enable;
16638 
16639  SCIP_CALL( SCIPreoptCreate(&scip->reopt, scip->set, scip->mem->probmem) );
16641  }
16642  /* disable all reoptimization plugins and free the structure if necessary */
16643  else if( (!enable && scip->reopt != NULL) || (!enable && scip->set->reopt_enable && scip->reopt == NULL) )
16644  {
16645  /* set enable flag */
16646  scip->set->reopt_enable = enable;
16647 
16648  if( scip->reopt != NULL )
16649  {
16650  SCIP_CALL( SCIPreoptFree(&(scip->reopt), scip->set, scip->origprimal, scip->mem->probmem) );
16651  assert(scip->reopt == NULL);
16652  }
16654  }
16655  }
16656  else
16657  {
16658  /* set enable flag */
16659  scip->set->reopt_enable = enable;
16660  }
16661 
16662  return SCIP_OKAY;
16663 }
16664 
16665 /** save bound change based on dual information in the reoptimization tree
16666  *
16667  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16668  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16669  *
16670  * @pre This method can be called if @p scip is in one of the following stages:
16671  * - \ref SCIP_STAGE_SOLVING
16672  * - \ref SCIP_STAGE_SOLVED
16673  */
16675  SCIP* scip, /**< SCIP data structure */
16676  SCIP_NODE* node, /**< node of the search tree */
16677  SCIP_VAR* var, /**< variable whose bound changed */
16678  SCIP_Real newbound, /**< new bound of the variable */
16679  SCIP_Real oldbound /**< old bound of the variable */
16680  )
16681 {
16682  SCIP_CALL( checkStage(scip, "SCIPaddReoptDualBndchg", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16683 
16684  assert(SCIPsetIsFeasLT(scip->set, newbound, oldbound) || SCIPsetIsFeasGT(scip->set, newbound, oldbound));
16685 
16686  SCIP_CALL( SCIPreoptAddDualBndchg(scip->reopt, scip->set, scip->mem->probmem, node, var, newbound, oldbound) );
16687 
16688  return SCIP_OKAY;
16689 }
16690 
16691 /** returns the optimal solution of the last iteration or NULL of none exists */
16693  SCIP* scip /**< SCIP data structure */
16694  )
16695 {
16696  SCIP_SOL* sol;
16697 
16698  assert(scip != NULL);
16699 
16700  sol = NULL;
16701 
16702  if( scip->set->reopt_enable && scip->stat->nreoptruns > 1 )
16703  {
16704  sol = SCIPreoptGetLastBestSol(scip->reopt);
16705  }
16706 
16707  return sol;
16708 }
16709 
16710 /** returns the objective coefficent of a given variable in a previous iteration
16711  *
16712  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16713  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16714  *
16715  * @pre This method can be called if @p scip is in one of the following stages:
16716  * - \ref SCIP_STAGE_PRESOLVING
16717  * - \ref SCIP_STAGE_SOLVING
16718  */
16720  SCIP* scip, /**< SCIP data structure */
16721  SCIP_VAR* var, /**< variable */
16722  int run, /**< number of the run */
16723  SCIP_Real* objcoef /**< pointer to store the objective coefficient */
16724  )
16725 {
16726  assert(scip != NULL);
16727  assert(var != NULL);
16728  assert(0 < run && run <= scip->stat->nreoptruns);
16729 
16730  SCIP_CALL( checkStage(scip, "SCIPgetReoptOldObjCoef", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
16731 
16732  if( SCIPvarIsOriginal(var) )
16733  *objcoef = SCIPreoptGetOldObjCoef(scip->reopt, run, SCIPvarGetIndex(var));
16734  else
16735  {
16736  SCIP_VAR* origvar;
16737  SCIP_Real constant;
16738  SCIP_Real scalar;
16739 
16740  assert(SCIPvarIsActive(var));
16741 
16742  origvar = var;
16743  constant = 0.0;
16744  scalar = 1.0;
16745 
16746  SCIP_CALL( SCIPvarGetOrigvarSum(&origvar, &scalar, &constant) );
16747  assert(origvar != NULL);
16748  assert(SCIPvarIsOriginal(origvar));
16749 
16750  *objcoef = SCIPreoptGetOldObjCoef(scip->reopt, run, SCIPvarGetIndex(origvar));
16751  }
16752  return SCIP_OKAY;
16753 }
16754 
16755 /** return the ids of child nodes stored in the reoptimization tree
16756  *
16757  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16758  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16759  *
16760  * @pre This method can be called if @p scip is in one of the following stages:
16761  * - \ref SCIP_STAGE_PRESOLVED
16762  * - \ref SCIP_STAGE_SOLVING
16763  * - \ref SCIP_STAGE_SOLVED
16764  */
16766  SCIP* scip, /**< SCIP data structure */
16767  SCIP_NODE* node, /**< node of the search tree */
16768  unsigned int* ids, /**< array of ids */
16769  int idssize, /**< allocated memory */
16770  int* nids /**< number of child nodes */
16771  )
16772 {
16773  assert(scip != NULL);
16774 
16775  SCIP_CALL( checkStage(scip, "SCIPgetReoptChildIDs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16776 
16777  (*nids) = 0;
16778 
16779  if( !scip->set->reopt_enable )
16780  return SCIP_OKAY;
16781 
16782  SCIP_CALL( SCIPreoptGetChildIDs(scip->reopt, scip->set, scip->mem->probmem, node, ids, idssize, nids) );
16783 
16784  return SCIP_OKAY;
16785 }
16786 
16787 /** return the ids of all leave nodes store in the reoptimization tree induced by the given node
16788  *
16789  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16790  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16791  *
16792  * @pre This method can be called if @p scip is in one of the following stages:
16793  * - \ref SCIP_STAGE_PRESOLVED
16794  * - \ref SCIP_STAGE_SOLVING
16795  * - \ref SCIP_STAGE_SOLVED
16796  */
16798  SCIP* scip, /**< SCIP data structure */
16799  SCIP_NODE* node, /**< node of the search tree */
16800  unsigned int* ids, /**< array of ids */
16801  int idssize, /**< size of ids array */
16802  int* nids /**< number of child nodes */
16803  )
16804 {
16805  assert(scip != NULL);
16806 
16807  SCIP_CALL( checkStage(scip, "SCIPgetReoptLeaveIDs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16808 
16809  (*nids) = 0;
16810 
16811  if( idssize == 0 || !scip->set->reopt_enable )
16812  return SCIP_OKAY;
16813 
16814  SCIP_CALL( SCIPreoptGetLeaves(scip->reopt, node, ids, idssize, nids) );
16815 
16816  return SCIP_OKAY;
16817 }
16818 
16819 /** returns the number of nodes in the reoptimization tree induced by @p node; if @p node == NULL the method
16820  * returns the number of nodes of the whole reoptimization tree.
16821  */
16823  SCIP* scip, /**< SCIP data structure */
16824  SCIP_NODE* node /**< node of the search tree */
16825  )
16826 {
16827  assert(scip != NULL);
16828  assert(scip->set->reopt_enable);
16829  assert(scip->reopt != NULL);
16830 
16831  return SCIPreoptGetNNodes(scip->reopt, node);
16832 }
16833 
16834 /** returns the number of leaf nodes of the subtree induced by @p node; if @p node == NULL, the method
16835  * returns the number of leaf nodes of the whole reoptimization tree.
16836  */
16838  SCIP* scip, /**< SCIP data structure */
16839  SCIP_NODE* node /**< node of the search tree */
16840  )
16841 {
16842  assert(scip != NULL);
16843  assert(scip->set->reopt_enable);
16844  assert(scip->reopt != NULL);
16845 
16846  return SCIPreoptGetNLeaves(scip->reopt, node);
16847 }
16848 
16849 /** gets the node of the reoptimization tree corresponding to the unique @p id */
16851  SCIP* scip, /**< SCIP data structure */
16852  unsigned int id /**< unique id */
16853  )
16854 {
16855  assert(scip != NULL);
16856  assert(scip->set->reopt_enable);
16857  assert(scip->reopt != NULL);
16858 
16859  return SCIPreoptGetReoptnode(scip->reopt, id);
16860 }
16861 
16862 /** add a variable bound change to a given reoptnode
16863  *
16864  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16865  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16866  *
16867  * @pre This method can be called if @p scip is in one of the following stages:
16868  * - \ref SCIP_STAGE_PRESOLVED
16869  * - \ref SCIP_STAGE_SOLVING
16870  * - \ref SCIP_STAGE_SOLVED
16871  */
16873  SCIP* scip, /**< SCIP data structure */
16874  SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
16875  SCIP_VAR* var, /**< variable pointer */
16876  SCIP_Real bound, /**< variable bound to add */
16877  SCIP_BOUNDTYPE boundtype /**< bound type of the variable value */
16878  )
16879 {
16880  assert(scip != NULL);
16881  assert(reoptnode != NULL);
16882  assert(scip->set->reopt_enable);
16883  assert(scip->reopt != NULL);
16884 
16885  SCIP_CALL( checkStage(scip, "SCIPaddReoptnodeBndchg", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16886 
16887  SCIP_CALL( SCIPreoptnodeAddBndchg(reoptnode, scip->set, scip->mem->probmem, var, bound, boundtype) );
16888 
16889  return SCIP_OKAY;
16890 }
16891 
16892 /** set the @p representation as the new search frontier
16893  *
16894  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16895  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16896  *
16897  * @pre This method can be called if @p scip is in one of the following stages:
16898  * - \ref SCIP_STAGE_PRESOLVED
16899  */
16901  SCIP* scip, /**< SCIP data structure */
16902  SCIP_REOPTNODE** representation, /**< array of representatives */
16903  int nrepresentatives, /**< number of representatives */
16904  SCIP_Bool* success /**< pointer to store the result */
16905  )
16906 {
16907  assert(scip != NULL);
16908  assert(representation != NULL);
16909  assert(nrepresentatives > 0);
16910  assert(scip->set->reopt_enable);
16911  assert(scip->reopt != NULL);
16912 
16913  SCIP_CALL( checkStage(scip, "SCIPsetReoptCompression", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
16914 
16915  SCIP_CALL( SCIPreoptApplyCompression(scip->reopt, scip->set, scip->mem->probmem, representation, nrepresentatives, success) );
16916 
16917  return SCIP_OKAY;
16918 }
16919 
16920 /** add stored constraint to a reoptimization node
16921  *
16922  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16923  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16924  *
16925  * @pre This method can be called if @p scip is in one of the following stages:
16926  * - \ref SCIP_STAGE_PRESOLVED
16927  */
16929  SCIP* scip, /**< SCIP data structure */
16930  SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
16931  SCIP_VAR** vars, /**< array of variables */
16932  SCIP_Real* vals, /**< array of variable bounds */
16933  SCIP_BOUNDTYPE* boundtypes, /**< array of variable boundtypes */
16934  SCIP_Real lhs, /**< lhs of the constraint */
16935  SCIP_Real rhs, /**< rhs of the constraint */
16936  int nvars, /**< number of variables */
16937  REOPT_CONSTYPE constype, /**< type of the constraint */
16938  SCIP_Bool linear /**< the given constraint has a linear representation */
16939  )
16940 {
16941  assert(scip != NULL);
16942  assert(reoptnode != NULL);
16943  assert(vars != NULL);
16944  assert(vals != NULL);
16945  assert(nvars >= 0);
16946 
16947  SCIP_CALL( checkStage(scip, "SCIPaddReoptnodeCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
16948 
16949  SCIP_CALL( SCIPreoptnodeAddCons(reoptnode, scip->set, scip->mem->probmem, vars, vals, boundtypes, lhs, rhs, nvars,
16950  constype, linear) );
16951 
16952  return SCIP_OKAY;
16953 }
16954 
16955 /** return the branching path stored in the reoptree at ID id */
16957  SCIP* scip, /**< SCIP data structure */
16958  SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
16959  SCIP_VAR** vars, /**< array of variables */
16960  SCIP_Real* vals, /**< array of variable bounds */
16961  SCIP_BOUNDTYPE* boundtypes, /**< array of bound types */
16962  int mem, /**< allocated memory */
16963  int* nvars, /**< number of variables */
16964  int* nafterdualvars /**< number of variables directly after the first based on dual information */
16965  )
16966 {
16967  assert(scip != NULL);
16968  assert(vars != NULL);
16969  assert(vals != NULL);
16970  assert(boundtypes != NULL);
16971  assert(scip->set->reopt_enable);
16972  assert(scip->reopt != NULL);
16973 
16974  SCIPreoptnodeGetPath(scip->reopt, reoptnode, vars, vals, boundtypes, mem, nvars, nafterdualvars);
16975 }
16976 
16977 /** initialize a set of empty reoptimization nodes
16978  *
16979  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16980  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16981  *
16982  * @pre This method can be called if @p scip is in one of the following stages:
16983  * - \ref SCIP_STAGE_PRESOLVED
16984  */
16986  SCIP* scip, /**< SCIP data structure */
16987  SCIP_REOPTNODE** representatives, /**< array of representatives */
16988  int nrepresentatives /**< number of representatives */
16989  )
16990 {
16991  int r;
16992 
16993  assert(scip != NULL);
16994  assert(representatives != NULL);
16995 
16996  SCIP_CALL( checkStage(scip, "SCIPinitRepresentation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
16997 
16998  for( r = 0; r < nrepresentatives; r++ )
16999  {
17000  SCIP_CALL( SCIPallocBlockMemory(scip, &representatives[r]) ); /*lint !e866*/
17001  SCIPreoptnodeInit(representatives[r], scip->set);
17002  }
17003 
17004  return SCIP_OKAY;
17005 }
17006 
17007 /** reset a set of initialized reoptimization nodes
17008  *
17009  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17010  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17011  *
17012  * @pre This method can be called if @p scip is in one of the following stages:
17013  * - \ref SCIP_STAGE_PRESOLVED
17014  */
17016  SCIP* scip, /**< SCIP data structure */
17017  SCIP_REOPTNODE** representatives, /**< array of representatives */
17018  int nrepresentatives /**< number of representatives */
17019  )
17020 {
17021  int r;
17022 
17023  assert(scip != NULL);
17024  assert(representatives != NULL);
17025 
17026  SCIP_CALL( checkStage(scip, "SCIPresetRepresentation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
17027 
17028  for( r = 0; r < nrepresentatives; r++ )
17029  {
17030  SCIP_CALL( SCIPreoptnodeReset(scip->reopt, scip->set, scip->mem->probmem, representatives[r]) );
17031  }
17032 
17033  return SCIP_OKAY;
17034 }
17035 
17036 /** free a set of initialized reoptimization nodes
17037  *
17038  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17039  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17040  *
17041  * @pre This method can be called if @p scip is in one of the following stages:
17042  * - \ref SCIP_STAGE_PRESOLVED
17043  */
17045  SCIP* scip, /**< SCIP data structure */
17046  SCIP_REOPTNODE** representatives, /**< array of representatives */
17047  int nrepresentatives /**< number of representatives */
17048  )
17049 {
17050  int r;
17051 
17052  assert(scip != NULL);
17053  assert(representatives != NULL);
17054 
17055  SCIP_CALL( checkStage(scip, "SCIPfreeRepresentation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
17056 
17057  for( r = 0; r < nrepresentatives; r++ )
17058  {
17059  if( representatives[r] != NULL )
17060  {
17061  SCIP_CALL( SCIPreoptnodeDelete(&representatives[r], scip->mem->probmem) );
17062  assert(representatives[r] == NULL);
17063  }
17064  }
17065 
17066  return SCIP_OKAY;
17067 }
17068 
17069 /** reactivate the given @p reoptnode and split them into several nodes if necessary
17070  *
17071  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17072  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17073  *
17074  * @pre This method can be called if @p scip is in one of the following stages:
17075  * - \ref SCIP_STAGE_SOLVING
17076  * - \ref SCIP_STAGE_SOLVED
17077  */
17079  SCIP* scip, /**< SCIP data structure */
17080  SCIP_REOPTNODE* reoptnode, /**< node to reactivate */
17081  unsigned int id, /**< unique id of the reoptimization node */
17082  SCIP_Real estimate, /**< estimate of the child nodes that should be created */
17083  SCIP_NODE** childnodes, /**< array to store the created child nodes */
17084  int* ncreatedchilds, /**< pointer to store number of created child nodes */
17085  int* naddedconss, /**< pointer to store number of generated constraints */
17086  int childnodessize, /**< available size of childnodes array */
17087  SCIP_Bool* success /**< pointer store the result*/
17088  )
17089 {
17090  assert(scip != NULL);
17091  assert(reoptnode != NULL);
17092 
17093  SCIP_CALL( checkStage(scip, "SCIPapplyReopt", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
17094 
17095  SCIP_CALL( SCIPreoptApply(scip->reopt, scip, scip->set, scip->stat, scip->transprob, scip->origprob, scip->tree,
17096  scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, scip->mem->probmem, reoptnode, id, estimate,
17097  childnodes, ncreatedchilds, naddedconss, childnodessize, success) );
17098 
17099  return SCIP_OKAY;
17100 }
17101 
17102 /** frees branch and bound tree and all solution process data; statistics, presolving data and transformed problem is
17103  * preserved
17104  *
17105  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17106  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17107  *
17108  * @pre This method can be called if @p scip is in one of the following stages:
17109  * - \ref SCIP_STAGE_INIT
17110  * - \ref SCIP_STAGE_PROBLEM
17111  * - \ref SCIP_STAGE_TRANSFORMED
17112  * - \ref SCIP_STAGE_PRESOLVING
17113  * - \ref SCIP_STAGE_PRESOLVED
17114  * - \ref SCIP_STAGE_SOLVING
17115  * - \ref SCIP_STAGE_SOLVED
17116  *
17117  * @post If this method is called in \SCIP stage \ref SCIP_STAGE_INIT or \ref SCIP_STAGE_PROBLEM, the stage of
17118  * \SCIP is not changed; otherwise, the \SCIP stage is changed to \ref SCIP_STAGE_TRANSFORMED
17119  *
17120  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
17121  */
17123  SCIP* scip, /**< SCIP data structure */
17124  SCIP_Bool restart /**< should certain data be preserved for improved restarting? */
17125  )
17126 {
17127  SCIP_CALL( checkStage(scip, "SCIPfreeSolve", TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
17128 
17129  switch( scip->set->stage )
17130  {
17131  case SCIP_STAGE_INIT:
17133  case SCIP_STAGE_PROBLEM:
17134  return SCIP_OKAY;
17135 
17136  case SCIP_STAGE_PRESOLVING:
17137  {
17138  SCIP_Bool infeasible;
17139 
17140  assert(scip->stat->status != SCIP_STATUS_INFEASIBLE);
17141  assert(scip->stat->status != SCIP_STATUS_INFORUNBD);
17142  assert(scip->stat->status != SCIP_STATUS_UNBOUNDED);
17143  assert(scip->stat->status != SCIP_STATUS_OPTIMAL);
17144 
17145  /* exit presolving */
17146  SCIP_CALL( exitPresolve(scip, FALSE, &infeasible) );
17147  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
17148  }
17149 
17150  /*lint -fallthrough*/
17151  case SCIP_STAGE_PRESOLVED:
17152  /* switch stage to TRANSFORMED */
17153  scip->set->stage = SCIP_STAGE_TRANSFORMED;
17154  return SCIP_OKAY;
17155 
17156  case SCIP_STAGE_SOLVING:
17157  case SCIP_STAGE_SOLVED:
17158  /* free solution process data structures */
17159  SCIP_CALL( freeSolve(scip, restart) );
17160  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
17161  return SCIP_OKAY;
17162 
17163  default:
17164  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
17165  return SCIP_INVALIDCALL;
17166  } /*lint !e788*/
17167 }
17168 
17169 /** frees branch and bound tree and all solution process data; statistics, presolving data and transformed problem is
17170  * preserved
17171  *
17172  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17173  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17174  *
17175  * @pre This method can be called if @p scip is in one of the following stages:
17176  * - \ref SCIP_STAGE_INIT
17177  * - \ref SCIP_STAGE_PROBLEM
17178  * - \ref SCIP_STAGE_TRANSFORMED
17179  * - \ref SCIP_STAGE_PRESOLVING
17180  * - \ref SCIP_STAGE_PRESOLVED
17181  * - \ref SCIP_STAGE_SOLVING
17182  * - \ref SCIP_STAGE_SOLVED
17183  *
17184  * @post If this method is called in \SCIP stage \ref SCIP_STAGE_INIT, \ref SCIP_STAGE_TRANSFORMED or \ref SCIP_STAGE_PROBLEM,
17185  * the stage of \SCIP is not changed; otherwise, the \SCIP stage is changed to \ref SCIP_STAGE_PRESOLVED.
17186  *
17187  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
17188  */
17190  SCIP* scip /**< SCIP data structure */
17191  )
17192 {
17193  SCIP_CALL( checkStage(scip, "SCIPfreeReoptSolve", TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
17194 
17195  switch( scip->set->stage )
17196  {
17197  case SCIP_STAGE_INIT:
17199  case SCIP_STAGE_PRESOLVED:
17200  case SCIP_STAGE_PROBLEM:
17201  return SCIP_OKAY;
17202 
17203  case SCIP_STAGE_PRESOLVING:
17204  {
17205  SCIP_Bool infeasible;
17206 
17207  assert(scip->stat->status != SCIP_STATUS_INFEASIBLE);
17208  assert(scip->stat->status != SCIP_STATUS_INFORUNBD);
17209  assert(scip->stat->status != SCIP_STATUS_UNBOUNDED);
17210  assert(scip->stat->status != SCIP_STATUS_OPTIMAL);
17211 
17212  /* exit presolving */
17213  SCIP_CALL( exitPresolve(scip, FALSE, &infeasible) );
17214  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
17215 
17216  return SCIP_OKAY;
17217  }
17218 
17219  case SCIP_STAGE_SOLVING:
17220  case SCIP_STAGE_SOLVED:
17221  /* free solution process data structures */
17222  SCIP_CALL( freeReoptSolve(scip) );
17223  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
17224  return SCIP_OKAY;
17225 
17226  default:
17227  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
17228  return SCIP_INVALIDCALL;
17229  } /*lint !e788*/
17230 }
17231 
17232 /** frees all solution process data including presolving and transformed problem, only original problem is kept
17233  *
17234  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17235  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17236  *
17237  * @pre This method can be called if @p scip is in one of the following stages:
17238  * - \ref SCIP_STAGE_INIT
17239  * - \ref SCIP_STAGE_PROBLEM
17240  * - \ref SCIP_STAGE_TRANSFORMED
17241  * - \ref SCIP_STAGE_PRESOLVING
17242  * - \ref SCIP_STAGE_PRESOLVED
17243  * - \ref SCIP_STAGE_SOLVING
17244  * - \ref SCIP_STAGE_SOLVED
17245  *
17246  * @post After calling this method \SCIP reaches one of the following stages:
17247  * - \ref SCIP_STAGE_INIT if the method was called from \SCIP stage \ref SCIP_STAGE_INIT
17248  * - \ref SCIP_STAGE_PROBLEM if the method was called from any other of the allowed stages
17249  *
17250  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
17251  */
17253  SCIP* scip /**< SCIP data structure */
17254  )
17255 {
17256  SCIP_CALL( checkStage(scip, "SCIPfreeTransform", TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
17257 
17258  switch( scip->set->stage )
17259  {
17260  case SCIP_STAGE_INIT:
17261  case SCIP_STAGE_PROBLEM:
17262  return SCIP_OKAY;
17263 
17264  case SCIP_STAGE_PRESOLVING:
17265  {
17266  SCIP_Bool infeasible;
17267 
17268  assert(scip->stat->status != SCIP_STATUS_INFEASIBLE);
17269  assert(scip->stat->status != SCIP_STATUS_INFORUNBD);
17270  assert(scip->stat->status != SCIP_STATUS_UNBOUNDED);
17271  assert(scip->stat->status != SCIP_STATUS_OPTIMAL);
17272 
17273  /* exit presolving */
17274  SCIP_CALL( exitPresolve(scip, FALSE, &infeasible) );
17275  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
17276  }
17277 
17278  /*lint -fallthrough*/
17279  case SCIP_STAGE_PRESOLVED:
17280  case SCIP_STAGE_SOLVING:
17281  case SCIP_STAGE_SOLVED:
17282  /* the solve was already freed, we directly go to freeTransform() */
17283  if( !scip->set->reopt_enable || scip->set->stage != SCIP_STAGE_PRESOLVED )
17284  {
17285  /* free solution process data */
17286  SCIP_CALL( SCIPfreeSolve(scip, FALSE) );
17287  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
17288  }
17289  /*lint -fallthrough*/
17290 
17292  /* free transformed problem data structures */
17293  SCIP_CALL( freeTransform(scip) );
17294  assert(scip->set->stage == SCIP_STAGE_PROBLEM);
17295  return SCIP_OKAY;
17296 
17297  default:
17298  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
17299  return SCIP_INVALIDCALL;
17300  } /*lint !e788*/
17301 }
17302 
17303 /** informs \SCIP that the solving process should be interrupted as soon as possible (e.g., after the current node has
17304  * been solved)
17305  *
17306  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17307  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17308  *
17309  * @pre This method can be called if @p scip is in one of the following stages:
17310  * - \ref SCIP_STAGE_PROBLEM
17311  * - \ref SCIP_STAGE_TRANSFORMING
17312  * - \ref SCIP_STAGE_TRANSFORMED
17313  * - \ref SCIP_STAGE_INITPRESOLVE
17314  * - \ref SCIP_STAGE_PRESOLVING
17315  * - \ref SCIP_STAGE_EXITPRESOLVE
17316  * - \ref SCIP_STAGE_PRESOLVED
17317  * - \ref SCIP_STAGE_SOLVING
17318  * - \ref SCIP_STAGE_SOLVED
17319  * - \ref SCIP_STAGE_EXITSOLVE
17320  * - \ref SCIP_STAGE_FREETRANS
17321  *
17322  * @note the \SCIP stage does not get changed
17323  */
17325  SCIP* scip /**< SCIP data structure */
17326  )
17327 {
17328  SCIP_CALL( checkStage(scip, "SCIPinterruptSolve", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17329 
17330  /* set the userinterrupt flag */
17331  scip->stat->userinterrupt = TRUE;
17332 
17333  return SCIP_OKAY;
17334 }
17335 
17336 /** informs SCIP that the solving process should be restarted as soon as possible (e.g., after the current node has
17337  * been solved)
17338  *
17339  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17340  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17341  *
17342  * @pre This method can be called if @p scip is in one of the following stages:
17343  * - \ref SCIP_STAGE_INITPRESOLVE
17344  * - \ref SCIP_STAGE_PRESOLVING
17345  * - \ref SCIP_STAGE_EXITPRESOLVE
17346  * - \ref SCIP_STAGE_SOLVING
17347  *
17348  * @note the \SCIP stage does not get changed
17349  */
17351  SCIP* scip /**< SCIP data structure */
17352  )
17353 {
17354  SCIP_CALL( checkStage(scip, "SCIPrestartSolve", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17355 
17356  /* set the userrestart flag */
17357  scip->stat->userrestart = TRUE;
17358 
17359  return SCIP_OKAY;
17360 }
17361 
17362 /** returns whether reoptimization is enabled or not */
17364  SCIP* scip /**< SCIP data structure */
17365  )
17366 {
17367  assert(scip != NULL);
17368 
17369  return scip->set->reopt_enable;
17370 }
17371 
17372 /** returns the stored solutions corresponding to a given run */
17374  SCIP* scip, /**< SCIP data structure */
17375  int run, /**< number of the run */
17376  SCIP_SOL** sols, /**< array to store solutions */
17377  int solssize, /**< size of the array */
17378  int* nsols /**< pointer to store number of solutions */
17379  )
17380 {
17381  assert(scip != NULL);
17382  assert(sols != NULL);
17383  assert(solssize > 0);
17384 
17385  if( scip->set->reopt_enable )
17386  {
17387  assert(run > 0 && run <= scip->stat->nreoptruns);
17388  SCIP_CALL( SCIPreoptGetSolsRun(scip->reopt, run, sols, solssize, nsols) );
17389  }
17390  else
17391  {
17392  *nsols = 0;
17393  }
17394 
17395  return SCIP_OKAY;
17396 }
17397 
17398 /** mark all stored solutions as not updated */
17400  SCIP* scip /**< SCIP data structure */
17401  )
17402 {
17403  assert(scip != NULL);
17404  assert(scip->set->reopt_enable);
17405  assert(scip->reopt != NULL);
17406 
17407  if( scip->set->reopt_enable )
17408  {
17409  assert(scip->reopt != NULL);
17411  }
17412 }
17413 
17414 /** check if the reoptimization process should be restarted
17415  *
17416  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17417  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17418  *
17419  * @pre This method can be called if @p scip is in one of the following stages:
17420  * - \ref SCIP_STAGE_TRANSFORMED
17421  * - \ref SCIP_STAGE_SOLVING
17422  */
17424  SCIP* scip, /**< SCIP data structure */
17425  SCIP_NODE* node, /**< current node of the branch and bound tree (or NULL) */
17426  SCIP_Bool* restart /**< pointer to store of the reoptimitation process should be restarted */
17427  )
17428 {
17429  assert(scip != NULL);
17430  assert(scip->set->reopt_enable);
17431  assert(scip->reopt != NULL);
17432 
17433  SCIP_CALL( checkStage(scip, "SCIPcheckReoptRestart", FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17434 
17435  SCIP_CALL( SCIPreoptCheckRestart(scip->reopt, scip->set, scip->mem->probmem, node, scip->transprob->vars,
17436  scip->transprob->nvars, restart) );
17437 
17438  return SCIP_OKAY;
17439 }
17440 
17441 /** return the similarity between two objective functions */
17443  SCIP* scip, /**< SCIP data structure */
17444  int run1, /**< number of run */
17445  int run2 /**< number of run */
17446  )
17447 {
17448  assert(scip != NULL);
17449  assert(run1 > 0 && run1 <= scip->stat->nreoptruns);
17450  assert(run2 > 0 && run2 <= scip->stat->nreoptruns);
17451 
17452  if( (run1 == scip->stat->nreoptruns && run2 == run1-1) || (run2 == scip->stat->nreoptruns && run1 == run2-1) )
17453  return SCIPreoptGetSimToPrevious(scip->reopt);
17454  else
17455  return SCIPreoptGetSimilarity(scip->reopt, scip->set, run1, run2, scip->origprob->vars, scip->origprob->nvars);
17456 }
17457 
17458 /** returns if a node should be reoptimized */
17460  SCIP* scip, /**< SCIP data structure */
17461  SCIP_NODE* node /**< node of the search tree */
17462  )
17463 {
17464  assert(scip != NULL);
17465  assert(node != NULL);
17466 
17467  if( scip->set->reopt_enable )
17468  {
17469  SCIP_REOPTNODE* reoptnode;
17470  unsigned int id;
17471 
17472  assert(scip->reopt != NULL);
17473 
17474  id = SCIPnodeGetReoptID(node);
17475 
17476  if( id == 0 && node != SCIPgetRootNode(scip) )
17477  return FALSE;
17478  else
17479  {
17480  reoptnode = SCIPgetReoptnode(scip, id);
17481  assert(reoptnode != NULL);
17482 
17483  return SCIPreoptnodeGetNChildren(reoptnode) > 0;
17484  }
17485  }
17486  else
17487  return FALSE;
17488 }
17489 
17490 /** deletes the given reoptimization node
17491  *
17492  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17493  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17494  *
17495  * @pre This method can be called if @p scip is in one of the following stages:
17496  * - \ref SCIP_STAGE_TRANSFORMED
17497  * - \ref SCIP_STAGE_SOLVING
17498  */
17500  SCIP* scip, /**< SCIP data structure */
17501  SCIP_REOPTNODE** reoptnode /**< node of the reoptimization tree */
17502  )
17503 {
17504  assert(scip != NULL);
17505  assert(scip->set->reopt_enable);
17506  assert(scip->reopt != NULL);
17507  assert((*reoptnode) != NULL);
17508 
17509  SCIP_CALL( checkStage(scip, "SCIPdeleteReoptnode", FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17510 
17511  SCIP_CALL( SCIPreoptnodeDelete(reoptnode, scip->mem->probmem) );
17512 
17513  return SCIP_OKAY;
17514 }
17515 
17516 /** splits the root into several nodes and moves the child nodes of the root to one of the created nodes
17517  *
17518  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17519  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17520  *
17521  * @pre This method can be called if @p scip is in one of the following stages:
17522  * - \ref SCIP_STAGE_SOLVING
17523  */
17525  SCIP* scip, /**< SCIP data structure */
17526  int* ncreatedchilds, /**< pointer to store the number of created nodes */
17527  int* naddedconss /**< pointer to store the number added constraints */
17528  )
17529 {
17530  assert(scip != NULL);
17531  assert(scip->set->reopt_enable);
17532  assert(scip->reopt != NULL);
17533 
17534  SCIP_CALL( checkStage(scip, "SCIPsplitReoptRoot", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17535 
17536  SCIP_CALL( SCIPreoptSplitRoot(scip->reopt, scip->tree, scip->set, scip->stat, scip->mem->probmem, ncreatedchilds,
17537  naddedconss) );
17538 
17539  return SCIP_OKAY;
17540 }
17541 
17542 /** remove the stored information about bound changes based in dual information
17543  *
17544  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17545  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17546  *
17547  * @pre This method can be called if @p scip is in one of the following stages:
17548  * - \ref SCIP_STAGE_SOLVING
17549  * - \ref SCIP_STAGE_SOLVED
17550  */
17552  SCIP* scip, /**< SCIP data structure */
17553  SCIP_NODE* node /**< node of the search tree */
17554  )
17555 {
17556  assert(scip != NULL);
17557  assert(scip->set->reopt_enable);
17558  assert(node != NULL);
17559 
17560  SCIP_CALL( checkStage(scip, "SCIPresetReoptnodeDualcons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
17561 
17562  SCIP_CALL( SCIPreoptResetDualBndchgs(scip->reopt, node, scip->mem->probmem) );
17563 
17564  return SCIP_OKAY;
17565 }
17566 
17567 /** returns whether we are in the restarting phase
17568  *
17569  * @return TRUE, if we are in the restarting phase; FALSE, otherwise
17570  *
17571  * @pre This method can be called if @p scip is in one of the following stages:
17572  * - \ref SCIP_STAGE_INITPRESOLVE
17573  * - \ref SCIP_STAGE_PRESOLVING
17574  * - \ref SCIP_STAGE_EXITPRESOLVE
17575  * - \ref SCIP_STAGE_PRESOLVED
17576  * - \ref SCIP_STAGE_INITSOLVE
17577  * - \ref SCIP_STAGE_SOLVING
17578  * - \ref SCIP_STAGE_SOLVED
17579  * - \ref SCIP_STAGE_EXITSOLVE
17580  * - \ref SCIP_STAGE_FREETRANS
17581  */
17583  SCIP* scip /**< SCIP data structure */
17584  )
17585 {
17586  SCIP_CALL_ABORT( checkStage(scip, "SCIPisInRestart", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17587 
17588  /* return the restart status */
17589  return scip->stat->inrestart;
17590 }
17591 
17592 
17593 /*
17594  * variable methods
17595  */
17596 
17597 /** creates and captures problem variable; if variable is of integral type, fractional bounds are automatically rounded;
17598  * an integer variable with bounds zero and one is automatically converted into a binary variable;
17599  *
17600  * @warning When doing column generation and the original problem is a maximization problem, notice that SCIP will
17601  * transform the problem into a minimization problem by multiplying the objective function by -1. Thus, the
17602  * original objective function value of variables created during the solving process has to be multiplied by
17603  * -1, too.
17604  *
17605  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17606  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17607  *
17608  * @pre This method can be called if @p scip is in one of the following stages:
17609  * - \ref SCIP_STAGE_PROBLEM
17610  * - \ref SCIP_STAGE_TRANSFORMING
17611  * - \ref SCIP_STAGE_INITPRESOLVE
17612  * - \ref SCIP_STAGE_PRESOLVING
17613  * - \ref SCIP_STAGE_EXITPRESOLVE
17614  * - \ref SCIP_STAGE_PRESOLVED
17615  * - \ref SCIP_STAGE_SOLVING
17616  *
17617  * @note the variable gets captured, hence at one point you have to release it using the method SCIPreleaseVar()
17618  */
17620  SCIP* scip, /**< SCIP data structure */
17621  SCIP_VAR** var, /**< pointer to variable object */
17622  const char* name, /**< name of variable, or NULL for automatic name creation */
17623  SCIP_Real lb, /**< lower bound of variable */
17624  SCIP_Real ub, /**< upper bound of variable */
17625  SCIP_Real obj, /**< objective function value */
17626  SCIP_VARTYPE vartype, /**< type of variable */
17627  SCIP_Bool initial, /**< should var's column be present in the initial root LP? */
17628  SCIP_Bool removable, /**< is var's column removable from the LP (due to aging or cleanup)? */
17629  SCIP_DECL_VARDELORIG ((*vardelorig)), /**< frees user data of original variable, or NULL */
17630  SCIP_DECL_VARTRANS ((*vartrans)), /**< creates transformed user data by transforming original user data, or NULL */
17631  SCIP_DECL_VARDELTRANS ((*vardeltrans)), /**< frees user data of transformed variable, or NULL */
17632  SCIP_DECL_VARCOPY ((*varcopy)), /**< copies variable data if wanted to subscip, or NULL */
17633  SCIP_VARDATA* vardata /**< user data for this specific variable */
17634  )
17635 {
17636  assert(var != NULL);
17637  assert(lb <= ub);
17638 
17639  SCIP_CALL( checkStage(scip, "SCIPcreateVar", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17640 
17641  /* forbid infinite objective function values */
17642  if( SCIPisInfinity(scip, REALABS(obj)) )
17643  {
17644  SCIPerrorMessage("invalid objective function value: value is infinite\n");
17645  return SCIP_INVALIDDATA;
17646  }
17647 
17648  switch( scip->set->stage )
17649  {
17650  case SCIP_STAGE_PROBLEM:
17651  SCIP_CALL( SCIPvarCreateOriginal(var, scip->mem->probmem, scip->set, scip->stat,
17652  name, lb, ub, obj, vartype, initial, removable, vardelorig, vartrans, vardeltrans, varcopy, vardata) );
17653  break;
17654 
17657  case SCIP_STAGE_PRESOLVING:
17659  case SCIP_STAGE_PRESOLVED:
17660  case SCIP_STAGE_SOLVING:
17661  SCIP_CALL( SCIPvarCreateTransformed(var, scip->mem->probmem, scip->set, scip->stat,
17662  name, lb, ub, obj, vartype, initial, removable, vardelorig, vartrans, vardeltrans, varcopy, vardata) );
17663  break;
17664 
17665  default:
17666  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
17667  return SCIP_INVALIDCALL;
17668  } /*lint !e788*/
17669 
17670  return SCIP_OKAY;
17671 }
17672 
17673 /** creates and captures problem variable with optional callbacks and variable data set to NULL, which can be set
17674  * afterwards using SCIPvarSetDelorigData(), SCIPvarSetTransData(),
17675  * SCIPvarSetDeltransData(), SCIPvarSetCopy(), and SCIPvarSetData(); sets variable flags initial=TRUE
17676  * and removable = FALSE, which can be adjusted by using SCIPvarSetInitial() and SCIPvarSetRemovable(), resp.;
17677  * if variable is of integral type, fractional bounds are automatically rounded;
17678  * an integer variable with bounds zero and one is automatically converted into a binary variable;
17679  *
17680  * @warning When doing column generation and the original problem is a maximization problem, notice that SCIP will
17681  * transform the problem into a minimization problem by multiplying the objective function by -1. Thus, the
17682  * original objective function value of variables created during the solving process has to be multiplied by
17683  * -1, too.
17684  *
17685  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17686  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17687  *
17688  * @pre This method can be called if @p scip is in one of the following stages:
17689  * - \ref SCIP_STAGE_PROBLEM
17690  * - \ref SCIP_STAGE_TRANSFORMING
17691  * - \ref SCIP_STAGE_INITPRESOLVE
17692  * - \ref SCIP_STAGE_PRESOLVING
17693  * - \ref SCIP_STAGE_EXITPRESOLVE
17694  * - \ref SCIP_STAGE_PRESOLVED
17695  * - \ref SCIP_STAGE_SOLVING
17696  *
17697  * @note the variable gets captured, hence at one point you have to release it using the method SCIPreleaseVar()
17698  */
17700  SCIP* scip, /**< SCIP data structure */
17701  SCIP_VAR** var, /**< pointer to variable object */
17702  const char* name, /**< name of variable, or NULL for automatic name creation */
17703  SCIP_Real lb, /**< lower bound of variable */
17704  SCIP_Real ub, /**< upper bound of variable */
17705  SCIP_Real obj, /**< objective function value */
17706  SCIP_VARTYPE vartype /**< type of variable */
17707  )
17708 {
17709  SCIP_CALL( checkStage(scip, "SCIPcreateVarBasic", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17710 
17711  SCIP_CALL( SCIPcreateVar(scip, var, name, lb, ub, obj, vartype, TRUE, FALSE, NULL, NULL, NULL, NULL, NULL) );
17712 
17713  return SCIP_OKAY;
17714 }
17715 
17716 /** outputs the variable name to the file stream
17717  *
17718  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17719  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17720  *
17721  * @pre This method can be called if @p scip is in one of the following stages:
17722  * - \ref SCIP_STAGE_PROBLEM
17723  * - \ref SCIP_STAGE_TRANSFORMING
17724  * - \ref SCIP_STAGE_TRANSFORMED
17725  * - \ref SCIP_STAGE_INITPRESOLVE
17726  * - \ref SCIP_STAGE_PRESOLVING
17727  * - \ref SCIP_STAGE_EXITPRESOLVE
17728  * - \ref SCIP_STAGE_PRESOLVED
17729  * - \ref SCIP_STAGE_INITSOLVE
17730  * - \ref SCIP_STAGE_SOLVING
17731  * - \ref SCIP_STAGE_SOLVED
17732  * - \ref SCIP_STAGE_EXITSOLVE
17733  * - \ref SCIP_STAGE_FREETRANS
17734  */
17736  SCIP* scip, /**< SCIP data structure */
17737  FILE* file, /**< output file, or NULL for stdout */
17738  SCIP_VAR* var, /**< variable to output */
17739  SCIP_Bool type /**< should the variable type be also posted */
17740  )
17741 {
17742  assert(scip != NULL);
17743  assert(var != NULL);
17744 
17745  SCIP_CALL( checkStage(scip, "SCIPwriteVarName", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17746 
17747  /* print variable name */
17748  if( SCIPvarIsNegated(var) )
17749  {
17750  SCIP_VAR* negatedvar;
17751 
17752  SCIP_CALL( SCIPgetNegatedVar(scip, var, &negatedvar) );
17753  SCIPinfoMessage(scip, file, "<~%s>", SCIPvarGetName(negatedvar));
17754  }
17755  else
17756  {
17757  SCIPinfoMessage(scip, file, "<%s>", SCIPvarGetName(var));
17758  }
17759 
17760  if( type )
17761  {
17762  /* print variable type */
17763  SCIPinfoMessage(scip, file, "[%c]",
17767  }
17768 
17769  return SCIP_OKAY;
17770 }
17771 
17772 /** print the given list of variables to output stream separated by the given delimiter character;
17773  *
17774  * i. e. the variables x1, x2, ..., xn with given delimiter ',' are written as: <x1>, <x2>, ..., <xn>;
17775  *
17776  * the method SCIPparseVarsList() can parse such a string
17777  *
17778  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17779  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17780  *
17781  * @pre This method can be called if @p scip is in one of the following stages:
17782  * - \ref SCIP_STAGE_PROBLEM
17783  * - \ref SCIP_STAGE_TRANSFORMING
17784  * - \ref SCIP_STAGE_TRANSFORMED
17785  * - \ref SCIP_STAGE_INITPRESOLVE
17786  * - \ref SCIP_STAGE_PRESOLVING
17787  * - \ref SCIP_STAGE_EXITPRESOLVE
17788  * - \ref SCIP_STAGE_PRESOLVED
17789  * - \ref SCIP_STAGE_INITSOLVE
17790  * - \ref SCIP_STAGE_SOLVING
17791  * - \ref SCIP_STAGE_SOLVED
17792  * - \ref SCIP_STAGE_EXITSOLVE
17793  * - \ref SCIP_STAGE_FREETRANS
17794  *
17795  * @note The printing process is done via the message handler system.
17796  */
17798  SCIP* scip, /**< SCIP data structure */
17799  FILE* file, /**< output file, or NULL for stdout */
17800  SCIP_VAR** vars, /**< variable array to output */
17801  int nvars, /**< number of variables */
17802  SCIP_Bool type, /**< should the variable type be also posted */
17803  char delimiter /**< character which is used for delimitation */
17804  )
17805 {
17806  int v;
17807 
17808  SCIP_CALL( checkStage(scip, "SCIPwriteVarsList", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17809 
17810  for( v = 0; v < nvars; ++v )
17811  {
17812  if( v > 0 )
17813  {
17814  SCIPinfoMessage(scip, file, "%c", delimiter);
17815  }
17816 
17817  /* print variable name */
17818  SCIP_CALL( SCIPwriteVarName(scip, file, vars[v], type) );
17819  }
17820 
17821  return SCIP_OKAY;
17822 }
17823 
17824 /** print the given variables and coefficients as linear sum in the following form
17825  * c1 <x1> + c2 <x2> ... + cn <xn>
17826  *
17827  * This string can be parsed by the method SCIPparseVarsLinearsum().
17828  *
17829  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17830  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17831  *
17832  * @pre This method can be called if @p scip is in one of the following stages:
17833  * - \ref SCIP_STAGE_PROBLEM
17834  * - \ref SCIP_STAGE_TRANSFORMING
17835  * - \ref SCIP_STAGE_TRANSFORMED
17836  * - \ref SCIP_STAGE_INITPRESOLVE
17837  * - \ref SCIP_STAGE_PRESOLVING
17838  * - \ref SCIP_STAGE_EXITPRESOLVE
17839  * - \ref SCIP_STAGE_PRESOLVED
17840  * - \ref SCIP_STAGE_INITSOLVE
17841  * - \ref SCIP_STAGE_SOLVING
17842  * - \ref SCIP_STAGE_SOLVED
17843  * - \ref SCIP_STAGE_EXITSOLVE
17844  * - \ref SCIP_STAGE_FREETRANS
17845  *
17846  * @note The printing process is done via the message handler system.
17847  */
17849  SCIP* scip, /**< SCIP data structure */
17850  FILE* file, /**< output file, or NULL for stdout */
17851  SCIP_VAR** vars, /**< variable array to output */
17852  SCIP_Real* vals, /**< array of coefficients or NULL if all coefficients are 1.0 */
17853  int nvars, /**< number of variables */
17854  SCIP_Bool type /**< should the variable type be also posted */
17855  )
17856 {
17857  int v;
17858 
17859  SCIP_CALL( checkStage(scip, "SCIPwriteVarsLinearsum", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17860 
17861  for( v = 0; v < nvars; ++v )
17862  {
17863  if( vals != NULL )
17864  {
17865  if( vals[v] == 1.0 )
17866  {
17867  if( v > 0 )
17868  SCIPinfoMessage(scip, file, " +");
17869  }
17870  else if( vals[v] == -1.0 )
17871  SCIPinfoMessage(scip, file, " -");
17872  else
17873  SCIPinfoMessage(scip, file, " %+.15g", vals[v]);
17874  }
17875  else if( nvars > 0 )
17876  SCIPinfoMessage(scip, file, " +");
17877 
17878  /* print variable name */
17879  SCIP_CALL( SCIPwriteVarName(scip, file, vars[v], type) );
17880  }
17881 
17882  return SCIP_OKAY;
17883 }
17884 
17885 /** print the given monomials as polynomial in the following form
17886  * c1 <x11>^e11 <x12>^e12 ... <x1n>^e1n + c2 <x21>^e21 <x22>^e22 ... + ... + cn <xn1>^en1 ...
17887  *
17888  * This string can be parsed by the method SCIPparseVarsPolynomial().
17889  *
17890  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17891  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17892  *
17893  * @pre This method can be called if @p scip is in one of the following stages:
17894  * - \ref SCIP_STAGE_PROBLEM
17895  * - \ref SCIP_STAGE_TRANSFORMING
17896  * - \ref SCIP_STAGE_TRANSFORMED
17897  * - \ref SCIP_STAGE_INITPRESOLVE
17898  * - \ref SCIP_STAGE_PRESOLVING
17899  * - \ref SCIP_STAGE_EXITPRESOLVE
17900  * - \ref SCIP_STAGE_PRESOLVED
17901  * - \ref SCIP_STAGE_INITSOLVE
17902  * - \ref SCIP_STAGE_SOLVING
17903  * - \ref SCIP_STAGE_SOLVED
17904  * - \ref SCIP_STAGE_EXITSOLVE
17905  * - \ref SCIP_STAGE_FREETRANS
17906  *
17907  * @note The printing process is done via the message handler system.
17908  */
17910  SCIP* scip, /**< SCIP data structure */
17911  FILE* file, /**< output file, or NULL for stdout */
17912  SCIP_VAR*** monomialvars, /**< arrays with variables for each monomial */
17913  SCIP_Real** monomialexps, /**< arrays with variable exponents, or NULL if always 1.0 */
17914  SCIP_Real* monomialcoefs, /**< array with monomial coefficients */
17915  int* monomialnvars, /**< array with number of variables for each monomial */
17916  int nmonomials, /**< number of monomials */
17917  SCIP_Bool type /**< should the variable type be also posted */
17918  )
17919 {
17920  int i;
17921  int v;
17922 
17923  assert(scip != NULL);
17924  assert(monomialvars != NULL || nmonomials == 0);
17925  assert(monomialcoefs != NULL || nmonomials == 0);
17926  assert(monomialnvars != NULL || nmonomials == 0);
17927 
17928  SCIP_CALL( checkStage(scip, "SCIPwriteVarsPolynomial", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17929 
17930  if( nmonomials == 0 )
17931  {
17932  SCIPinfoMessage(scip, file, " 0 ");
17933  return SCIP_OKAY;
17934  }
17935 
17936  for( i = 0; i < nmonomials; ++i )
17937  {
17938  if( monomialcoefs[i] == 1.0 ) /*lint !e613*/
17939  {
17940  if( i > 0 )
17941  SCIPinfoMessage(scip, file, " +");
17942  }
17943  else if( monomialcoefs[i] == -1.0 ) /*lint !e613*/
17944  SCIPinfoMessage(scip, file, " -");
17945  else
17946  SCIPinfoMessage(scip, file, " %+.15g", monomialcoefs[i]); /*lint !e613*/
17947 
17948  assert(monomialvars[i] != NULL || monomialnvars[i] == 0); /*lint !e613*/
17949 
17950  for( v = 0; v < monomialnvars[i]; ++v ) /*lint !e613*/
17951  {
17952  SCIP_CALL( SCIPwriteVarName(scip, file, monomialvars[i][v], type) ); /*lint !e613*/
17953  if( monomialexps != NULL && monomialexps[i] != NULL && monomialexps[i][v] != 1.0 )
17954  {
17955  SCIPinfoMessage(scip, file, "^%.15g", monomialexps[i][v]);
17956  }
17957  }
17958  }
17959 
17960  return SCIP_OKAY;
17961 }
17962 
17963 /** parses variable information (in cip format) out of a string; if the parsing process was successful a variable is
17964  * created and captured; if variable is of integral type, fractional bounds are automatically rounded; an integer
17965  * variable with bounds zero and one is automatically converted into a binary variable
17966  *
17967  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17968  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17969  *
17970  * @pre This method can be called if @p scip is in one of the following stages:
17971  * - \ref SCIP_STAGE_PROBLEM
17972  * - \ref SCIP_STAGE_TRANSFORMING
17973  * - \ref SCIP_STAGE_INITPRESOLVE
17974  * - \ref SCIP_STAGE_PRESOLVING
17975  * - \ref SCIP_STAGE_EXITPRESOLVE
17976  * - \ref SCIP_STAGE_PRESOLVED
17977  * - \ref SCIP_STAGE_SOLVING
17978  */
17980  SCIP* scip, /**< SCIP data structure */
17981  SCIP_VAR** var, /**< pointer to store the problem variable */
17982  const char* str, /**< string to parse */
17983  SCIP_Bool initial, /**< should var's column be present in the initial root LP? */
17984  SCIP_Bool removable, /**< is var's column removable from the LP (due to aging or cleanup)? */
17985  SCIP_DECL_VARCOPY ((*varcopy)), /**< copies variable data if wanted to subscip, or NULL */
17986  SCIP_DECL_VARDELORIG ((*vardelorig)), /**< frees user data of original variable */
17987  SCIP_DECL_VARTRANS ((*vartrans)), /**< creates transformed user data by transforming original user data */
17988  SCIP_DECL_VARDELTRANS ((*vardeltrans)), /**< frees user data of transformed variable */
17989  SCIP_VARDATA* vardata, /**< user data for this specific variable */
17990  char** endptr, /**< pointer to store the final string position if successful */
17991  SCIP_Bool* success /**< pointer store if the paring process was successful */
17992  )
17993 {
17994  assert(var != NULL);
17995 
17996  SCIP_CALL( checkStage(scip, "SCIPparseVar", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17997 
17998  switch( scip->set->stage )
17999  {
18000  case SCIP_STAGE_PROBLEM:
18001  SCIP_CALL( SCIPvarParseOriginal(var, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
18002  str, initial, removable, varcopy, vardelorig, vartrans, vardeltrans, vardata, endptr, success) );
18003  break;
18004 
18007  case SCIP_STAGE_PRESOLVING:
18009  case SCIP_STAGE_PRESOLVED:
18010  case SCIP_STAGE_SOLVING:
18011  SCIP_CALL( SCIPvarParseTransformed(var, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
18012  str, initial, removable, varcopy, vardelorig, vartrans, vardeltrans, vardata, endptr, success) );
18013  break;
18014 
18015  default:
18016  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
18017  return SCIP_INVALIDCALL;
18018  } /*lint !e788*/
18019 
18020  return SCIP_OKAY;
18021 }
18022 
18023 /** parses the given string for a variable name and stores the variable in the corresponding pointer if such a variable
18024  * exits and returns the position where the parsing stopped
18025  *
18026  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18027  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18028  *
18029  * @pre This method can be called if @p scip is in one of the following stages:
18030  * - \ref SCIP_STAGE_PROBLEM
18031  * - \ref SCIP_STAGE_TRANSFORMING
18032  * - \ref SCIP_STAGE_INITPRESOLVE
18033  * - \ref SCIP_STAGE_PRESOLVING
18034  * - \ref SCIP_STAGE_EXITPRESOLVE
18035  * - \ref SCIP_STAGE_PRESOLVED
18036  * - \ref SCIP_STAGE_SOLVING
18037  */
18039  SCIP* scip, /**< SCIP data structure */
18040  const char* str, /**< string to parse */
18041  SCIP_VAR** var, /**< pointer to store the problem variable, or NULL if it does not exit */
18042  char** endptr /**< pointer to store the final string position if successful */
18043  )
18044 {
18045  char varname[SCIP_MAXSTRLEN];
18046 
18047  assert(str != NULL);
18048  assert(var != NULL);
18049  assert(endptr != NULL);
18050 
18051  SCIP_CALL( checkStage(scip, "SCIPparseVarName", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18052 
18053  SCIPstrCopySection(str, '<', '>', varname, SCIP_MAXSTRLEN, endptr);
18054  assert(*endptr != NULL);
18055 
18056  if( *varname == '\0' )
18057  {
18058  SCIPerrorMessage("invalid variable name string given: could not find '<'\n");
18059  return SCIP_INVALIDDATA;
18060  }
18061 
18062  /* check if we have a negated variable */
18063  if( *varname == '~' )
18064  {
18065  SCIPdebugMsg(scip, "parsed negated variable name <%s>\n", &varname[1]);
18066 
18067  /* search for the variable and ignore '~' */
18068  (*var) = SCIPfindVar(scip, &varname[1]);
18069 
18070  if( *var != NULL )
18071  {
18072  SCIP_CALL( SCIPgetNegatedVar(scip, *var, var) );
18073  }
18074  }
18075  else
18076  {
18077  SCIPdebugMsg(scip, "parsed variable name <%s>\n", varname);
18078 
18079  /* search for the variable */
18080  (*var) = SCIPfindVar(scip, varname);
18081  }
18082 
18083  str = *endptr;
18084 
18085  /* skip additional variable type marker */
18086  if( *str == '[' && (str[1] == SCIP_VARTYPE_BINARY_CHAR || str[1] == SCIP_VARTYPE_INTEGER_CHAR ||
18087  str[1] == SCIP_VARTYPE_IMPLINT_CHAR || str[1] == SCIP_VARTYPE_CONTINUOUS_CHAR ) && str[2] == ']' )
18088  (*endptr) += 3;
18089 
18090  return SCIP_OKAY;
18091 }
18092 
18093 /** parse the given string as variable list (here ',' is the delimiter)) (<x1>, <x2>, ..., <xn>) (see
18094  * SCIPwriteVarsList() ); if it was successful, the pointer success is set to TRUE
18095  *
18096  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18097  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18098  *
18099  * @pre This method can be called if @p scip is in one of the following stages:
18100  * - \ref SCIP_STAGE_PROBLEM
18101  * - \ref SCIP_STAGE_TRANSFORMING
18102  * - \ref SCIP_STAGE_INITPRESOLVE
18103  * - \ref SCIP_STAGE_PRESOLVING
18104  * - \ref SCIP_STAGE_EXITPRESOLVE
18105  * - \ref SCIP_STAGE_PRESOLVED
18106  * - \ref SCIP_STAGE_SOLVING
18107  *
18108  * @note The pointer success in only set to FALSE in the case that a variable with a parsed variable name does not exist.
18109  *
18110  * @note If the number of (parsed) variables is greater than the available slots in the variable array, nothing happens
18111  * except that the required size is stored in the corresponding integer; the reason for this approach is that we
18112  * cannot reallocate memory, since we do not know how the memory has been allocated (e.g., by a C++ 'new' or SCIP
18113  * memory functions).
18114  */
18116  SCIP* scip, /**< SCIP data structure */
18117  const char* str, /**< string to parse */
18118  SCIP_VAR** vars, /**< array to store the parsed variable */
18119  int* nvars, /**< pointer to store number of parsed variables */
18120  int varssize, /**< size of the variable array */
18121  int* requiredsize, /**< pointer to store the required array size for the active variables */
18122  char** endptr, /**< pointer to store the final string position if successful */
18123  char delimiter, /**< character which is used for delimitation */
18124  SCIP_Bool* success /**< pointer to store the whether the parsing was successful or not */
18125  )
18126 {
18127  SCIP_VAR** tmpvars;
18128  SCIP_VAR* var;
18129  int ntmpvars = 0;
18130  int v;
18131 
18132  assert( nvars != NULL );
18133  assert( requiredsize != NULL );
18134  assert( endptr != NULL );
18135  assert( success != NULL );
18136 
18137  SCIP_CALL( checkStage(scip, "SCIPparseVarsList", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18138 
18139  /* allocate buffer memory for temporary storing the parsed variables */
18140  SCIP_CALL( SCIPallocBufferArray(scip, &tmpvars, varssize) );
18141 
18142  (*success) = TRUE;
18143 
18144  do
18145  {
18146  *endptr = (char*)str;
18147 
18148  /* parse variable name */
18149  SCIP_CALL( SCIPparseVarName(scip, str, &var, endptr) );
18150 
18151  if( var == NULL )
18152  {
18153  SCIPdebugMsg(scip, "variable with name <%s> does not exist\n", SCIPvarGetName(var));
18154  (*success) = FALSE;
18155  break;
18156  }
18157 
18158  /* store the variable in the tmp array */
18159  if( ntmpvars < varssize )
18160  tmpvars[ntmpvars] = var;
18161 
18162  ntmpvars++;
18163 
18164  str = *endptr;
18165 
18166  while( isspace((unsigned char)*str) )
18167  str++;
18168  }
18169  while( *str == delimiter );
18170 
18171  *endptr = (char*)str;
18172 
18173  /* if all variable name searches were successful and the variable array has enough slots, copy the collected variables */
18174  if( (*success) && ntmpvars <= varssize )
18175  {
18176  for( v = 0; v < ntmpvars; ++v )
18177  vars[v] = tmpvars[v];
18178 
18179  (*nvars) = ntmpvars;
18180  }
18181  else
18182  (*nvars) = 0;
18183 
18184  (*requiredsize) = ntmpvars;
18185 
18186  /* free buffer arrays */
18187  SCIPfreeBufferArray(scip, &tmpvars);
18188 
18189  return SCIP_OKAY;
18190 }
18191 
18192 /** parse the given string as linear sum of variables and coefficients (c1 <x1> + c2 <x2> + ... + cn <xn>)
18193  * (see SCIPwriteVarsLinearsum() ); if it was successful, the pointer success is set to TRUE
18194  *
18195  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18196  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18197  *
18198  * @pre This method can be called if @p scip is in one of the following stages:
18199  * - \ref SCIP_STAGE_PROBLEM
18200  * - \ref SCIP_STAGE_TRANSFORMING
18201  * - \ref SCIP_STAGE_INITPRESOLVE
18202  * - \ref SCIP_STAGE_PRESOLVING
18203  * - \ref SCIP_STAGE_EXITPRESOLVE
18204  * - \ref SCIP_STAGE_PRESOLVED
18205  * - \ref SCIP_STAGE_SOLVING
18206  *
18207  * @note The pointer success in only set to FALSE in the case that a variable with a parsed variable name does not exist.
18208  *
18209  * @note If the number of (parsed) variables is greater than the available slots in the variable array, nothing happens
18210  * except that the required size is stored in the corresponding integer; the reason for this approach is that we
18211  * cannot reallocate memory, since we do not know how the memory has been allocated (e.g., by a C++ 'new' or SCIP
18212  * memory functions).
18213  */
18215  SCIP* scip, /**< SCIP data structure */
18216  const char* str, /**< string to parse */
18217  SCIP_VAR** vars, /**< array to store the parsed variables */
18218  SCIP_Real* vals, /**< array to store the parsed coefficients */
18219  int* nvars, /**< pointer to store number of parsed variables */
18220  int varssize, /**< size of the variable array */
18221  int* requiredsize, /**< pointer to store the required array size for the active variables */
18222  char** endptr, /**< pointer to store the final string position if successful */
18223  SCIP_Bool* success /**< pointer to store the whether the parsing was successful or not */
18224  )
18225 {
18226  SCIP_VAR*** monomialvars;
18227  SCIP_Real** monomialexps;
18228  SCIP_Real* monomialcoefs;
18229  int* monomialnvars;
18230  int nmonomials;
18231 
18232  SCIP_CALL( checkStage(scip, "SCIPparseVarsLinearsum", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18233 
18234  assert(scip != NULL);
18235  assert(str != NULL);
18236  assert(vars != NULL || varssize == 0);
18237  assert(vals != NULL || varssize == 0);
18238  assert(nvars != NULL);
18239  assert(requiredsize != NULL);
18240  assert(endptr != NULL);
18241  assert(success != NULL);
18242 
18243  *requiredsize = 0;
18244 
18245  SCIP_CALL( SCIPparseVarsPolynomial(scip, str, &monomialvars, &monomialexps, &monomialcoefs, &monomialnvars, &nmonomials, endptr, success) );
18246 
18247  if( !*success )
18248  {
18249  assert(nmonomials == 0); /* SCIPparseVarsPolynomial should have freed all buffers, so no need to call free here */
18250  return SCIP_OKAY;
18251  }
18252 
18253  /* check if linear sum is just "0" */
18254  if( nmonomials == 1 && monomialnvars[0] == 0 && monomialcoefs[0] == 0.0 )
18255  {
18256  *nvars = 0;
18257  *requiredsize = 0;
18258 
18259  SCIPfreeParseVarsPolynomialData(scip, &monomialvars, &monomialexps, &monomialcoefs, &monomialnvars, nmonomials);
18260 
18261  return SCIP_OKAY;
18262  }
18263 
18264  *nvars = nmonomials;
18265  *requiredsize = nmonomials;
18266 
18267  /* if we have enough slots in the variables array, copy variables over */
18268  if( varssize >= nmonomials )
18269  {
18270  int v;
18271 
18272  for( v = 0; v < nmonomials; ++v )
18273  {
18274  if( monomialnvars[v] == 0 )
18275  {
18276  SCIPerrorMessage("constant in linear sum\n");
18277  *success = FALSE;
18278  break;
18279  }
18280  if( monomialnvars[v] > 1 || monomialexps[v][0] != 1.0 )
18281  {
18282  SCIPerrorMessage("nonlinear monomial in linear sum\n");
18283  *success = FALSE;
18284  break;
18285  }
18286  assert(monomialnvars[v] == 1);
18287  assert(monomialvars[v][0] != NULL);
18288  assert(monomialexps[v][0] == 1.0);
18289 
18290  vars[v] = monomialvars[v][0]; /*lint !e613*/
18291  vals[v] = monomialcoefs[v]; /*lint !e613*/
18292  }
18293  }
18294 
18295  SCIPfreeParseVarsPolynomialData(scip, &monomialvars, &monomialexps, &monomialcoefs, &monomialnvars, nmonomials);
18296 
18297  return SCIP_OKAY;
18298 }
18299 
18300 /** parse the given string as polynomial of variables and coefficients
18301  * (c1 <x11>^e11 <x12>^e12 ... <x1n>^e1n + c2 <x21>^e21 <x22>^e22 ... + ... + cn <xn1>^en1 ...)
18302  * (see SCIPwriteVarsPolynomial()); if it was successful, the pointer success is set to TRUE
18303  *
18304  * The user has to call SCIPfreeParseVarsPolynomialData(scip, monomialvars, monomialexps,
18305  * monomialcoefs, monomialnvars, *nmonomials) short after SCIPparseVarsPolynomial to free all the
18306  * allocated memory again. Do not keep the arrays created by SCIPparseVarsPolynomial around, since
18307  * they use buffer memory that is intended for short term use only.
18308  *
18309  * Parsing is stopped at the end of string (indicated by the \\0-character) or when no more monomials
18310  * are recognized.
18311  *
18312  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18313  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18314  *
18315  * @pre This method can be called if @p scip is in one of the following stages:
18316  * - \ref SCIP_STAGE_PROBLEM
18317  * - \ref SCIP_STAGE_TRANSFORMING
18318  * - \ref SCIP_STAGE_INITPRESOLVE
18319  * - \ref SCIP_STAGE_PRESOLVING
18320  * - \ref SCIP_STAGE_EXITPRESOLVE
18321  * - \ref SCIP_STAGE_PRESOLVED
18322  * - \ref SCIP_STAGE_SOLVING
18323  */
18325  SCIP* scip, /**< SCIP data structure */
18326  const char* str, /**< string to parse */
18327  SCIP_VAR**** monomialvars, /**< pointer to store arrays with variables for each monomial */
18328  SCIP_Real*** monomialexps, /**< pointer to store arrays with variable exponents */
18329  SCIP_Real** monomialcoefs, /**< pointer to store array with monomial coefficients */
18330  int** monomialnvars, /**< pointer to store array with number of variables for each monomial */
18331  int* nmonomials, /**< pointer to store number of parsed monomials */
18332  char** endptr, /**< pointer to store the final string position if successful */
18333  SCIP_Bool* success /**< pointer to store the whether the parsing was successful or not */
18334  )
18335 {
18336  typedef enum
18337  {
18338  SCIPPARSEPOLYNOMIAL_STATE_BEGIN, /* we are at the beginning of a monomial */
18339  SCIPPARSEPOLYNOMIAL_STATE_INTERMED, /* we are in between the factors of a monomial */
18340  SCIPPARSEPOLYNOMIAL_STATE_COEF, /* we parse the coefficient of a monomial */
18341  SCIPPARSEPOLYNOMIAL_STATE_VARS, /* we parse monomial variables */
18342  SCIPPARSEPOLYNOMIAL_STATE_EXPONENT, /* we parse the exponent of a variable */
18343  SCIPPARSEPOLYNOMIAL_STATE_END, /* we are at the end the polynomial */
18344  SCIPPARSEPOLYNOMIAL_STATE_ERROR /* a parsing error occured */
18345  } SCIPPARSEPOLYNOMIAL_STATES;
18346 
18347  SCIPPARSEPOLYNOMIAL_STATES state;
18348  int monomialssize;
18349 
18350  /* data of currently parsed monomial */
18351  int varssize;
18352  int nvars;
18353  SCIP_VAR** vars;
18354  SCIP_Real* exponents;
18355  SCIP_Real coef;
18356 
18357  assert(scip != NULL);
18358  assert(str != NULL);
18359  assert(monomialvars != NULL);
18360  assert(monomialexps != NULL);
18361  assert(monomialnvars != NULL);
18362  assert(monomialcoefs != NULL);
18363  assert(nmonomials != NULL);
18364  assert(endptr != NULL);
18365  assert(success != NULL);
18366 
18367  SCIP_CALL( checkStage(scip, "SCIPparseVarsPolynomial", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18368 
18369  *success = FALSE;
18370  *nmonomials = 0;
18371  monomialssize = 0;
18372  *monomialvars = NULL;
18373  *monomialexps = NULL;
18374  *monomialcoefs = NULL;
18375  *monomialnvars = NULL;
18376 
18377  /* initialize state machine */
18378  state = SCIPPARSEPOLYNOMIAL_STATE_BEGIN;
18379  varssize = 0;
18380  nvars = 0;
18381  vars = NULL;
18382  exponents = NULL;
18383  coef = SCIP_INVALID;
18384 
18385  SCIPdebugMsg(scip, "parsing polynomial from '%s'\n", str);
18386 
18387  while( *str && state != SCIPPARSEPOLYNOMIAL_STATE_END && state != SCIPPARSEPOLYNOMIAL_STATE_ERROR )
18388  {
18389  /* skip white space */
18390  while( isspace((unsigned char)*str) )
18391  str++;
18392 
18393  assert(state != SCIPPARSEPOLYNOMIAL_STATE_END);
18394 
18395  switch( state )
18396  {
18397  case SCIPPARSEPOLYNOMIAL_STATE_BEGIN:
18398  {
18399  if( coef != SCIP_INVALID ) /*lint !e777*/
18400  {
18401  SCIPdebugMsg(scip, "push monomial with coefficient <%g> and <%d> vars\n", coef, nvars);
18402  /* push previous monomial */
18403  if( monomialssize <= *nmonomials )
18404  {
18405  monomialssize = SCIPcalcMemGrowSize(scip, *nmonomials+1);
18406 
18407  SCIP_CALL( SCIPreallocBufferArray(scip, monomialvars, monomialssize) );
18408  SCIP_CALL( SCIPreallocBufferArray(scip, monomialexps, monomialssize) );
18409  SCIP_CALL( SCIPreallocBufferArray(scip, monomialnvars, monomialssize) );
18410  SCIP_CALL( SCIPreallocBufferArray(scip, monomialcoefs, monomialssize) );
18411  }
18412 
18413  if( nvars > 0 )
18414  {
18415  SCIP_CALL( SCIPduplicateBufferArray(scip, &(*monomialvars)[*nmonomials], vars, nvars) ); /*lint !e866*/
18416  SCIP_CALL( SCIPduplicateBufferArray(scip, &(*monomialexps)[*nmonomials], exponents, nvars) ); /*lint !e866*/
18417  }
18418  else
18419  {
18420  (*monomialvars)[*nmonomials] = NULL;
18421  (*monomialexps)[*nmonomials] = NULL;
18422  }
18423  (*monomialcoefs)[*nmonomials] = coef;
18424  (*monomialnvars)[*nmonomials] = nvars;
18425  ++*nmonomials;
18426 
18427  nvars = 0;
18428  coef = SCIP_INVALID;
18429  }
18430 
18431  if( *str == '<' )
18432  {
18433  /* there seem to come a variable at the beginning of a monomial
18434  * so assume the coefficient is 1.0
18435  */
18436  state = SCIPPARSEPOLYNOMIAL_STATE_VARS;
18437  coef = 1.0;
18438  break;
18439  }
18440  if( *str == '-' || *str == '+' || isdigit(*str) )
18441  {
18442  state = SCIPPARSEPOLYNOMIAL_STATE_COEF;
18443  break;
18444  }
18445 
18446  state = SCIPPARSEPOLYNOMIAL_STATE_END;
18447 
18448  break;
18449  }
18450 
18451  case SCIPPARSEPOLYNOMIAL_STATE_INTERMED:
18452  {
18453  if( *str == '<' )
18454  {
18455  /* there seem to come another variable */
18456  state = SCIPPARSEPOLYNOMIAL_STATE_VARS;
18457  break;
18458  }
18459 
18460  if( *str == '-' || *str == '+' || isdigit(*str) )
18461  {
18462  /* there seem to come a coefficient, which means the next monomial */
18463  state = SCIPPARSEPOLYNOMIAL_STATE_BEGIN;
18464  break;
18465  }
18466 
18467  /* since we cannot detect the symbols we stop parsing the polynomial */
18468  state = SCIPPARSEPOLYNOMIAL_STATE_END;
18469  break;
18470  }
18471 
18472  case SCIPPARSEPOLYNOMIAL_STATE_COEF:
18473  {
18474  if( *str == '+' && !isdigit(str[1]) )
18475  {
18476  /* only a plus sign, without number */
18477  coef = 1.0;
18478  ++str;
18479  }
18480  else if( *str == '-' && !isdigit(str[1]) )
18481  {
18482  /* only a minus sign, without number */
18483  coef = -1.0;
18484  ++str;
18485  }
18486  else if( SCIPstrToRealValue(str, &coef, endptr) )
18487  {
18488  str = *endptr;
18489  }
18490  else
18491  {
18492  SCIPerrorMessage("could not parse number in the beginning of '%s'\n", str);
18493  state = SCIPPARSEPOLYNOMIAL_STATE_ERROR;
18494  break;
18495  }
18496 
18497  /* after the coefficient we go into the intermediate state, i.e., expecting next variables */
18498  state = SCIPPARSEPOLYNOMIAL_STATE_INTERMED;
18499 
18500  break;
18501  }
18502 
18503  case SCIPPARSEPOLYNOMIAL_STATE_VARS:
18504  {
18505  SCIP_VAR* var;
18506 
18507  assert(*str == '<');
18508 
18509  /* parse variable name */
18510  SCIP_CALL( SCIPparseVarName(scip, str, &var, endptr) );
18511 
18512  /* check if variable name was parsed */
18513  if( *endptr == str )
18514  {
18515  state = SCIPPARSEPOLYNOMIAL_STATE_END;
18516  break;
18517  }
18518 
18519  if( var == NULL )
18520  {
18521  SCIPerrorMessage("did not find variable in the beginning of %s\n", str);
18522  state = SCIPPARSEPOLYNOMIAL_STATE_ERROR;
18523  break;
18524  }
18525 
18526  /* add variable to vars array */
18527  if( nvars + 1 > varssize )
18528  {
18529  varssize = SCIPcalcMemGrowSize(scip, nvars+1);
18530  SCIP_CALL( SCIPreallocBufferArray(scip, &vars, varssize) );
18531  SCIP_CALL( SCIPreallocBufferArray(scip, &exponents, varssize) );
18532  }
18533  assert(vars != NULL);
18534  assert(exponents != NULL);
18535 
18536  vars[nvars] = var;
18537  exponents[nvars] = 1.0;
18538  ++nvars;
18539 
18540  str = *endptr;
18541 
18542  if( *str == '^' )
18543  state = SCIPPARSEPOLYNOMIAL_STATE_EXPONENT;
18544  else
18545  state = SCIPPARSEPOLYNOMIAL_STATE_INTERMED;
18546 
18547  break;
18548  }
18549 
18550  case SCIPPARSEPOLYNOMIAL_STATE_EXPONENT:
18551  {
18552  assert(*str == '^');
18553  assert(nvars > 0); /* we should be in a monomial that has already a variable */
18554  assert(exponents != NULL);
18555  ++str;
18556 
18557  if( !SCIPstrToRealValue(str, &exponents[nvars-1], endptr) )
18558  {
18559  SCIPerrorMessage("could not parse number in the beginning of '%s'\n", str);
18560  state = SCIPPARSEPOLYNOMIAL_STATE_ERROR;
18561  break;
18562  }
18563  str = *endptr;
18564 
18565  /* after the exponent we go into the intermediate state, i.e., expecting next variables */
18566  state = SCIPPARSEPOLYNOMIAL_STATE_INTERMED;
18567  break;
18568  }
18569 
18570  case SCIPPARSEPOLYNOMIAL_STATE_END:
18571  case SCIPPARSEPOLYNOMIAL_STATE_ERROR:
18572  default:
18573  SCIPerrorMessage("unexpected state\n");
18574  return SCIP_READERROR;
18575  }
18576  }
18577 
18578  /* set end pointer */
18579  *endptr = (char*)str;
18580 
18581  /* check state at end of string */
18582  switch( state )
18583  {
18584  case SCIPPARSEPOLYNOMIAL_STATE_BEGIN:
18585  case SCIPPARSEPOLYNOMIAL_STATE_END:
18586  case SCIPPARSEPOLYNOMIAL_STATE_INTERMED:
18587  {
18588  if( coef != SCIP_INVALID ) /*lint !e777*/
18589  {
18590  /* push last monomial */
18591  SCIPdebugMsg(scip, "push monomial with coefficient <%g> and <%d> vars\n", coef, nvars);
18592  if( monomialssize <= *nmonomials )
18593  {
18594  monomialssize = *nmonomials+1;
18595  SCIP_CALL( SCIPreallocBufferArray(scip, monomialvars, monomialssize) );
18596  SCIP_CALL( SCIPreallocBufferArray(scip, monomialexps, monomialssize) );
18597  SCIP_CALL( SCIPreallocBufferArray(scip, monomialnvars, monomialssize) );
18598  SCIP_CALL( SCIPreallocBufferArray(scip, monomialcoefs, monomialssize) );
18599  }
18600 
18601  if( nvars > 0 )
18602  {
18603  /* shrink vars and exponents array to needed size and take over ownership */
18604  SCIP_CALL( SCIPreallocBufferArray(scip, &vars, nvars) );
18605  SCIP_CALL( SCIPreallocBufferArray(scip, &exponents, nvars) );
18606  (*monomialvars)[*nmonomials] = vars;
18607  (*monomialexps)[*nmonomials] = exponents;
18608  vars = NULL;
18609  exponents = NULL;
18610  }
18611  else
18612  {
18613  (*monomialvars)[*nmonomials] = NULL;
18614  (*monomialexps)[*nmonomials] = NULL;
18615  }
18616  (*monomialcoefs)[*nmonomials] = coef;
18617  (*monomialnvars)[*nmonomials] = nvars;
18618  ++*nmonomials;
18619  }
18620 
18621  *success = TRUE;
18622  break;
18623  }
18624 
18625  case SCIPPARSEPOLYNOMIAL_STATE_COEF:
18626  case SCIPPARSEPOLYNOMIAL_STATE_VARS:
18627  case SCIPPARSEPOLYNOMIAL_STATE_EXPONENT:
18628  {
18629  SCIPerrorMessage("unexpected parsing state at end of polynomial string\n");
18630  }
18631  /*lint -fallthrough*/
18632  case SCIPPARSEPOLYNOMIAL_STATE_ERROR:
18633  assert(!*success);
18634  break;
18635  }
18636 
18637  /* free memory to store current monomial, if still existing */
18638  SCIPfreeBufferArrayNull(scip, &vars);
18639  SCIPfreeBufferArrayNull(scip, &exponents);
18640 
18641  if( *success && *nmonomials > 0 )
18642  {
18643  /* shrink arrays to required size, so we do not need to keep monomialssize around */
18644  assert(*nmonomials <= monomialssize);
18645  SCIP_CALL( SCIPreallocBufferArray(scip, monomialvars, *nmonomials) );
18646  SCIP_CALL( SCIPreallocBufferArray(scip, monomialexps, *nmonomials) );
18647  SCIP_CALL( SCIPreallocBufferArray(scip, monomialnvars, *nmonomials) );
18648  SCIP_CALL( SCIPreallocBufferArray(scip, monomialcoefs, *nmonomials) );
18649 
18650  /* SCIPwriteVarsPolynomial(scip, NULL, *monomialvars, *monomialexps, *monomialcoefs, *monomialnvars, *nmonomials, FALSE); */
18651  }
18652  else
18653  {
18654  /* in case of error, cleanup all data here */
18655  SCIPfreeParseVarsPolynomialData(scip, monomialvars, monomialexps, monomialcoefs, monomialnvars, *nmonomials);
18656  *nmonomials = 0;
18657  }
18658 
18659  return SCIP_OKAY;
18660 }
18661 
18662 /** frees memory allocated when parsing a polynomial from a string
18663  *
18664  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18665  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18666  *
18667  * @pre This method can be called if @p scip is in one of the following stages:
18668  * - \ref SCIP_STAGE_PROBLEM
18669  * - \ref SCIP_STAGE_TRANSFORMING
18670  * - \ref SCIP_STAGE_INITPRESOLVE
18671  * - \ref SCIP_STAGE_PRESOLVING
18672  * - \ref SCIP_STAGE_EXITPRESOLVE
18673  * - \ref SCIP_STAGE_PRESOLVED
18674  * - \ref SCIP_STAGE_SOLVING
18675  */
18677  SCIP* scip, /**< SCIP data structure */
18678  SCIP_VAR**** monomialvars, /**< pointer to store arrays with variables for each monomial */
18679  SCIP_Real*** monomialexps, /**< pointer to store arrays with variable exponents */
18680  SCIP_Real** monomialcoefs, /**< pointer to store array with monomial coefficients */
18681  int** monomialnvars, /**< pointer to store array with number of variables for each monomial */
18682  int nmonomials /**< pointer to store number of parsed monomials */
18683  )
18684 {
18685  int i;
18686 
18687  assert(scip != NULL);
18688  assert(monomialvars != NULL);
18689  assert(monomialexps != NULL);
18690  assert(monomialcoefs != NULL);
18691  assert(monomialnvars != NULL);
18692  assert((*monomialvars != NULL) == (nmonomials > 0));
18693  assert((*monomialexps != NULL) == (nmonomials > 0));
18694  assert((*monomialcoefs != NULL) == (nmonomials > 0));
18695  assert((*monomialnvars != NULL) == (nmonomials > 0));
18696 
18697  SCIP_CALL_ABORT( checkStage(scip, "SCIPfreeParseVarsPolynomialData", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18698 
18699  if( nmonomials == 0 )
18700  return;
18701 
18702  for( i = nmonomials - 1; i >= 0; --i )
18703  {
18704  SCIPfreeBufferArrayNull(scip, &(*monomialvars)[i]);
18705  SCIPfreeBufferArrayNull(scip, &(*monomialexps)[i]);
18706  }
18707 
18708  SCIPfreeBufferArray(scip, monomialvars);
18709  SCIPfreeBufferArray(scip, monomialexps);
18710  SCIPfreeBufferArray(scip, monomialcoefs);
18711  SCIPfreeBufferArray(scip, monomialnvars);
18712 }
18713 
18714 /** increases usage counter of variable
18715  *
18716  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18717  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18718  *
18719  * @pre This method can be called if @p scip is in one of the following stages:
18720  * - \ref SCIP_STAGE_PROBLEM
18721  * - \ref SCIP_STAGE_TRANSFORMING
18722  * - \ref SCIP_STAGE_TRANSFORMED
18723  * - \ref SCIP_STAGE_INITPRESOLVE
18724  * - \ref SCIP_STAGE_PRESOLVING
18725  * - \ref SCIP_STAGE_EXITPRESOLVE
18726  * - \ref SCIP_STAGE_PRESOLVED
18727  * - \ref SCIP_STAGE_INITSOLVE
18728  * - \ref SCIP_STAGE_SOLVING
18729  * - \ref SCIP_STAGE_SOLVED
18730  * - \ref SCIP_STAGE_EXITSOLVE
18731  */
18733  SCIP* scip, /**< SCIP data structure */
18734  SCIP_VAR* var /**< variable to capture */
18735  )
18736 {
18737  SCIP_CALL( checkStage(scip, "SCIPcaptureVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
18738  assert(var->scip == scip);
18739 
18740  SCIPvarCapture(var);
18741 
18742  return SCIP_OKAY;
18743 }
18744 
18745 /** decreases usage counter of variable, if the usage pointer reaches zero the variable gets freed
18746  *
18747  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18748  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18749  *
18750  * @pre This method can be called if @p scip is in one of the following stages:
18751  * - \ref SCIP_STAGE_PROBLEM
18752  * - \ref SCIP_STAGE_TRANSFORMING
18753  * - \ref SCIP_STAGE_TRANSFORMED
18754  * - \ref SCIP_STAGE_INITPRESOLVE
18755  * - \ref SCIP_STAGE_PRESOLVING
18756  * - \ref SCIP_STAGE_EXITPRESOLVE
18757  * - \ref SCIP_STAGE_PRESOLVED
18758  * - \ref SCIP_STAGE_INITSOLVE
18759  * - \ref SCIP_STAGE_SOLVING
18760  * - \ref SCIP_STAGE_SOLVED
18761  * - \ref SCIP_STAGE_EXITSOLVE
18762  * - \ref SCIP_STAGE_FREETRANS
18763  *
18764  * @note the pointer of the variable will be NULLed
18765  */
18767  SCIP* scip, /**< SCIP data structure */
18768  SCIP_VAR** var /**< pointer to variable */
18769  )
18770 {
18771  assert(var != NULL);
18772  assert(*var != NULL);
18773  assert((*var)->scip == scip);
18774 
18775  SCIP_CALL( checkStage(scip, "SCIPreleaseVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
18776 
18777  switch( scip->set->stage )
18778  {
18779  case SCIP_STAGE_PROBLEM:
18780  SCIP_CALL( SCIPvarRelease(var, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
18781  return SCIP_OKAY;
18782 
18786  case SCIP_STAGE_PRESOLVING:
18788  case SCIP_STAGE_PRESOLVED:
18789  case SCIP_STAGE_INITSOLVE:
18790  case SCIP_STAGE_SOLVING:
18791  case SCIP_STAGE_SOLVED:
18792  case SCIP_STAGE_EXITSOLVE:
18793  case SCIP_STAGE_FREETRANS:
18794  if( !SCIPvarIsTransformed(*var) && (*var)->nuses == 1 )
18795  {
18796  SCIPerrorMessage("cannot release last use of original variable while the transformed problem exists\n");
18797  return SCIP_INVALIDCALL;
18798  }
18799  SCIP_CALL( SCIPvarRelease(var, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
18800  return SCIP_OKAY;
18801 
18802  default:
18803  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
18804  return SCIP_INVALIDCALL;
18805  } /*lint !e788*/
18806 }
18807 
18808 /** changes the name of a variable
18809  *
18810  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18811  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18812  *
18813  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_PROBLEM
18814  *
18815  * @note to get the current name of a variable, use SCIPvarGetName() from pub_var.h
18816  */
18818  SCIP* scip, /**< SCIP data structure */
18819  SCIP_VAR* var, /**< variable */
18820  const char* name /**< new name of constraint */
18821  )
18822 {
18823  SCIP_CALL( checkStage(scip, "SCIPchgVarName", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
18824  assert( var->scip == scip );
18825 
18826  if( SCIPgetStage(scip) != SCIP_STAGE_PROBLEM )
18827  {
18828  SCIPerrorMessage("variable names can only be changed in problem creation stage\n");
18829  SCIPABORT();
18830  return SCIP_INVALIDCALL; /*lint !e527*/
18831  }
18832 
18833  /* remove variable's name from the namespace if the variable was already added */
18834  if( SCIPvarGetProbindex(var) != -1 )
18835  {
18836  SCIP_CALL( SCIPprobRemoveVarName(scip->origprob, var) );
18837  }
18838 
18839  /* change variable name */
18840  SCIP_CALL( SCIPvarChgName(var, SCIPblkmem(scip), name) );
18841 
18842  /* add variable's name to the namespace if the variable was already added */
18843  if( SCIPvarGetProbindex(var) != -1 )
18844  {
18845  SCIP_CALL( SCIPprobAddVarName(scip->origprob, var) );
18846  }
18847 
18848  return SCIP_OKAY;
18849 }
18850 
18851 /** gets and captures transformed variable of a given variable; if the variable is not yet transformed,
18852  * a new transformed variable for this variable is created
18853  *
18854  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18855  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18856  *
18857  * @pre This method can be called if @p scip is in one of the following stages:
18858  * - \ref SCIP_STAGE_TRANSFORMING
18859  * - \ref SCIP_STAGE_TRANSFORMED
18860  * - \ref SCIP_STAGE_INITPRESOLVE
18861  * - \ref SCIP_STAGE_PRESOLVING
18862  * - \ref SCIP_STAGE_EXITPRESOLVE
18863  * - \ref SCIP_STAGE_PRESOLVED
18864  * - \ref SCIP_STAGE_INITSOLVE
18865  * - \ref SCIP_STAGE_SOLVING
18866  */
18868  SCIP* scip, /**< SCIP data structure */
18869  SCIP_VAR* var, /**< variable to get/create transformed variable for */
18870  SCIP_VAR** transvar /**< pointer to store the transformed variable */
18871  )
18872 {
18873  assert(transvar != NULL);
18874 
18875  SCIP_CALL( checkStage(scip, "SCIPtransformVar", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18876 
18877  if( SCIPvarIsTransformed(var) )
18878  {
18879  *transvar = var;
18880  SCIPvarCapture(*transvar);
18881  }
18882  else
18883  {
18884  SCIP_CALL( SCIPvarTransform(var, scip->mem->probmem, scip->set, scip->stat, scip->origprob->objsense, transvar) );
18885  }
18886 
18887  return SCIP_OKAY;
18888 }
18889 
18890 /** gets and captures transformed variables for an array of variables;
18891  * if a variable of the array is not yet transformed, a new transformed variable for this variable is created;
18892  * it is possible to call this method with vars == transvars
18893  *
18894  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18895  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18896  *
18897  * @pre This method can be called if @p scip is in one of the following stages:
18898  * - \ref SCIP_STAGE_TRANSFORMING
18899  * - \ref SCIP_STAGE_TRANSFORMED
18900  * - \ref SCIP_STAGE_INITPRESOLVE
18901  * - \ref SCIP_STAGE_PRESOLVING
18902  * - \ref SCIP_STAGE_EXITPRESOLVE
18903  * - \ref SCIP_STAGE_PRESOLVED
18904  * - \ref SCIP_STAGE_INITSOLVE
18905  * - \ref SCIP_STAGE_SOLVING
18906  */
18908  SCIP* scip, /**< SCIP data structure */
18909  int nvars, /**< number of variables to get/create transformed variables for */
18910  SCIP_VAR** vars, /**< array with variables to get/create transformed variables for */
18911  SCIP_VAR** transvars /**< array to store the transformed variables */
18912  )
18913 {
18914  int v;
18915 
18916  assert(nvars == 0 || vars != NULL);
18917  assert(nvars == 0 || transvars != NULL);
18918 
18919  SCIP_CALL( checkStage(scip, "SCIPtransformVars", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18920 
18921  for( v = 0; v < nvars; ++v )
18922  {
18923  if( SCIPvarIsTransformed(vars[v]) )
18924  {
18925  transvars[v] = vars[v];
18926  SCIPvarCapture(transvars[v]);
18927  }
18928  else
18929  {
18930  SCIP_CALL( SCIPvarTransform(vars[v], scip->mem->probmem, scip->set, scip->stat, scip->origprob->objsense,
18931  &transvars[v]) );
18932  }
18933  }
18934 
18935  return SCIP_OKAY;
18936 }
18937 
18938 /** gets corresponding transformed variable of a given variable;
18939  * returns NULL as transvar, if transformed variable is not yet existing
18940  *
18941  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18942  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18943  *
18944  * @pre This method can be called if @p scip is in one of the following stages:
18945  * - \ref SCIP_STAGE_TRANSFORMING
18946  * - \ref SCIP_STAGE_TRANSFORMED
18947  * - \ref SCIP_STAGE_INITPRESOLVE
18948  * - \ref SCIP_STAGE_PRESOLVING
18949  * - \ref SCIP_STAGE_EXITPRESOLVE
18950  * - \ref SCIP_STAGE_PRESOLVED
18951  * - \ref SCIP_STAGE_INITSOLVE
18952  * - \ref SCIP_STAGE_SOLVING
18953  * - \ref SCIP_STAGE_SOLVED
18954  * - \ref SCIP_STAGE_EXITSOLVE
18955  * - \ref SCIP_STAGE_FREETRANS
18956  */
18958  SCIP* scip, /**< SCIP data structure */
18959  SCIP_VAR* var, /**< variable to get transformed variable for */
18960  SCIP_VAR** transvar /**< pointer to store the transformed variable */
18961  )
18962 {
18963  assert(transvar != NULL);
18964 
18965  SCIP_CALL( checkStage(scip, "SCIPgetTransformedVar", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
18966 
18967  if( SCIPvarIsTransformed(var) )
18968  *transvar = var;
18969  else
18970  {
18971  SCIP_CALL( SCIPvarGetTransformed(var, scip->mem->probmem, scip->set, scip->stat, transvar) );
18972  }
18973 
18974  return SCIP_OKAY;
18975 }
18976 
18977 /** gets corresponding transformed variables for an array of variables;
18978  * stores NULL in a transvars slot, if the transformed variable is not yet existing;
18979  * it is possible to call this method with vars == transvars, but remember that variables that are not
18980  * yet transformed will be replaced with NULL
18981  *
18982  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18983  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18984  *
18985  * @pre This method can be called if @p scip is in one of the following stages:
18986  * - \ref SCIP_STAGE_TRANSFORMING
18987  * - \ref SCIP_STAGE_TRANSFORMED
18988  * - \ref SCIP_STAGE_INITPRESOLVE
18989  * - \ref SCIP_STAGE_PRESOLVING
18990  * - \ref SCIP_STAGE_EXITPRESOLVE
18991  * - \ref SCIP_STAGE_PRESOLVED
18992  * - \ref SCIP_STAGE_INITSOLVE
18993  * - \ref SCIP_STAGE_SOLVING
18994  * - \ref SCIP_STAGE_SOLVED
18995  * - \ref SCIP_STAGE_EXITSOLVE
18996  * - \ref SCIP_STAGE_FREETRANS
18997  */
18999  SCIP* scip, /**< SCIP data structure */
19000  int nvars, /**< number of variables to get transformed variables for */
19001  SCIP_VAR** vars, /**< array with variables to get transformed variables for */
19002  SCIP_VAR** transvars /**< array to store the transformed variables */
19003  )
19004 {
19005  int v;
19006 
19007  assert(nvars == 0 || vars != NULL);
19008  assert(nvars == 0 || transvars != NULL);
19009 
19010  SCIP_CALL( checkStage(scip, "SCIPgetTransformedVars", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
19011 
19012  for( v = 0; v < nvars; ++v )
19013  {
19014  if( SCIPvarIsTransformed(vars[v]) )
19015  transvars[v] = vars[v];
19016  else
19017  {
19018  SCIP_CALL( SCIPvarGetTransformed(vars[v], scip->mem->probmem, scip->set, scip->stat, &transvars[v]) );
19019  }
19020  }
19021 
19022  return SCIP_OKAY;
19023 }
19024 
19025 /** gets negated variable x' = lb + ub - x of variable x; negated variable is created, if not yet existing;
19026  * in difference to \ref SCIPcreateVar, the negated variable must not be released (unless captured explicitly)
19027  *
19028  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19029  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19030  *
19031  * @pre This method can be called if @p scip is in one of the following stages:
19032  * - \ref SCIP_STAGE_PROBLEM
19033  * - \ref SCIP_STAGE_TRANSFORMING
19034  * - \ref SCIP_STAGE_TRANSFORMED
19035  * - \ref SCIP_STAGE_INITPRESOLVE
19036  * - \ref SCIP_STAGE_PRESOLVING
19037  * - \ref SCIP_STAGE_EXITPRESOLVE
19038  * - \ref SCIP_STAGE_PRESOLVED
19039  * - \ref SCIP_STAGE_INITSOLVE
19040  * - \ref SCIP_STAGE_SOLVING
19041  * - \ref SCIP_STAGE_SOLVED
19042  * - \ref SCIP_STAGE_EXITSOLVE
19043  * - \ref SCIP_STAGE_FREETRANS
19044  */
19046  SCIP* scip, /**< SCIP data structure */
19047  SCIP_VAR* var, /**< variable to get negated variable for */
19048  SCIP_VAR** negvar /**< pointer to store the negated variable */
19049  )
19050 {
19051  SCIP_CALL( checkStage(scip, "SCIPgetNegatedVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
19052  assert( var->scip == scip );
19053 
19054  SCIP_CALL( SCIPvarNegate(var, scip->mem->probmem, scip->set, scip->stat, negvar) );
19055 
19056  return SCIP_OKAY;
19057 }
19058 
19059 /** gets negated variables x' = lb + ub - x of variables x; negated variables are created, if not yet existing
19060  *
19061  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19062  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19063  *
19064  * @pre This method can be called if @p scip is in one of the following stages:
19065  * - \ref SCIP_STAGE_PROBLEM
19066  * - \ref SCIP_STAGE_TRANSFORMING
19067  * - \ref SCIP_STAGE_TRANSFORMED
19068  * - \ref SCIP_STAGE_INITPRESOLVE
19069  * - \ref SCIP_STAGE_PRESOLVING
19070  * - \ref SCIP_STAGE_EXITPRESOLVE
19071  * - \ref SCIP_STAGE_PRESOLVED
19072  * - \ref SCIP_STAGE_INITSOLVE
19073  * - \ref SCIP_STAGE_SOLVING
19074  * - \ref SCIP_STAGE_SOLVED
19075  * - \ref SCIP_STAGE_EXITSOLVE
19076  * - \ref SCIP_STAGE_FREETRANS
19077  */
19079  SCIP* scip, /**< SCIP data structure */
19080  int nvars, /**< number of variables to get negated variables for */
19081  SCIP_VAR** vars, /**< array of variables to get negated variables for */
19082  SCIP_VAR** negvars /**< array to store the negated variables */
19083  )
19084 {
19085  int v;
19086 
19087  SCIP_CALL( checkStage(scip, "SCIPgetNegatedVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
19088 
19089  for( v = 0; v < nvars; ++v )
19090  {
19091  SCIP_CALL( SCIPvarNegate(vars[v], scip->mem->probmem, scip->set, scip->stat, &(negvars[v])) );
19092  }
19093 
19094  return SCIP_OKAY;
19095 }
19096 
19097 /** gets a binary variable that is equal to the given binary variable, and that is either active, fixed, or
19098  * multi-aggregated, or the negated variable of an active, fixed, or multi-aggregated variable
19099  *
19100  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19101  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19102  *
19103  * @pre This method can be called if @p scip is in one of the following stages:
19104  * - \ref SCIP_STAGE_PROBLEM
19105  * - \ref SCIP_STAGE_TRANSFORMED
19106  * - \ref SCIP_STAGE_INITPRESOLVE
19107  * - \ref SCIP_STAGE_PRESOLVING
19108  * - \ref SCIP_STAGE_EXITPRESOLVE
19109  * - \ref SCIP_STAGE_PRESOLVED
19110  * - \ref SCIP_STAGE_INITSOLVE
19111  * - \ref SCIP_STAGE_SOLVING
19112  * - \ref SCIP_STAGE_SOLVED
19113  * - \ref SCIP_STAGE_EXITSOLVE
19114  */
19116  SCIP* scip, /**< SCIP data structure */
19117  SCIP_VAR* var, /**< binary variable to get binary representative for */
19118  SCIP_VAR** repvar, /**< pointer to store the binary representative */
19119  SCIP_Bool* negated /**< pointer to store whether the negation of an active variable was returned */
19120  )
19121 {
19122  assert(scip != NULL);
19123  assert(var != NULL);
19124  assert(repvar != NULL);
19125  assert(negated != NULL);
19126  assert(var->scip == scip);
19127 
19128  SCIP_CALL( checkStage(scip, "SCIPgetBinvarRepresentative", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
19129 
19130  /* get the active representative of the given variable */
19131  *repvar = var;
19132  *negated = FALSE;
19133  SCIP_CALL( SCIPvarGetProbvarBinary(repvar, negated) );
19134 
19135  /* negate the representative, if it corresponds to the negation of the given variable */
19136  if( *negated )
19137  {
19138  SCIP_CALL( SCIPgetNegatedVar(scip, *repvar, repvar) );
19139  }
19140 
19141  return SCIP_OKAY;
19142 }
19143 
19144 /** gets binary variables that are equal to the given binary variables, and which are either active, fixed, or
19145  * multi-aggregated, or the negated variables of active, fixed, or multi-aggregated variables
19146  *
19147  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19148  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19149  *
19150  * @pre This method can be called if @p scip is in one of the following stages:
19151  * - \ref SCIP_STAGE_PROBLEM
19152  * - \ref SCIP_STAGE_TRANSFORMED
19153  * - \ref SCIP_STAGE_INITPRESOLVE
19154  * - \ref SCIP_STAGE_PRESOLVING
19155  * - \ref SCIP_STAGE_EXITPRESOLVE
19156  * - \ref SCIP_STAGE_PRESOLVED
19157  * - \ref SCIP_STAGE_INITSOLVE
19158  * - \ref SCIP_STAGE_SOLVING
19159  * - \ref SCIP_STAGE_SOLVED
19160  * - \ref SCIP_STAGE_EXITSOLVE
19161  */
19163  SCIP* scip, /**< SCIP data structure */
19164  int nvars, /**< number of binary variables to get representatives for */
19165  SCIP_VAR** vars, /**< binary variables to get binary representatives for */
19166  SCIP_VAR** repvars, /**< array to store the binary representatives */
19167  SCIP_Bool* negated /**< array to store whether the negation of an active variable was returned */
19168  )
19169 {
19170  int v;
19171 
19172  assert(scip != NULL);
19173  assert(vars != NULL || nvars == 0);
19174  assert(repvars != NULL || nvars == 0);
19175  assert(negated != NULL || nvars == 0);
19176 
19177  SCIP_CALL( checkStage(scip, "SCIPgetBinvarRepresentatives", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
19178 
19179  if( nvars == 0 )
19180  return SCIP_OKAY;
19181 
19182  /* get the active representative of the given variable */
19183  BMScopyMemoryArray(repvars, vars, nvars);
19184  BMSclearMemoryArray(negated, nvars);
19185  SCIP_CALL( SCIPvarsGetProbvarBinary(&repvars, &negated, nvars) );
19186 
19187  /* negate the representatives, if they correspond to the negation of the given variables */
19188  for( v = nvars - 1; v >= 0; --v )
19189  if( negated[v] )
19190  {
19191  SCIP_CALL( SCIPgetNegatedVar(scip, repvars[v], &(repvars[v])) );
19192  }
19193 
19194  return SCIP_OKAY;
19195 }
19196 
19197 /** flattens aggregation graph of multi-aggregated variable in order to avoid exponential recursion later on
19198  *
19199  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19200  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19201  *
19202  * @pre This method can be called if @p scip is in one of the following stages:
19203  * - \ref SCIP_STAGE_INITPRESOLVE
19204  * - \ref SCIP_STAGE_PRESOLVING
19205  * - \ref SCIP_STAGE_EXITPRESOLVE
19206  * - \ref SCIP_STAGE_PRESOLVED
19207  * - \ref SCIP_STAGE_INITSOLVE
19208  * - \ref SCIP_STAGE_SOLVING
19209  * - \ref SCIP_STAGE_SOLVED
19210  */
19212  SCIP* scip, /**< SCIP data structure */
19213  SCIP_VAR* var /**< problem variable */
19214  )
19215 {
19216  assert( scip != NULL );
19217  assert( var != NULL );
19218  SCIP_CALL( checkStage(scip, "SCIPflattenVarAggregationGraph", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
19219 
19220  SCIP_CALL( SCIPvarFlattenAggregationGraph(var, scip->mem->probmem, scip->set) );
19221  return SCIP_OKAY;
19222 }
19223 
19224 /** Transforms a given linear sum of variables, that is a_1*x_1 + ... + a_n*x_n + c into a corresponding linear sum of
19225  * active variables, that is b_1*y_1 + ... + b_m*y_m + d.
19226  *
19227  * If the number of needed active variables is greater than the available slots in the variable array, nothing happens
19228  * except that the required size is stored in the corresponding variable (requiredsize). Otherwise, the active variable
19229  * representation is stored in the variable array, scalar array and constant.
19230  *
19231  * The reason for this approach is that we cannot reallocate memory, since we do not know how the memory has been
19232  * allocated (e.g., by a C++ 'new' or SCIP functions).
19233  *
19234  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19235  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19236  *
19237  * @pre This method can be called if @p scip is in one of the following stages:
19238  * - \ref SCIP_STAGE_TRANSFORMED
19239  * - \ref SCIP_STAGE_INITPRESOLVE
19240  * - \ref SCIP_STAGE_PRESOLVING
19241  * - \ref SCIP_STAGE_EXITPRESOLVE
19242  * - \ref SCIP_STAGE_PRESOLVED
19243  * - \ref SCIP_STAGE_INITSOLVE
19244  * - \ref SCIP_STAGE_SOLVING
19245  * - \ref SCIP_STAGE_SOLVED
19246  * - \ref SCIP_STAGE_EXITSOLVE
19247  * - \ref SCIP_STAGE_FREETRANS
19248  *
19249  * @note The resulting linear sum is stored into the given variable array, scalar array, and constant. That means the
19250  * given entries are overwritten.
19251  *
19252  * @note That method can be used to convert a single variables into variable space of active variables. Therefore call
19253  * the method with the linear sum 1.0*x + 0.0.
19254  */
19256  SCIP* scip, /**< SCIP data structure */
19257  SCIP_VAR** vars, /**< variable array x_1, ..., x_n in the linear sum which will be
19258  * overwritten by the variable array y_1, ..., y_m in the linear sum
19259  * w.r.t. active variables */
19260  SCIP_Real* scalars, /**< scalars a_1, ..., a_n in linear sum which will be overwritten to the
19261  * scalars b_1, ..., b_m in the linear sum of the active variables */
19262  int* nvars, /**< pointer to number of variables in the linear sum which will be
19263  * overwritten by the number of variables in the linear sum corresponding
19264  * to the active variables */
19265  int varssize, /**< available slots in vars and scalars array which is needed to check if
19266  * the array are large enough for the linear sum w.r.t. active
19267  * variables */
19268  SCIP_Real* constant, /**< pointer to constant c in linear sum a_1*x_1 + ... + a_n*x_n + c which
19269  * will chnage to constant d in the linear sum b_1*y_1 + ... + b_m*y_m +
19270  * d w.r.t. the active variables */
19271  int* requiredsize, /**< pointer to store the required array size for the linear sum w.r.t. the
19272  * active variables */
19273  SCIP_Bool mergemultiples /**< should multiple occurrences of a var be replaced by a single coeff? */
19274  )
19275 {
19276  assert( scip != NULL );
19277  assert( nvars != NULL );
19278  assert( vars != NULL || *nvars == 0 );
19279  assert( scalars != NULL || *nvars == 0 );
19280  assert( constant != NULL );
19281  assert( requiredsize != NULL );
19282  assert( *nvars <= varssize );
19283 
19284  SCIP_CALL( checkStage(scip, "SCIPgetProbvarLinearSum", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
19285  SCIP_CALL( SCIPvarGetActiveRepresentatives(scip->set, vars, scalars, nvars, varssize, constant, requiredsize, mergemultiples) );
19286 
19287  return SCIP_OKAY;
19288 }
19289 
19290 /** transforms given variable, scalar and constant to the corresponding active, fixed, or
19291  * multi-aggregated variable, scalar and constant; if the variable resolves to a fixed variable,
19292  * "scalar" will be 0.0 and the value of the sum will be stored in "constant"; a multi-aggregation
19293  * with only one active variable (this can happen due to fixings after the multi-aggregation),
19294  * is treated like an aggregation; if the multi-aggregation constant is infinite, "scalar" will be 0.0
19295  *
19296  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19297  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19298  *
19299  * @pre This method can be called if @p scip is in one of the following stages:
19300  * - \ref SCIP_STAGE_TRANSFORMED
19301  * - \ref SCIP_STAGE_INITPRESOLVE
19302  * - \ref SCIP_STAGE_PRESOLVING
19303  * - \ref SCIP_STAGE_EXITPRESOLVE
19304  * - \ref SCIP_STAGE_PRESOLVED
19305  * - \ref SCIP_STAGE_INITSOLVE
19306  * - \ref SCIP_STAGE_SOLVING
19307  * - \ref SCIP_STAGE_SOLVED
19308  * - \ref SCIP_STAGE_EXITSOLVE
19309  * - \ref SCIP_STAGE_FREETRANS
19310  */
19312  SCIP* scip, /**< SCIP data structure */
19313  SCIP_VAR** var, /**< pointer to problem variable x in sum a*x + c */
19314  SCIP_Real* scalar, /**< pointer to scalar a in sum a*x + c */
19315  SCIP_Real* constant /**< pointer to constant c in sum a*x + c */
19316  )
19317 {
19318  assert(scip != NULL);
19319  assert(var != NULL);
19320  assert(scalar != NULL);
19321  assert(constant != NULL);
19322 
19323  SCIP_CALL( checkStage(scip, "SCIPgetProbvarSum", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
19324  SCIP_CALL( SCIPvarGetProbvarSum(var, scip->set, scalar, constant) );
19325 
19326  return SCIP_OKAY;
19327 }
19328 
19329 /** return for given variables all their active counterparts; all active variables will be pairwise different
19330  * @note It does not hold that the first output variable is the active variable for the first input variable.
19331  *
19332  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19333  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19334  *
19335  * @pre This method can be called if @p scip is in one of the following stages:
19336  * - \ref SCIP_STAGE_TRANSFORMED
19337  * - \ref SCIP_STAGE_INITPRESOLVE
19338  * - \ref SCIP_STAGE_PRESOLVING
19339  * - \ref SCIP_STAGE_EXITPRESOLVE
19340  * - \ref SCIP_STAGE_PRESOLVED
19341  * - \ref SCIP_STAGE_INITSOLVE
19342  * - \ref SCIP_STAGE_SOLVING
19343  * - \ref SCIP_STAGE_SOLVED
19344  * - \ref SCIP_STAGE_EXITSOLVE
19345  * - \ref SCIP_STAGE_FREETRANS
19346  */
19348  SCIP* scip, /**< SCIP data structure */
19349  SCIP_VAR** vars, /**< variable array with given variables and as output all active
19350  * variables, if enough slots exist
19351  */
19352  int* nvars, /**< number of given variables, and as output number of active variables,
19353  * if enough slots exist
19354  */
19355  int varssize, /**< available slots in vars array */
19356  int* requiredsize /**< pointer to store the required array size for the active variables */
19357  )
19358 {
19359  assert(scip != NULL);
19360  assert(nvars != NULL);
19361  assert(vars != NULL || *nvars == 0);
19362  assert(varssize >= *nvars);
19363  assert(requiredsize != NULL);
19364 
19365  SCIP_CALL( checkStage(scip, "SCIPgetActiveVars", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
19366  SCIP_CALL( SCIPvarsGetActiveVars(scip->set, vars, nvars, varssize, requiredsize) );
19367 
19368  return SCIP_OKAY;
19369 }
19370 
19371 /** returns the reduced costs of the variable in the current node's LP relaxation;
19372  * the current node has to have a feasible LP.
19373  *
19374  * returns SCIP_INVALID if the variable is active but not in the current LP;
19375  * returns 0 if the variable has been aggregated out or fixed in presolving.
19376  *
19377  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
19378  *
19379  * @note The return value of this method should be used carefully if the dual feasibility check was explictely disabled.
19380  */
19382  SCIP* scip, /**< SCIP data structure */
19383  SCIP_VAR* var /**< variable to get reduced costs, should be a column in current node LP */
19384  )
19385 {
19386  assert( scip != NULL );
19387  assert( var != NULL );
19388  assert( var->scip == scip );
19389 
19390  switch( SCIPvarGetStatus(var) )
19391  {
19393  if( var->data.original.transvar == NULL )
19394  return SCIP_INVALID;
19395  return SCIPgetVarRedcost(scip, var->data.original.transvar);
19396 
19397  case SCIP_VARSTATUS_COLUMN:
19398  return SCIPgetColRedcost(scip, SCIPvarGetCol(var));
19399 
19400  case SCIP_VARSTATUS_LOOSE:
19401  return SCIP_INVALID;
19402 
19403  case SCIP_VARSTATUS_FIXED:
19407  return 0.0;
19408 
19409  default:
19410  SCIPerrorMessage("unknown variable status\n");
19411  SCIPABORT();
19412  return 0.0; /*lint !e527*/
19413  }
19414 }
19415 
19416 /** returns the implied reduced costs of the variable in the current node's LP relaxation;
19417  * the current node has to have a feasible LP.
19418  *
19419  * returns SCIP_INVALID if the variable is active but not in the current LP;
19420  * returns 0 if the variable has been aggregated out or fixed in presolving.
19421  *
19422  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
19423  *
19424  * @note The return value of this method should be used carefully if the dual feasibility check was explictely disabled.
19425  */
19427  SCIP* scip, /**< SCIP data structure */
19428  SCIP_VAR* var, /**< variable to get reduced costs, should be a column in current node LP */
19429  SCIP_Bool varfixing /**< FALSE if for x == 0, TRUE for x == 1 */
19430  )
19431 {
19432  assert( scip != NULL );
19433  assert( var != NULL );
19434  assert( var->scip == scip );
19435 
19436  switch( SCIPvarGetStatus(var) )
19437  {
19439  if( var->data.original.transvar == NULL )
19440  return SCIP_INVALID;
19441  return SCIPgetVarImplRedcost(scip, var->data.original.transvar, varfixing);
19442 
19443  case SCIP_VARSTATUS_COLUMN:
19444  return SCIPvarGetImplRedcost(var, scip->set, varfixing, scip->stat, scip->transprob, scip->lp);
19445 
19446  case SCIP_VARSTATUS_LOOSE:
19447  return SCIP_INVALID;
19448 
19449  case SCIP_VARSTATUS_FIXED:
19453  return 0.0;
19454 
19455  default:
19456  SCIPerrorMessage("unknown variable status\n");
19457  SCIPABORT();
19458  return 0.0; /*lint !e527*/
19459  }
19460 }
19461 
19462 
19463 /** returns the Farkas coefficient of the variable in the current node's LP relaxation;
19464  * the current node has to have an infeasible LP.
19465  *
19466  * returns SCIP_INVALID if the variable is active but not in the current LP;
19467  * returns 0 if the variable has been aggregated out or fixed in presolving.
19468  *
19469  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
19470  */
19472  SCIP* scip, /**< SCIP data structure */
19473  SCIP_VAR* var /**< variable to get reduced costs, should be a column in current node LP */
19474  )
19475 {
19476  assert(scip != NULL);
19477  assert(var != NULL);
19478  assert(var->scip == scip);
19479 
19480  switch( SCIPvarGetStatus(var) )
19481  {
19483  if( var->data.original.transvar == NULL )
19484  return SCIP_INVALID;
19485  return SCIPgetVarFarkasCoef(scip,var->data.original.transvar);
19486 
19487  case SCIP_VARSTATUS_COLUMN:
19488  return SCIPgetColFarkasCoef(scip,SCIPvarGetCol(var));
19489 
19490  case SCIP_VARSTATUS_LOOSE:
19491  return SCIP_INVALID;
19492 
19493  case SCIP_VARSTATUS_FIXED:
19497  return 0.0;
19498 
19499  default:
19500  SCIPerrorMessage("unknown variable status\n");
19501  SCIPABORT();
19502  return 0.0; /*lint !e527*/
19503  }
19504 }
19505 
19506 /** returns lower bound of variable directly before or after the bound change given by the bound change index
19507  * was applied
19508  */
19510  SCIP* scip, /**< SCIP data structure */
19511  SCIP_VAR* var, /**< problem variable */
19512  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node */
19513  SCIP_Bool after /**< should the bound change with given index be included? */
19514  )
19515 {
19516  SCIP_VARSTATUS varstatus;
19517  assert(var != NULL);
19518 
19519  varstatus = SCIPvarGetStatus(var);
19520 
19521  if( varstatus == SCIP_VARSTATUS_COLUMN || varstatus == SCIP_VARSTATUS_LOOSE )
19522  {
19523  if( bdchgidx == NULL )
19524  return SCIPvarGetLbLocal(var);
19525  else
19526  {
19527  SCIP_BDCHGINFO* bdchginfo;
19528 
19529  bdchginfo = SCIPvarGetLbchgInfo(var, bdchgidx, after);
19530  if( bdchginfo != NULL )
19531  return SCIPbdchginfoGetNewbound(bdchginfo);
19532  else
19533  return var->glbdom.lb;
19534  }
19535  }
19536 
19537  /* get bounds of attached variables */
19538  switch( varstatus )
19539  {
19541  assert(var->data.original.transvar != NULL);
19542  return SCIPgetVarLbAtIndex(scip, var->data.original.transvar, bdchgidx, after);
19543 
19544  case SCIP_VARSTATUS_FIXED:
19545  return var->glbdom.lb;
19546 
19547  case SCIP_VARSTATUS_AGGREGATED: /* x = a*y + c -> y = (x-c)/a */
19548  assert(var->data.aggregate.var != NULL);
19549  if( var->data.aggregate.scalar > 0.0 )
19550  {
19551  SCIP_Real lb;
19552 
19553  lb = SCIPgetVarLbAtIndex(scip, var->data.aggregate.var, bdchgidx, after);
19554 
19555  /* a > 0 -> get lower bound of y */
19556  if( SCIPisInfinity(scip, -lb) )
19557  return -SCIPinfinity(scip);
19558  else if( SCIPisInfinity(scip, lb) )
19559  return SCIPinfinity(scip);
19560  else
19561  return var->data.aggregate.scalar * lb + var->data.aggregate.constant;
19562  }
19563  else if( var->data.aggregate.scalar < 0.0 )
19564  {
19565  SCIP_Real ub;
19566 
19567  ub = SCIPgetVarUbAtIndex(scip, var->data.aggregate.var, bdchgidx, after);
19568 
19569  /* a < 0 -> get upper bound of y */
19570  if( SCIPisInfinity(scip, -ub) )
19571  return SCIPinfinity(scip);
19572  else if( SCIPisInfinity(scip, ub) )
19573  return -SCIPinfinity(scip);
19574  else
19575  return var->data.aggregate.scalar * ub + var->data.aggregate.constant;
19576  }
19577  else
19578  {
19579  SCIPerrorMessage("scalar is zero in aggregation\n");
19580  SCIPABORT();
19581  return SCIP_INVALID; /*lint !e527*/
19582  }
19583 
19585  /* handle multi-aggregated variables depending on one variable only (possibly caused by SCIPvarFlattenAggregationGraph()) */
19586  if ( var->data.multaggr.nvars == 1 )
19587  {
19588  assert(var->data.multaggr.vars != NULL);
19589  assert(var->data.multaggr.scalars != NULL);
19590  assert(var->data.multaggr.vars[0] != NULL);
19591 
19592  if( var->data.multaggr.scalars[0] > 0.0 )
19593  {
19594  SCIP_Real lb;
19595 
19596  lb = SCIPgetVarLbAtIndex(scip, var->data.multaggr.vars[0], bdchgidx, after);
19597 
19598  /* a > 0 -> get lower bound of y */
19599  if( SCIPisInfinity(scip, -lb) )
19600  return -SCIPinfinity(scip);
19601  else if( SCIPisInfinity(scip, lb) )
19602  return SCIPinfinity(scip);
19603  else
19604  return var->data.multaggr.scalars[0] * lb + var->data.multaggr.constant;
19605  }
19606  else if( var->data.multaggr.scalars[0] < 0.0 )
19607  {
19608  SCIP_Real ub;
19609 
19610  ub = SCIPgetVarUbAtIndex(scip, var->data.multaggr.vars[0], bdchgidx, after);
19611 
19612  /* a < 0 -> get upper bound of y */
19613  if( SCIPisInfinity(scip, -ub) )
19614  return SCIPinfinity(scip);
19615  else if( SCIPisInfinity(scip, ub) )
19616  return -SCIPinfinity(scip);
19617  else
19618  return var->data.multaggr.scalars[0] * ub + var->data.multaggr.constant;
19619  }
19620  else
19621  {
19622  SCIPerrorMessage("scalar is zero in multi-aggregation\n");
19623  SCIPABORT();
19624  return SCIP_INVALID; /*lint !e527*/
19625  }
19626  }
19627  SCIPerrorMessage("cannot get the bounds of a multi-aggregated variable.\n");
19628  SCIPABORT();
19629  return SCIP_INVALID; /*lint !e527*/
19630 
19631  case SCIP_VARSTATUS_NEGATED: /* x' = offset - x -> x = offset - x' */
19632  assert(var->negatedvar != NULL);
19634  assert(var->negatedvar->negatedvar == var);
19635  return var->data.negate.constant - SCIPgetVarUbAtIndex(scip, var->negatedvar, bdchgidx, after);
19636 
19637  case SCIP_VARSTATUS_COLUMN: /* for lint */
19638  case SCIP_VARSTATUS_LOOSE: /* for lint */
19639  default:
19640  SCIPerrorMessage("unknown variable status\n");
19641  SCIPABORT();
19642  return SCIP_INVALID; /*lint !e527*/
19643  }
19644 }
19645 
19646 /** returns upper bound of variable directly before or after the bound change given by the bound change index
19647  * was applied
19648  */
19650  SCIP* scip, /**< SCIP data structure */
19651  SCIP_VAR* var, /**< problem variable */
19652  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node */
19653  SCIP_Bool after /**< should the bound change with given index be included? */
19654  )
19655 {
19656  SCIP_VARSTATUS varstatus;
19657  assert(var != NULL);
19658 
19659  varstatus = SCIPvarGetStatus(var);
19660 
19661  if( varstatus == SCIP_VARSTATUS_COLUMN || varstatus == SCIP_VARSTATUS_LOOSE )
19662  {
19663  if( bdchgidx == NULL )
19664  return SCIPvarGetUbLocal(var);
19665  else
19666  {
19667  SCIP_BDCHGINFO* bdchginfo;
19668 
19669  bdchginfo = SCIPvarGetUbchgInfo(var, bdchgidx, after);
19670  if( bdchginfo != NULL )
19671  return SCIPbdchginfoGetNewbound(bdchginfo);
19672  else
19673  return var->glbdom.ub;
19674  }
19675  }
19676 
19677  /* get bounds of attached variables */
19678  switch( varstatus )
19679  {
19681  assert(var->data.original.transvar != NULL);
19682  return SCIPgetVarUbAtIndex(scip, var->data.original.transvar, bdchgidx, after);
19683 
19684  case SCIP_VARSTATUS_FIXED:
19685  return var->glbdom.ub;
19686 
19687  case SCIP_VARSTATUS_AGGREGATED: /* x = a*y + c -> y = (x-c)/a */
19688  assert(var->data.aggregate.var != NULL);
19689  if( var->data.aggregate.scalar > 0.0 )
19690  {
19691  SCIP_Real ub;
19692 
19693  ub = SCIPgetVarUbAtIndex(scip, var->data.aggregate.var, bdchgidx, after);
19694 
19695  /* a > 0 -> get lower bound of y */
19696  if( SCIPisInfinity(scip, -ub) )
19697  return -SCIPinfinity(scip);
19698  else if( SCIPisInfinity(scip, ub) )
19699  return SCIPinfinity(scip);
19700  else
19701  return var->data.aggregate.scalar * ub + var->data.aggregate.constant;
19702  }
19703  else if( var->data.aggregate.scalar < 0.0 )
19704  {
19705  SCIP_Real lb;
19706 
19707  lb = SCIPgetVarLbAtIndex(scip, var->data.aggregate.var, bdchgidx, after);
19708 
19709  /* a < 0 -> get upper bound of y */
19710  if ( SCIPisInfinity(scip, -lb) )
19711  return SCIPinfinity(scip);
19712  else if ( SCIPisInfinity(scip, lb) )
19713  return -SCIPinfinity(scip);
19714  else
19715  return var->data.aggregate.scalar * lb + var->data.aggregate.constant;
19716  }
19717  else
19718  {
19719  SCIPerrorMessage("scalar is zero in aggregation\n");
19720  SCIPABORT();
19721  return SCIP_INVALID; /*lint !e527*/
19722  }
19723 
19725  /* handle multi-aggregated variables depending on one variable only (possibly caused by SCIPvarFlattenAggregationGraph()) */
19726  if ( var->data.multaggr.nvars == 1 )
19727  {
19728  assert(var->data.multaggr.vars != NULL);
19729  assert(var->data.multaggr.scalars != NULL);
19730  assert(var->data.multaggr.vars[0] != NULL);
19731 
19732  if( var->data.multaggr.scalars[0] > 0.0 )
19733  {
19734  SCIP_Real ub;
19735 
19736  ub = SCIPgetVarUbAtIndex(scip, var->data.multaggr.vars[0], bdchgidx, after);
19737 
19738  /* a > 0 -> get lower bound of y */
19739  if ( SCIPisInfinity(scip, -ub) )
19740  return -SCIPinfinity(scip);
19741  else if ( SCIPisInfinity(scip, ub) )
19742  return SCIPinfinity(scip);
19743  else
19744  return var->data.multaggr.scalars[0] * ub + var->data.multaggr.constant;
19745  }
19746  else if( var->data.multaggr.scalars[0] < 0.0 )
19747  {
19748  SCIP_Real lb;
19749 
19750  lb = SCIPgetVarLbAtIndex(scip, var->data.multaggr.vars[0], bdchgidx, after);
19751 
19752  /* a < 0 -> get upper bound of y */
19753  if ( SCIPisInfinity(scip, -lb) )
19754  return SCIPinfinity(scip);
19755  else if ( SCIPisInfinity(scip, lb) )
19756  return -SCIPinfinity(scip);
19757  else
19758  return var->data.multaggr.scalars[0] * lb + var->data.multaggr.constant;
19759  }
19760  else
19761  {
19762  SCIPerrorMessage("scalar is zero in multi-aggregation\n");
19763  SCIPABORT();
19764  return SCIP_INVALID; /*lint !e527*/
19765  }
19766  }
19767  SCIPerrorMessage("cannot get the bounds of a multiple aggregated variable.\n");
19768  SCIPABORT();
19769  return SCIP_INVALID; /*lint !e527*/
19770 
19771  case SCIP_VARSTATUS_NEGATED: /* x' = offset - x -> x = offset - x' */
19772  assert(var->negatedvar != NULL);
19774  assert(var->negatedvar->negatedvar == var);
19775  return var->data.negate.constant - SCIPgetVarLbAtIndex(scip, var->negatedvar, bdchgidx, after);
19776 
19777  case SCIP_VARSTATUS_COLUMN: /* for lint */
19778  case SCIP_VARSTATUS_LOOSE: /* for lint */
19779  default:
19780  SCIPerrorMessage("unknown variable status\n");
19781  SCIPABORT();
19782  return SCIP_INVALID; /*lint !e527*/
19783  }
19784 }
19785 
19786 /** returns lower or upper bound of variable directly before or after the bound change given by the bound change index
19787  * was applied
19788  */
19790  SCIP* scip, /**< SCIP data structure */
19791  SCIP_VAR* var, /**< problem variable */
19792  SCIP_BOUNDTYPE boundtype, /**< type of bound: lower or upper bound */
19793  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node */
19794  SCIP_Bool after /**< should the bound change with given index be included? */
19795  )
19796 {
19797  if( boundtype == SCIP_BOUNDTYPE_LOWER )
19798  return SCIPgetVarLbAtIndex(scip, var, bdchgidx, after);
19799  else
19800  {
19801  assert(boundtype == SCIP_BOUNDTYPE_UPPER);
19802  return SCIPgetVarUbAtIndex(scip, var, bdchgidx, after);
19803  }
19804 }
19805 
19806 /** returns whether the binary variable was fixed at the time given by the bound change index */
19808  SCIP* scip, /**< SCIP data structure */
19809  SCIP_VAR* var, /**< problem variable */
19810  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node */
19811  SCIP_Bool after /**< should the bound change with given index be included? */
19812  )
19813 {
19814  assert(var != NULL);
19815  assert(SCIPvarIsBinary(var));
19816 
19817  /* check the current bounds first in order to decide at which bound change information we have to look
19818  * (which is expensive because we have to follow the aggregation tree to the active variable)
19819  */
19820  return ((SCIPvarGetLbLocal(var) > 0.5 && SCIPgetVarLbAtIndex(scip, var, bdchgidx, after) > 0.5)
19821  || (SCIPvarGetUbLocal(var) < 0.5 && SCIPgetVarUbAtIndex(scip, var, bdchgidx, after) < 0.5));
19822 }
19823 
19824 /** gets solution value for variable in current node
19825  *
19826  * @return solution value for variable in current node
19827  *
19828  * @pre This method can be called if @p scip is in one of the following stages:
19829  * - \ref SCIP_STAGE_PRESOLVED
19830  * - \ref SCIP_STAGE_SOLVING
19831  */
19833  SCIP* scip, /**< SCIP data structure */
19834  SCIP_VAR* var /**< variable to get solution value for */
19835  )
19836 {
19837  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19838  assert( var->scip == scip );
19839 
19840  return SCIPvarGetSol(var, SCIPtreeHasCurrentNodeLP(scip->tree));
19841 }
19842 
19843 /** gets solution values of multiple variables in current node
19844  *
19845  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19846  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19847  *
19848  * @pre This method can be called if @p scip is in one of the following stages:
19849  * - \ref SCIP_STAGE_PRESOLVED
19850  * - \ref SCIP_STAGE_SOLVING
19851  */
19853  SCIP* scip, /**< SCIP data structure */
19854  int nvars, /**< number of variables to get solution value for */
19855  SCIP_VAR** vars, /**< array with variables to get value for */
19856  SCIP_Real* vals /**< array to store solution values of variables */
19857  )
19858 {
19859  int v;
19860 
19861  assert(nvars == 0 || vars != NULL);
19862  assert(nvars == 0 || vals != NULL);
19863 
19864  SCIP_CALL( checkStage(scip, "SCIPgetVarSols", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19865 
19866  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
19867  {
19868  for( v = 0; v < nvars; ++v )
19869  vals[v] = SCIPvarGetLPSol(vars[v]);
19870  }
19871  else
19872  {
19873  for( v = 0; v < nvars; ++v )
19874  vals[v] = SCIPvarGetPseudoSol(vars[v]);
19875  }
19876 
19877  return SCIP_OKAY;
19878 }
19879 
19880 /** sets the solution value of all variables in the global relaxation solution to zero
19881  *
19882  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19883  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19884  *
19885  * @pre This method can be called if @p scip is in one of the following stages:
19886  * - \ref SCIP_STAGE_PRESOLVED
19887  * - \ref SCIP_STAGE_SOLVING
19888  */
19890  SCIP* scip /**< SCIP data structure */
19891  )
19892 {
19893  SCIP_VAR** vars;
19894  int nvars;
19895  int v;
19896 
19897  assert(scip != NULL);
19898 
19899  SCIP_CALL( checkStage(scip, "SCIPclearRelaxSolVals", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19900 
19901  /* the relaxation solution is already cleared */
19902  if( SCIPrelaxationIsSolZero(scip->relaxation) )
19903  return SCIP_OKAY;
19904 
19905  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, NULL, NULL, NULL, NULL) );
19906 
19907  for( v = 0; v < nvars; v++ )
19908  {
19909  SCIP_CALL( SCIPvarSetRelaxSol(vars[v], scip->set, scip->relaxation, 0.0, FALSE) );
19910  }
19911 
19912  SCIPrelaxationSetSolObj(scip->relaxation, 0.0);
19914 
19915  return SCIP_OKAY;
19916 }
19917 
19918 /** sets the value of the given variable in the global relaxation solution;
19919  * this solution can be filled by the relaxation handlers and can be used by heuristics and for separation;
19920  * You can use SCIPclearRelaxSolVals() to set all values to zero, initially;
19921  * after setting all solution values, you have to call SCIPmarkRelaxSolValid()
19922  * to inform SCIP that the stored solution is valid
19923  *
19924  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19925  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19926  *
19927  * @pre This method can be called if @p scip is in one of the following stages:
19928  * - \ref SCIP_STAGE_PRESOLVED
19929  * - \ref SCIP_STAGE_SOLVING
19930  *
19931  * @note This method incrementally updates the objective value of the relaxation solution. If the whole solution
19932  * should be updated, using SCIPsetRelaxSolVals() instead or calling SCIPclearRelaxSolVals() before setting
19933  * the first value to reset the solution and the objective value to 0 may help the numerics.
19934  */
19936  SCIP* scip, /**< SCIP data structure */
19937  SCIP_VAR* var, /**< variable to set value for */
19938  SCIP_Real val /**< solution value of variable */
19939  )
19940 {
19941  assert(scip != NULL);
19942 
19943  SCIP_CALL( checkStage(scip, "SCIPsetRelaxSolVal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19944 
19945  SCIP_CALL( SCIPvarSetRelaxSol(var, scip->set, scip->relaxation, val, TRUE) );
19946 
19947  if( val != 0.0 )
19950 
19951  return SCIP_OKAY;
19952 }
19953 
19954 /** sets the values of the given variables in the global relaxation solution and informs SCIP about the validity
19955  * and whether the solution can be enforced via linear cuts;
19956  * this solution can be filled by the relaxation handlers and can be used by heuristics and for separation;
19957  * the solution is automatically cleared, s.t. all other variables get value 0.0
19958  *
19959  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19960  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19961  *
19962  * @pre This method can be called if @p scip is in one of the following stages:
19963  * - \ref SCIP_STAGE_PRESOLVED
19964  * - \ref SCIP_STAGE_SOLVING
19965  */
19967  SCIP* scip, /**< SCIP data structure */
19968  int nvars, /**< number of variables to set relaxation solution value for */
19969  SCIP_VAR** vars, /**< array with variables to set value for */
19970  SCIP_Real* vals, /**< array with solution values of variables */
19971  SCIP_Bool includeslp /**< does the relaxator contain all cuts in the LP? */
19972  )
19973 {
19974  int v;
19975 
19976  assert(scip != NULL);
19977  assert(nvars == 0 || vars != NULL);
19978  assert(nvars == 0 || vals != NULL);
19979 
19980  SCIP_CALL( checkStage(scip, "SCIPsetRelaxSolVals", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19981 
19983 
19984  for( v = 0; v < nvars; v++ )
19985  {
19986  SCIP_CALL( SCIPvarSetRelaxSol(vars[v], scip->set, scip->relaxation, vals[v], TRUE) );
19987  }
19988 
19990  SCIPrelaxationSetSolValid(scip->relaxation, TRUE, includeslp);
19991 
19992  return SCIP_OKAY;
19993 }
19994 
19995 /** sets the values of the variables in the global relaxation solution to the values in the given primal solution
19996  * and informs SCIP about the validity and whether the solution can be enforced via linear cuts;
19997  * the relaxation solution can be filled by the relaxation handlers and might be used by heuristics and for separation
19998  *
19999  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20000  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20001  *
20002  * @pre This method can be called if @p scip is in one of the following stages:
20003  * - \ref SCIP_STAGE_PRESOLVED
20004  * - \ref SCIP_STAGE_SOLVING
20005  */
20007  SCIP* scip, /**< SCIP data structure */
20008  SCIP_SOL* sol, /**< primal relaxation solution */
20009  SCIP_Bool includeslp /**< does the relaxator contain all cuts in the LP? */
20010  )
20011 {
20012  SCIP_VAR** vars;
20013  SCIP_Real* vals;
20014  int nvars;
20015  int v;
20016 
20017  assert(scip != NULL);
20018 
20019  SCIP_CALL( checkStage(scip, "SCIPsetRelaxSolValsSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20020 
20021  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, NULL, NULL, NULL, NULL) );
20022 
20023  /* alloc buffer array for solution values of the variables and get the values */
20024  SCIP_CALL( SCIPallocBufferArray(scip, &vals, nvars) );
20025  SCIP_CALL( SCIPgetSolVals(scip, sol, nvars, vars, vals) );
20026 
20028 
20029  for( v = 0; v < nvars; v++ )
20030  {
20031  SCIP_CALL( SCIPvarSetRelaxSol(vars[v], scip->set, scip->relaxation, vals[v], FALSE) );
20032  }
20033 
20034  SCIPrelaxationSetSolObj(scip->relaxation, SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
20035 
20037  SCIPrelaxationSetSolValid(scip->relaxation, TRUE, includeslp);
20038 
20039  SCIPfreeBufferArray(scip, &vals);
20040 
20041  return SCIP_OKAY;
20042 }
20043 
20044 /** returns whether the relaxation solution is valid
20045  *
20046  * @return TRUE, if the relaxation solution is valid; FALSE, otherwise
20047  *
20048  * @pre This method can be called if @p scip is in one of the following stages:
20049  * - \ref SCIP_STAGE_PRESOLVED
20050  * - \ref SCIP_STAGE_SOLVING
20051  */
20053  SCIP* scip /**< SCIP data structure */
20054  )
20055 {
20056  assert(scip != NULL);
20057 
20058  SCIP_CALL_ABORT( checkStage(scip, "SCIPisRelaxSolValid", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20059 
20060  return SCIPrelaxationIsSolValid(scip->relaxation);
20061 }
20062 
20063 /** informs SCIP that the relaxation solution is valid and whether the relaxation can be enforced through linear cuts
20064  *
20065  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20066  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20067  *
20068  * @pre This method can be called if @p scip is in one of the following stages:
20069  * - \ref SCIP_STAGE_PRESOLVED
20070  * - \ref SCIP_STAGE_SOLVING
20071  */
20073  SCIP* scip, /**< SCIP data structure */
20074  SCIP_Bool includeslp /**< does the relaxator contain all cuts in the LP? */
20075  )
20076 {
20077  assert(scip != NULL);
20078 
20079  SCIP_CALL( checkStage(scip, "SCIPmarkRelaxSolValid", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20080 
20081  SCIPrelaxationSetSolValid(scip->relaxation, TRUE, includeslp);
20082 
20083  return SCIP_OKAY;
20084 }
20085 
20086 /** informs SCIP, that the relaxation solution is invalid
20087  *
20088  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20089  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20090  *
20091  * @pre This method can be called if @p scip is in one of the following stages:
20092  * - \ref SCIP_STAGE_PRESOLVED
20093  * - \ref SCIP_STAGE_SOLVING
20094  */
20096  SCIP* scip /**< SCIP data structure */
20097  )
20098 {
20099  assert(scip != NULL);
20100 
20101  SCIP_CALL( checkStage(scip, "SCIPmarkRelaxSolInvalid", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20102 
20104 
20105  return SCIP_OKAY;
20106 }
20107 
20108 /** gets the relaxation solution value of the given variable
20109  *
20110  * @return the relaxation solution value of the given variable
20111  *
20112  * @pre This method can be called if @p scip is in one of the following stages:
20113  * - \ref SCIP_STAGE_PRESOLVED
20114  * - \ref SCIP_STAGE_SOLVING
20115  */
20117  SCIP* scip, /**< SCIP data structure */
20118  SCIP_VAR* var /**< variable to get value for */
20119  )
20120 {
20121  assert(scip != NULL);
20122  assert(var != NULL);
20123  assert(var->scip == scip);
20124 
20125  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRelaxSolVal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20126 
20127  if( !SCIPrelaxationIsSolValid(scip->relaxation) )
20128  {
20129  SCIPerrorMessage("Relaxation Solution is not valid!\n");
20130  SCIPABORT();
20131  return SCIP_INVALID; /*lint !e527*/
20132  }
20133 
20134  return SCIPvarGetRelaxSol(var, scip->set);
20135 }
20136 
20137 /** gets the relaxation solution objective value
20138  *
20139  * @return the objective value of the relaxation solution
20140  *
20141  * @pre This method can be called if @p scip is in one of the following stages:
20142  * - \ref SCIP_STAGE_PRESOLVED
20143  * - \ref SCIP_STAGE_SOLVING
20144  */
20146  SCIP* scip /**< SCIP data structure */
20147  )
20148 {
20149  assert(scip != NULL);
20150 
20151  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRelaxSolObj", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20152 
20153  if( !SCIPrelaxationIsSolValid(scip->relaxation) )
20154  {
20155  SCIPerrorMessage("Relaxation Solution is not valid!\n");
20156  SCIPABORT();
20157  return SCIP_INVALID; /*lint !e527*/
20158  }
20159 
20160  return SCIPrelaxationGetSolObj(scip->relaxation);
20161 }
20162 
20163 /** start strong branching - call before any strong branching
20164  *
20165  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20166  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20167  *
20168  * @pre This method can be called if @p scip is in one of the following stages:
20169  * - \ref SCIP_STAGE_PRESOLVED
20170  * - \ref SCIP_STAGE_SOLVING
20171  *
20172  * @note if propagation is enabled, strong branching is not done directly on the LP, but probing nodes are created
20173  * which allow to perform propagation but also creates some overhead
20174  */
20176  SCIP* scip, /**< SCIP data structure */
20177  SCIP_Bool enablepropagation /**< should propagation be done before solving the strong branching LP? */
20178  )
20179 {
20180  assert( scip != NULL );
20181  SCIP_CALL( checkStage(scip, "SCIPstartStrongbranch", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20182 
20183  assert(!SCIPinProbing(scip));
20184 
20185  SCIPdebugMsg(scip, "starting strong branching mode%s: lpcount=%" SCIP_LONGINT_FORMAT "\n", enablepropagation ? " with propagation" : "", scip->stat->lpcount - scip->stat->nsbdivinglps);
20186 
20187  /* start probing mode to allow propagation before solving the strong branching LPs; if no propagation should be done,
20188  * start the strong branching mode in the LP interface
20189  */
20190  if( enablepropagation )
20191  {
20192  if( SCIPtreeProbing(scip->tree) )
20193  {
20194  SCIPerrorMessage("cannot start strong branching with propagation while in probing mode\n");
20195  return SCIP_INVALIDCALL;
20196  }
20197 
20198  if( scip->lp != NULL && SCIPlpDiving(scip->lp) )
20199  {
20200  SCIPerrorMessage("cannot start strong branching with propagation while in diving mode\n");
20201  return SCIP_INVALIDCALL;
20202  }
20203 
20204  /* other then in SCIPstartProbing(), we do not disable collecting variable statistics during strong branching;
20205  * we cannot disable it, because the pseudo costs would not be updated, otherwise,
20206  * and reliability branching would end up doing strong branching all the time
20207  */
20208  SCIP_CALL( SCIPtreeStartProbing(scip->tree, scip->mem->probmem, scip->set, scip->lp, scip->relaxation, scip->transprob, TRUE) );
20209 
20210  /* inform the LP that the current probing mode is used for strong branching */
20212 
20213  }
20214  else
20215  {
20217  }
20218 
20219  /* reset local strong branching info */
20221 
20222  return SCIP_OKAY;
20223 }
20224 
20225 /** end strong branching - call after any strong branching
20226  *
20227  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20228  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20229  *
20230  * @pre This method can be called if @p scip is in one of the following stages:
20231  * - \ref SCIP_STAGE_PRESOLVED
20232  * - \ref SCIP_STAGE_SOLVING
20233  */
20235  SCIP* scip /**< SCIP data structure */
20236  )
20237 {
20238  assert( scip != NULL );
20239 
20240  SCIP_CALL( checkStage(scip, "SCIPendStrongbranch", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20241 
20242  /* depending on whether the strong branching mode was started with propagation enabled or not, we end the strong
20243  * branching probing mode or the LP strong branching mode
20244  */
20245  if( SCIPtreeProbing(scip->tree) )
20246  {
20247  SCIP_NODE* node;
20248  SCIP_DOMCHG* domchg;
20249  SCIP_VAR** boundchgvars;
20250  SCIP_Real* bounds;
20251  SCIP_BOUNDTYPE* boundtypes;
20252  int nboundchgs;
20253  int nbnds;
20254  int i;
20255 
20256  /* collect all bound changes deducted during probing, which were applied at the probing root and apply them to the
20257  * focusnode
20258  */
20259  node = SCIPgetCurrentNode(scip);
20260  assert(SCIPnodeGetType(node) == SCIP_NODETYPE_PROBINGNODE);
20261  assert(SCIPgetProbingDepth(scip) == 0);
20262 
20263  domchg = SCIPnodeGetDomchg(node);
20264  nboundchgs = SCIPdomchgGetNBoundchgs(domchg);
20265 
20266  SCIP_CALL( SCIPallocBufferArray(scip, &boundchgvars, nboundchgs) );
20267  SCIP_CALL( SCIPallocBufferArray(scip, &bounds, nboundchgs) );
20268  SCIP_CALL( SCIPallocBufferArray(scip, &boundtypes, nboundchgs) );
20269 
20270  for( i = 0, nbnds = 0; i < nboundchgs; ++i )
20271  {
20272  SCIP_BOUNDCHG* boundchg;
20273 
20274  boundchg = SCIPdomchgGetBoundchg(domchg, i);
20275 
20276  /* ignore redundant bound changes */
20277  if( SCIPboundchgIsRedundant(boundchg) )
20278  continue;
20279 
20280  boundchgvars[nbnds] = SCIPboundchgGetVar(boundchg);
20281  bounds[nbnds] = SCIPboundchgGetNewbound(boundchg);
20282  boundtypes[nbnds] = SCIPboundchgGetBoundtype(boundchg);
20283  ++nbnds;
20284  }
20285 
20286  SCIPdebugMsg(scip, "ending strong branching with probing: %d bound changes collected\n", nbnds);
20287 
20288  /* inform the LP that the probing mode is not used for strong branching anymore */
20290 
20291  /* switch back from probing to normal operation mode and restore variables and constraints to focus node */
20292  SCIP_CALL( SCIPtreeEndProbing(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
20293  scip->transprob, scip->origprob, scip->lp, scip->relaxation, scip->primal,
20294  scip->branchcand, scip->eventqueue, scip->eventfilter, scip->cliquetable) );
20295 
20296  /* apply the collected bound changes */
20297  for( i = 0; i < nbnds; ++i )
20298  {
20299  if( boundtypes[i] == SCIP_BOUNDTYPE_LOWER )
20300  {
20301  SCIPdebugMsg(scip, "apply probing lower bound change <%s> >= %.9g\n", SCIPvarGetName(boundchgvars[i]), bounds[i]);
20302  SCIP_CALL( SCIPchgVarLb(scip, boundchgvars[i], bounds[i]) );
20303  }
20304  else
20305  {
20306  SCIPdebugMsg(scip, "apply probing upper bound change <%s> <= %.9g\n", SCIPvarGetName(boundchgvars[i]), bounds[i]);
20307  SCIP_CALL( SCIPchgVarUb(scip, boundchgvars[i], bounds[i]) );
20308  }
20309  }
20310 
20311  SCIPfreeBufferArray(scip, &boundtypes);
20312  SCIPfreeBufferArray(scip, &bounds);
20313  SCIPfreeBufferArray(scip, &boundchgvars);
20314  }
20315  else
20316  {
20317  SCIPdebugMsg(scip, "ending strong branching\n");
20318 
20320  }
20321 
20322  return SCIP_OKAY;
20323 }
20324 
20325 /** analyze the strong branching for the given variable; that includes conflict analysis for infeasible branches and
20326  * storing of root reduced cost information
20327  */
20328 static
20330  SCIP* scip, /**< SCIP data structure */
20331  SCIP_VAR* var, /**< variable to analyze */
20332  SCIP_Bool* downinf, /**< pointer to store whether the downwards branch is infeasible, or NULL */
20333  SCIP_Bool* upinf, /**< pointer to store whether the upwards branch is infeasible, or NULL */
20334  SCIP_Bool* downconflict, /**< pointer to store whether a conflict constraint was created for an
20335  * infeasible downwards branch, or NULL */
20336  SCIP_Bool* upconflict /**< pointer to store whether a conflict constraint was created for an
20337  * infeasible upwards branch, or NULL */
20338  )
20339 {
20340  SCIP_COL* col;
20341  SCIP_Bool downcutoff;
20342  SCIP_Bool upcutoff;
20343 
20344  col = SCIPvarGetCol(var);
20345  assert(col != NULL);
20346 
20347  downcutoff = col->sbdownvalid && SCIPsetIsGE(scip->set, col->sbdown, scip->lp->cutoffbound);
20348  upcutoff = col->sbupvalid && SCIPsetIsGE(scip->set, col->sbup, scip->lp->cutoffbound);
20349 
20350  if( downinf != NULL )
20351  *downinf = downcutoff;
20352  if( upinf != NULL )
20353  *upinf = upcutoff;
20354 
20355  /* analyze infeasible strong branching sub problems:
20356  * because the strong branching's bound change is necessary for infeasibility, it cannot be undone;
20357  * therefore, infeasible strong branchings on non-binary variables will not produce a valid conflict constraint
20358  */
20359  if( scip->set->conf_enable && scip->set->conf_usesb && scip->set->nconflicthdlrs > 0
20360  && SCIPvarIsBinary(var) && SCIPtreeGetCurrentDepth(scip->tree) > 0 )
20361  {
20362  if( (downcutoff && SCIPsetFeasCeil(scip->set, col->primsol-1.0) >= col->lb - 0.5)
20363  || (upcutoff && SCIPsetFeasFloor(scip->set, col->primsol+1.0) <= col->ub + 0.5) )
20364  {
20365  assert(downconflict != NULL);
20366  assert(upconflict != NULL);
20367  SCIP_CALL( SCIPconflictAnalyzeStrongbranch(scip->conflict, scip->conflictstore, scip->mem->probmem, scip->set, scip->stat,
20368  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, col, downconflict, upconflict) );
20369  }
20370  }
20371 
20372  /* the strong branching results can be used to strengthen the root reduced cost information which is used for example
20373  * to propagate against the cutoff bound
20374  *
20375  * @note Ignore the results if the LP solution of the down (up) branch LP is smaller which should not happened by
20376  * theory but can arise due to numerical issues.
20377  */
20378  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 && SCIPvarIsBinary(var) && SCIPlpIsDualReliable(scip->lp) )
20379  {
20380  SCIP_Real lpobjval;
20381 
20382  assert(SCIPgetLPSolstat(scip) == SCIP_LPSOLSTAT_OPTIMAL);
20383 
20384  lpobjval = SCIPlpGetObjval(scip->lp, scip->set, scip->transprob);
20385 
20386  if( col->sbdownvalid && SCIPsetFeasCeil(scip->set, col->primsol-1.0) >= col->lb - 0.5 && lpobjval < col->sbdown )
20387  SCIPvarUpdateBestRootSol(var, scip->set, SCIPvarGetUbGlobal(var), -(col->sbdown - lpobjval), lpobjval);
20388  if( col->sbupvalid && SCIPsetFeasFloor(scip->set, col->primsol+1.0) <= col->ub + 0.5 && lpobjval < col->sbup )
20389  SCIPvarUpdateBestRootSol(var, scip->set, SCIPvarGetLbGlobal(var), col->sbup - lpobjval, lpobjval);
20390  }
20391 
20392  return SCIP_OKAY;
20393 }
20394 
20395 /** gets strong branching information on column variable with fractional value
20396  *
20397  * Before calling this method, the strong branching mode must have been activated by calling SCIPstartStrongbranch();
20398  * after strong branching was done for all candidate variables, the strong branching mode must be ended by
20399  * SCIPendStrongbranch(). Since this method does not apply domain propagation before strongbranching,
20400  * propagation should not be enabled in the SCIPstartStrongbranch() call.
20401  *
20402  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20403  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20404  *
20405  * @pre This method can be called if @p scip is in one of the following stages:
20406  * - \ref SCIP_STAGE_PRESOLVED
20407  * - \ref SCIP_STAGE_SOLVING
20408  */
20410  SCIP* scip, /**< SCIP data structure */
20411  SCIP_VAR* var, /**< variable to get strong branching values for */
20412  int itlim, /**< iteration limit for strong branchings */
20413  SCIP_Real* down, /**< stores dual bound after branching column down */
20414  SCIP_Real* up, /**< stores dual bound after branching column up */
20415  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
20416  * otherwise, it can only be used as an estimate value */
20417  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
20418  * otherwise, it can only be used as an estimate value */
20419  SCIP_Bool* downinf, /**< pointer to store whether the downwards branch is infeasible, or NULL */
20420  SCIP_Bool* upinf, /**< pointer to store whether the upwards branch is infeasible, or NULL */
20421  SCIP_Bool* downconflict, /**< pointer to store whether a conflict constraint was created for an
20422  * infeasible downwards branch, or NULL */
20423  SCIP_Bool* upconflict, /**< pointer to store whether a conflict constraint was created for an
20424  * infeasible upwards branch, or NULL */
20425  SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred or the
20426  * solving process should be stopped (e.g., due to a time limit) */
20427  )
20428 {
20429  SCIP_COL* col;
20430 
20431  assert(scip != NULL);
20432  assert(var != NULL);
20433  assert(lperror != NULL);
20434  assert(!SCIPtreeProbing(scip->tree)); /* we should not be in strong branching with propagation mode */
20435  assert(var->scip == scip);
20436 
20437  SCIP_CALL( checkStage(scip, "SCIPgetVarStrongbranchFrac", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20438 
20439  if( downvalid != NULL )
20440  *downvalid = FALSE;
20441  if( upvalid != NULL )
20442  *upvalid = FALSE;
20443  if( downinf != NULL )
20444  *downinf = FALSE;
20445  if( upinf != NULL )
20446  *upinf = FALSE;
20447  if( downconflict != NULL )
20448  *downconflict = FALSE;
20449  if( upconflict != NULL )
20450  *upconflict = FALSE;
20451 
20453  {
20454  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
20455  return SCIP_INVALIDDATA;
20456  }
20457 
20458  col = SCIPvarGetCol(var);
20459  assert(col != NULL);
20460 
20461  if( !SCIPcolIsInLP(col) )
20462  {
20463  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
20464  return SCIP_INVALIDDATA;
20465  }
20466 
20467  /* check if the solving process should be aborted */
20468  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
20469  {
20470  /* mark this as if the LP failed */
20471  *lperror = TRUE;
20472  return SCIP_OKAY;
20473  }
20474 
20475  /* call strong branching for column with fractional value */
20476  SCIP_CALL( SCIPcolGetStrongbranch(col, FALSE, scip->set, scip->stat, scip->transprob, scip->lp, itlim,
20477  down, up, downvalid, upvalid, lperror) );
20478 
20479  /* check, if the branchings are infeasible; in exact solving mode, we cannot trust the strong branching enough to
20480  * declare the sub nodes infeasible
20481  */
20482  if( !(*lperror) && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->set->misc_exactsolve )
20483  {
20484  SCIP_CALL( analyzeStrongbranch(scip, var, downinf, upinf, downconflict, upconflict) );
20485  }
20486 
20487  return SCIP_OKAY;
20488 }
20489 
20490 /** create, solve, and evaluate a single strong branching child (for strong branching with propagation) */
20491 static
20493  SCIP* scip, /**< SCIP data structure */
20494  SCIP_VAR* var, /**< variable to get strong branching values for */
20495  SCIP_Bool down, /**< do we regard the down child? */
20496  SCIP_Bool firstchild, /**< is this the first of the two strong branching children? */
20497  SCIP_Bool propagate, /**< should domain propagation be performed? */
20498  SCIP_Real newbound, /**< new bound to apply at the strong branching child */
20499  int itlim, /**< iteration limit for strong branchings */
20500  int maxproprounds, /**< maximum number of propagation rounds (-1: no limit, -2: parameter
20501  * settings) */
20502  SCIP_Real* value, /**< stores dual bound for strong branching child */
20503  SCIP_Bool* valid, /**< stores whether the returned value is a valid dual bound, or NULL;
20504  * otherwise, it can only be used as an estimate value */
20505  SCIP_Longint* ndomreductions, /**< pointer to store the number of domain reductions found, or NULL */
20506  SCIP_Bool* conflict, /**< pointer to store whether a conflict constraint was created for an
20507  * infeasible strong branching child, or NULL */
20508  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred or the
20509  * solving process should be stopped (e.g., due to a time limit) */
20510  SCIP_VAR** vars, /**< active problem variables */
20511  int nvars, /**< number of active problem variables */
20512  SCIP_Real* newlbs, /**< array to store valid lower bounds for all active variables, or NULL */
20513  SCIP_Real* newubs, /**< array to store valid upper bounds for all active variables, or NULL */
20514  SCIP_Bool* foundsol, /**< pointer to store whether a primal solution was found during strong branching */
20515  SCIP_Bool* cutoff /**< pointer to store whether the strong branching child is infeasible */
20516  )
20517 {
20518  SCIP_Longint ndomreds;
20519 
20520  assert(value != NULL);
20521  assert(foundsol != NULL);
20522  assert(cutoff != NULL);
20523  assert(valid != NULL ? !(*valid) : TRUE);
20524 
20525  *foundsol = FALSE;
20526 
20527  /* check whether the strong branching child is already infeasible due to the bound change */
20528  if( down )
20529  {
20530  /* the down branch is infeasible due to the branching bound change; since this means that solval is not within the
20531  * bounds, this should only happen if previous strong branching calls on other variables detected bound changes which
20532  * are valid for and were already applied at the probing root
20533  */
20534  if( newbound < SCIPvarGetLbLocal(var) - 0.5 )
20535  {
20536  *value = SCIPinfinity(scip);
20537 
20538  if( valid != NULL )
20539  *valid = TRUE;
20540 
20541  /* bound changes are applied in SCIPendStrongbranch(), which can be seen as a conflict constraint */
20542  if( conflict != NULL )
20543  *conflict = TRUE;
20544 
20545  *cutoff = TRUE;
20546 
20547  return SCIP_OKAY;
20548  }
20549  }
20550  else
20551  {
20552  /* the up branch is infeasible due to the branching bound change; since this means that solval is not within the
20553  * bounds, this should only happen if previous strong branching calls on other variables detected bound changes which
20554  * are valid for and were already applied at the probing root
20555  */
20556  if( newbound > SCIPvarGetUbLocal(var) + 0.5 )
20557  {
20558  *value = SCIPinfinity(scip);
20559 
20560  if( valid != NULL )
20561  *valid = TRUE;
20562 
20563  /* bound changes are applied in SCIPendStrongbranch(), which can be seen as a conflict constraint */
20564  if( conflict != NULL )
20565  *conflict = TRUE;
20566 
20567  *cutoff = TRUE;
20568 
20569  return SCIP_OKAY;
20570  }
20571  }
20572 
20573  /* we need to ensure that we can create at least one new probing node without exceeding the maximal tree depth */
20575  {
20576  /* create a new probing node for the strong branching child and apply the new bound for the variable */
20577  SCIP_CALL( SCIPnewProbingNode(scip) );
20578 
20579  if( down )
20580  {
20581  assert(SCIPisGE(scip, newbound, SCIPvarGetLbLocal(var)));
20582  if( SCIPisLT(scip, newbound, SCIPvarGetUbLocal(var)) )
20583  {
20584  SCIP_CALL( SCIPchgVarUbProbing(scip, var, newbound) );
20585  }
20586  }
20587  else
20588  {
20589  assert(SCIPisLE(scip, newbound, SCIPvarGetUbLocal(var)));
20590  if( SCIPisGT(scip, newbound, SCIPvarGetLbLocal(var)) )
20591  {
20592  SCIP_CALL( SCIPchgVarLbProbing(scip, var, newbound) );
20593  }
20594  }
20595  }
20596  else
20597  {
20598  if( valid != NULL )
20599  *valid = FALSE;
20600 
20601  if( cutoff != NULL ) /*lint !e774*/
20602  *cutoff = FALSE;
20603 
20604  if( conflict != NULL )
20605  *conflict = FALSE;
20606 
20607  return SCIP_OKAY;
20608  }
20609 
20610  /* propagate domains at the probing node */
20611  if( propagate )
20612  {
20613  /* start time measuring */
20614  SCIPclockStart(scip->stat->strongpropclock, scip->set);
20615 
20616  ndomreds = 0;
20617  SCIP_CALL( SCIPpropagateProbing(scip, maxproprounds, cutoff, &ndomreds) );
20618 
20619  /* store number of domain reductions in strong branching */
20620  if( down )
20621  SCIPstatAdd(scip->stat, scip->set, nsbdowndomchgs, ndomreds);
20622  else
20623  SCIPstatAdd(scip->stat, scip->set, nsbupdomchgs, ndomreds);
20624 
20625  if( ndomreductions != NULL )
20626  *ndomreductions = ndomreds;
20627 
20628  /* stop time measuring */
20629  SCIPclockStop(scip->stat->strongpropclock, scip->set);
20630 
20631  if( *cutoff )
20632  {
20633  *value = SCIPinfinity(scip);
20634 
20635  if( valid != NULL )
20636  *valid = TRUE;
20637 
20638  SCIPdebugMsg(scip, "%s branch of var <%s> detected infeasible during propagation\n",
20639  down ? "down" : "up", SCIPvarGetName(var));
20640  }
20641  }
20642 
20643  /* if propagation did not already detect infeasibility, solve the probing LP */
20644  if( !(*cutoff) )
20645  {
20646  SCIP_CALL( SCIPsolveProbingLP(scip, itlim, lperror, cutoff) );
20647  assert(SCIPisLPRelax(scip));
20648 
20649  if( *cutoff )
20650  {
20651  assert(!(*lperror));
20652 
20653  *value = SCIPinfinity(scip);
20654 
20655  if( valid != NULL )
20656  *valid = TRUE;
20657 
20658  SCIPdebugMsg(scip, "%s branch of var <%s> detected infeasible in LP solving: status=%d\n",
20659  down ? "down" : "up", SCIPvarGetName(var), SCIPgetLPSolstat(scip));
20660  }
20661  else if( !(*lperror) )
20662  {
20663  /* save the lp solution status */
20664  scip->stat->lastsblpsolstats[down ? 0 : 1] = SCIPgetLPSolstat(scip);
20665 
20666  switch( SCIPgetLPSolstat(scip) )
20667  {
20669  {
20670  SCIP_Longint oldnbestsolsfound = scip->primal->nbestsolsfound;
20671  *value = SCIPgetLPObjval(scip);
20672  assert(SCIPisLT(scip, *value, SCIPgetCutoffbound(scip)));
20673 
20674  SCIPdebugMsg(scip, "probing LP solved to optimality, objective value: %16.9g\n", *value);
20675 
20676  if( valid != NULL )
20677  *valid = TRUE;
20678 
20679  /* check the strong branching LP solution for feasibility */
20680  if( scip->set->branch_checksbsol )
20681  {
20682  SCIP_SOL* sol;
20683  SCIP_Bool rounded = TRUE;
20684 
20685  /* start clock for strong branching solutions */
20686  SCIPclockStart(scip->stat->sbsoltime, scip->set);
20687 
20688  SCIP_CALL( SCIPcreateLPSol(scip, &sol, NULL) );
20689 
20690  /* try to round the strong branching solution */
20691  if( scip->set->branch_roundsbsol )
20692  {
20693  SCIP_CALL( SCIProundSol(scip, sol, &rounded) );
20694  }
20695 
20696  /* check the solution for feasibility if rounding worked well (or was not tried) */
20697  if( rounded )
20698  {
20699  SCIP_CALL( SCIPtrySolFree(scip, &sol, FALSE, FALSE, FALSE, TRUE, FALSE, foundsol) );
20700  }
20701  else
20702  {
20703  SCIP_CALL( SCIPfreeSol(scip, &sol) );
20704  }
20705 
20706  if( *foundsol )
20707  {
20708  SCIPdebugMsg(scip, "found new solution in strong branching\n");
20709 
20710  scip->stat->nsbsolsfound++;
20711 
20712  if( scip->primal->nbestsolsfound != oldnbestsolsfound )
20713  {
20714  scip->stat->nsbbestsolsfound++;
20715  }
20716 
20717  if( SCIPisGE(scip, *value, SCIPgetCutoffbound(scip)) )
20718  *cutoff = TRUE;
20719  }
20720 
20721  /* stop clock for strong branching solutions */
20722  SCIPclockStop(scip->stat->sbsoltime, scip->set);
20723  }
20724 
20725  break;
20726  }
20728  ++scip->stat->nsbtimesiterlimhit;
20729  /*lint -fallthrough*/
20731  {
20732  /* use LP value as estimate */
20733  SCIP_LPI* lpi;
20734  SCIP_Real objval;
20735  SCIP_Real looseobjval;
20736 
20737  SCIPdebugMsg(scip, "probing LP hit %s limit\n", SCIPgetLPSolstat(scip) == SCIP_LPSOLSTAT_ITERLIMIT ? "iteration" : "time");
20738 
20739  /* we access the LPI directly, because when a time limit was hit, we cannot access objective value and dual
20740  * feasibility using the SCIPlp... methods; we should try to avoid direct calls to the LPI, but this is rather
20741  * uncritical here, because we are immediately after the SCIPsolveProbingLP() call, because we access the LPI
20742  * read-only, and we check SCIPlpiWasSolved() first
20743  */
20744  SCIP_CALL( SCIPgetLPI(scip, &lpi) );
20745 
20746  if( SCIPlpiWasSolved(lpi) )
20747  {
20748  SCIP_CALL( SCIPlpiGetObjval(lpi, &objval) );
20749  looseobjval = SCIPlpGetLooseObjval(scip->lp, scip->set, scip->transprob);
20750 
20751  /* the infinity value in the LPI should not be smaller than SCIP's infinity value */
20752  assert(!SCIPlpiIsInfinity(lpi, objval) || SCIPisInfinity(scip, objval));
20753 
20754  /* we use SCIP's infinity value here because a value larger than this is counted as infeasible by SCIP */
20755  if( SCIPisInfinity(scip, objval) )
20756  *value = SCIPinfinity(scip);
20757  else if( SCIPisInfinity(scip, -looseobjval) )
20758  *value = -SCIPinfinity(scip);
20759  else
20760  *value = objval + looseobjval;
20761 
20762  if( SCIPlpiIsDualFeasible(lpi) )
20763  {
20764  if( valid != NULL )
20765  *valid = TRUE;
20766 
20767  if( SCIPisGE(scip, *value, SCIPgetCutoffbound(scip)) )
20768  *cutoff = TRUE;
20769  }
20770  }
20771  break;
20772  }
20773  case SCIP_LPSOLSTAT_ERROR:
20775  *lperror = TRUE;
20776  break;
20777  case SCIP_LPSOLSTAT_NOTSOLVED: /* should only be the case for *cutoff = TRUE or *lperror = TRUE */
20778  case SCIP_LPSOLSTAT_OBJLIMIT: /* in this case, *cutoff should be TRUE and we should not get here */
20779  case SCIP_LPSOLSTAT_INFEASIBLE: /* in this case, *cutoff should be TRUE and we should not get here */
20780  default:
20781  SCIPerrorMessage("invalid LP solution status <%d>\n", SCIPgetLPSolstat(scip));
20782  return SCIP_INVALIDDATA;
20783  } /*lint !e788*/
20784  }
20785 
20786  /* If columns are missing in the LP, the cutoff flag may be wrong. Therefore, we need to set it and the valid pointer
20787  * to false here.
20788  */
20789  if( (*cutoff) && !SCIPallColsInLP(scip) )
20790  {
20791  *cutoff = FALSE;
20792  }
20793 
20794 #ifndef NDEBUG
20795  if( *lperror )
20796  {
20797  SCIPdebugMsg(scip, "error during strong branching probing LP solving: status=%d\n", SCIPgetLPSolstat(scip));
20798  }
20799 #endif
20800  }
20801 
20802 
20803  /* if the subproblem was feasible, we store the local bounds of the variables after propagation and (possibly)
20804  * conflict analysis
20805  * @todo do this after propagation? should be able to get valid bounds more often, but they might be weaker
20806  */
20807  if( !(*cutoff) && newlbs != NULL)
20808  {
20809  int v;
20810 
20811  assert(newubs != NULL);
20812 
20813  /* initialize the newlbs and newubs to the current local bounds */
20814  if( firstchild )
20815  {
20816  for( v = 0; v < nvars; ++v )
20817  {
20818  newlbs[v] = SCIPvarGetLbLocal(vars[v]);
20819  newubs[v] = SCIPvarGetUbLocal(vars[v]);
20820  }
20821  }
20822  /* update newlbs and newubs: take the weaker of the already stored bounds and the current local bounds */
20823  else
20824  {
20825  for( v = 0; v < nvars; ++v )
20826  {
20827  SCIP_Real lb = SCIPvarGetLbLocal(vars[v]);
20828  SCIP_Real ub = SCIPvarGetUbLocal(vars[v]);
20829 
20830  newlbs[v] = MIN(newlbs[v], lb);
20831  newubs[v] = MAX(newubs[v], ub);
20832  }
20833  }
20834  }
20835 
20836  /* revert all changes at the probing node */
20837  SCIP_CALL( SCIPbacktrackProbing(scip, 0) );
20838 
20839  return SCIP_OKAY;
20840 }
20841 
20842 /** gets strong branching information with previous domain propagation on column variable
20843  *
20844  * Before calling this method, the strong branching mode must have been activated by calling SCIPstartStrongbranch();
20845  * after strong branching was done for all candidate variables, the strong branching mode must be ended by
20846  * SCIPendStrongbranch(). Since this method applies domain propagation before strongbranching, propagation has to be be
20847  * enabled in the SCIPstartStrongbranch() call.
20848  *
20849  * Before solving the strong branching LP, domain propagation can be performed. The number of propagation rounds
20850  * can be specified by the parameter @p maxproprounds.
20851  *
20852  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20853  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20854  *
20855  * @pre This method can be called if @p scip is in one of the following stages:
20856  * - \ref SCIP_STAGE_PRESOLVED
20857  * - \ref SCIP_STAGE_SOLVING
20858  *
20859  * @warning When using this method, LP banching candidates and solution values must be copied beforehand, because
20860  * they are updated w.r.t. the strong branching LP solution.
20861  */
20863  SCIP* scip, /**< SCIP data structure */
20864  SCIP_VAR* var, /**< variable to get strong branching values for */
20865  SCIP_Real solval, /**< value of the variable in the current LP solution */
20866  SCIP_Real lpobjval, /**< LP objective value of the current LP solution */
20867  int itlim, /**< iteration limit for strong branchings */
20868  int maxproprounds, /**< maximum number of propagation rounds (-1: no limit, -2: parameter
20869  * settings) */
20870  SCIP_Real* down, /**< stores dual bound after branching column down */
20871  SCIP_Real* up, /**< stores dual bound after branching column up */
20872  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
20873  * otherwise, it can only be used as an estimate value */
20874  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
20875  * otherwise, it can only be used as an estimate value */
20876  SCIP_Longint* ndomredsdown, /**< pointer to store the number of domain reductions down, or NULL */
20877  SCIP_Longint* ndomredsup, /**< pointer to store the number of domain reductions up, or NULL */
20878  SCIP_Bool* downinf, /**< pointer to store whether the downwards branch is infeasible, or NULL */
20879  SCIP_Bool* upinf, /**< pointer to store whether the upwards branch is infeasible, or NULL */
20880  SCIP_Bool* downconflict, /**< pointer to store whether a conflict constraint was created for an
20881  * infeasible downwards branch, or NULL */
20882  SCIP_Bool* upconflict, /**< pointer to store whether a conflict constraint was created for an
20883  * infeasible upwards branch, or NULL */
20884  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred or the
20885  * solving process should be stopped (e.g., due to a time limit) */
20886  SCIP_Real* newlbs, /**< array to store valid lower bounds for all active variables, or NULL */
20887  SCIP_Real* newubs /**< array to store valid upper bounds for all active variables, or NULL */
20888  )
20889 {
20890  SCIP_COL* col;
20891  SCIP_VAR** vars;
20892  SCIP_Longint oldniters;
20893  SCIP_Real newub;
20894  SCIP_Real newlb;
20895  SCIP_Bool propagate;
20896  SCIP_Bool cutoff;
20897  SCIP_Bool downchild;
20898  SCIP_Bool firstchild;
20899  SCIP_Bool foundsol;
20900  SCIP_Bool downvalidlocal;
20901  SCIP_Bool upvalidlocal;
20902  SCIP_Bool allcolsinlp;
20903  SCIP_Bool enabledconflict;
20904  int oldnconflicts;
20905  int nvars;
20906 
20907  assert(scip != NULL);
20908  assert(var != NULL);
20909  assert(SCIPvarIsIntegral(var));
20910  assert(down != NULL);
20911  assert(up != NULL);
20912  assert(lperror != NULL);
20913  assert((newlbs != NULL) == (newubs != NULL));
20914  assert(SCIPinProbing(scip));
20915  assert(var->scip == scip);
20916 
20917  SCIP_CALL( checkStage(scip, "SCIPgetVarStrongbranchWithPropagation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20918 
20919  /* check whether propagation should be performed */
20920  propagate = (maxproprounds != 0);
20921 
20922  /* Check, if all existing columns are in LP.
20923  * If this is not the case, we may still return that the up and down dual bounds are valid, because the branching
20924  * rule should not apply them otherwise.
20925  * However, we must not set the downinf or upinf pointers to TRUE based on the dual bound, because we cannot
20926  * guarantee that this node can be cut off.
20927  */
20928  allcolsinlp = SCIPallColsInLP(scip);
20929 
20930  /* if maxproprounds is -2, change it to 0, which for the following calls means using the parameter settings */
20931  if( maxproprounds == -2 )
20932  maxproprounds = 0;
20933 
20934  *down = lpobjval;
20935  *up = lpobjval;
20936  if( downvalid != NULL )
20937  *downvalid = FALSE;
20938  if( upvalid != NULL )
20939  *upvalid = FALSE;
20940  if( downinf != NULL )
20941  *downinf = FALSE;
20942  if( upinf != NULL )
20943  *upinf = FALSE;
20944  if( downconflict != NULL )
20945  *downconflict = FALSE;
20946  if( upconflict != NULL )
20947  *upconflict = FALSE;
20948  if( ndomredsdown != NULL )
20949  *ndomredsdown = 0;
20950  if( ndomredsup != NULL )
20951  *ndomredsup = 0;
20952 
20953  *lperror = FALSE;
20954 
20955  vars = SCIPgetVars(scip);
20956  nvars = SCIPgetNVars(scip);
20957 
20959 
20960  /* check if the solving process should be aborted */
20961  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
20962  {
20963  /* mark this as if the LP failed */
20964  *lperror = TRUE;
20965  return SCIP_OKAY;
20966  }
20967 
20969  {
20970  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
20971  return SCIP_INVALIDDATA;
20972  }
20973 
20974  col = SCIPvarGetCol(var);
20975  assert(col != NULL);
20976 
20977  if( !SCIPcolIsInLP(col) )
20978  {
20979  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
20980  return SCIP_INVALIDDATA;
20981  }
20982 
20983  newlb = SCIPfeasFloor(scip, solval + 1.0);
20984  newub = SCIPfeasCeil(scip, solval - 1.0);
20985 
20986  SCIPdebugMsg(scip, "strong branching on var <%s>: solval=%g, lb=%g, ub=%g\n", SCIPvarGetName(var), solval,
20988 
20989  /* the up branch is infeasible due to the branching bound change; since this means that solval is not within the
20990  * bounds, this should only happen if previous strong branching calls on other variables detected bound changes which
20991  * are valid for and were already applied at the probing root
20992  */
20993  if( newlb > SCIPvarGetUbLocal(var) + 0.5 )
20994  {
20995  *up = SCIPinfinity(scip);
20996 
20997  if( upinf != NULL )
20998  *upinf = TRUE;
20999 
21000  if( upvalid != NULL )
21001  *upvalid = TRUE;
21002 
21003  /* bound changes are applied in SCIPendStrongbranch(), which can be seen as a conflict constraint */
21004  if( upconflict != NULL )
21005  *upconflict = TRUE;
21006 
21007  SCIPcolSetStrongbranchData(col, scip->set, scip->stat, scip->lp, lpobjval, solval,
21008  *down, *up, FALSE, TRUE, 0LL, INT_MAX);
21009 
21010  /* we do not regard the down branch; its valid pointer stays set to FALSE */
21011  return SCIP_OKAY;
21012  }
21013 
21014  /* the down branch is infeasible due to the branching bound change; since this means that solval is not within the
21015  * bounds, this should only happen if previous strong branching calls on other variables detected bound changes which
21016  * are valid for and were already applied at the probing root
21017  */
21018  if( newub < SCIPvarGetLbLocal(var) - 0.5 )
21019  {
21020  *down = SCIPinfinity(scip);
21021 
21022  if( downinf != NULL )
21023  *downinf = TRUE;
21024 
21025  if( downvalid != NULL )
21026  *downvalid = TRUE;
21027 
21028  /* bound changes are applied in SCIPendStrongbranch(), which can be seen as a conflict constraint */
21029  if( downconflict != NULL )
21030  *downconflict = TRUE;
21031 
21032  SCIPcolSetStrongbranchData(col, scip->set, scip->stat, scip->lp, lpobjval, solval,
21033  *down, *up, TRUE, FALSE, 0LL, INT_MAX);
21034 
21035  /* we do not regard the up branch; its valid pointer stays set to FALSE */
21036  return SCIP_OKAY;
21037  }
21038 
21039  /* We now do strong branching by creating the two potential child nodes as probing nodes and solving them one after
21040  * the other. We will stop when the first child is detected infeasible, saving the effort we would need for the
21041  * second child. Since empirically, the up child tends to be infeasible more often, we do strongbranching first on
21042  * the up branch.
21043  */
21044  oldniters = scip->stat->nsbdivinglpiterations;
21045  firstchild = TRUE;
21046  cutoff = FALSE;
21047 
21048  /* switch conflict analysis according to usesb parameter */
21049  enabledconflict = scip->set->conf_enable;
21050  scip->set->conf_enable = (scip->set->conf_enable && scip->set->conf_usesb);
21051 
21052  /* @todo: decide the branch to look at first based on the cutoffs in previous calls? */
21053  switch( scip->set->branch_firstsbchild )
21054  {
21055  case 'u':
21056  downchild = FALSE;
21057  break;
21058  case 'd':
21059  downchild = TRUE;
21060  break;
21061  case 'a':
21062  downchild = SCIPvarGetNLocksDown(var) > SCIPvarGetNLocksUp(var);
21063  break;
21064  case 'h':
21066  break;
21067  default:
21068  SCIPerrorMessage("Error: Unknown parameter value <%c> for branching/firstsbchild parameter:\n",scip->set->branch_firstsbchild);
21069  SCIPABORT();
21070  scip->set->conf_enable = enabledconflict;
21071  return SCIP_PARAMETERWRONGVAL; /*lint !e527*/
21072  }
21073 
21074  downvalidlocal = FALSE;
21075  upvalidlocal = FALSE;
21076 
21077  do
21078  {
21079  oldnconflicts = SCIPconflictGetNConflicts(scip->conflict);
21080 
21081  if( downchild )
21082  {
21083  SCIP_CALL( performStrongbranchWithPropagation(scip, var, downchild, firstchild, propagate, newub, itlim, maxproprounds,
21084  down, &downvalidlocal, ndomredsdown, downconflict, lperror, vars, nvars, newlbs, newubs, &foundsol, &cutoff) );
21085 
21086  /* check whether a new solutions rendered the previous child infeasible */
21087  if( foundsol && !firstchild && allcolsinlp )
21088  {
21089  if( SCIPisGE(scip, *up, SCIPgetCutoffbound(scip)) )
21090  {
21091  if( upinf != NULL )
21092  *upinf = TRUE;
21093  }
21094  }
21095 
21096  /* check for infeasibility */
21097  if( cutoff )
21098  {
21099  if( downinf != NULL )
21100  *downinf = TRUE;
21101 
21102  if( downconflict != NULL &&
21103  (SCIPvarGetLbLocal(var) > newub + 0.5 || SCIPconflictGetNConflicts(scip->conflict) > oldnconflicts) )
21104  {
21105  *downconflict = TRUE;
21106  }
21107 
21108  if( !scip->set->branch_forceall )
21109  {
21110  /* if this is the first call, we do not regard the up branch, its valid pointer is initially set to FALSE */
21111  break;
21112  }
21113  }
21114  }
21115  else
21116  {
21117  SCIP_CALL( performStrongbranchWithPropagation(scip, var, downchild, firstchild, propagate, newlb, itlim, maxproprounds,
21118  up, &upvalidlocal, ndomredsup, upconflict, lperror, vars, nvars, newlbs, newubs, &foundsol, &cutoff) );
21119 
21120  /* check whether a new solutions rendered the previous child infeasible */
21121  if( foundsol && !firstchild && allcolsinlp )
21122  {
21123  if( SCIPisGE(scip, *down, SCIPgetCutoffbound(scip)) )
21124  {
21125  if( downinf != NULL )
21126  *downinf = TRUE;
21127  }
21128  }
21129 
21130  /* check for infeasibility */
21131  if( cutoff )
21132  {
21133  if( upinf != NULL )
21134  *upinf = TRUE;
21135 
21136  assert(upinf == NULL || (*upinf) == TRUE);
21137 
21138  if( upconflict != NULL &&
21139  (SCIPvarGetUbLocal(var) < newlb - 0.5 || SCIPconflictGetNConflicts(scip->conflict) > oldnconflicts) )
21140  {
21141  *upconflict = TRUE;
21142  }
21143 
21144  if( !scip->set->branch_forceall )
21145  {
21146  /* if this is the first call, we do not regard the down branch, its valid pointer is initially set to FALSE */
21147  break;
21148  }
21149  }
21150  }
21151 
21152  downchild = !downchild;
21153  firstchild = !firstchild;
21154  }
21155  while( !firstchild );
21156 
21157 
21158  /* set strong branching information in column */
21159  if( *lperror )
21160  {
21161  SCIPcolInvalidateStrongbranchData(col, scip->set, scip->stat, scip->lp);
21162  }
21163  else
21164  {
21165  SCIPcolSetStrongbranchData(col, scip->set, scip->stat, scip->lp, lpobjval, solval,
21166  *down, *up, downvalidlocal, upvalidlocal, scip->stat->nsbdivinglpiterations - oldniters, itlim);
21167  }
21168 
21169  if( downvalid != NULL )
21170  *downvalid = downvalidlocal;
21171  if( upvalid != NULL )
21172  *upvalid = upvalidlocal;
21173 
21174  scip->set->conf_enable = enabledconflict;
21175 
21176  return SCIP_OKAY;
21177 }
21178 
21179 /** gets strong branching information on column variable x with integral LP solution value (val); that is, the down branch
21180  * is (val -1.0) and the up brach ins (val +1.0)
21181  *
21182  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21183  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21184  *
21185  * @pre This method can be called if @p scip is in one of the following stages:
21186  * - \ref SCIP_STAGE_PRESOLVED
21187  * - \ref SCIP_STAGE_SOLVING
21188  *
21189  * @note If the integral LP solution value is the lower or upper bound of the variable, the corresponding branch will be
21190  * marked as infeasible. That is, the valid pointer and the infeasible pointer are set to TRUE.
21191  */
21193  SCIP* scip, /**< SCIP data structure */
21194  SCIP_VAR* var, /**< variable to get strong branching values for */
21195  int itlim, /**< iteration limit for strong branchings */
21196  SCIP_Real* down, /**< stores dual bound after branching column down */
21197  SCIP_Real* up, /**< stores dual bound after branching column up */
21198  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
21199  * otherwise, it can only be used as an estimate value */
21200  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
21201  * otherwise, it can only be used as an estimate value */
21202  SCIP_Bool* downinf, /**< pointer to store whether the downwards branch is infeasible, or NULL */
21203  SCIP_Bool* upinf, /**< pointer to store whether the upwards branch is infeasible, or NULL */
21204  SCIP_Bool* downconflict, /**< pointer to store whether a conflict constraint was created for an
21205  * infeasible downwards branch, or NULL */
21206  SCIP_Bool* upconflict, /**< pointer to store whether a conflict constraint was created for an
21207  * infeasible upwards branch, or NULL */
21208  SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred or the
21209  * solving process should be stopped (e.g., due to a time limit) */
21210  )
21211 {
21212  SCIP_COL* col;
21213 
21214  SCIP_CALL( checkStage(scip, "SCIPgetVarStrongbranchInt", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21215 
21216  assert(lperror != NULL);
21217  assert(var->scip == scip);
21218 
21219  if( downvalid != NULL )
21220  *downvalid = FALSE;
21221  if( upvalid != NULL )
21222  *upvalid = FALSE;
21223  if( downinf != NULL )
21224  *downinf = FALSE;
21225  if( upinf != NULL )
21226  *upinf = FALSE;
21227  if( downconflict != NULL )
21228  *downconflict = FALSE;
21229  if( upconflict != NULL )
21230  *upconflict = FALSE;
21231 
21233  {
21234  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
21235  return SCIP_INVALIDDATA;
21236  }
21237 
21238  col = SCIPvarGetCol(var);
21239  assert(col != NULL);
21240 
21241  if( !SCIPcolIsInLP(col) )
21242  {
21243  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
21244  return SCIP_INVALIDDATA;
21245  }
21246 
21247  /* check if the solving process should be aborted */
21248  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
21249  {
21250  /* mark this as if the LP failed */
21251  *lperror = TRUE;
21252  return SCIP_OKAY;
21253  }
21254 
21255  /* call strong branching for column */
21256  SCIP_CALL( SCIPcolGetStrongbranch(col, TRUE, scip->set, scip->stat, scip->transprob, scip->lp, itlim,
21257  down, up, downvalid, upvalid, lperror) );
21258 
21259  /* check, if the branchings are infeasible; in exact solving mode, we cannot trust the strong branching enough to
21260  * declare the sub nodes infeasible
21261  */
21262  if( !(*lperror) && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->set->misc_exactsolve )
21263  {
21264  SCIP_CALL( analyzeStrongbranch(scip, var, downinf, upinf, downconflict, upconflict) );
21265  }
21266 
21267  return SCIP_OKAY;
21268 }
21269 
21270 /** gets strong branching information on column variables with fractional values
21271  *
21272  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21273  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21274  *
21275  * @pre This method can be called if @p scip is in one of the following stages:
21276  * - \ref SCIP_STAGE_PRESOLVED
21277  * - \ref SCIP_STAGE_SOLVING
21278  */
21280  SCIP* scip, /**< SCIP data structure */
21281  SCIP_VAR** vars, /**< variables to get strong branching values for */
21282  int nvars, /**< number of variables */
21283  int itlim, /**< iteration limit for strong branchings */
21284  SCIP_Real* down, /**< stores dual bounds after branching variables down */
21285  SCIP_Real* up, /**< stores dual bounds after branching variables up */
21286  SCIP_Bool* downvalid, /**< stores whether the returned down values are valid dual bounds, or NULL;
21287  * otherwise, they can only be used as an estimate value */
21288  SCIP_Bool* upvalid, /**< stores whether the returned up values are valid dual bounds, or NULL;
21289  * otherwise, they can only be used as an estimate value */
21290  SCIP_Bool* downinf, /**< array to store whether the downward branches are infeasible, or NULL */
21291  SCIP_Bool* upinf, /**< array to store whether the upward branches are infeasible, or NULL */
21292  SCIP_Bool* downconflict, /**< array to store whether conflict constraints were created for
21293  * infeasible downward branches, or NULL */
21294  SCIP_Bool* upconflict, /**< array to store whether conflict constraints were created for
21295  * infeasible upward branches, or NULL */
21296  SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred or the
21297  * solving process should be stopped (e.g., due to a time limit) */
21298  )
21299 {
21300  SCIP_COL** cols;
21301  int j;
21302 
21303  SCIP_CALL( checkStage(scip, "SCIPgetVarsStrongbranchesFrac", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21304 
21305  assert( lperror != NULL );
21306  assert( vars != NULL );
21307 
21308  /* set up data */
21309  cols = NULL;
21310  SCIP_CALL( SCIPallocBufferArray(scip, &cols, nvars) );
21311  assert(cols != NULL);
21312  for( j = 0; j < nvars; ++j )
21313  {
21314  SCIP_VAR* var;
21315  SCIP_COL* col;
21316 
21317  if( downvalid != NULL )
21318  downvalid[j] = FALSE;
21319  if( upvalid != NULL )
21320  upvalid[j] = FALSE;
21321  if( downinf != NULL )
21322  downinf[j] = FALSE;
21323  if( upinf != NULL )
21324  upinf[j] = FALSE;
21325  if( downconflict != NULL )
21326  downconflict[j] = FALSE;
21327  if( upconflict != NULL )
21328  upconflict[j] = FALSE;
21329 
21330  var = vars[j];
21331  assert( var != NULL );
21333  {
21334  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
21335  SCIPfreeBufferArray(scip, &cols);
21336  return SCIP_INVALIDDATA;
21337  }
21338 
21339  col = SCIPvarGetCol(var);
21340  assert(col != NULL);
21341  cols[j] = col;
21342 
21343  if( !SCIPcolIsInLP(col) )
21344  {
21345  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
21346  SCIPfreeBufferArray(scip, &cols);
21347  return SCIP_INVALIDDATA;
21348  }
21349  }
21350 
21351  /* check if the solving process should be aborted */
21352  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
21353  {
21354  /* mark this as if the LP failed */
21355  *lperror = TRUE;
21356  }
21357  else
21358  {
21359  /* call strong branching for columns with fractional value */
21360  SCIP_CALL( SCIPcolGetStrongbranches(cols, nvars, FALSE, scip->set, scip->stat, scip->transprob, scip->lp, itlim,
21361  down, up, downvalid, upvalid, lperror) );
21362 
21363  /* check, if the branchings are infeasible; in exact solving mode, we cannot trust the strong branching enough to
21364  * declare the sub nodes infeasible
21365  */
21366  if( !(*lperror) && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->set->misc_exactsolve )
21367  {
21368  for( j = 0; j < nvars; ++j )
21369  {
21370  SCIP_CALL( analyzeStrongbranch(scip, vars[j], (downinf != NULL) ? (&(downinf[j])) : NULL,
21371  (upinf != NULL) ? (&(upinf[j])) : NULL, (downconflict != NULL) ? (&(downconflict[j])) : NULL,
21372  (upconflict != NULL) ? (&(upconflict[j])) : NULL) );
21373  }
21374  }
21375  }
21376  SCIPfreeBufferArray(scip, &cols);
21377 
21378  return SCIP_OKAY;
21379 }
21380 
21381 /** gets strong branching information on column variables with integral values
21382  *
21383  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21384  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21385  *
21386  * @pre This method can be called if @p scip is in one of the following stages:
21387  * - \ref SCIP_STAGE_PRESOLVED
21388  * - \ref SCIP_STAGE_SOLVING
21389  */
21391  SCIP* scip, /**< SCIP data structure */
21392  SCIP_VAR** vars, /**< variables to get strong branching values for */
21393  int nvars, /**< number of variables */
21394  int itlim, /**< iteration limit for strong branchings */
21395  SCIP_Real* down, /**< stores dual bounds after branching variables down */
21396  SCIP_Real* up, /**< stores dual bounds after branching variables up */
21397  SCIP_Bool* downvalid, /**< stores whether the returned down values are valid dual bounds, or NULL;
21398  * otherwise, they can only be used as an estimate value */
21399  SCIP_Bool* upvalid, /**< stores whether the returned up values are valid dual bounds, or NULL;
21400  * otherwise, they can only be used as an estimate value */
21401  SCIP_Bool* downinf, /**< array to store whether the downward branches are infeasible, or NULL */
21402  SCIP_Bool* upinf, /**< array to store whether the upward branches are infeasible, or NULL */
21403  SCIP_Bool* downconflict, /**< array to store whether conflict constraints were created for
21404  * infeasible downward branches, or NULL */
21405  SCIP_Bool* upconflict, /**< array to store whether conflict constraints were created for
21406  * infeasible upward branches, or NULL */
21407  SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred or the
21408  * solving process should be stopped (e.g., due to a time limit) */
21409  )
21410 {
21411  SCIP_COL** cols;
21412  int j;
21413 
21414  assert(lperror != NULL);
21415 
21416  SCIP_CALL( checkStage(scip, "SCIPgetVarsStrongbranchesInt", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21417 
21418  assert( vars != NULL );
21419 
21420  /* set up data */
21421  cols = NULL;
21422  SCIP_CALL( SCIPallocBufferArray(scip, &cols, nvars) );
21423  assert(cols != NULL);
21424  for( j = 0; j < nvars; ++j )
21425  {
21426  SCIP_VAR* var;
21427  SCIP_COL* col;
21428 
21429  if( downvalid != NULL )
21430  downvalid[j] = FALSE;
21431  if( upvalid != NULL )
21432  upvalid[j] = FALSE;
21433  if( downinf != NULL )
21434  downinf[j] = FALSE;
21435  if( upinf != NULL )
21436  upinf[j] = FALSE;
21437  if( downconflict != NULL )
21438  downconflict[j] = FALSE;
21439  if( upconflict != NULL )
21440  upconflict[j] = FALSE;
21441 
21442  var = vars[j];
21443  assert( var != NULL );
21445  {
21446  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
21447  SCIPfreeBufferArray(scip, &cols);
21448  return SCIP_INVALIDDATA;
21449  }
21450 
21451  col = SCIPvarGetCol(var);
21452  assert(col != NULL);
21453  cols[j] = col;
21454 
21455  if( !SCIPcolIsInLP(col) )
21456  {
21457  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
21458  SCIPfreeBufferArray(scip, &cols);
21459  return SCIP_INVALIDDATA;
21460  }
21461  }
21462 
21463  /* check if the solving process should be aborted */
21464  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
21465  {
21466  /* mark this as if the LP failed */
21467  *lperror = TRUE;
21468  }
21469  else
21470  {
21471  /* call strong branching for columns */
21472  SCIP_CALL( SCIPcolGetStrongbranches(cols, nvars, TRUE, scip->set, scip->stat, scip->transprob, scip->lp, itlim,
21473  down, up, downvalid, upvalid, lperror) );
21474 
21475  /* check, if the branchings are infeasible; in exact solving mode, we cannot trust the strong branching enough to
21476  * declare the sub nodes infeasible
21477  */
21478  if( !(*lperror) && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->set->misc_exactsolve )
21479  {
21480  for( j = 0; j < nvars; ++j )
21481  {
21482  SCIP_CALL( analyzeStrongbranch(scip, vars[j], (downinf != NULL) ? (&(downinf[j])) : NULL,
21483  (upinf != NULL) ? (&(upinf[j])) : NULL, (downconflict != NULL) ? (&(downconflict[j])) : NULL,
21484  (upconflict != NULL) ? (&(upconflict[j])) : NULL) );
21485 
21486  }
21487  }
21488  }
21489  SCIPfreeBufferArray(scip, &cols);
21490 
21491  return SCIP_OKAY;
21492 }
21493 
21494 /** get LP solution status of last strong branching call (currently only works for strong branching with propagation) */
21496  SCIP* scip, /**< SCIP data structure */
21497  SCIP_BRANCHDIR branchdir /**< branching direction for which LP solution status is requested */
21498  )
21499 {
21500  assert(NULL != scip);
21501  assert(branchdir == SCIP_BRANCHDIR_DOWNWARDS || branchdir == SCIP_BRANCHDIR_UPWARDS);
21502 
21503  return scip->stat->lastsblpsolstats[branchdir == SCIP_BRANCHDIR_DOWNWARDS ? 0 : 1];
21504 }
21505 
21506 /** gets strong branching information on COLUMN variable of the last SCIPgetVarStrongbranch() call;
21507  * returns values of SCIP_INVALID, if strong branching was not yet called on the given variable;
21508  * keep in mind, that the returned old values may have nothing to do with the current LP solution
21509  *
21510  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21511  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21512  *
21513  * @pre This method can be called if @p scip is in one of the following stages:
21514  * - \ref SCIP_STAGE_SOLVING
21515  * - \ref SCIP_STAGE_SOLVED
21516  */
21518  SCIP* scip, /**< SCIP data structure */
21519  SCIP_VAR* var, /**< variable to get last strong branching values for */
21520  SCIP_Real* down, /**< stores dual bound after branching column down */
21521  SCIP_Real* up, /**< stores dual bound after branching column up */
21522  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
21523  * otherwise, it can only be used as an estimate value */
21524  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
21525  * otherwise, it can only be used as an estimate value */
21526  SCIP_Real* solval, /**< stores LP solution value of variable at the last strong branching call, or NULL */
21527  SCIP_Real* lpobjval /**< stores LP objective value at last strong branching call, or NULL */
21528  )
21529 {
21530  SCIP_CALL( checkStage(scip, "SCIPgetVarStrongbranchLast", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
21531 
21533  {
21534  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable\n");
21535  return SCIP_INVALIDDATA;
21536  }
21537 
21538  SCIPcolGetStrongbranchLast(SCIPvarGetCol(var), down, up, downvalid, upvalid, solval, lpobjval);
21539 
21540  return SCIP_OKAY;
21541 }
21542 
21543 /** gets node number of the last node in current branch and bound run, where strong branching was used on the
21544  * given variable, or -1 if strong branching was never applied to the variable in current run
21545  *
21546  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21547  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21548  *
21549  * @pre This method can be called if @p scip is in one of the following stages:
21550  * - \ref SCIP_STAGE_TRANSFORMING
21551  * - \ref SCIP_STAGE_TRANSFORMED
21552  * - \ref SCIP_STAGE_INITPRESOLVE
21553  * - \ref SCIP_STAGE_PRESOLVING
21554  * - \ref SCIP_STAGE_EXITPRESOLVE
21555  * - \ref SCIP_STAGE_PRESOLVED
21556  * - \ref SCIP_STAGE_INITSOLVE
21557  * - \ref SCIP_STAGE_SOLVING
21558  * - \ref SCIP_STAGE_SOLVED
21559  * - \ref SCIP_STAGE_EXITSOLVE
21560  */
21562  SCIP* scip, /**< SCIP data structure */
21563  SCIP_VAR* var /**< variable to get last strong branching node for */
21564  )
21565 {
21566  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarStrongbranchNode", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
21567 
21568  assert( var->scip == scip );
21569 
21571  return -1;
21572 
21574 }
21575 
21576 /** if strong branching was already applied on the variable at the current node, returns the number of LPs solved after
21577  * the LP where the strong branching on this variable was applied;
21578  * if strong branching was not yet applied on the variable at the current node, returns INT_MAX
21579  *
21580  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21581  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21582  *
21583  * @pre This method can be called if @p scip is in one of the following stages:
21584  * - \ref SCIP_STAGE_TRANSFORMING
21585  * - \ref SCIP_STAGE_TRANSFORMED
21586  * - \ref SCIP_STAGE_INITPRESOLVE
21587  * - \ref SCIP_STAGE_PRESOLVING
21588  * - \ref SCIP_STAGE_EXITPRESOLVE
21589  * - \ref SCIP_STAGE_PRESOLVED
21590  * - \ref SCIP_STAGE_INITSOLVE
21591  * - \ref SCIP_STAGE_SOLVING
21592  * - \ref SCIP_STAGE_SOLVED
21593  * - \ref SCIP_STAGE_EXITSOLVE
21594  */
21596  SCIP* scip, /**< SCIP data structure */
21597  SCIP_VAR* var /**< variable to get strong branching LP age for */
21598  )
21599 {
21600  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarStrongbranchLPAge", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
21601 
21602  assert( var->scip == scip );
21603 
21605  return SCIP_LONGINT_MAX;
21606 
21607  return SCIPcolGetStrongbranchLPAge(SCIPvarGetCol(var), scip->stat);
21608 }
21609 
21610 /** gets number of times, strong branching was applied in current run on the given variable
21611  *
21612  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21613  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21614  *
21615  * @pre This method can be called if @p scip is in one of the following stages:
21616  * - \ref SCIP_STAGE_TRANSFORMING
21617  * - \ref SCIP_STAGE_TRANSFORMED
21618  * - \ref SCIP_STAGE_INITPRESOLVE
21619  * - \ref SCIP_STAGE_PRESOLVING
21620  * - \ref SCIP_STAGE_EXITPRESOLVE
21621  * - \ref SCIP_STAGE_PRESOLVED
21622  * - \ref SCIP_STAGE_INITSOLVE
21623  * - \ref SCIP_STAGE_SOLVING
21624  * - \ref SCIP_STAGE_SOLVED
21625  * - \ref SCIP_STAGE_EXITSOLVE
21626  */
21628  SCIP* scip, /**< SCIP data structure */
21629  SCIP_VAR* var /**< variable to get last strong branching node for */
21630  )
21631 {
21632  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarNStrongbranchs", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
21633 
21634  assert( var->scip == scip );
21635 
21637  return 0;
21638 
21640 }
21641 
21642 /** adds given values to lock numbers of variable for rounding
21643  *
21644  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21645  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21646  *
21647  * @pre This method can be called if @p scip is in one of the following stages:
21648  * - \ref SCIP_STAGE_PROBLEM
21649  * - \ref SCIP_STAGE_TRANSFORMING
21650  * - \ref SCIP_STAGE_TRANSFORMED
21651  * - \ref SCIP_STAGE_INITPRESOLVE
21652  * - \ref SCIP_STAGE_PRESOLVING
21653  * - \ref SCIP_STAGE_EXITPRESOLVE
21654  * - \ref SCIP_STAGE_PRESOLVED
21655  * - \ref SCIP_STAGE_INITSOLVE
21656  * - \ref SCIP_STAGE_SOLVING
21657  * - \ref SCIP_STAGE_EXITSOLVE
21658  * - \ref SCIP_STAGE_FREETRANS
21659  */
21661  SCIP* scip, /**< SCIP data structure */
21662  SCIP_VAR* var, /**< problem variable */
21663  int nlocksdown, /**< modification in number of rounding down locks */
21664  int nlocksup /**< modification in number of rounding up locks */
21665  )
21666 {
21667  SCIP_CALL( checkStage(scip, "SCIPaddVarLocks", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE) );
21668 
21669  assert( var->scip == scip );
21670 
21671  switch( scip->set->stage )
21672  {
21673  case SCIP_STAGE_PROBLEM:
21674  assert(!SCIPvarIsTransformed(var));
21675  /*lint -fallthrough*/
21679  case SCIP_STAGE_PRESOLVING:
21681  case SCIP_STAGE_PRESOLVED:
21682  case SCIP_STAGE_INITSOLVE:
21683  case SCIP_STAGE_SOLVING:
21684  case SCIP_STAGE_EXITSOLVE:
21685  case SCIP_STAGE_FREETRANS:
21686  SCIP_CALL( SCIPvarAddLocks(var, scip->mem->probmem, scip->set, scip->eventqueue, nlocksdown, nlocksup) );
21687  return SCIP_OKAY;
21688 
21689  default:
21690  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21691  return SCIP_INVALIDCALL;
21692  } /*lint !e788*/
21693 }
21694 
21695 /** locks rounding of variable with respect to the lock status of the constraint and its negation;
21696  * this method should be called whenever the lock status of a variable in a constraint changes, for example if
21697  * the coefficient of the variable changed its sign or if the left or right hand sides of the constraint were
21698  * added or removed
21699  *
21700  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21701  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21702  *
21703  * @pre This method can be called if @p scip is in one of the following stages:
21704  * - \ref SCIP_STAGE_PROBLEM
21705  * - \ref SCIP_STAGE_TRANSFORMING
21706  * - \ref SCIP_STAGE_INITPRESOLVE
21707  * - \ref SCIP_STAGE_PRESOLVING
21708  * - \ref SCIP_STAGE_EXITPRESOLVE
21709  * - \ref SCIP_STAGE_INITSOLVE
21710  * - \ref SCIP_STAGE_SOLVING
21711  * - \ref SCIP_STAGE_EXITSOLVE
21712  * - \ref SCIP_STAGE_FREETRANS
21713  */
21715  SCIP* scip, /**< SCIP data structure */
21716  SCIP_VAR* var, /**< problem variable */
21717  SCIP_CONS* cons, /**< constraint */
21718  SCIP_Bool lockdown, /**< should the rounding be locked in downwards direction? */
21719  SCIP_Bool lockup /**< should the rounding be locked in upwards direction? */
21720  )
21721 {
21722  int nlocksdown;
21723  int nlocksup;
21724 
21725  SCIP_CALL( checkStage(scip, "SCIPlockVarCons", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE) );
21726 
21727  assert( var->scip == scip );
21728 
21729  nlocksdown = 0;
21730  nlocksup = 0;
21731  if( SCIPconsIsLockedPos(cons) )
21732  {
21733  if( lockdown )
21734  nlocksdown++;
21735  if( lockup )
21736  nlocksup++;
21737  }
21738  if( SCIPconsIsLockedNeg(cons) )
21739  {
21740  if( lockdown )
21741  nlocksup++;
21742  if( lockup )
21743  nlocksdown++;
21744  }
21745 
21746  switch( scip->set->stage )
21747  {
21748  case SCIP_STAGE_PROBLEM:
21749  assert(!SCIPvarIsTransformed(var));
21750  /*lint -fallthrough*/
21754  case SCIP_STAGE_PRESOLVING:
21756  case SCIP_STAGE_INITSOLVE:
21757  case SCIP_STAGE_SOLVING:
21758  case SCIP_STAGE_EXITSOLVE:
21759  case SCIP_STAGE_FREETRANS:
21760  SCIP_CALL( SCIPvarAddLocks(var, scip->mem->probmem, scip->set, scip->eventqueue, nlocksdown, nlocksup) );
21761  return SCIP_OKAY;
21762 
21763  default:
21764  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21765  return SCIP_INVALIDCALL;
21766  } /*lint !e788*/
21767 }
21768 
21769 /** unlocks rounding of variable with respect to the lock status of the constraint and its negation;
21770  * this method should be called whenever the lock status of a variable in a constraint changes, for example if
21771  * the coefficient of the variable changed its sign or if the left or right hand sides of the constraint were
21772  * added or removed
21773  *
21774  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21775  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21776  *
21777  * @pre This method can be called if @p scip is in one of the following stages:
21778  * - \ref SCIP_STAGE_PROBLEM
21779  * - \ref SCIP_STAGE_TRANSFORMING
21780  * - \ref SCIP_STAGE_INITPRESOLVE
21781  * - \ref SCIP_STAGE_PRESOLVING
21782  * - \ref SCIP_STAGE_EXITPRESOLVE
21783  * - \ref SCIP_STAGE_INITSOLVE
21784  * - \ref SCIP_STAGE_SOLVING
21785  * - \ref SCIP_STAGE_EXITSOLVE
21786  * - \ref SCIP_STAGE_FREETRANS
21787  */
21789  SCIP* scip, /**< SCIP data structure */
21790  SCIP_VAR* var, /**< problem variable */
21791  SCIP_CONS* cons, /**< constraint */
21792  SCIP_Bool lockdown, /**< should the rounding be unlocked in downwards direction? */
21793  SCIP_Bool lockup /**< should the rounding be unlocked in upwards direction? */
21794  )
21795 {
21796  int nlocksdown;
21797  int nlocksup;
21798 
21799  SCIP_CALL( checkStage(scip, "SCIPunlockVarCons", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE) );
21800 
21801  assert( var->scip == scip );
21802 
21803  nlocksdown = 0;
21804  nlocksup = 0;
21805  if( SCIPconsIsLockedPos(cons) )
21806  {
21807  if( lockdown )
21808  nlocksdown++;
21809  if( lockup )
21810  nlocksup++;
21811  }
21812  if( SCIPconsIsLockedNeg(cons) )
21813  {
21814  if( lockdown )
21815  nlocksup++;
21816  if( lockup )
21817  nlocksdown++;
21818  }
21819 
21820  switch( scip->set->stage )
21821  {
21822  case SCIP_STAGE_PROBLEM:
21823  assert(!SCIPvarIsTransformed(var));
21824  /*lint -fallthrough*/
21827  case SCIP_STAGE_PRESOLVING:
21829  case SCIP_STAGE_INITSOLVE:
21830  case SCIP_STAGE_SOLVING:
21831  case SCIP_STAGE_EXITSOLVE:
21832  case SCIP_STAGE_FREETRANS:
21833  SCIP_CALL( SCIPvarAddLocks(var, scip->mem->probmem, scip->set, scip->eventqueue, -nlocksdown, -nlocksup) );
21834  return SCIP_OKAY;
21835 
21836  default:
21837  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21838  return SCIP_INVALIDCALL;
21839  } /*lint !e788*/
21840 }
21841 
21842 /** changes variable's objective value
21843  *
21844  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21845  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21846  *
21847  * @pre This method can be called if @p scip is in one of the following stages:
21848  * - \ref SCIP_STAGE_PROBLEM
21849  * - \ref SCIP_STAGE_TRANSFORMING
21850  * - \ref SCIP_STAGE_PRESOLVING
21851  * - \ref SCIP_STAGE_PRESOLVED
21852  */
21854  SCIP* scip, /**< SCIP data structure */
21855  SCIP_VAR* var, /**< variable to change the objective value for */
21856  SCIP_Real newobj /**< new objective value */
21857  )
21858 {
21859  SCIP_CALL( checkStage(scip, "SCIPchgVarObj", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
21860 
21861  assert( var->scip == scip );
21862 
21863  /* forbid infinite objective values */
21864  if( SCIPisInfinity(scip, REALABS(newobj)) )
21865  {
21866  SCIPerrorMessage("invalid objective value: objective value is infinite\n");
21867  return SCIP_INVALIDDATA;
21868  }
21869 
21870  switch( scip->set->stage )
21871  {
21872  case SCIP_STAGE_PROBLEM:
21873  assert(!SCIPvarIsTransformed(var));
21874  SCIP_CALL( SCIPvarChgObj(var, scip->mem->probmem, scip->set, scip->origprob, scip->primal, scip->lp, scip->eventqueue, newobj) );
21875  return SCIP_OKAY;
21876 
21879  case SCIP_STAGE_PRESOLVING:
21880  case SCIP_STAGE_PRESOLVED:
21881  SCIP_CALL( SCIPvarChgObj(var, scip->mem->probmem, scip->set, scip->transprob, scip->primal, scip->lp, scip->eventqueue, newobj) );
21882  return SCIP_OKAY;
21883 
21884  default:
21885  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21886  return SCIP_INVALIDCALL;
21887  } /*lint !e788*/
21888 }
21889 
21890 /** adds value to variable's objective value
21891  *
21892  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21893  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21894  *
21895  * @pre This method can be called if @p scip is in one of the following stages:
21896  * - \ref SCIP_STAGE_PROBLEM
21897  * - \ref SCIP_STAGE_TRANSFORMING
21898  * - \ref SCIP_STAGE_PRESOLVING
21899  * - \ref SCIP_STAGE_EXITPRESOLVE
21900  * - \ref SCIP_STAGE_PRESOLVED
21901  */
21903  SCIP* scip, /**< SCIP data structure */
21904  SCIP_VAR* var, /**< variable to change the objective value for */
21905  SCIP_Real addobj /**< additional objective value */
21906  )
21907 {
21908  SCIP_CALL( checkStage(scip, "SCIPaddVarObj", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
21909 
21910  assert( var->scip == scip );
21911 
21912  switch( scip->set->stage )
21913  {
21914  case SCIP_STAGE_PROBLEM:
21915  assert(!SCIPvarIsTransformed(var));
21916  SCIP_CALL( SCIPvarAddObj(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob, scip->primal,
21917  scip->tree, scip->reopt, scip->lp, scip->eventqueue, addobj) );
21918  return SCIP_OKAY;
21919 
21921  case SCIP_STAGE_PRESOLVING:
21923  case SCIP_STAGE_PRESOLVED:
21924  SCIP_CALL( SCIPvarAddObj(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob, scip->primal,
21925  scip->tree, scip->reopt, scip->lp, scip->eventqueue, addobj) );
21926  return SCIP_OKAY;
21927 
21928  default:
21929  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21930  return SCIP_INVALIDCALL;
21931  } /*lint !e788*/
21932 }
21933 
21934 /** returns the adjusted (i.e. rounded, if the given variable is of integral type) lower bound value;
21935  * does not change the bounds of the variable
21936  *
21937  * @return adjusted lower bound for the given variable; the bound of the variable is not changed
21938  *
21939  * @pre This method can be called if @p scip is in one of the following stages:
21940  * - \ref SCIP_STAGE_PROBLEM
21941  * - \ref SCIP_STAGE_TRANSFORMING
21942  * - \ref SCIP_STAGE_TRANSFORMED
21943  * - \ref SCIP_STAGE_INITPRESOLVE
21944  * - \ref SCIP_STAGE_PRESOLVING
21945  * - \ref SCIP_STAGE_EXITPRESOLVE
21946  * - \ref SCIP_STAGE_PRESOLVED
21947  * - \ref SCIP_STAGE_INITSOLVE
21948  * - \ref SCIP_STAGE_SOLVING
21949  * - \ref SCIP_STAGE_SOLVED
21950  * - \ref SCIP_STAGE_EXITSOLVE
21951  * - \ref SCIP_STAGE_FREETRANS
21952  */
21954  SCIP* scip, /**< SCIP data structure */
21955  SCIP_VAR* var, /**< variable to adjust the bound for */
21956  SCIP_Real lb /**< lower bound value to adjust */
21957  )
21958 {
21959  SCIP_CALL_ABORT( checkStage(scip, "SCIPadjustedVarLb", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
21960 
21961  SCIPvarAdjustLb(var, scip->set, &lb);
21962 
21963  return lb;
21964 }
21965 
21966 /** returns the adjusted (i.e. rounded, if the given variable is of integral type) upper bound value;
21967  * does not change the bounds of the variable
21968  *
21969  * @return adjusted upper bound for the given variable; the bound of the variable is not changed
21970  *
21971  * @pre This method can be called if @p scip is in one of the following stages:
21972  * - \ref SCIP_STAGE_PROBLEM
21973  * - \ref SCIP_STAGE_TRANSFORMING
21974  * - \ref SCIP_STAGE_TRANSFORMED
21975  * - \ref SCIP_STAGE_INITPRESOLVE
21976  * - \ref SCIP_STAGE_PRESOLVING
21977  * - \ref SCIP_STAGE_EXITPRESOLVE
21978  * - \ref SCIP_STAGE_PRESOLVED
21979  * - \ref SCIP_STAGE_INITSOLVE
21980  * - \ref SCIP_STAGE_SOLVING
21981  * - \ref SCIP_STAGE_SOLVED
21982  * - \ref SCIP_STAGE_EXITSOLVE
21983  * - \ref SCIP_STAGE_FREETRANS
21984  */
21986  SCIP* scip, /**< SCIP data structure */
21987  SCIP_VAR* var, /**< variable to adjust the bound for */
21988  SCIP_Real ub /**< upper bound value to adjust */
21989  )
21990 {
21991  SCIP_CALL_ABORT( checkStage(scip, "SCIPadjustedVarUb", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
21992 
21993  SCIPvarAdjustUb(var, scip->set, &ub);
21994 
21995  return ub;
21996 }
21997 
21998 /** depending on SCIP's stage, changes lower bound of variable in the problem, in preprocessing, or in current node;
21999  * if possible, adjusts bound to integral value; doesn't store any inference information in the bound change, such
22000  * that in conflict analysis, this change is treated like a branching decision
22001  *
22002  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22003  * SCIPgetVars()) gets resorted.
22004  *
22005  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22006  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22007  *
22008  * @pre This method can be called if @p scip is in one of the following stages:
22009  * - \ref SCIP_STAGE_PROBLEM
22010  * - \ref SCIP_STAGE_TRANSFORMING
22011  * - \ref SCIP_STAGE_PRESOLVING
22012  * - \ref SCIP_STAGE_SOLVING
22013  *
22014  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22015  */
22017  SCIP* scip, /**< SCIP data structure */
22018  SCIP_VAR* var, /**< variable to change the bound for */
22019  SCIP_Real newbound /**< new value for bound */
22020  )
22021 {
22022  SCIP_CALL( checkStage(scip, "SCIPchgVarLb", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22023 
22024  SCIPvarAdjustLb(var, scip->set, &newbound);
22025 
22026  /* ignore tightenings of lower bounds to +infinity during solving process */
22027  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22028  {
22029 #ifndef NDEBUG
22030  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
22031  SCIPvarGetLbLocal(var));
22032 #endif
22033  return SCIP_OKAY;
22034  }
22035 
22036  switch( scip->set->stage )
22037  {
22038  case SCIP_STAGE_PROBLEM:
22039  assert(!SCIPvarIsTransformed(var));
22040  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22041  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22042  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22043  scip->branchcand, scip->eventqueue, newbound) );
22044  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
22045  break;
22046 
22048  case SCIP_STAGE_PRESOLVED:
22049  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22050  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22051  break;
22052 
22053  case SCIP_STAGE_PRESOLVING:
22054  if( !SCIPinProbing(scip) )
22055  {
22056  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22057  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22058 
22059  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22060  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
22061  var, newbound, SCIP_BOUNDTYPE_LOWER, FALSE) );
22062 
22064  {
22065  SCIP_Bool infeasible;
22066 
22067  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, &infeasible) );
22068  assert(!infeasible);
22069  }
22070  break;
22071  }
22072  /*lint -fallthrough*/
22073  case SCIP_STAGE_SOLVING:
22075  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
22076  scip->cliquetable, var, newbound,
22078  break;
22079 
22080  default:
22081  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22082  return SCIP_INVALIDCALL;
22083  } /*lint !e788*/
22084 
22085  return SCIP_OKAY;
22086 }
22087 
22088 /** depending on SCIP's stage, changes upper bound of variable in the problem, in preprocessing, or in current node;
22089  * if possible, adjusts bound to integral value; doesn't store any inference information in the bound change, such
22090  * that in conflict analysis, this change is treated like a branching decision
22091  *
22092  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22093  * SCIPgetVars()) gets resorted.
22094  *
22095  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22096  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22097  *
22098  * @pre This method can be called if @p scip is in one of the following stages:
22099  * - \ref SCIP_STAGE_PROBLEM
22100  * - \ref SCIP_STAGE_TRANSFORMING
22101  * - \ref SCIP_STAGE_PRESOLVING
22102  * - \ref SCIP_STAGE_SOLVING
22103  *
22104  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22105  */
22107  SCIP* scip, /**< SCIP data structure */
22108  SCIP_VAR* var, /**< variable to change the bound for */
22109  SCIP_Real newbound /**< new value for bound */
22110  )
22111 {
22112  SCIP_CALL( checkStage(scip, "SCIPchgVarUb", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22113 
22114  SCIPvarAdjustUb(var, scip->set, &newbound);
22115 
22116  /* ignore tightenings of upper bounds to -infinity during solving process */
22117  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22118  {
22119 #ifndef NDEBUG
22120  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
22121  SCIPvarGetUbLocal(var));
22122 #endif
22123  return SCIP_OKAY;
22124  }
22125 
22126  switch( scip->set->stage )
22127  {
22128  case SCIP_STAGE_PROBLEM:
22129  assert(!SCIPvarIsTransformed(var));
22130  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22131  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22132  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22133  scip->branchcand, scip->eventqueue, newbound) );
22134  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
22135  break;
22136 
22138  case SCIP_STAGE_PRESOLVED:
22139  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22140  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22141  break;
22142 
22143  case SCIP_STAGE_PRESOLVING:
22144  if( !SCIPinProbing(scip) )
22145  {
22146  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22147  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22148 
22149  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22150  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
22151  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, FALSE) );
22152 
22154  {
22155  SCIP_Bool infeasible;
22156 
22157  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, &infeasible) );
22158  assert(!infeasible);
22159  }
22160  break;
22161  }
22162  /*lint -fallthrough*/
22163  case SCIP_STAGE_SOLVING:
22165  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
22166  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, FALSE) );
22167  break;
22168 
22169  default:
22170  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22171  return SCIP_INVALIDCALL;
22172  } /*lint !e788*/
22173 
22174  return SCIP_OKAY;
22175 }
22176 
22177 /** changes lower bound of variable in the given node; if possible, adjust bound to integral value; doesn't store any
22178  * inference information in the bound change, such that in conflict analysis, this change is treated like a branching
22179  * decision
22180  *
22181  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22182  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22183  *
22184  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
22185  */
22187  SCIP* scip, /**< SCIP data structure */
22188  SCIP_NODE* node, /**< node to change bound at, or NULL for current node */
22189  SCIP_VAR* var, /**< variable to change the bound for */
22190  SCIP_Real newbound /**< new value for bound */
22191  )
22192 {
22193  SCIP_CALL( checkStage(scip, "SCIPchgVarLbNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22194 
22195  if( node == NULL )
22196  {
22197  SCIP_CALL( SCIPchgVarLb(scip, var, newbound) );
22198  }
22199  else
22200  {
22201  SCIPvarAdjustLb(var, scip->set, &newbound);
22202 
22203  /* ignore tightenings of lower bounds to +infinity during solving process */
22204  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22205  {
22206 #ifndef NDEBUG
22207  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
22208  SCIPvarGetLbLocal(var));
22209 #endif
22210  return SCIP_OKAY;
22211  }
22212 
22213  SCIP_CALL( SCIPnodeAddBoundchg(node, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
22214  scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22216  }
22217 
22218  return SCIP_OKAY;
22219 }
22220 
22221 /** changes upper bound of variable in the given node; if possible, adjust bound to integral value; doesn't store any
22222  * inference information in the bound change, such that in conflict analysis, this change is treated like a branching
22223  * decision
22224  *
22225  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22226  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22227  *
22228  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
22229  */
22231  SCIP* scip, /**< SCIP data structure */
22232  SCIP_NODE* node, /**< node to change bound at, or NULL for current node */
22233  SCIP_VAR* var, /**< variable to change the bound for */
22234  SCIP_Real newbound /**< new value for bound */
22235  )
22236 {
22237  SCIP_CALL( checkStage(scip, "SCIPchgVarUbNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22238 
22239  if( node == NULL )
22240  {
22241  SCIP_CALL( SCIPchgVarUb(scip, var, newbound) );
22242  }
22243  else
22244  {
22245  SCIPvarAdjustUb(var, scip->set, &newbound);
22246 
22247  /* ignore tightenings of upper bounds to -infinity during solving process */
22248  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22249  {
22250 #ifndef NDEBUG
22251  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
22252  SCIPvarGetUbLocal(var));
22253 #endif
22254  return SCIP_OKAY;
22255  }
22256 
22257  SCIP_CALL( SCIPnodeAddBoundchg(node, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
22258  scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22260  }
22261 
22262  return SCIP_OKAY;
22263 }
22264 
22265 /** changes global lower bound of variable; if possible, adjust bound to integral value; also tightens the local bound,
22266  * if the global bound is better than the local bound
22267  *
22268  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22269  * SCIPgetVars()) gets resorted.
22270  *
22271  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22272  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22273  *
22274  * @pre This method can be called if @p scip is in one of the following stages:
22275  * - \ref SCIP_STAGE_PROBLEM
22276  * - \ref SCIP_STAGE_TRANSFORMING
22277  * - \ref SCIP_STAGE_PRESOLVING
22278  * - \ref SCIP_STAGE_SOLVING
22279  *
22280  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22281  */
22283  SCIP* scip, /**< SCIP data structure */
22284  SCIP_VAR* var, /**< variable to change the bound for */
22285  SCIP_Real newbound /**< new value for bound */
22286  )
22287 {
22288  SCIP_CALL( checkStage(scip, "SCIPchgVarLbGlobal", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22289 
22290  SCIPvarAdjustLb(var, scip->set, &newbound);
22291 
22292  /* ignore tightenings of lower bounds to +infinity during solving process */
22293  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22294  {
22295 #ifndef NDEBUG
22296  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
22297  SCIPvarGetLbLocal(var));
22298 #endif
22299  return SCIP_OKAY;
22300  }
22301 
22302  switch( scip->set->stage )
22303  {
22304  case SCIP_STAGE_PROBLEM:
22305  assert(!SCIPvarIsTransformed(var));
22306  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22307  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22308  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22309  scip->branchcand, scip->eventqueue, newbound) );
22310  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
22311  break;
22312 
22314  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22315  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22316  break;
22317 
22318  case SCIP_STAGE_PRESOLVING:
22319  if( !SCIPinProbing(scip) )
22320  {
22321  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22322  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22323 
22324  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22325  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22327 
22329  {
22330  SCIP_Bool infeasible;
22331 
22332  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, &infeasible) );
22333  assert(!infeasible);
22334  }
22335  break;
22336  }
22337  /*lint -fallthrough*/
22338  case SCIP_STAGE_SOLVING:
22339  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22340  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22342  break;
22343 
22344  default:
22345  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22346  return SCIP_INVALIDCALL;
22347  } /*lint !e788*/
22348 
22349  return SCIP_OKAY;
22350 }
22351 
22352 /** changes global upper bound of variable; if possible, adjust bound to integral value; also tightens the local bound,
22353  * if the global bound is better than the local bound
22354  *
22355  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22356  * SCIPgetVars()) gets resorted.
22357  *
22358  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22359  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22360  *
22361  * @pre This method can be called if @p scip is in one of the following stages:
22362  * - \ref SCIP_STAGE_PROBLEM
22363  * - \ref SCIP_STAGE_TRANSFORMING
22364  * - \ref SCIP_STAGE_PRESOLVING
22365  * - \ref SCIP_STAGE_SOLVING
22366  *
22367  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22368  */
22370  SCIP* scip, /**< SCIP data structure */
22371  SCIP_VAR* var, /**< variable to change the bound for */
22372  SCIP_Real newbound /**< new value for bound */
22373  )
22374 {
22375  SCIP_CALL( checkStage(scip, "SCIPchgVarUbGlobal", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22376 
22377  SCIPvarAdjustUb(var, scip->set, &newbound);
22378 
22379  /* ignore tightenings of upper bounds to -infinity during solving process */
22380  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22381  {
22382 #ifndef NDEBUG
22383  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
22384  SCIPvarGetUbLocal(var));
22385 #endif
22386  return SCIP_OKAY;
22387  }
22388 
22389  switch( scip->set->stage )
22390  {
22391  case SCIP_STAGE_PROBLEM:
22392  assert(!SCIPvarIsTransformed(var));
22393  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22394  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22395  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22396  scip->branchcand, scip->eventqueue, newbound) );
22397  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
22398  break;
22399 
22401  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22402  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22403  break;
22404 
22405  case SCIP_STAGE_PRESOLVING:
22406  if( !SCIPinProbing(scip) )
22407  {
22408  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22409  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22410 
22411  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22412  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22414 
22416  {
22417  SCIP_Bool infeasible;
22418 
22419  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, &infeasible) );
22420  assert(!infeasible);
22421  }
22422  break;
22423  }
22424  /*lint -fallthrough*/
22425  case SCIP_STAGE_SOLVING:
22426  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22427  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22429  break;
22430 
22431  default:
22432  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22433  return SCIP_INVALIDCALL;
22434  } /*lint !e788*/
22435 
22436  return SCIP_OKAY;
22437 }
22438 
22439 /** changes lazy lower bound of the variable, this is only possible if the variable is not in the LP yet
22440  *
22441  * lazy bounds are bounds, that are enforced by constraints and the objective function; hence, these bounds do not need
22442  * to be put into the LP explicitly.
22443  *
22444  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22445  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22446  *
22447  * @pre This method can be called if @p scip is in one of the following stages:
22448  * - \ref SCIP_STAGE_PROBLEM
22449  * - \ref SCIP_STAGE_TRANSFORMING
22450  * - \ref SCIP_STAGE_TRANSFORMED
22451  * - \ref SCIP_STAGE_PRESOLVING
22452  * - \ref SCIP_STAGE_SOLVING
22453  *
22454  * @note lazy bounds are useful for branch-and-price since the corresponding variable bounds are not part of the LP
22455  */
22457  SCIP* scip, /**< SCIP data structure */
22458  SCIP_VAR* var, /**< problem variable */
22459  SCIP_Real lazylb /**< the lazy lower bound to be set */
22460  )
22461 {
22462  assert(scip != NULL);
22463  assert(var != NULL);
22464 
22465  SCIP_CALL( checkStage(scip, "SCIPchgVarLbLazy", FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22466 
22467  SCIP_CALL( SCIPvarChgLbLazy(var, scip->set, lazylb) );
22468 
22469  return SCIP_OKAY;
22470 }
22471 
22472 /** changes lazy upper bound of the variable, this is only possible if the variable is not in the LP yet
22473  *
22474  * lazy bounds are bounds, that are enforced by constraints and the objective function; hence, these bounds do not need
22475  * to be put into the LP explicitly.
22476  *
22477  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22478  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22479  *
22480  * @pre This method can be called if @p scip is in one of the following stages:
22481  * - \ref SCIP_STAGE_PROBLEM
22482  * - \ref SCIP_STAGE_TRANSFORMING
22483  * - \ref SCIP_STAGE_TRANSFORMED
22484  * - \ref SCIP_STAGE_PRESOLVING
22485  * - \ref SCIP_STAGE_SOLVING
22486  *
22487  * @note lazy bounds are useful for branch-and-price since the corresponding variable bounds are not part of the LP
22488  */
22490  SCIP* scip, /**< SCIP data structure */
22491  SCIP_VAR* var, /**< problem variable */
22492  SCIP_Real lazyub /**< the lazy lower bound to be set */
22493  )
22494 {
22495  assert(scip != NULL);
22496  assert(var != NULL);
22497 
22498  SCIP_CALL( checkStage(scip, "SCIPchgVarUbLazy", FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22499 
22500  SCIP_CALL( SCIPvarChgUbLazy(var, scip->set, lazyub) );
22501 
22502  return SCIP_OKAY;
22503 }
22504 
22505 /** changes lower bound of variable in preprocessing or in the current node, if the new bound is tighter
22506  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
22507  * doesn't store any inference information in the bound change, such that in conflict analysis, this change
22508  * is treated like a branching decision
22509  *
22510  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22511  * SCIPgetVars()) gets resorted.
22512  *
22513  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22514  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22515  *
22516  * @pre This method can be called if @p scip is in one of the following stages:
22517  * - \ref SCIP_STAGE_PROBLEM
22518  * - \ref SCIP_STAGE_PRESOLVING
22519  * - \ref SCIP_STAGE_SOLVING
22520  *
22521  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22522  */
22524  SCIP* scip, /**< SCIP data structure */
22525  SCIP_VAR* var, /**< variable to change the bound for */
22526  SCIP_Real newbound, /**< new value for bound */
22527  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
22528  SCIP_Bool* infeasible, /**< pointer to store whether the new domain is empty */
22529  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
22530  )
22531 {
22532  SCIP_Real lb;
22533  SCIP_Real ub;
22534 
22535  assert(infeasible != NULL);
22536  /** @todo if needed provide pending local/global bound changes that will be flushed after leaving diving mode (as in struct_tree.h) */
22537  assert(!SCIPinDive(scip));
22538 
22539  SCIP_CALL( checkStage(scip, "SCIPtightenVarLb", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22540 
22541  *infeasible = FALSE;
22542  if( tightened != NULL )
22543  *tightened = FALSE;
22544 
22545  SCIPvarAdjustLb(var, scip->set, &newbound);
22546 
22547  /* ignore tightenings of lower bounds to +infinity during solving process */
22548  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22549  {
22550 #ifndef NDEBUG
22551  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
22552  SCIPvarGetLbLocal(var));
22553 #endif
22554  return SCIP_OKAY;
22555  }
22556 
22557  /* get current bounds */
22558  lb = SCIPcomputeVarLbLocal(scip, var);
22559  ub = SCIPcomputeVarUbLocal(scip, var);
22560  assert(SCIPsetIsLE(scip->set, lb, ub));
22561 
22562  if( SCIPsetIsFeasGT(scip->set, newbound, ub) )
22563  {
22564  *infeasible = TRUE;
22565  return SCIP_OKAY;
22566  }
22567  newbound = MIN(newbound, ub);
22568 
22569  if( (force && SCIPsetIsLE(scip->set, newbound, lb)) || (!force && !SCIPsetIsLbBetter(scip->set, newbound, lb, ub)) )
22570  return SCIP_OKAY;
22571 
22572  switch( scip->set->stage )
22573  {
22574  case SCIP_STAGE_PROBLEM:
22575  assert(!SCIPvarIsTransformed(var));
22576  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22577  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22578  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22579  scip->branchcand, scip->eventqueue, newbound) );
22580  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
22581  break;
22583  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22584  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22585  break;
22586  case SCIP_STAGE_PRESOLVING:
22587  if( !SCIPinProbing(scip) )
22588  {
22589  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22590  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22591 
22592  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22593  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22595 
22597  {
22598  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
22599  assert(!(*infeasible));
22600  }
22601  break;
22602  }
22603  /*lint -fallthrough*/
22604  case SCIP_STAGE_SOLVING:
22606  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
22607  var, newbound, SCIP_BOUNDTYPE_LOWER, FALSE) );
22608  break;
22609 
22610  default:
22611  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22612  return SCIP_INVALIDCALL;
22613  } /*lint !e788*/
22614 
22615  if( tightened != NULL )
22616  *tightened = TRUE;
22617 
22618  return SCIP_OKAY;
22619 }
22620 
22621 /** changes upper bound of variable in preprocessing or in the current node, if the new bound is tighter
22622  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
22623  * doesn't store any inference information in the bound change, such that in conflict analysis, this change
22624  * is treated like a branching decision
22625  *
22626  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22627  * SCIPgetVars()) gets resorted.
22628  *
22629  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22630  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22631  *
22632  * @pre This method can be called if @p scip is in one of the following stages:
22633  * - \ref SCIP_STAGE_PROBLEM
22634  * - \ref SCIP_STAGE_PRESOLVING
22635  * - \ref SCIP_STAGE_SOLVING
22636  *
22637  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22638  */
22640  SCIP* scip, /**< SCIP data structure */
22641  SCIP_VAR* var, /**< variable to change the bound for */
22642  SCIP_Real newbound, /**< new value for bound */
22643  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
22644  SCIP_Bool* infeasible, /**< pointer to store whether the new domain is empty */
22645  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
22646  )
22647 {
22648  SCIP_Real lb;
22649  SCIP_Real ub;
22650 
22651  assert(infeasible != NULL);
22652  /** @todo if needed provide pending local/global bound changes that will be flushed after leaving diving mode (as in struct_tree.h) */
22653  assert(!SCIPinDive(scip));
22654 
22655  SCIP_CALL( checkStage(scip, "SCIPtightenVarUb", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22656 
22657  *infeasible = FALSE;
22658  if( tightened != NULL )
22659  *tightened = FALSE;
22660 
22661  SCIPvarAdjustUb(var, scip->set, &newbound);
22662 
22663  /* ignore tightenings of upper bounds to -infinity during solving process */
22664  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22665  {
22666 #ifndef NDEBUG
22667  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
22668  SCIPvarGetUbLocal(var));
22669 #endif
22670  return SCIP_OKAY;
22671  }
22672 
22673  /* get current bounds */
22674  lb = SCIPcomputeVarLbLocal(scip, var);
22675  ub = SCIPcomputeVarUbLocal(scip, var);
22676  assert(SCIPsetIsLE(scip->set, lb, ub));
22677 
22678  if( SCIPsetIsFeasLT(scip->set, newbound, lb) )
22679  {
22680  *infeasible = TRUE;
22681  return SCIP_OKAY;
22682  }
22683  newbound = MAX(newbound, lb);
22684 
22685  if( (force && SCIPsetIsGE(scip->set, newbound, ub)) || (!force && !SCIPsetIsUbBetter(scip->set, newbound, lb, ub)) )
22686  return SCIP_OKAY;
22687 
22688  switch( scip->set->stage )
22689  {
22690  case SCIP_STAGE_PROBLEM:
22691  assert(!SCIPvarIsTransformed(var));
22692  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22693  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22694  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22695  scip->branchcand, scip->eventqueue, newbound) );
22696  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
22697  break;
22699  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22700  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22701  break;
22702  case SCIP_STAGE_PRESOLVING:
22703  if( !SCIPinProbing(scip) )
22704  {
22705  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22706  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22707 
22708  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22709  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22711 
22713  {
22714  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
22715  assert(!(*infeasible));
22716  }
22717  break;
22718  }
22719  /*lint -fallthrough*/
22720  case SCIP_STAGE_SOLVING:
22722  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
22723  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, FALSE) );
22724  break;
22725 
22726  default:
22727  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22728  return SCIP_INVALIDCALL;
22729  } /*lint !e788*/
22730 
22731  if( tightened != NULL )
22732  *tightened = TRUE;
22733 
22734  return SCIP_OKAY;
22735 }
22736 
22737 /** fixes variable in preprocessing or in the current node, if the new bound is tighter (w.r.t. bound strengthening
22738  * epsilon) than the current bound; if possible, adjusts bound to integral value; the given inference constraint is
22739  * stored, such that the conflict analysis is able to find out the reason for the deduction of the bound change
22740  *
22741  * @note In presolving stage when not in probing mode the variable will be fixed directly, otherwise this method
22742  * changes first the lowerbound by calling SCIPinferVarLbCons and second the upperbound by calling
22743  * SCIPinferVarUbCons
22744  *
22745  * @note If SCIP is in presolving stage, it can happen that the internal variable array (which get be accessed via
22746  * SCIPgetVars()) gets resorted.
22747  *
22748  * @note During presolving, an integer variable which bound changes to {0,1} is upgraded to a binary variable.
22749  */
22751  SCIP* scip, /**< SCIP data structure */
22752  SCIP_VAR* var, /**< variable to change the bound for */
22753  SCIP_Real fixedval, /**< new value for fixation */
22754  SCIP_CONS* infercons, /**< constraint that deduced the bound change */
22755  int inferinfo, /**< user information for inference to help resolving the conflict */
22756  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
22757  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
22758  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
22759  )
22760 {
22761  assert(scip != NULL);
22762  assert(var != NULL);
22763  assert(infeasible != NULL);
22764 
22765  SCIP_CALL( checkStage(scip, "SCIPinferVarFixCons", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22766 
22767  if( tightened != NULL )
22768  *tightened = FALSE;
22769 
22770  /* in presolving case we take the shortcut to directly fix the variables */
22771  if( SCIPgetStage(scip) == SCIP_STAGE_PRESOLVING && SCIPtreeGetCurrentDepth(scip->tree) == 0 )
22772  {
22773  SCIP_Bool fixed;
22774 
22775  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
22776  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
22777  fixedval, infeasible, &fixed) );
22778 
22779  if( tightened != NULL )
22780  *tightened = fixed;
22781  }
22782  /* otherwise we use the lb and ub methods */
22783  else
22784  {
22785  SCIP_Bool lbtightened;
22786 
22787  SCIP_CALL( SCIPinferVarLbCons(scip, var, fixedval, infercons, inferinfo, force, infeasible, &lbtightened) );
22788 
22789  if( ! (*infeasible) )
22790  {
22791  SCIP_CALL( SCIPinferVarUbCons(scip, var, fixedval, infercons, inferinfo, force, infeasible, tightened) );
22792 
22793  if( tightened != NULL )
22794  *tightened |= lbtightened;
22795  }
22796  }
22797 
22798  return SCIP_OKAY;
22799 }
22800 
22801 /** changes lower bound of variable in preprocessing or in the current node, if the new bound is tighter
22802  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
22803  * the given inference constraint is stored, such that the conflict analysis is able to find out the reason
22804  * for the deduction of the bound change
22805  *
22806  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22807  * SCIPgetVars()) gets resorted.
22808  *
22809  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22810  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22811  *
22812  * @pre This method can be called if @p scip is in one of the following stages:
22813  * - \ref SCIP_STAGE_PROBLEM
22814  * - \ref SCIP_STAGE_PRESOLVING
22815  * - \ref SCIP_STAGE_SOLVING
22816  *
22817  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22818  */
22820  SCIP* scip, /**< SCIP data structure */
22821  SCIP_VAR* var, /**< variable to change the bound for */
22822  SCIP_Real newbound, /**< new value for bound */
22823  SCIP_CONS* infercons, /**< constraint that deduced the bound change */
22824  int inferinfo, /**< user information for inference to help resolving the conflict */
22825  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
22826  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
22827  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
22828  )
22829 {
22830  SCIP_Real lb;
22831  SCIP_Real ub;
22832 
22833  assert(infeasible != NULL);
22834 
22835  SCIP_CALL( checkStage(scip, "SCIPinferVarLbCons", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22836 
22837  *infeasible = FALSE;
22838  if( tightened != NULL )
22839  *tightened = FALSE;
22840 
22841  SCIPvarAdjustLb(var, scip->set, &newbound);
22842 
22843  /* ignore tightenings of lower bounds to +infinity during solving process */
22844  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22845  {
22846 #ifndef NDEBUG
22847  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
22848  SCIPvarGetLbLocal(var));
22849 #endif
22850  return SCIP_OKAY;
22851  }
22852 
22853  /* get current bounds */
22854  lb = SCIPvarGetLbLocal(var);
22855  ub = SCIPvarGetUbLocal(var);
22856  assert(SCIPsetIsLE(scip->set, lb, ub));
22857 
22858  if( SCIPsetIsFeasGT(scip->set, newbound, ub) )
22859  {
22860  *infeasible = TRUE;
22861  return SCIP_OKAY;
22862  }
22863  newbound = MIN(newbound, ub);
22864 
22865  if( (force && SCIPsetIsLE(scip->set, newbound, lb)) || (!force && !SCIPsetIsLbBetter(scip->set, newbound, lb, ub)) )
22866  return SCIP_OKAY;
22867 
22868  switch( scip->set->stage )
22869  {
22870  case SCIP_STAGE_PROBLEM:
22871  assert(!SCIPvarIsTransformed(var));
22872  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22873  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22874  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22875  scip->branchcand, scip->eventqueue, newbound) );
22876  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
22877  break;
22878 
22879  case SCIP_STAGE_PRESOLVING:
22880  if( !SCIPinProbing(scip) )
22881  {
22882  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22883  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22884 
22885  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22886  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22888 
22890  {
22891  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
22892  assert(!(*infeasible));
22893  }
22894  break;
22895  }
22896  /*lint -fallthrough*/
22897  case SCIP_STAGE_SOLVING:
22899  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
22900  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_LOWER, infercons, NULL, inferinfo, FALSE) );
22901  break;
22902 
22903  default:
22904  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22905  return SCIP_INVALIDCALL;
22906  } /*lint !e788*/
22907 
22908  if( tightened != NULL )
22909  *tightened = TRUE;
22910 
22911  return SCIP_OKAY;
22912 }
22913 
22914 /** changes upper bound of variable in preprocessing or in the current node, if the new bound is tighter
22915  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
22916  * the given inference constraint is stored, such that the conflict analysis is able to find out the reason
22917  * for the deduction of the bound change
22918  *
22919  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22920  * SCIPgetVars()) gets resorted.
22921  *
22922  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22923  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22924  *
22925  * @pre This method can be called if @p scip is in one of the following stages:
22926  * - \ref SCIP_STAGE_PROBLEM
22927  * - \ref SCIP_STAGE_PRESOLVING
22928  * - \ref SCIP_STAGE_SOLVING
22929  *
22930  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22931  */
22933  SCIP* scip, /**< SCIP data structure */
22934  SCIP_VAR* var, /**< variable to change the bound for */
22935  SCIP_Real newbound, /**< new value for bound */
22936  SCIP_CONS* infercons, /**< constraint that deduced the bound change */
22937  int inferinfo, /**< user information for inference to help resolving the conflict */
22938  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
22939  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
22940  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
22941  )
22942 {
22943  SCIP_Real lb;
22944  SCIP_Real ub;
22945 
22946  assert(infeasible != NULL);
22947 
22948  SCIP_CALL( checkStage(scip, "SCIPinferVarUbCons", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22949 
22950  *infeasible = FALSE;
22951  if( tightened != NULL )
22952  *tightened = FALSE;
22953 
22954  SCIPvarAdjustUb(var, scip->set, &newbound);
22955 
22956  /* ignore tightenings of upper bounds to -infinity during solving process */
22957  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22958  {
22959 #ifndef NDEBUG
22960  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
22961  SCIPvarGetUbLocal(var));
22962 #endif
22963  return SCIP_OKAY;
22964  }
22965 
22966  /* get current bounds */
22967  lb = SCIPvarGetLbLocal(var);
22968  ub = SCIPvarGetUbLocal(var);
22969  assert(SCIPsetIsLE(scip->set, lb, ub));
22970 
22971  if( SCIPsetIsFeasLT(scip->set, newbound, lb) )
22972  {
22973  *infeasible = TRUE;
22974  return SCIP_OKAY;
22975  }
22976  newbound = MAX(newbound, lb);
22977 
22978  if( (force && SCIPsetIsGE(scip->set, newbound, ub)) || (!force && !SCIPsetIsUbBetter(scip->set, newbound, lb, ub)) )
22979  return SCIP_OKAY;
22980 
22981  switch( scip->set->stage )
22982  {
22983  case SCIP_STAGE_PROBLEM:
22984  assert(!SCIPvarIsTransformed(var));
22985  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22986  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22987  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22988  scip->branchcand, scip->eventqueue, newbound) );
22989  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
22990  break;
22991 
22992  case SCIP_STAGE_PRESOLVING:
22993  if( !SCIPinProbing(scip) )
22994  {
22995  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22996  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22997 
22998  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22999  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
23001 
23003  {
23004  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
23005  assert(!(*infeasible));
23006  }
23007  break;
23008  }
23009  /*lint -fallthrough*/
23010  case SCIP_STAGE_SOLVING:
23012  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
23013  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, infercons, NULL, inferinfo, FALSE) );
23014  break;
23015 
23016  default:
23017  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
23018  return SCIP_INVALIDCALL;
23019  } /*lint !e788*/
23020 
23021  if( tightened != NULL )
23022  *tightened = TRUE;
23023 
23024  return SCIP_OKAY;
23025 }
23026 
23027 /** depending on SCIP's stage, fixes binary variable in the problem, in preprocessing, or in current node;
23028  * the given inference constraint is stored, such that the conflict analysis is able to find out the reason for the
23029  * deduction of the fixing
23030  *
23031  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23032  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23033  *
23034  * @pre This method can be called if @p scip is in one of the following stages:
23035  * - \ref SCIP_STAGE_PROBLEM
23036  * - \ref SCIP_STAGE_PRESOLVING
23037  * - \ref SCIP_STAGE_SOLVING
23038  */
23040  SCIP* scip, /**< SCIP data structure */
23041  SCIP_VAR* var, /**< binary variable to fix */
23042  SCIP_Bool fixedval, /**< value to fix binary variable to */
23043  SCIP_CONS* infercons, /**< constraint that deduced the fixing */
23044  int inferinfo, /**< user information for inference to help resolving the conflict */
23045  SCIP_Bool* infeasible, /**< pointer to store whether the fixing is infeasible */
23046  SCIP_Bool* tightened /**< pointer to store whether the fixing tightened the local bounds, or NULL */
23047  )
23048 {
23049  SCIP_Real lb;
23050  SCIP_Real ub;
23051 
23052  assert(SCIPvarIsBinary(var));
23053  assert(fixedval == TRUE || fixedval == FALSE);
23054  assert(infeasible != NULL);
23055 
23056  SCIP_CALL( checkStage(scip, "SCIPinferBinvarCons", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23057 
23058  *infeasible = FALSE;
23059  if( tightened != NULL )
23060  *tightened = FALSE;
23061 
23062  /* get current bounds */
23063  lb = SCIPvarGetLbLocal(var);
23064  ub = SCIPvarGetUbLocal(var);
23065  assert(SCIPsetIsEQ(scip->set, lb, 0.0) || SCIPsetIsEQ(scip->set, lb, 1.0));
23066  assert(SCIPsetIsEQ(scip->set, ub, 0.0) || SCIPsetIsEQ(scip->set, ub, 1.0));
23067  assert(SCIPsetIsLE(scip->set, lb, ub));
23068 
23069  /* check, if variable is already fixed */
23070  if( (lb > 0.5) || (ub < 0.5) )
23071  {
23072  *infeasible = (fixedval == (lb < 0.5));
23073 
23074  return SCIP_OKAY;
23075  }
23076 
23077  /* apply the fixing */
23078  switch( scip->set->stage )
23079  {
23080  case SCIP_STAGE_PROBLEM:
23081  assert(!SCIPvarIsTransformed(var));
23082  if( fixedval == TRUE )
23083  {
23084  SCIP_CALL( SCIPchgVarLb(scip, var, 1.0) );
23085  }
23086  else
23087  {
23088  SCIP_CALL( SCIPchgVarUb(scip, var, 0.0) );
23089  }
23090  break;
23091 
23092  case SCIP_STAGE_PRESOLVING:
23093  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 )
23094  {
23095  SCIP_Bool fixed;
23096 
23097  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
23098  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
23099  (SCIP_Real)fixedval, infeasible, &fixed) );
23100  break;
23101  }
23102  /*lint -fallthrough*/
23103  case SCIP_STAGE_SOLVING:
23104  if( fixedval == TRUE )
23105  {
23107  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
23108  scip->cliquetable, var, 1.0, SCIP_BOUNDTYPE_LOWER, infercons, NULL, inferinfo, FALSE) );
23109  }
23110  else
23111  {
23113  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
23114  scip->cliquetable, var, 0.0, SCIP_BOUNDTYPE_UPPER, infercons, NULL, inferinfo, FALSE) );
23115  }
23116  break;
23117 
23118  default:
23119  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
23120  return SCIP_INVALIDCALL;
23121  } /*lint !e788*/
23122 
23123  if( tightened != NULL )
23124  *tightened = TRUE;
23125 
23126  return SCIP_OKAY;
23127 }
23128 
23129 /** fixes variable in preprocessing or in the current node, if the new bound is tighter (w.r.t. bound strengthening
23130  * epsilon) than the current bound; if possible, adjusts bound to integral value; the given inference constraint is
23131  * stored, such that the conflict analysis is able to find out the reason for the deduction of the bound change
23132  *
23133  * @note In presolving stage when not in probing mode the variable will be fixed directly, otherwise this method
23134  * changes first the lowerbound by calling SCIPinferVarLbProp and second the upperbound by calling
23135  * SCIPinferVarUbProp
23136  *
23137  * @note If SCIP is in presolving stage, it can happen that the internal variable array (which get be accessed via
23138  * SCIPgetVars()) gets resorted.
23139  *
23140  * @note During presolving, an integer variable which bound changes to {0,1} is upgraded to a binary variable.
23141  */
23143  SCIP* scip, /**< SCIP data structure */
23144  SCIP_VAR* var, /**< variable to change the bound for */
23145  SCIP_Real fixedval, /**< new value for fixation */
23146  SCIP_PROP* inferprop, /**< propagator that deduced the bound change */
23147  int inferinfo, /**< user information for inference to help resolving the conflict */
23148  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
23149  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
23150  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
23151  )
23152 {
23153  assert(scip != NULL);
23154  assert(var != NULL);
23155  assert(infeasible != NULL);
23156 
23157  SCIP_CALL( checkStage(scip, "SCIPinferVarFixProp", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23158 
23159  if( tightened != NULL )
23160  *tightened = FALSE;
23161 
23162  /* in presolving case we take the shortcut to directly fix the variables */
23163  if( SCIPgetStage(scip) == SCIP_STAGE_PRESOLVING && SCIPtreeGetCurrentDepth(scip->tree) == 0 )
23164  {
23165  SCIP_Bool fixed;
23166 
23167  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
23168  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
23169  fixedval, infeasible, &fixed) );
23170 
23171  if( tightened != NULL )
23172  *tightened = fixed;
23173  }
23174  /* otherwise we use the lb and ub methods */
23175  else
23176  {
23177  SCIP_Bool lbtightened;
23178 
23179  SCIP_CALL( SCIPinferVarLbProp(scip, var, fixedval, inferprop, inferinfo, force, infeasible, &lbtightened) );
23180 
23181  if( ! (*infeasible) )
23182  {
23183  SCIP_CALL( SCIPinferVarUbProp(scip, var, fixedval, inferprop, inferinfo, force, infeasible, tightened) );
23184 
23185  if( tightened != NULL )
23186  *tightened |= lbtightened;
23187  }
23188  }
23189 
23190  return SCIP_OKAY;
23191 }
23192 
23193 /** changes lower bound of variable in preprocessing or in the current node, if the new bound is tighter
23194  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
23195  * the given inference propagator is stored, such that the conflict analysis is able to find out the reason
23196  * for the deduction of the bound change
23197  *
23198  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
23199  * SCIPgetVars()) gets resorted.
23200  *
23201  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23202  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23203  *
23204  * @pre This method can be called if @p scip is in one of the following stages:
23205  * - \ref SCIP_STAGE_PROBLEM
23206  * - \ref SCIP_STAGE_PRESOLVING
23207  * - \ref SCIP_STAGE_SOLVING
23208  *
23209  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
23210  */
23212  SCIP* scip, /**< SCIP data structure */
23213  SCIP_VAR* var, /**< variable to change the bound for */
23214  SCIP_Real newbound, /**< new value for bound */
23215  SCIP_PROP* inferprop, /**< propagator that deduced the bound change */
23216  int inferinfo, /**< user information for inference to help resolving the conflict */
23217  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
23218  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
23219  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
23220  )
23221 {
23222  SCIP_Real lb;
23223  SCIP_Real ub;
23224 
23225  assert(infeasible != NULL);
23226 
23227  SCIP_CALL( checkStage(scip, "SCIPinferVarLbProp", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23228 
23229  *infeasible = FALSE;
23230  if( tightened != NULL )
23231  *tightened = FALSE;
23232 
23233  SCIPvarAdjustLb(var, scip->set, &newbound);
23234 
23235  /* ignore tightenings of lower bounds to +infinity during solving process */
23236  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
23237  {
23238 #ifndef NDEBUG
23239  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
23240  SCIPvarGetLbLocal(var));
23241 #endif
23242  return SCIP_OKAY;
23243  }
23244 
23245  /* get current bounds */
23246  lb = SCIPvarGetLbLocal(var);
23247  ub = SCIPvarGetUbLocal(var);
23248  assert(SCIPsetIsLE(scip->set, lb, ub));
23249 
23250  if( SCIPsetIsFeasGT(scip->set, newbound, ub) )
23251  {
23252  *infeasible = TRUE;
23253  return SCIP_OKAY;
23254  }
23255  newbound = MIN(newbound, ub);
23256 
23257  if( (!force && !SCIPsetIsLbBetter(scip->set, newbound, lb, ub))
23258  || SCIPsetIsLE(scip->set, newbound, lb) )
23259  return SCIP_OKAY;
23260 
23261  switch( scip->set->stage )
23262  {
23263  case SCIP_STAGE_PROBLEM:
23264  assert(!SCIPvarIsTransformed(var));
23265  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23266  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
23267  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23268  scip->branchcand, scip->eventqueue, newbound) );
23269  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
23270  break;
23271 
23272  case SCIP_STAGE_PRESOLVING:
23273  if( !SCIPinProbing(scip) )
23274  {
23275  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
23276  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
23277 
23278  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
23279  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
23281 
23283  {
23284  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
23285  assert(!(*infeasible));
23286  }
23287  break;
23288  }
23289  /*lint -fallthrough*/
23290  case SCIP_STAGE_SOLVING:
23292  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
23293  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_LOWER, NULL, inferprop, inferinfo, FALSE) );
23294  break;
23295 
23296  default:
23297  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
23298  return SCIP_INVALIDCALL;
23299  } /*lint !e788*/
23300 
23301  if( tightened != NULL )
23302  *tightened = TRUE;
23303 
23304  return SCIP_OKAY;
23305 }
23306 
23307 /** changes upper bound of variable in preprocessing or in the current node, if the new bound is tighter
23308  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
23309  * the given inference propagator is stored, such that the conflict analysis is able to find out the reason
23310  * for the deduction of the bound change
23311  *
23312  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
23313  * SCIPgetVars()) gets resorted.
23314  *
23315  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23316  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23317  *
23318  * @pre This method can be called if @p scip is in one of the following stages:
23319  * - \ref SCIP_STAGE_PROBLEM
23320  * - \ref SCIP_STAGE_PRESOLVING
23321  * - \ref SCIP_STAGE_SOLVING
23322  *
23323  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
23324  */
23326  SCIP* scip, /**< SCIP data structure */
23327  SCIP_VAR* var, /**< variable to change the bound for */
23328  SCIP_Real newbound, /**< new value for bound */
23329  SCIP_PROP* inferprop, /**< propagator that deduced the bound change */
23330  int inferinfo, /**< user information for inference to help resolving the conflict */
23331  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
23332  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
23333  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
23334  )
23335 {
23336  SCIP_Real lb;
23337  SCIP_Real ub;
23338 
23339  assert(infeasible != NULL);
23340 
23341  SCIP_CALL( checkStage(scip, "SCIPinferVarUbProp", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23342 
23343  *infeasible = FALSE;
23344  if( tightened != NULL )
23345  *tightened = FALSE;
23346 
23347  SCIPvarAdjustUb(var, scip->set, &newbound);
23348 
23349  /* ignore tightenings of upper bounds to -infinity during solving process */
23350  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
23351  {
23352 #ifndef NDEBUG
23353  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
23354  SCIPvarGetUbLocal(var));
23355 #endif
23356  return SCIP_OKAY;
23357  }
23358 
23359  /* get current bounds */
23360  lb = SCIPvarGetLbLocal(var);
23361  ub = SCIPvarGetUbLocal(var);
23362  assert(SCIPsetIsLE(scip->set, lb, ub));
23363 
23364  if( SCIPsetIsFeasLT(scip->set, newbound, lb) )
23365  {
23366  *infeasible = TRUE;
23367  return SCIP_OKAY;
23368  }
23369  newbound = MAX(newbound, lb);
23370 
23371  if( (!force && !SCIPsetIsUbBetter(scip->set, newbound, lb, ub))
23372  || SCIPsetIsGE(scip->set, newbound, ub) )
23373  return SCIP_OKAY;
23374 
23375  switch( scip->set->stage )
23376  {
23377  case SCIP_STAGE_PROBLEM:
23378  assert(!SCIPvarIsTransformed(var));
23379  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23380  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
23381  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23382  scip->branchcand, scip->eventqueue, newbound) );
23383  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
23384  break;
23385 
23386  case SCIP_STAGE_PRESOLVING:
23387  if( !SCIPinProbing(scip) )
23388  {
23389  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
23390  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
23391 
23392  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
23393  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
23395 
23397  {
23398  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
23399  assert(!(*infeasible));
23400  }
23401  break;
23402  }
23403  /*lint -fallthrough*/
23404  case SCIP_STAGE_SOLVING:
23406  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
23407  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, NULL, inferprop, inferinfo, FALSE) );
23408  break;
23409 
23410  default:
23411  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
23412  return SCIP_INVALIDCALL;
23413  } /*lint !e788*/
23414 
23415  if( tightened != NULL )
23416  *tightened = TRUE;
23417 
23418  return SCIP_OKAY;
23419 }
23420 
23421 /** depending on SCIP's stage, fixes binary variable in the problem, in preprocessing, or in current node;
23422  * the given inference propagator is stored, such that the conflict analysis is able to find out the reason for the
23423  * deduction of the fixing
23424  *
23425  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23426  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23427  *
23428  * @pre This method can be called if @p scip is in one of the following stages:
23429  * - \ref SCIP_STAGE_PROBLEM
23430  * - \ref SCIP_STAGE_PRESOLVING
23431  * - \ref SCIP_STAGE_PRESOLVED
23432  * - \ref SCIP_STAGE_SOLVING
23433  */
23435  SCIP* scip, /**< SCIP data structure */
23436  SCIP_VAR* var, /**< binary variable to fix */
23437  SCIP_Bool fixedval, /**< value to fix binary variable to */
23438  SCIP_PROP* inferprop, /**< propagator that deduced the fixing */
23439  int inferinfo, /**< user information for inference to help resolving the conflict */
23440  SCIP_Bool* infeasible, /**< pointer to store whether the fixing is infeasible */
23441  SCIP_Bool* tightened /**< pointer to store whether the fixing tightened the local bounds, or NULL */
23442  )
23443 {
23444  SCIP_Real lb;
23445  SCIP_Real ub;
23446 
23447  assert(SCIPvarIsBinary(var));
23448  assert(fixedval == TRUE || fixedval == FALSE);
23449  assert(infeasible != NULL);
23450 
23451  SCIP_CALL( checkStage(scip, "SCIPinferBinvarProp", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23452 
23453  *infeasible = FALSE;
23454  if( tightened != NULL )
23455  *tightened = FALSE;
23456 
23457  /* get current bounds */
23458  lb = SCIPvarGetLbLocal(var);
23459  ub = SCIPvarGetUbLocal(var);
23460  assert(SCIPsetIsEQ(scip->set, lb, 0.0) || SCIPsetIsEQ(scip->set, lb, 1.0));
23461  assert(SCIPsetIsEQ(scip->set, ub, 0.0) || SCIPsetIsEQ(scip->set, ub, 1.0));
23462  assert(SCIPsetIsLE(scip->set, lb, ub));
23463 
23464  /* check, if variable is already fixed */
23465  if( (lb > 0.5) || (ub < 0.5) )
23466  {
23467  *infeasible = (fixedval == (lb < 0.5));
23468 
23469  return SCIP_OKAY;
23470  }
23471 
23472  /* apply the fixing */
23473  switch( scip->set->stage )
23474  {
23475  case SCIP_STAGE_PROBLEM:
23476  assert(!SCIPvarIsTransformed(var));
23477  if( fixedval == TRUE )
23478  {
23479  SCIP_CALL( SCIPchgVarLb(scip, var, 1.0) );
23480  }
23481  else
23482  {
23483  SCIP_CALL( SCIPchgVarUb(scip, var, 0.0) );
23484  }
23485  break;
23486 
23487  case SCIP_STAGE_PRESOLVING:
23488  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 )
23489  {
23490  SCIP_Bool fixed;
23491 
23492  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
23493  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
23494  (SCIP_Real)fixedval, infeasible, &fixed) );
23495  break;
23496  }
23497  /*lint -fallthrough*/
23498  case SCIP_STAGE_SOLVING:
23499  if( fixedval == TRUE )
23500  {
23502  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, 1.0,
23503  SCIP_BOUNDTYPE_LOWER, NULL, inferprop, inferinfo, FALSE) );
23504  }
23505  else
23506  {
23508  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, 0.0,
23509  SCIP_BOUNDTYPE_UPPER, NULL, inferprop, inferinfo, FALSE) );
23510  }
23511  break;
23512 
23513  default:
23514  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
23515  return SCIP_INVALIDCALL;
23516  } /*lint !e788*/
23517 
23518  if( tightened != NULL )
23519  *tightened = TRUE;
23520 
23521  return SCIP_OKAY;
23522 }
23523 
23524 /** changes global lower bound of variable in preprocessing or in the current node, if the new bound is tighter
23525  * (w.r.t. bound strengthening epsilon) than the current global bound; if possible, adjusts bound to integral value;
23526  * also tightens the local bound, if the global bound is better than the local bound
23527  *
23528  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
23529  * SCIPgetVars()) gets resorted.
23530  *
23531  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23532  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23533  *
23534  * @pre This method can be called if @p scip is in one of the following stages:
23535  * - \ref SCIP_STAGE_PROBLEM
23536  * - \ref SCIP_STAGE_TRANSFORMING
23537  * - \ref SCIP_STAGE_PRESOLVING
23538  * - \ref SCIP_STAGE_SOLVING
23539  *
23540  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
23541  */
23543  SCIP* scip, /**< SCIP data structure */
23544  SCIP_VAR* var, /**< variable to change the bound for */
23545  SCIP_Real newbound, /**< new value for bound */
23546  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
23547  SCIP_Bool* infeasible, /**< pointer to store whether the new domain is empty */
23548  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
23549  )
23550 {
23551  SCIP_Real lb;
23552  SCIP_Real ub;
23553 
23554  assert(infeasible != NULL);
23555 
23556  SCIP_CALL( checkStage(scip, "SCIPtightenVarLbGlobal", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23557 
23558  *infeasible = FALSE;
23559  if( tightened != NULL )
23560  *tightened = FALSE;
23561 
23562  SCIPvarAdjustLb(var, scip->set, &newbound);
23563 
23564  /* ignore tightenings of lower bounds to +infinity during solving process */
23565  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
23566  {
23567 #ifndef NDEBUG
23568  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
23569  SCIPvarGetLbLocal(var));
23570 #endif
23571  return SCIP_OKAY;
23572  }
23573 
23574  /* get current bounds */
23575  lb = SCIPvarGetLbGlobal(var);
23576  ub = SCIPvarGetUbGlobal(var);
23577  assert(scip->set->stage == SCIP_STAGE_PROBLEM || SCIPsetIsLE(scip->set, lb, ub));
23578 
23579  if( SCIPsetIsFeasGT(scip->set, newbound, ub) )
23580  {
23581  *infeasible = TRUE;
23582  return SCIP_OKAY;
23583  }
23584  newbound = MIN(newbound, ub);
23585 
23586  /* bound changes of less than epsilon are ignored by SCIPvarChgLb or raise an assert in SCIPnodeAddBoundinfer,
23587  * so don't apply them even if force is set
23588  */
23589  if( SCIPsetIsEQ(scip->set, lb, newbound) || (!force && !SCIPsetIsLbBetter(scip->set, newbound, lb, ub)) )
23590  return SCIP_OKAY;
23591 
23592  switch( scip->set->stage )
23593  {
23594  case SCIP_STAGE_PROBLEM:
23595  assert(!SCIPvarIsTransformed(var));
23596  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23597  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
23598  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23599  scip->branchcand, scip->eventqueue, newbound) );
23600  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
23601  break;
23602 
23604  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23605  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
23606  break;
23607 
23608  case SCIP_STAGE_PRESOLVING:
23609  if( !SCIPinProbing(scip) )
23610  {
23611  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
23612  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
23613 
23614  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
23615  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
23617 
23619  {
23620  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
23621  assert(!(*infeasible));
23622  }
23623  break;
23624  }
23625  /*lint -fallthrough*/
23626  case SCIP_STAGE_SOLVING:
23627  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
23628  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
23630  break;
23631 
23632  default:
23633  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
23634  return SCIP_INVALIDCALL;
23635  } /*lint !e788*/
23636 
23637  /* coverity: unreachable code */
23638  if( tightened != NULL )
23639  *tightened = TRUE;
23640 
23641  return SCIP_OKAY;
23642 }
23643 
23644 /** changes global upper bound of variable in preprocessing or in the current node, if the new bound is tighter
23645  * (w.r.t. bound strengthening epsilon) than the current global bound; if possible, adjusts bound to integral value;
23646  * also tightens the local bound, if the global bound is better than the local bound
23647  *
23648  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
23649  * SCIPgetVars()) gets resorted.
23650  *
23651  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23652  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23653  *
23654  * @pre This method can be called if @p scip is in one of the following stages:
23655  * - \ref SCIP_STAGE_PROBLEM
23656  * - \ref SCIP_STAGE_TRANSFORMING
23657  * - \ref SCIP_STAGE_PRESOLVING
23658  * - \ref SCIP_STAGE_SOLVING
23659  *
23660  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
23661  */
23663  SCIP* scip, /**< SCIP data structure */
23664  SCIP_VAR* var, /**< variable to change the bound for */
23665  SCIP_Real newbound, /**< new value for bound */
23666  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
23667  SCIP_Bool* infeasible, /**< pointer to store whether the new domain is empty */
23668  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
23669  )
23670 {
23671  SCIP_Real lb;
23672  SCIP_Real ub;
23673 
23674  assert(infeasible != NULL);
23675 
23676  SCIP_CALL( checkStage(scip, "SCIPtightenVarUbGlobal", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23677 
23678  *infeasible = FALSE;
23679  if( tightened != NULL )
23680  *tightened = FALSE;
23681 
23682  SCIPvarAdjustUb(var, scip->set, &newbound);
23683 
23684  /* ignore tightenings of upper bounds to -infinity during solving process */
23685  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
23686  {
23687 #ifndef NDEBUG
23688  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
23689  SCIPvarGetUbLocal(var));
23690 #endif
23691  return SCIP_OKAY;
23692  }
23693 
23694  /* get current bounds */
23695  lb = SCIPvarGetLbGlobal(var);
23696  ub = SCIPvarGetUbGlobal(var);
23697  assert(scip->set->stage == SCIP_STAGE_PROBLEM || SCIPsetIsLE(scip->set, lb, ub));
23698 
23699  if( SCIPsetIsFeasLT(scip->set, newbound, lb) )
23700  {
23701  *infeasible = TRUE;
23702  return SCIP_OKAY;
23703  }
23704  newbound = MAX(newbound, lb);
23705 
23706  /* bound changes of less than epsilon are ignored by SCIPvarChgUb or raise an assert in SCIPnodeAddBoundinfer,
23707  * so don't apply them even if force is set
23708  */
23709  if( SCIPsetIsEQ(scip->set, ub, newbound) || (!force && !SCIPsetIsUbBetter(scip->set, newbound, lb, ub)) )
23710  return SCIP_OKAY;
23711 
23712  switch( scip->set->stage )
23713  {
23714  case SCIP_STAGE_PROBLEM:
23715  assert(!SCIPvarIsTransformed(var));
23716  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23717  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
23718  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23719  scip->branchcand, scip->eventqueue, newbound) );
23720  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
23721  break;
23722 
23724  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23725  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
23726  break;
23727 
23728  case SCIP_STAGE_PRESOLVING:
23729  if( !SCIPinProbing(scip) )
23730  {
23731  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
23732  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
23733 
23734  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
23735  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
23737 
23739  {
23740  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
23741  assert(!(*infeasible));
23742  }
23743  break;
23744  }
23745  /*lint -fallthrough*/
23746  case SCIP_STAGE_SOLVING:
23747  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
23748  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
23750  break;
23751 
23752  default:
23753  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
23754  return SCIP_INVALIDCALL;
23755  } /*lint !e788*/
23756 
23757  /* coverity: unreachable code */
23758  if( tightened != NULL )
23759  *tightened = TRUE;
23760 
23761  return SCIP_OKAY;
23762 }
23763 
23764 /* some simple variable functions implemented as defines */
23765 #undef SCIPcomputeVarLbGlobal
23766 #undef SCIPcomputeVarUbGlobal
23767 #undef SCIPcomputeVarLbLocal
23768 #undef SCIPcomputeVarUbLocal
23769 
23770 /** for a multi-aggregated variable, returns the global lower bound computed by adding the global bounds from all aggregation variables
23771  *
23772  * 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
23773  * calling this function for a non-multi-aggregated variable results in a call to SCIPvarGetLbGlobal.
23774  *
23775  * @return the global lower bound computed by adding the global bounds from all aggregation variables
23776  */
23778  SCIP* scip, /**< SCIP data structure */
23779  SCIP_VAR* var /**< variable to compute the bound for */
23780  )
23781 {
23782  assert(scip != NULL);
23783  assert(var != NULL);
23784 
23786  return SCIPvarGetMultaggrLbGlobal(var, scip->set);
23787  else
23788  return SCIPvarGetLbGlobal(var);
23789 }
23790 
23791 /** for a multi-aggregated variable, returns the global upper bound computed by adding the global bounds from all aggregation variables
23792  *
23793  * 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
23794  * calling this function for a non-multi-aggregated variable results in a call to SCIPvarGetUbGlobal
23795  *
23796  * @return the global upper bound computed by adding the global bounds from all aggregation variables
23797  */
23799  SCIP* scip, /**< SCIP data structure */
23800  SCIP_VAR* var /**< variable to compute the bound for */
23801  )
23802 {
23803  assert(scip != NULL);
23804  assert(var != NULL);
23805 
23807  return SCIPvarGetMultaggrUbGlobal(var, scip->set);
23808  else
23809  return SCIPvarGetUbGlobal(var);
23810 }
23811 
23812 /** for a multi-aggregated variable, returns the local lower bound computed by adding the local bounds from all aggregation variables
23813  *
23814  * 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
23815  * calling this function for a non-multi-aggregated variable results in a call to SCIPvarGetLbLocal.
23816  *
23817  * @return the local lower bound computed by adding the global bounds from all aggregation variables
23818  */
23820  SCIP* scip, /**< SCIP data structure */
23821  SCIP_VAR* var /**< variable to compute the bound for */
23822  )
23823 {
23824  assert(scip != NULL);
23825  assert(var != NULL);
23826 
23828  return SCIPvarGetMultaggrLbLocal(var, scip->set);
23829  else
23830  return SCIPvarGetLbLocal(var);
23831 }
23832 
23833 /** for a multi-aggregated variable, returns the local upper bound computed by adding the local bounds from all aggregation variables
23834  *
23835  * 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
23836  * calling this function for a non-multi-aggregated variable results in a call to SCIPvarGetUbLocal.
23837  *
23838  * @return the local upper bound computed by adding the global bounds from all aggregation variables
23839  */
23841  SCIP* scip, /**< SCIP data structure */
23842  SCIP_VAR* var /**< variable to compute the bound for */
23843  )
23844 {
23845  assert(scip != NULL);
23846  assert(var != NULL);
23847 
23849  return SCIPvarGetMultaggrUbLocal(var, scip->set);
23850  else
23851  return SCIPvarGetUbLocal(var);
23852 }
23853 
23854 /** for a multi-aggregated variable, gives the global lower bound computed by adding the global bounds from all
23855  * aggregation variables, this global bound may be tighter than the one given by SCIPvarGetLbGlobal, since the latter is
23856  * not updated if bounds of aggregation variables are changing
23857  *
23858  * calling this function for a non-multi-aggregated variable is not allowed
23859  */
23861  SCIP* scip, /**< SCIP data structure */
23862  SCIP_VAR* var /**< variable to compute the bound for */
23863  )
23864 {
23865  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_MULTAGGR);
23866  return SCIPvarGetMultaggrLbGlobal(var, scip->set);
23867 }
23868 
23869 /** for a multi-aggregated variable, gives the global upper bound computed by adding the global bounds from all
23870  * aggregation variables, this upper bound may be tighter than the one given by SCIPvarGetUbGlobal, since the latter is
23871  * not updated if bounds of aggregation variables are changing
23872  *
23873  * calling this function for a non-multi-aggregated variable is not allowed
23874  */
23876  SCIP* scip, /**< SCIP data structure */
23877  SCIP_VAR* var /**< variable to compute the bound for */
23878  )
23879 {
23880  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_MULTAGGR);
23881  return SCIPvarGetMultaggrUbGlobal(var, scip->set);
23882 }
23883 
23884 /** for a multi-aggregated variable, gives the local lower bound computed by adding the local bounds from all
23885  * aggregation variables, this lower bound may be tighter than the one given by SCIPvarGetLbLocal, since the latter is
23886  * not updated if bounds of aggregation variables are changing
23887  *
23888  * calling this function for a non-multi-aggregated variable is not allowed
23889  */
23891  SCIP* scip, /**< SCIP data structure */
23892  SCIP_VAR* var /**< variable to compute the bound for */
23893  )
23894 {
23895  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_MULTAGGR);
23896  return SCIPvarGetMultaggrLbLocal(var, scip->set);
23897 }
23898 
23899 /** for a multi-aggregated variable, gives the local upper bound computed by adding the local bounds from all
23900  * aggregation variables, this upper bound may be tighter than the one given by SCIPvarGetUbLocal, since the latter is
23901  * not updated if bounds of aggregation variables are changing
23902  *
23903  * calling this function for a non-multi-aggregated variable is not allowed
23904  */
23906  SCIP* scip, /**< SCIP data structure */
23907  SCIP_VAR* var /**< variable to compute the bound for */
23908  )
23909 {
23910  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_MULTAGGR);
23911  return SCIPvarGetMultaggrUbLocal(var, scip->set);
23912 }
23913 
23914 /** returns solution value and index of variable lower bound that is closest to the variable's value in the given primal
23915  * solution or current LP solution if no primal solution is given; returns an index of -1 if no variable lower bound is
23916  * available
23917  *
23918  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23919  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23920  *
23921  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
23922  */
23924  SCIP* scip, /**< SCIP data structure */
23925  SCIP_VAR* var, /**< active problem variable */
23926  SCIP_SOL* sol, /**< primal solution, or NULL for LP solution */
23927  SCIP_Real* closestvlb, /**< pointer to store the value of the closest variable lower bound */
23928  int* closestvlbidx /**< pointer to store the index of the closest variable lower bound */
23929  )
23930 {
23931  SCIP_CALL( checkStage(scip, "SCIPgetVarClosestVlb", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23932 
23933  SCIPvarGetClosestVlb(var, sol, scip->set, scip->stat, closestvlb, closestvlbidx);
23934 
23935  return SCIP_OKAY;
23936 }
23937 
23938 /** returns solution value and index of variable upper bound that is closest to the variable's value in the given primal solution;
23939  * or current LP solution if no primal solution is given; returns an index of -1 if no variable upper bound is available
23940  *
23941  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23942  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23943  *
23944  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
23945  */
23947  SCIP* scip, /**< SCIP data structure */
23948  SCIP_VAR* var, /**< active problem variable */
23949  SCIP_SOL* sol, /**< primal solution, or NULL for LP solution */
23950  SCIP_Real* closestvub, /**< pointer to store the value of the closest variable lower bound */
23951  int* closestvubidx /**< pointer to store the index of the closest variable lower bound */
23952  )
23953 {
23954  SCIP_CALL( checkStage(scip, "SCIPgetVarClosestVub", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23955 
23956  SCIPvarGetClosestVub(var, sol, scip->set, scip->stat, closestvub, closestvubidx);
23957 
23958  return SCIP_OKAY;
23959 }
23960 
23961 /** informs variable x about a globally valid variable lower bound x >= b*z + d with integer variable z;
23962  * if z is binary, the corresponding valid implication for z is also added;
23963  * if z is non-continuous and 1/b not too small, the corresponding valid upper/lower bound
23964  * z <= (x-d)/b or z >= (x-d)/b (depending on the sign of of b) is added, too;
23965  * improves the global bounds of the variable and the vlb variable if possible
23966  *
23967  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23968  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23969  *
23970  * @pre This method can be called if @p scip is in one of the following stages:
23971  * - \ref SCIP_STAGE_PRESOLVING
23972  * - \ref SCIP_STAGE_PRESOLVED
23973  * - \ref SCIP_STAGE_SOLVING
23974  */
23976  SCIP* scip, /**< SCIP data structure */
23977  SCIP_VAR* var, /**< problem variable */
23978  SCIP_VAR* vlbvar, /**< variable z in x >= b*z + d */
23979  SCIP_Real vlbcoef, /**< coefficient b in x >= b*z + d */
23980  SCIP_Real vlbconstant, /**< constant d in x >= b*z + d */
23981  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
23982  int* nbdchgs /**< pointer to store the number of performed bound changes, or NULL */
23983  )
23984 {
23985  int nlocalbdchgs;
23986 
23987  SCIP_CALL( checkStage(scip, "SCIPaddVarVlb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23988 
23989  SCIP_CALL( SCIPvarAddVlb(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob, scip->tree,
23990  scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, vlbvar, vlbcoef, vlbconstant,
23991  TRUE, infeasible, &nlocalbdchgs) );
23992 
23993  *nbdchgs = nlocalbdchgs;
23994 
23995  /* 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
23996  * detected infeasibility
23997  */
23998  if( !(*infeasible) && SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS && !SCIPisZero(scip, 1.0/vlbcoef) )
23999  {
24000  if( vlbcoef > 0.0 )
24001  {
24002  /* if b > 0, we have a variable upper bound: x >= b*z + d => z <= (x-d)/b */
24003  SCIP_CALL( SCIPvarAddVub(vlbvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
24004  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var, 1.0/vlbcoef,
24005  -vlbconstant/vlbcoef, TRUE, infeasible, &nlocalbdchgs) );
24006  }
24007  else
24008  {
24009  /* if b < 0, we have a variable lower bound: x >= b*z + d => z >= (x-d)/b */
24010  SCIP_CALL( SCIPvarAddVlb(vlbvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
24011  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var, 1.0/vlbcoef,
24012  -vlbconstant/vlbcoef, TRUE, infeasible, &nlocalbdchgs) );
24013  }
24014  *nbdchgs += nlocalbdchgs;
24015  }
24016 
24017  return SCIP_OKAY;
24018 }
24019 
24020 /** informs variable x about a globally valid variable upper bound x <= b*z + d with integer variable z;
24021  * if z is binary, the corresponding valid implication for z is also added;
24022  * if z is non-continuous and 1/b not too small, the corresponding valid lower/upper bound
24023  * z >= (x-d)/b or z <= (x-d)/b (depending on the sign of of b) is added, too;
24024  * improves the global bounds of the variable and the vlb variable if possible
24025  *
24026  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24027  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24028  *
24029  * @pre This method can be called if @p scip is in one of the following stages:
24030  * - \ref SCIP_STAGE_PRESOLVING
24031  * - \ref SCIP_STAGE_PRESOLVED
24032  * - \ref SCIP_STAGE_SOLVING
24033  */
24035  SCIP* scip, /**< SCIP data structure */
24036  SCIP_VAR* var, /**< problem variable */
24037  SCIP_VAR* vubvar, /**< variable z in x <= b*z + d */
24038  SCIP_Real vubcoef, /**< coefficient b in x <= b*z + d */
24039  SCIP_Real vubconstant, /**< constant d in x <= b*z + d */
24040  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
24041  int* nbdchgs /**< pointer to store the number of performed bound changes, or NULL */
24042  )
24043 {
24044  int nlocalbdchgs;
24045 
24046  SCIP_CALL( checkStage(scip, "SCIPaddVarVub", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24047 
24048  SCIP_CALL( SCIPvarAddVub(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob, scip->tree,
24049  scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, vubvar, vubcoef, vubconstant, TRUE,
24050  infeasible, &nlocalbdchgs) );
24051 
24052  *nbdchgs = nlocalbdchgs;
24053 
24054  /* 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
24055  * detected infeasibility
24056  */
24057  if( !(*infeasible) && SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS && !SCIPisZero(scip, 1.0/vubcoef) )
24058  {
24059  if( vubcoef > 0.0 )
24060  {
24061  /* if b < 0, we have a variable lower bound: x >= b*z + d => z >= (x-d)/b */
24062  SCIP_CALL( SCIPvarAddVlb(vubvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
24063  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var, 1.0/vubcoef,
24064  -vubconstant/vubcoef, TRUE, infeasible, &nlocalbdchgs) );
24065  }
24066  else
24067  {
24068  /* if b > 0, we have a variable upper bound: x >= b*z + d => z <= (x-d)/b */
24069  SCIP_CALL( SCIPvarAddVub(vubvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
24070  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var, 1.0/vubcoef,
24071  -vubconstant/vubcoef, TRUE, infeasible, &nlocalbdchgs) );
24072  }
24073  *nbdchgs += nlocalbdchgs;
24074  }
24075 
24076  return SCIP_OKAY;
24077 }
24078 
24079 /** informs binary variable x about a globally valid implication: x == 0 or x == 1 ==> y <= b or y >= b;
24080  * also adds the corresponding implication or variable bound to the implied variable;
24081  * if the implication is conflicting, the variable is fixed to the opposite value;
24082  * if the variable is already fixed to the given value, the implication is performed immediately;
24083  * if the implication is redundant with respect to the variables' global bounds, it is ignored
24084  *
24085  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24086  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24087  *
24088  * @pre This method can be called if @p scip is in one of the following stages:
24089  * - \ref SCIP_STAGE_TRANSFORMED
24090  * - \ref SCIP_STAGE_PRESOLVING
24091  * - \ref SCIP_STAGE_PRESOLVED
24092  * - \ref SCIP_STAGE_SOLVING
24093  */
24095  SCIP* scip, /**< SCIP data structure */
24096  SCIP_VAR* var, /**< problem variable */
24097  SCIP_Bool varfixing, /**< FALSE if y should be added in implications for x == 0, TRUE for x == 1 */
24098  SCIP_VAR* implvar, /**< variable y in implication y <= b or y >= b */
24099  SCIP_BOUNDTYPE impltype, /**< type of implication y <= b (SCIP_BOUNDTYPE_UPPER)
24100  * or y >= b (SCIP_BOUNDTYPE_LOWER) */
24101  SCIP_Real implbound, /**< bound b in implication y <= b or y >= b */
24102  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
24103  int* nbdchgs /**< pointer to store the number of performed bound changes, or NULL */
24104  )
24105 {
24106  SCIP_CALL( checkStage(scip, "SCIPaddVarImplication", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24107 
24108  if ( nbdchgs != NULL )
24109  *nbdchgs = 0;
24110 
24111  if( !SCIPvarIsBinary(var) )
24112  {
24113  SCIPerrorMessage("can't add implication for nonbinary variable\n");
24114  return SCIP_INVALIDDATA;
24115  }
24116 
24117  /* transform implication containing two binary variables to clique */
24118  if( SCIPvarIsBinary(implvar) )
24119  {
24120  SCIP_VAR* vars[2];
24121  SCIP_Bool vals[2];
24122 
24123  assert(SCIPisFeasEQ(scip, implbound, 1.0) || SCIPisFeasZero(scip, implbound));
24124  assert((impltype == SCIP_BOUNDTYPE_UPPER) == SCIPisFeasZero(scip, implbound));
24125 
24126  vars[0] = var;
24127  vars[1] = implvar;
24128  vals[0] = varfixing;
24129  vals[1] = (impltype == SCIP_BOUNDTYPE_UPPER);
24130 
24131  SCIP_CALL( SCIPaddClique(scip, vars, vals, 2, FALSE, infeasible, nbdchgs) );
24132 
24133  return SCIP_OKAY;
24134  }
24135 
24136  /* the implication graph can only handle 'real' binary (SCIP_VARTYPE_BINARY) variables, therefore we transform the
24137  * implication in variable bounds, (lowerbound of y will be abbreviated by lby, upperbound equivlaent) the follwing
24138  * four cases are:
24139  *
24140  * 1. (x >= 1 => y >= b) => y >= (b - lby) * x + lby
24141  * 2. (x >= 1 => y <= b) => y <= (b - uby) * x + uby
24142  * 3. (x <= 0 => y >= b) => y >= (lby - b) * x + b
24143  * 4. (x <= 0 => y <= b) => y <= (uby - b) * x + b
24144  */
24145  if( SCIPvarGetType(var) != SCIP_VARTYPE_BINARY )
24146  {
24147  SCIP_Real lby;
24148  SCIP_Real uby;
24149 
24150  lby = SCIPvarGetLbGlobal(implvar);
24151  uby = SCIPvarGetUbGlobal(implvar);
24152 
24153  if( varfixing == TRUE )
24154  {
24155  if( impltype == SCIP_BOUNDTYPE_LOWER )
24156  {
24157  /* we return if the lower bound is infinity */
24158  if( SCIPisInfinity(scip, -lby) )
24159  return SCIP_OKAY;
24160 
24161  SCIP_CALL( SCIPvarAddVlb(implvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
24162  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var,
24163  implbound - lby, lby, TRUE, infeasible, nbdchgs) );
24164  }
24165  else
24166  {
24167  /* we return if the upper bound is infinity */
24168  if( SCIPisInfinity(scip, uby) )
24169  return SCIP_OKAY;
24170 
24171  SCIP_CALL( SCIPvarAddVub(implvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
24172  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var,
24173  implbound - uby, uby, TRUE, infeasible, nbdchgs) );
24174  }
24175  }
24176  else
24177  {
24178  if( impltype == SCIP_BOUNDTYPE_LOWER )
24179  {
24180  /* we return if the lower bound is infinity */
24181  if( SCIPisInfinity(scip, -lby) )
24182  return SCIP_OKAY;
24183 
24184  SCIP_CALL( SCIPvarAddVlb(implvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
24185  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var,
24186  lby - implbound, implbound, TRUE, infeasible, nbdchgs) );
24187  }
24188  else
24189  {
24190  /* we return if the upper bound is infinity */
24191  if( SCIPisInfinity(scip, uby) )
24192  return SCIP_OKAY;
24193 
24194  SCIP_CALL( SCIPvarAddVub(implvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
24195  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var,
24196  uby - implbound, implbound, TRUE, infeasible, nbdchgs) );
24197  }
24198  }
24199  }
24200  else
24201  {
24202  SCIP_CALL( SCIPvarAddImplic(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
24203  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, varfixing, implvar, impltype,
24204  implbound, TRUE, infeasible, nbdchgs) );
24205  }
24206 
24207  return SCIP_OKAY;
24208 }
24209 
24210 /** adds a clique information to SCIP, stating that at most one of the given binary variables can be set to 1;
24211  * if a variable appears twice in the same clique, the corresponding implications are performed
24212  *
24213  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24214  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24215  *
24216  * @pre This method can be called if @p scip is in one of the following stages:
24217  * - \ref SCIP_STAGE_TRANSFORMED
24218  * - \ref SCIP_STAGE_PRESOLVING
24219  * - \ref SCIP_STAGE_PRESOLVED
24220  * - \ref SCIP_STAGE_SOLVING
24221  */
24223  SCIP* scip, /**< SCIP data structure */
24224  SCIP_VAR** vars, /**< binary variables in the clique from which at most one can be set to 1 */
24225  SCIP_Bool* values, /**< values of the variables in the clique; NULL to use TRUE for all vars */
24226  int nvars, /**< number of variables in the clique */
24227  SCIP_Bool isequation, /**< is the clique an equation or an inequality? */
24228  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
24229  int* nbdchgs /**< pointer to store the number of performed bound changes, or NULL */
24230  )
24231 {
24232  SCIP_CALL( checkStage(scip, "SCIPaddClique", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24233 
24234  *infeasible = FALSE;
24235  if( nbdchgs != NULL )
24236  *nbdchgs = 0;
24237 
24238  if( nvars > 1 )
24239  {
24240  /* add the clique to the clique table */
24241  SCIP_CALL( SCIPcliquetableAdd(scip->cliquetable, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
24242  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, vars, values, nvars, isequation,
24243  infeasible, nbdchgs) );
24244  }
24245 
24246  return SCIP_OKAY;
24247 }
24248 
24249 /** relabels the given labels in-place in an increasing fashion: the first seen label is 0, the next label 1, etc...
24250  *
24251  * @note every label equal to -1 is treated as a previously unseen, unique label and gets a new ordered label.
24252  */
24253 static
24255  SCIP*const scip, /**< SCIP data structure */
24256  int* labels, /**< current labels that will be overwritten */
24257  int const nlabels, /**< number of variables in the clique */
24258  int* nclasses /**< pointer to store the total number of distinct labels */
24259  )
24260 {
24261  SCIP_HASHMAP* classidx2newlabel;
24262 
24263  int classidx;
24264  int i;
24265 
24266  SCIP_CALL( SCIPhashmapCreate(&classidx2newlabel, SCIPblkmem(scip), nlabels) );
24267 
24268  classidx = 0;
24269 
24270  /* loop over labels to create local class indices that obey the variable order */
24271  for( i = 0; i < nlabels; ++i )
24272  {
24273  int currentlabel = labels[i];
24274  int localclassidx;
24275 
24276  /* labels equal to -1 are stored as singleton classes */
24277  if( currentlabel == -1 )
24278  {
24279  ++classidx;
24280  localclassidx = classidx;
24281  }
24282  else
24283  {
24284  assert(currentlabel >= 0);
24285  /* look up the class index image in the hash map; if it is not stored yet, new class index is created and stored */
24286  if( !SCIPhashmapExists(classidx2newlabel, (void*)(size_t)currentlabel) )
24287  {
24288  ++classidx;
24289  localclassidx = classidx;
24290  SCIP_CALL( SCIPhashmapInsert(classidx2newlabel, (void*)(size_t)currentlabel, (void *)(size_t)classidx) );
24291  }
24292  else
24293  {
24294  localclassidx = (int)(size_t)SCIPhashmapGetImage(classidx2newlabel, (void*)(size_t)currentlabel);
24295  }
24296  }
24297  assert(localclassidx - 1 >= 0);
24298  assert(localclassidx - 1 <= i);
24299 
24300  /* indices start with zero, but we have an offset of 1 because we cannot store 0 in a hashmap */
24301  labels[i] = localclassidx - 1;
24302  }
24303 
24304  assert(classidx > 0);
24305  assert(classidx <= nlabels);
24306  *nclasses = classidx;
24307 
24308  SCIPhashmapFree(&classidx2newlabel);
24309 
24310  return SCIP_OKAY;
24311 }
24312 
24313 /** sort the variables w.r.t. the given labels; thereby ensure the current order of the variables with the same label. */
24314 static
24316  SCIP* scip, /**< SCIP data structure */
24317  SCIP_VAR** vars, /**< variable array */
24318  int* classlabels, /**< array that contains a class label for every variable */
24319  SCIP_VAR** sortedvars, /**< array to store variables after stable sorting */
24320  int* sortedindices, /**< array to store indices of sorted variables in the original vars array */
24321  int* classesstartposs, /**< starting position array for each label class (must have size nclasses + 1) */
24322  int nvars, /**< size of the vars arrays */
24323  int nclasses /**< number of label classes */
24324  )
24325 {
24326  SCIP_VAR*** varpointers;
24327  int** indexpointers;
24328  int* classcount;
24329 
24330  int nextpos;
24331  int c;
24332  int v;
24333 
24334  assert(scip != NULL);
24335  assert(vars != NULL);
24336  assert(sortedindices != NULL);
24337  assert(classesstartposs != NULL);
24338 
24339  assert(nvars == 0 || vars != NULL);
24340 
24341  if( nvars == 0 )
24342  return SCIP_OKAY;
24343 
24344  assert(classlabels != NULL);
24345  assert(nclasses > 0);
24346 
24347  /* we first count all class cardinalities and allocate temporary memory for a bucket sort */
24348  SCIP_CALL( SCIPallocBufferArray(scip, &classcount, nclasses) );
24349  BMSclearMemoryArray(classcount, nclasses);
24350 
24351  /* first we count for each class the number of elements */
24352  for( v = nvars - 1; v >= 0; --v )
24353  {
24354  assert(0 <= classlabels[v] && classlabels[v] < nclasses);
24355  ++(classcount[classlabels[v]]);
24356  }
24357 
24358 #ifndef NDEBUG
24359  BMSclearMemoryArray(sortedvars, nvars);
24360  BMSclearMemoryArray(sortedindices, nvars);
24361 #endif
24362  SCIP_CALL( SCIPallocBufferArray(scip, &varpointers, nclasses) );
24363  SCIP_CALL( SCIPallocBufferArray(scip, &indexpointers, nclasses) );
24364 
24365  nextpos = 0;
24366  /* now we initialize all start pointers for each class, so they will be ordered */
24367  for( c = 0; c < nclasses; ++c )
24368  {
24369  /* to reach the goal that all variables of each class will be standing next to each other we will initialize the
24370  * starting pointers for each class by adding the cardinality of each class to the last class starting pointer
24371  * e.g. class1 has 4 elements and class2 has 3 elements then the starting pointer for class1 will be the pointer
24372  * to sortedvars[0], the starting pointer to class2 will be the pointer to sortedvars[4] and to class3 it will be
24373  * the pointer to sortedvars[7]
24374  */
24375  varpointers[c] = (SCIP_VAR**) (sortedvars + nextpos);
24376  indexpointers[c] = (int*) (sortedindices + nextpos);
24377  classesstartposs[c] = nextpos;
24378  assert(classcount[c] > 0);
24379  nextpos += classcount[c];
24380  assert(nextpos > 0);
24381  }
24382  assert(nextpos == nvars);
24383  classesstartposs[c] = nextpos;
24384 
24385  /* now we copy all variables to the right order */
24386  for( v = 0; v < nvars; ++v )
24387  {
24388  /* copy variable itself to the right position */
24389  *(varpointers[classlabels[v]]) = vars[v]; /*lint !e613*/
24390  ++(varpointers[classlabels[v]]);
24391 
24392  /* copy index */
24393  *(indexpointers[classlabels[v]]) = v;
24394  ++(indexpointers[classlabels[v]]);
24395  }
24396 
24397 /* in debug mode, we ensure the correctness of the mapping */
24398 #ifndef NDEBUG
24399  for( v = 0; v < nvars; ++v )
24400  {
24401  assert(sortedvars[v] != NULL);
24402  assert(sortedindices[v] >= 0);
24403 
24404  /* assert that the sorted indices map back to the correct variable in the original order */
24405  assert(vars[sortedindices[v]] == sortedvars[v]);
24406  }
24407 #endif
24408 
24409  /* free temporary memory */
24410  SCIPfreeBufferArray(scip, &indexpointers);
24411  SCIPfreeBufferArray(scip, &varpointers);
24412  SCIPfreeBufferArray(scip, &classcount);
24413 
24414  return SCIP_OKAY;
24415 }
24416 
24417 
24418 /* calculate clique partition for a maximal amount of comparisons on variables due to expensive algorithm
24419  * @todo: check for a good value, maybe it's better to check parts of variables
24420  */
24421 #define MAXNCLIQUEVARSCOMP 1000000
24422 
24423 /** calculates a partition of the given set of binary variables into cliques;
24424  * afterwards the output array contains one value for each variable, such that two variables got the same value iff they
24425  * were assigned to the same clique;
24426  * the first variable is always assigned to clique 0, and a variable can only be assigned to clique i if at least one of
24427  * the preceding variables was assigned to clique i-1;
24428  * for each clique at most 1 variables can be set to TRUE in a feasible solution;
24429  *
24430  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24431  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24432  *
24433  * @pre This method can be called if @p scip is in one of the following stages:
24434  * - \ref SCIP_STAGE_INITPRESOLVE
24435  * - \ref SCIP_STAGE_PRESOLVING
24436  * - \ref SCIP_STAGE_EXITPRESOLVE
24437  * - \ref SCIP_STAGE_PRESOLVED
24438  * - \ref SCIP_STAGE_SOLVING
24439  */
24440 static
24442  SCIP*const scip, /**< SCIP data structure */
24443  SCIP_VAR**const vars, /**< binary variables in the clique from which at most one can be set to 1 */
24444  SCIP_Bool*const values, /**< clique value (TRUE or FALSE) for each variable in the clique */
24445  int const nvars, /**< number of variables in the array */
24446  int*const cliquepartition, /**< array of length nvars to store the clique partition */
24447  int*const ncliques /**< pointer to store the number of cliques actually contained in the partition */
24448  )
24449 {
24450  SCIP_VAR** cliquevars;
24451  SCIP_Bool* cliquevalues;
24452  int i;
24453  int maxncliquevarscomp;
24454  int ncliquevars;
24455 
24456 
24457 
24458  /* allocate temporary memory for storing the variables of the current clique */
24459  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &cliquevars, nvars) );
24460  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &cliquevalues, nvars) );
24461 
24462  /* initialize the cliquepartition array with -1 */
24463  for( i = nvars - 1; i >= 0; --i )
24464  cliquepartition[i] = -1;
24465 
24466  maxncliquevarscomp = (int) MIN(nvars * (SCIP_Longint)nvars, MAXNCLIQUEVARSCOMP);
24467  /* calculate the clique partition */
24468  *ncliques = 0;
24469  for( i = 0; i < nvars; ++i )
24470  {
24471  if( cliquepartition[i] == -1 )
24472  {
24473  int j;
24474 
24475  /* variable starts a new clique */
24476  cliquepartition[i] = *ncliques;
24477  cliquevars[0] = vars[i];
24478  cliquevalues[0] = values[i];
24479  ncliquevars = 1;
24480 
24481  /* if variable is not active (multi-aggregated or fixed), it cannot be in any clique */
24482  if( SCIPvarIsActive(vars[i]) && SCIPvarGetNCliques(vars[i], values[i]) > 0 )
24483  {
24484  /* greedily fill up the clique */
24485  for( j = i+1; j < nvars; ++j )
24486  {
24487  /* if variable is not active (multi-aggregated or fixed), it cannot be in any clique */
24488  if( cliquepartition[j] == -1 && SCIPvarIsActive(vars[j]) )
24489  {
24490  int k;
24491 
24492  /* check if every variable in the current clique can be extended by tmpvars[j] */
24493  for( k = ncliquevars - 1; k >= 0; --k )
24494  {
24495  if( !SCIPvarsHaveCommonClique(vars[j], values[j], cliquevars[k], cliquevalues[k], FALSE) )
24496  break;
24497  }
24498 
24499  if( k == -1 )
24500  {
24501  /* put the variable into the same clique */
24502  cliquepartition[j] = cliquepartition[i];
24503  cliquevars[ncliquevars] = vars[j];
24504  cliquevalues[ncliquevars] = values[j];
24505  ++ncliquevars;
24506  }
24507  }
24508  }
24509  }
24510 
24511  /* this clique is finished */
24512  ++(*ncliques);
24513  }
24514  assert(cliquepartition[i] >= 0 && cliquepartition[i] < i+1);
24515 
24516  /* break if we reached the maximal number of comparisons */
24517  if( i * nvars > maxncliquevarscomp )
24518  break;
24519  }
24520  /* if we had to many variables fill up the cliquepartition and put each variable in a separate clique */
24521  for( ; i < nvars; ++i )
24522  {
24523  if( cliquepartition[i] == -1 )
24524  {
24525  cliquepartition[i] = *ncliques;
24526  ++(*ncliques);
24527  }
24528  }
24529 
24530  SCIPsetFreeBufferArray(scip->set, &cliquevalues);
24531  SCIPsetFreeBufferArray(scip->set, &cliquevars);
24532 
24533  return SCIP_OKAY;
24534 }
24535 
24536 /** calculates a partition of the given set of binary variables into cliques; takes into account independent clique components
24537  *
24538  * The algorithm performs the following steps:
24539  * - recomputes connected components of the clique table, if necessary
24540  * - computes a clique partition for every connected component greedily.
24541  * - relabels the resulting clique partition such that it satisfies the description below
24542  *
24543  * afterwards the output array contains one value for each variable, such that two variables got the same value iff they
24544  * were assigned to the same clique;
24545  * the first variable is always assigned to clique 0, and a variable can only be assigned to clique i if at least one of
24546  * the preceding variables was assigned to clique i-1;
24547  * for each clique at most 1 variables can be set to TRUE in a feasible solution;
24548  *
24549  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24550  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24551  *
24552  * @pre This method can be called if @p scip is in one of the following stages:
24553  * - \ref SCIP_STAGE_INITPRESOLVE
24554  * - \ref SCIP_STAGE_PRESOLVING
24555  * - \ref SCIP_STAGE_EXITPRESOLVE
24556  * - \ref SCIP_STAGE_PRESOLVED
24557  * - \ref SCIP_STAGE_SOLVING
24558  */
24560  SCIP*const scip, /**< SCIP data structure */
24561  SCIP_VAR**const vars, /**< binary variables in the clique from which at most one can be set to 1 */
24562  int const nvars, /**< number of variables in the clique */
24563  int*const cliquepartition, /**< array of length nvars to store the clique partition */
24564  int*const ncliques /**< pointer to store the number of cliques actually contained in the partition */
24565  )
24566 {
24567  SCIP_VAR** tmpvars;
24568 
24569  SCIP_VAR** sortedtmpvars;
24570  SCIP_Bool* tmpvalues;
24571  SCIP_Bool* sortedtmpvalues;
24572  int* componentlabels;
24573  int* sortedindices;
24574  int* componentstartposs;
24575  int i;
24576  int c;
24577 
24578  int ncomponents;
24579 
24580  assert(scip != NULL);
24581  assert(nvars == 0 || vars != NULL);
24582  assert(nvars == 0 || cliquepartition != NULL);
24583  assert(ncliques != NULL);
24584 
24585  SCIP_CALL( checkStage(scip, "SCIPcalcCliquePartition", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24586 
24587  if( nvars == 0 )
24588  {
24589  *ncliques = 0;
24590  return SCIP_OKAY;
24591  }
24592 
24593  /* early abort if no cliques are present */
24594  if( SCIPgetNCliques(scip) == 0 )
24595  {
24596  for( i = 0; i < nvars; ++i )
24597  cliquepartition[i] = i;
24598 
24599  *ncliques = nvars;
24600 
24601  return SCIP_OKAY;
24602  }
24603 
24604 
24605  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &tmpvalues, nvars) );
24606  SCIP_CALL( SCIPsetDuplicateBufferArray(scip->set, &tmpvars, vars, nvars) );
24607  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &componentlabels, nvars) );
24608  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &sortedindices, nvars) );
24609 
24610  /* initialize the tmpvalues array */
24611  for( i = nvars - 1; i >= 0; --i )
24612  {
24613  tmpvalues[i] = TRUE;
24614  cliquepartition[i] = -1;
24615  }
24616 
24617  /* get corresponding active problem variables */
24618  SCIP_CALL( SCIPvarsGetProbvarBinary(&tmpvars, &tmpvalues, nvars) );
24619 
24620  ncomponents = -1;
24621 
24622  /* update clique components if necessary */
24624  {
24625  SCIP_VAR** allvars;
24626  int nallbinvars;
24627  int nallintvars;
24628  int nallimplvars;
24629 
24630  SCIP_CALL( SCIPgetVarsData(scip, &allvars, NULL, &nallbinvars, &nallintvars, &nallimplvars, NULL) );
24631 
24632  SCIP_CALL( SCIPcliquetableComputeCliqueComponents(scip->cliquetable, scip->set, SCIPblkmem(scip), allvars, nallbinvars, nallintvars, nallimplvars) );
24633  }
24634 
24636 
24637  /* store the global clique component labels */
24638  for( i = 0; i < nvars; ++i )
24639  {
24640  if( SCIPvarIsActive(tmpvars[i]) )
24641  componentlabels[i] = SCIPcliquetableGetVarComponentIdx(scip->cliquetable, tmpvars[i]);
24642  else
24643  componentlabels[i] = -1;
24644  }
24645 
24646  /* relabel component labels order consistent as prerequisite for a stable sort */
24647  SCIP_CALL( relabelOrderConsistent(scip, componentlabels, nvars, &ncomponents) );
24648  assert(ncomponents >= 1);
24649  assert(ncomponents <= nvars);
24650 
24651  /* allocate storage array for the starting positions of the components */
24652  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &componentstartposs, ncomponents + 1) );
24653 
24654  /* stable sort the variables w.r.t. the component labels so that we can restrict the quadratic algorithm to the components */
24655  if( ncomponents > 1 )
24656  {
24657  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &sortedtmpvars, nvars) );
24658  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &sortedtmpvalues, nvars) );
24659  SCIP_CALL( labelSortStable(scip, tmpvars, componentlabels, sortedtmpvars, sortedindices, componentstartposs, nvars, ncomponents) );
24660 
24661  /* reassign the tmpvalues with respect to the sorting */
24662  for( i = 0; i < nvars; ++i )
24663  {
24664  assert(tmpvars[sortedindices[i]] == sortedtmpvars[i]);
24665  sortedtmpvalues[i] = tmpvalues[sortedindices[i]];
24666  }
24667  }
24668  else
24669  {
24670  /* if we have only one large connected component, skip the stable sorting and prepare the data differently */
24671  sortedtmpvars = tmpvars;
24672  sortedtmpvalues = tmpvalues;
24673  componentstartposs[0] = 0;
24674  componentstartposs[1] = nvars;
24675 
24676  /* sorted indices are the identity */
24677  for( i = 0; i < nvars; ++i )
24678  sortedindices[i] = i;
24679  }
24680 
24681  *ncliques = 0;
24682  /* calculate a greedy clique partition for each connected component */
24683  for( c = 0; c < ncomponents; ++c )
24684  {
24685  int* localcliquepartition;
24686  int nlocalcliques;
24687  int ncomponentvars;
24688  int l;
24689 
24690  /* extract the number of variables in this connected component */
24691  ncomponentvars = componentstartposs[c + 1] - componentstartposs[c];
24692  nlocalcliques = 0;
24693 
24694  /* allocate necessary memory to hold the intermediate component clique partition */
24695  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &localcliquepartition, ncomponentvars) );
24696 
24697  /* call greedy clique algorithm for all component variables */
24698  SCIP_CALL( calcCliquePartitionGreedy(scip, &(sortedtmpvars[componentstartposs[c]]), &(sortedtmpvalues[componentstartposs[c]]),
24699  ncomponentvars, localcliquepartition, &nlocalcliques) );
24700 
24701  assert(nlocalcliques >= 1);
24702  assert(nlocalcliques <= ncomponentvars);
24703 
24704  /* store the obtained clique partition with an offset of ncliques for the original variables */
24705  for( l = componentstartposs[c]; l < componentstartposs[c + 1]; ++l )
24706  {
24707  int origvaridx = sortedindices[l];
24708  assert(cliquepartition[origvaridx] == -1);
24709  assert(localcliquepartition[l - componentstartposs[c]] <= l - componentstartposs[c]);
24710  cliquepartition[origvaridx] = localcliquepartition[l - componentstartposs[c]] + (*ncliques);
24711  }
24712  *ncliques += nlocalcliques;
24713 
24714  /* free the local clique partition */
24715  SCIPsetFreeBufferArray(scip->set, &localcliquepartition);
24716  }
24717 
24718  /* except in the two trivial cases, we have to ensure the order consistency of the partition indices */
24719  if( ncomponents > 1 && ncomponents < nvars )
24720  {
24721  int partitionsize;
24722  SCIP_CALL( relabelOrderConsistent(scip, cliquepartition, nvars, &partitionsize) );
24723 
24724  assert(partitionsize == *ncliques);
24725  }
24726 
24727  if( ncomponents > 1 )
24728  {
24729  SCIPsetFreeBufferArray(scip->set, &sortedtmpvalues);
24730  SCIPsetFreeBufferArray(scip->set, &sortedtmpvars);
24731  }
24732 
24733  /* use the greedy algorithm as a whole to verify the result on small number of variables */
24734 #ifdef SCIP_DISABLED_CODE
24735  {
24736  int* debugcliquepartition;
24737  int ndebugcliques;
24738 
24739  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &debugcliquepartition, nvars) );
24740 
24741  /* call greedy clique algorithm for all component variables */
24742  SCIP_CALL( calcCliquePartitionGreedy(scip, tmpvars, tmpvalues, nvars, debugcliquepartition, &ndebugcliques) );
24743 
24744  /* loop and compare the traditional greedy clique with */
24745  for( i = 0; i < nvars; ++i )
24746  assert(i * nvars > MAXNCLIQUEVARSCOMP || cliquepartition[i] == debugcliquepartition[i]);
24747 
24748  SCIPsetFreeBufferArray(scip->set, &debugcliquepartition);
24749  }
24750 #endif
24751 
24752  /* free temporary memory */
24753  SCIPsetFreeBufferArray(scip->set, &componentstartposs);
24754  SCIPsetFreeBufferArray(scip->set, &sortedindices);
24755  SCIPsetFreeBufferArray(scip->set, &componentlabels);
24756  SCIPsetFreeBufferArray(scip->set, &tmpvars);
24757  SCIPsetFreeBufferArray(scip->set, &tmpvalues);
24758 
24759  return SCIP_OKAY;
24760 }
24761 
24762 /** calculates a partition of the given set of binary variables into negated cliques;
24763  * afterwards the output array contains one value for each variable, such that two variables got the same value iff they
24764  * were assigned to the same negated clique;
24765  * the first variable is always assigned to clique 0 and a variable can only be assigned to clique i if at least one of
24766  * the preceding variables was assigned to clique i-1;
24767  * for each clique with n_c variables at least n_c-1 variables can be set to TRUE in a feasible solution;
24768  *
24769  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24770  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24771  *
24772  * @pre This method can be called if @p scip is in one of the following stages:
24773  * - \ref SCIP_STAGE_INITPRESOLVE
24774  * - \ref SCIP_STAGE_PRESOLVING
24775  * - \ref SCIP_STAGE_EXITPRESOLVE
24776  * - \ref SCIP_STAGE_PRESOLVED
24777  * - \ref SCIP_STAGE_SOLVING
24778  */
24780  SCIP*const scip, /**< SCIP data structure */
24781  SCIP_VAR**const vars, /**< binary variables in the clique from which at most one can be set to 1 */
24782  int const nvars, /**< number of variables in the clique */
24783  int*const cliquepartition, /**< array of length nvars to store the clique partition */
24784  int*const ncliques /**< pointer to store the number of cliques actually contained in the partition */
24785  )
24786 {
24787  SCIP_VAR** negvars;
24788  int v;
24789 
24790  assert(scip != NULL);
24791  assert(cliquepartition != NULL || nvars == 0);
24792  assert(ncliques != NULL);
24793 
24794  if( nvars == 0 )
24795  {
24796  *ncliques = 0;
24797  return SCIP_OKAY;
24798  }
24799  assert(vars != NULL);
24800 
24801  /* allocate temporary memory */
24802  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &negvars, nvars) );
24803 
24804  /* get all negated variables */
24805  for( v = nvars - 1; v >= 0; --v )
24806  {
24807  SCIP_CALL( SCIPgetNegatedVar(scip, vars[v], &(negvars[v])) );
24808  }
24809 
24810  /* calculate cliques on negated variables, which are "negated" cliques on normal variables array */
24811  SCIP_CALL( SCIPcalcCliquePartition( scip, negvars, nvars, cliquepartition, ncliques) );
24812 
24813  /* free temporary memory */
24814  SCIPsetFreeBufferArray(scip->set, &negvars);
24815 
24816  return SCIP_OKAY;
24817 }
24818 
24819 
24820 /** force SCIP to clean up all cliques; cliques do not get automatically cleaned up after presolving. Use
24821  * this method to prevent inactive variables in cliques when retrieved via SCIPgetCliques()
24822  *
24823  * @return SCIP_OKAY if everything worked, otherwise a suitable error code is passed
24824  *
24825  * @pre This method can be called if @p scip is in one of the following stages:
24826  * - \ref SCIP_STAGE_TRANSFORMED
24827  * - \ref SCIP_STAGE_INITPRESOLVE
24828  * - \ref SCIP_STAGE_PRESOLVING
24829  * - \ref SCIP_STAGE_EXITPRESOLVE
24830  * - \ref SCIP_STAGE_PRESOLVED
24831  * - \ref SCIP_STAGE_INITSOLVE
24832  * - \ref SCIP_STAGE_SOLVING
24833  * - \ref SCIP_STAGE_SOLVED
24834  * - \ref SCIP_STAGE_EXITSOLVE
24835  */
24837  SCIP* scip, /**< SCIP data structure */
24838  SCIP_Bool* infeasible /**< pointer to store if cleanup detected infeasibility */
24839  )
24840 {
24841  int nlocalbdchgs;
24842  SCIP_Bool globalinfeasibility;
24843 
24844  SCIP_CALL_ABORT( checkStage(scip, "SCIPcleanupCliques", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
24845 
24846  globalinfeasibility = FALSE;
24847  nlocalbdchgs = 0;
24848  SCIP_CALL( SCIPcliquetableCleanup(scip->cliquetable, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
24849  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, &nlocalbdchgs,
24850  &globalinfeasibility) );
24851 
24852  if( infeasible != NULL )
24853  *infeasible = globalinfeasibility;
24854 
24855  if( globalinfeasibility )
24857 
24858  return SCIP_OKAY;
24859 }
24860 
24861 /** gets the number of cliques in the clique table
24862  *
24863  * @return number of cliques in the clique table
24864  *
24865  * @note cliques do not get automatically cleaned up after presolving. Use SCIPcleanupCliques()
24866  * to prevent inactive variables in cliques when retrieved via SCIPgetCliques(). This might reduce the number of cliques
24867  *
24868  * @pre This method can be called if @p scip is in one of the following stages:
24869  * - \ref SCIP_STAGE_TRANSFORMED
24870  * - \ref SCIP_STAGE_INITPRESOLVE
24871  * - \ref SCIP_STAGE_PRESOLVING
24872  * - \ref SCIP_STAGE_EXITPRESOLVE
24873  * - \ref SCIP_STAGE_PRESOLVED
24874  * - \ref SCIP_STAGE_INITSOLVE
24875  * - \ref SCIP_STAGE_SOLVING
24876  * - \ref SCIP_STAGE_SOLVED
24877  * - \ref SCIP_STAGE_EXITSOLVE
24878  */
24880  SCIP* scip /**< SCIP data structure */
24881  )
24882 {
24883  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCliques", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
24884 
24886 }
24887 
24888 /** gets the number of cliques created so far by the cliquetable
24889  *
24890  * @return number of cliques created so far by the cliquetable
24891  *
24892  * @note cliques do not get automatically cleaned up after presolving. Use SCIPcleanupCliques()
24893  * to prevent inactive variables in cliques when retrieved via SCIPgetCliques(). This might reduce the number of cliques
24894  *
24895  * @pre This method can be called if @p scip is in one of the following stages:
24896  * - \ref SCIP_STAGE_TRANSFORMED
24897  * - \ref SCIP_STAGE_INITPRESOLVE
24898  * - \ref SCIP_STAGE_PRESOLVING
24899  * - \ref SCIP_STAGE_EXITPRESOLVE
24900  * - \ref SCIP_STAGE_PRESOLVED
24901  * - \ref SCIP_STAGE_INITSOLVE
24902  * - \ref SCIP_STAGE_SOLVING
24903  * - \ref SCIP_STAGE_SOLVED
24904  * - \ref SCIP_STAGE_EXITSOLVE
24905  */
24907  SCIP* scip /**< SCIP data structure */
24908  )
24909 {
24910  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCliquesCreated", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
24911 
24913 }
24914 
24915 /** gets the array of cliques in the clique table
24916  *
24917  * @return array of cliques in the clique table
24918  *
24919  * @note cliques do not get automatically cleaned up after presolving. Use SCIPcleanupCliques()
24920  * to prevent inactive variables in cliques when retrieved via SCIPgetCliques(). This might reduce the number of cliques
24921  *
24922  * @pre This method can be called if @p scip is in one of the following stages:
24923  * - \ref SCIP_STAGE_TRANSFORMED
24924  * - \ref SCIP_STAGE_INITPRESOLVE
24925  * - \ref SCIP_STAGE_PRESOLVING
24926  * - \ref SCIP_STAGE_EXITPRESOLVE
24927  * - \ref SCIP_STAGE_PRESOLVED
24928  * - \ref SCIP_STAGE_INITSOLVE
24929  * - \ref SCIP_STAGE_SOLVING
24930  * - \ref SCIP_STAGE_SOLVED
24931  * - \ref SCIP_STAGE_EXITSOLVE
24932  */
24934  SCIP* scip /**< SCIP data structure */
24935  )
24936 {
24937  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCliques", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
24938 
24939  return SCIPcliquetableGetCliques(scip->cliquetable);
24940 }
24941 
24942 /** returns whether there is a clique that contains both given variable/value pairs;
24943  * the variables must be active binary variables;
24944  * if regardimplics is FALSE, only the cliques in the clique table are looked at;
24945  * if regardimplics is TRUE, both the cliques and the implications of the implication graph are regarded
24946  *
24947  * @return TRUE, if there is a clique that contains both variable/clique pairs; FALSE, otherwise
24948  *
24949  * @pre This method can be called if @p scip is in one of the following stages:
24950  * - \ref SCIP_STAGE_TRANSFORMED
24951  * - \ref SCIP_STAGE_INITPRESOLVE
24952  * - \ref SCIP_STAGE_PRESOLVING
24953  * - \ref SCIP_STAGE_EXITPRESOLVE
24954  * - \ref SCIP_STAGE_PRESOLVED
24955  * - \ref SCIP_STAGE_INITSOLVE
24956  * - \ref SCIP_STAGE_SOLVING
24957  * - \ref SCIP_STAGE_SOLVED
24958  * - \ref SCIP_STAGE_EXITSOLVE
24959  *
24960  * @note a variable with it's negated variable are NOT! in a clique
24961  * @note a variable with itself are in a clique
24962  */
24964  SCIP* scip, /**< SCIP data structure */
24965  SCIP_VAR* var1, /**< first variable */
24966  SCIP_Bool value1, /**< value of first variable */
24967  SCIP_VAR* var2, /**< second variable */
24968  SCIP_Bool value2, /**< value of second variable */
24969  SCIP_Bool regardimplics /**< should the implication graph also be searched for a clique? */
24970  )
24971 {
24972  assert(scip != NULL);
24973  assert(var1 != NULL);
24974  assert(var2 != NULL);
24975  assert(SCIPvarIsActive(var1));
24976  assert(SCIPvarIsActive(var2));
24977  assert(SCIPvarIsBinary(var1));
24978  assert(SCIPvarIsBinary(var2));
24979 
24980  SCIP_CALL_ABORT( checkStage(scip, "SCIPhaveVarsCommonClique", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
24981 
24982  /* if both variables together have more cliques then actual cliques exist, then they have a common clique (in debug
24983  * mode we check this for correctness), otherwise we need to call the pairwise comparison method for these variables
24984  */
24985 #ifndef NDEBUG
24986  assert((SCIPvarGetNCliques(var1, value1) + SCIPvarGetNCliques(var2, value2) > SCIPcliquetableGetNCliques(scip->cliquetable)) ? SCIPvarsHaveCommonClique(var1, value1, var2, value2, FALSE) : TRUE);
24987 #endif
24988 
24989  return (SCIPvarGetNCliques(var1, value1) + SCIPvarGetNCliques(var2, value2) > SCIPcliquetableGetNCliques(scip->cliquetable)
24990  || SCIPvarsHaveCommonClique(var1, value1, var2, value2, regardimplics));
24991 }
24992 
24993 
24994 /** writes the clique graph to a gml file
24995  *
24996  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24997  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24998  *
24999  * @pre This method can be called if @p scip is in one of the following stages:
25000  * - \ref SCIP_STAGE_TRANSFORMED
25001  * - \ref SCIP_STAGE_INITPRESOLVE
25002  * - \ref SCIP_STAGE_PRESOLVING
25003  * - \ref SCIP_STAGE_EXITPRESOLVE
25004  * - \ref SCIP_STAGE_PRESOLVED
25005  * - \ref SCIP_STAGE_INITSOLVE
25006  * - \ref SCIP_STAGE_SOLVING
25007  * - \ref SCIP_STAGE_SOLVED
25008  * - \ref SCIP_STAGE_EXITSOLVE
25009  *
25010  * @note there can be duplicated arcs in the output file
25011  *
25012  * If @p writenodeweights is true, only nodes corresponding to variables that have a fractional value and only edges
25013  * between such nodes are written.
25014  */
25016  SCIP* scip, /**< SCIP data structure */
25017  const char* fname, /**< name of file */
25018  SCIP_Bool writenodeweights /**< should we write weights of nodes? */
25019  )
25020 {
25021  FILE* gmlfile;
25022  SCIP_HASHMAP* nodehashmap;
25023  SCIP_CLIQUE** cliques;
25024  SCIP_VAR** clqvars;
25025  SCIP_VAR** allvars;
25026  SCIP_Bool* clqvalues;
25027  char nodename[SCIP_MAXSTRLEN];
25028  int nallvars;
25029  int nbinvars;
25030  int nintvars;
25031  int nimplvars;
25032  int ncliques;
25033  int c;
25034  int v1;
25035  int v2;
25036  int id1;
25037  int id2;
25038 
25039  assert(scip != NULL);
25040  assert(fname != NULL);
25041 
25042  SCIP_CALL_ABORT( checkStage(scip, "SCIPwriteCliqueGraph", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
25043 
25044  /* get all active variables */
25045  SCIP_CALL( SCIPgetVarsData(scip, &allvars, &nallvars, &nbinvars, &nintvars, &nimplvars, NULL) );
25046 
25047  /* no possible variables for cliques exist */
25048  if( nbinvars + nimplvars == 0 )
25049  return SCIP_OKAY;
25050 
25051  ncliques = SCIPgetNCliques(scip);
25052 
25053  /* no cliques and do not wont to check for binary implications */
25054  if( ncliques == 0 )
25055  return SCIP_OKAY;
25056 
25057  /* open gml file */
25058  gmlfile = fopen(fname, "w");
25059 
25060  if( gmlfile == NULL )
25061  {
25062  SCIPerrorMessage("cannot open graph file <%s>\n", fname);
25063  SCIPABORT();
25064  return SCIP_INVALIDDATA; /*lint !e527*/
25065  }
25066 
25067  /* create the hash map */
25068  SCIP_CALL_FINALLY( SCIPhashmapCreate(&nodehashmap, SCIPblkmem(scip), nbinvars+nimplvars), fclose(gmlfile) );
25069 
25070  /* write starting of gml file */
25071  SCIPgmlWriteOpening(gmlfile, TRUE);
25072 
25073  cliques = SCIPgetCliques(scip);
25074 
25075  /* write nodes and arcs for all cliques */
25076  for( c = ncliques - 1; c >= 0; --c )
25077  {
25078  clqvalues = SCIPcliqueGetValues(cliques[c]);
25079  clqvars = SCIPcliqueGetVars(cliques[c]);
25080 
25081  for( v1 = SCIPcliqueGetNVars(cliques[c]) - 1; v1 >= 0; --v1 )
25082  {
25083  id1 = clqvalues[v1] ? SCIPvarGetProbindex(clqvars[v1]) : (nallvars + SCIPvarGetProbindex(clqvars[v1]));
25084 
25085  /* if corresponding node was not added yet, add it */
25086  if( !SCIPhashmapExists(nodehashmap, (void*)(size_t)id1) )
25087  {
25088  assert(id1 >= 0);
25089  SCIP_CALL_FINALLY( SCIPhashmapInsert(nodehashmap, (void*)(size_t)id1, (void*)(size_t) 1), fclose(gmlfile) );
25090 
25091  (void) SCIPsnprintf(nodename, SCIP_MAXSTRLEN, "%s%s", (id1 >= nallvars ? "~" : ""), SCIPvarGetName(clqvars[v1]));
25092 
25093  /* write new gml node for new variable */
25094  if ( writenodeweights )
25095  {
25096  if ( ! SCIPisFeasIntegral(scip, SCIPgetSolVal(scip, NULL, clqvars[v1])) )
25097  SCIPgmlWriteNodeWeight(gmlfile, (unsigned int)id1, nodename, NULL, NULL, NULL, SCIPgetSolVal(scip, NULL, clqvars[v1]));
25098  }
25099  else
25100  {
25101  SCIPgmlWriteNode(gmlfile, (unsigned int)id1, nodename, NULL, NULL, NULL);
25102  }
25103  }
25104 
25105  for( v2 = SCIPcliqueGetNVars(cliques[c]) - 1; v2 >= 0; --v2 )
25106  {
25107  if( v1 == v2 )
25108  continue;
25109 
25110  id2 = clqvalues[v2] ? SCIPvarGetProbindex(clqvars[v2]) : (nallvars + SCIPvarGetProbindex(clqvars[v2]));
25111 
25112  /* if corresponding node was not added yet, add it */
25113  if( !SCIPhashmapExists(nodehashmap, (void*)(size_t)id2) )
25114  {
25115  assert(id2 >= 0);
25116  SCIP_CALL_FINALLY( SCIPhashmapInsert(nodehashmap, (void*)(size_t)id2, (void*)(size_t) 1), fclose(gmlfile) );
25117 
25118  (void) SCIPsnprintf(nodename, SCIP_MAXSTRLEN, "%s%s", (id2 >= nallvars ? "~" : ""), SCIPvarGetName(clqvars[v2]));
25119 
25120  /* write new gml node for new variable */
25121  if ( writenodeweights )
25122  {
25123  if ( ! SCIPisFeasIntegral(scip, SCIPgetSolVal(scip, NULL, clqvars[v2])) )
25124  SCIPgmlWriteNodeWeight(gmlfile, (unsigned int)id2, nodename, NULL, NULL, NULL, SCIPgetSolVal(scip, NULL, clqvars[v2]));
25125  }
25126  else
25127  {
25128  SCIPgmlWriteNode(gmlfile, (unsigned int)id2, nodename, NULL, NULL, NULL);
25129  }
25130  }
25131 
25132  /* write gml arc between resultant and operand */
25133  if ( ! writenodeweights || ! SCIPisFeasIntegral(scip, SCIPgetSolVal(scip, NULL, clqvars[v2])) )
25134  SCIPgmlWriteArc(gmlfile, (unsigned int)id1, (unsigned int)id2, NULL, NULL);
25135  }
25136  }
25137  }
25138 
25139  /* free the hash map */
25140  SCIPhashmapFree(&nodehashmap);
25141 
25142  SCIPgmlWriteClosing(gmlfile);
25143  fclose(gmlfile);
25144 
25145  return SCIP_OKAY;
25146 }
25147 
25148 /** Removes (irrelevant) variable from all its global structures, i.e. cliques, implications and variable bounds.
25149  * This is an advanced method which should be used with care.
25150  *
25151  * @return SCIP_OKAY if everything worked, otherwise a suitable error code is passed
25152  *
25153  * @pre This method can be called if @p scip is in one of the following stages:
25154  * - \ref SCIP_STAGE_TRANSFORMED
25155  * - \ref SCIP_STAGE_INITPRESOLVE
25156  * - \ref SCIP_STAGE_PRESOLVING
25157  * - \ref SCIP_STAGE_EXITPRESOLVE
25158  * - \ref SCIP_STAGE_PRESOLVED
25159  * - \ref SCIP_STAGE_INITSOLVE
25160  * - \ref SCIP_STAGE_SOLVING
25161  * - \ref SCIP_STAGE_SOLVED
25162  * - \ref SCIP_STAGE_EXITSOLVE
25163  */
25165  SCIP* scip, /**< SCIP data structure */
25166  SCIP_VAR* var /**< variable to remove from global structures */
25167  )
25168 {
25169  assert(scip != NULL);
25170 
25171  SCIP_CALL_ABORT( checkStage(scip, "SCIPremoveVarFromGlobalStructures", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
25172 
25173  /* mark the variable as deletable from global structures - This is necessary for the delayed clean up of cliques */
25175 
25176  /* remove variable from all its cliques, implications, and variable bounds */
25178 
25179  return SCIP_OKAY;
25180 }
25181 
25182 /** sets the branch factor of the variable; this value can be used in the branching methods to scale the score
25183  * values of the variables; higher factor leads to a higher probability that this variable is chosen for branching
25184  *
25185  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25186  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25187  *
25188  * @pre This method can be called if @p scip is in one of the following stages:
25189  * - \ref SCIP_STAGE_PROBLEM
25190  * - \ref SCIP_STAGE_TRANSFORMING
25191  * - \ref SCIP_STAGE_TRANSFORMED
25192  * - \ref SCIP_STAGE_INITPRESOLVE
25193  * - \ref SCIP_STAGE_PRESOLVING
25194  * - \ref SCIP_STAGE_EXITPRESOLVE
25195  * - \ref SCIP_STAGE_PRESOLVED
25196  * - \ref SCIP_STAGE_SOLVING
25197  */
25199  SCIP* scip, /**< SCIP data structure */
25200  SCIP_VAR* var, /**< problem variable */
25201  SCIP_Real branchfactor /**< factor to weigh variable's branching score with */
25202  )
25203 {
25204  SCIP_CALL( checkStage(scip, "SCIPchgVarBranchFactor", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25205 
25206  SCIP_CALL( SCIPvarChgBranchFactor(var, scip->set, branchfactor) );
25207 
25208  return SCIP_OKAY;
25209 }
25210 
25211 /** scales the branch factor of the variable with the given value
25212  *
25213  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25214  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25215  *
25216  * @pre This method can be called if @p scip is in one of the following stages:
25217  * - \ref SCIP_STAGE_PROBLEM
25218  * - \ref SCIP_STAGE_TRANSFORMING
25219  * - \ref SCIP_STAGE_TRANSFORMED
25220  * - \ref SCIP_STAGE_INITPRESOLVE
25221  * - \ref SCIP_STAGE_PRESOLVING
25222  * - \ref SCIP_STAGE_EXITPRESOLVE
25223  * - \ref SCIP_STAGE_PRESOLVED
25224  * - \ref SCIP_STAGE_SOLVING
25225  */
25227  SCIP* scip, /**< SCIP data structure */
25228  SCIP_VAR* var, /**< problem variable */
25229  SCIP_Real scale /**< factor to scale variable's branching factor with */
25230  )
25231 {
25232  SCIP_CALL( checkStage(scip, "SCIPscaleVarBranchFactor", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25233 
25234  SCIP_CALL( SCIPvarChgBranchFactor(var, scip->set, scale * SCIPvarGetBranchFactor(var)) );
25235 
25236  return SCIP_OKAY;
25237 }
25238 
25239 /** adds the given value to the branch factor of the variable
25240  *
25241  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25242  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25243  *
25244  * @pre This method can be called if @p scip is in one of the following stages:
25245  * - \ref SCIP_STAGE_PROBLEM
25246  * - \ref SCIP_STAGE_TRANSFORMING
25247  * - \ref SCIP_STAGE_TRANSFORMED
25248  * - \ref SCIP_STAGE_INITPRESOLVE
25249  * - \ref SCIP_STAGE_PRESOLVING
25250  * - \ref SCIP_STAGE_EXITPRESOLVE
25251  * - \ref SCIP_STAGE_PRESOLVED
25252  * - \ref SCIP_STAGE_SOLVING
25253  */
25255  SCIP* scip, /**< SCIP data structure */
25256  SCIP_VAR* var, /**< problem variable */
25257  SCIP_Real addfactor /**< value to add to the branch factor of the variable */
25258  )
25259 {
25260  SCIP_CALL( checkStage(scip, "SCIPaddVarBranchFactor", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25261 
25262  SCIP_CALL( SCIPvarChgBranchFactor(var, scip->set, addfactor + SCIPvarGetBranchFactor(var)) );
25263 
25264  return SCIP_OKAY;
25265 }
25266 
25267 /** sets the branch priority of the variable; variables with higher branch priority are always preferred to variables
25268  * with lower priority in selection of branching variable
25269  *
25270  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25271  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25272  *
25273  * @pre This method can be called if @p scip is in one of the following stages:
25274  * - \ref SCIP_STAGE_PROBLEM
25275  * - \ref SCIP_STAGE_TRANSFORMING
25276  * - \ref SCIP_STAGE_TRANSFORMED
25277  * - \ref SCIP_STAGE_INITPRESOLVE
25278  * - \ref SCIP_STAGE_PRESOLVING
25279  * - \ref SCIP_STAGE_EXITPRESOLVE
25280  * - \ref SCIP_STAGE_PRESOLVED
25281  * - \ref SCIP_STAGE_SOLVING
25282  *
25283  * @note the default branching priority is 0
25284  */
25286  SCIP* scip, /**< SCIP data structure */
25287  SCIP_VAR* var, /**< problem variable */
25288  int branchpriority /**< branch priority of the variable */
25289  )
25290 {
25291  SCIP_CALL( checkStage(scip, "SCIPchgVarBranchPriority", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25292 
25293  assert( var->scip == scip );
25294 
25295  if( SCIPisTransformed(scip) )
25296  {
25297  assert(scip->branchcand != NULL);
25298 
25299  /* inform the pseudo branch candidates that the branch priority changes and change the branch priority */
25300  SCIP_CALL( SCIPbranchcandUpdateVarBranchPriority(scip->branchcand, scip->set, var, branchpriority) );
25301  }
25302  else
25303  {
25304  /* change the branching priority of the variable */
25305  SCIP_CALL( SCIPvarChgBranchPriority(var, branchpriority) );
25306  }
25307 
25308  return SCIP_OKAY;
25309 }
25310 
25311 /** changes the branch priority of the variable to the given value, if it is larger than the current priority
25312  *
25313  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25314  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25315  *
25316  * @pre This method can be called if @p scip is in one of the following stages:
25317  * - \ref SCIP_STAGE_PROBLEM
25318  * - \ref SCIP_STAGE_TRANSFORMING
25319  * - \ref SCIP_STAGE_TRANSFORMED
25320  * - \ref SCIP_STAGE_INITPRESOLVE
25321  * - \ref SCIP_STAGE_PRESOLVING
25322  * - \ref SCIP_STAGE_EXITPRESOLVE
25323  * - \ref SCIP_STAGE_PRESOLVED
25324  * - \ref SCIP_STAGE_SOLVING
25325  */
25327  SCIP* scip, /**< SCIP data structure */
25328  SCIP_VAR* var, /**< problem variable */
25329  int branchpriority /**< new branch priority of the variable, if it is larger than current priority */
25330  )
25331 {
25332  SCIP_CALL( checkStage(scip, "SCIPupdateVarBranchPriority", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25333 
25334  assert( var->scip == scip );
25335 
25336  if( branchpriority > SCIPvarGetBranchPriority(var) )
25337  {
25338  SCIP_CALL( SCIPvarChgBranchPriority(var, branchpriority) );
25339  }
25340 
25341  return SCIP_OKAY;
25342 }
25343 
25344 /** adds the given value to the branch priority of the variable
25345  *
25346  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25347  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25348  *
25349  * @pre This method can be called if @p scip is in one of the following stages:
25350  * - \ref SCIP_STAGE_PROBLEM
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_SOLVING
25358  */
25360  SCIP* scip, /**< SCIP data structure */
25361  SCIP_VAR* var, /**< problem variable */
25362  int addpriority /**< value to add to the branch priority of the variable */
25363  )
25364 {
25365  SCIP_CALL( checkStage(scip, "SCIPaddVarBranchPriority", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25366 
25367  assert( var->scip == scip );
25368 
25369  SCIP_CALL( SCIPvarChgBranchPriority(var, addpriority + SCIPvarGetBranchPriority(var)) );
25370 
25371  return SCIP_OKAY;
25372 }
25373 
25374 /** sets the branch direction of the variable (-1: prefer downwards branch, 0: automatic selection, +1: prefer upwards
25375  * branch)
25376  *
25377  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25378  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25379  *
25380  * @pre This method can be called if @p scip is in one of the following stages:
25381  * - \ref SCIP_STAGE_PROBLEM
25382  * - \ref SCIP_STAGE_TRANSFORMING
25383  * - \ref SCIP_STAGE_TRANSFORMED
25384  * - \ref SCIP_STAGE_INITPRESOLVE
25385  * - \ref SCIP_STAGE_PRESOLVING
25386  * - \ref SCIP_STAGE_EXITPRESOLVE
25387  * - \ref SCIP_STAGE_PRESOLVED
25388  * - \ref SCIP_STAGE_SOLVING
25389  */
25391  SCIP* scip, /**< SCIP data structure */
25392  SCIP_VAR* var, /**< problem variable */
25393  SCIP_BRANCHDIR branchdirection /**< preferred branch direction of the variable (downwards, upwards, auto) */
25394  )
25395 {
25396  SCIP_CALL( checkStage(scip, "SCIPchgVarBranchDirection", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25397 
25398  assert( var->scip == scip );
25399 
25400  SCIP_CALL( SCIPvarChgBranchDirection(var, branchdirection) );
25401 
25402  return SCIP_OKAY;
25403 }
25404 
25405 /** tightens the variable bounds due a new variable type */
25406 static
25408  SCIP* scip, /**< SCIP data structure */
25409  SCIP_VAR* var, /**< variable to change the bound for */
25410  SCIP_VARTYPE vartype, /**< new type of variable */
25411  SCIP_Bool* infeasible /**< pointer to store whether an infeasibility was detected (, due to
25412  * integrality condition of the new variable type) */
25413  )
25414 {
25415  assert(scip != NULL);
25417  assert(scip->set->stage == SCIP_STAGE_PROBLEM || SCIPvarIsTransformed(var));
25418  assert(var->scip == scip);
25419 
25420  *infeasible = FALSE;
25421 
25422  /* adjusts bounds if the variable type changed form continuous to non-continuous (integral) */
25424  {
25425  SCIP_Bool tightened;
25426 
25427  /* we adjust variable bounds to integers first, since otherwise a later bound tightening with a fractional old
25428  * bound may give an assert because SCIP expects non-continuous variables to have non-fractional bounds
25429  *
25430  * we adjust bounds with a fractionality within [eps,feastol] only if the resulting bound change is a bound
25431  * tightening, because relaxing bounds may not be allowed
25432  */
25433  if( !SCIPisFeasIntegral(scip, SCIPvarGetLbGlobal(var)) ||
25435  )
25436  {
25437  SCIP_CALL( SCIPtightenVarLbGlobal(scip, var, SCIPfeasCeil(scip, SCIPvarGetLbGlobal(var)), TRUE, infeasible, &tightened) );
25438  if( *infeasible )
25439  return SCIP_OKAY;
25440 
25441  /* 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
25442  * 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
25443  */
25444  assert(tightened || SCIPisFeasLE(scip, SCIPvarGetUbGlobal(var), SCIPfeasCeil(scip, SCIPvarGetLbGlobal(var))));
25445  }
25446  if( !SCIPisFeasIntegral(scip, SCIPvarGetUbGlobal(var)) ||
25448  )
25449  {
25450  SCIP_CALL( SCIPtightenVarUbGlobal(scip, var, SCIPfeasFloor(scip, SCIPvarGetUbGlobal(var)), TRUE, infeasible, &tightened) );
25451  if( *infeasible )
25452  return SCIP_OKAY;
25453 
25454  assert(tightened || SCIPisFeasGE(scip, SCIPvarGetLbGlobal(var), SCIPfeasFloor(scip, SCIPvarGetUbGlobal(var))));
25455  }
25456  }
25457 
25458  return SCIP_OKAY;
25459 }
25460 
25461 /** changes type of variable in the problem;
25462  *
25463  * @warning This type change might change the variable array returned from SCIPgetVars() and SCIPgetVarsData();
25464  *
25465  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25466  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25467  *
25468  * @pre This method can be called if @p scip is in one of the following stages:
25469  * - \ref SCIP_STAGE_PROBLEM
25470  * - \ref SCIP_STAGE_TRANSFORMING
25471  * - \ref SCIP_STAGE_PRESOLVING
25472  *
25473  * @note If SCIP is already beyond the SCIP_STAGE_PROBLEM and a original variable is passed, the variable type of the
25474  * corresponding transformed variable is changed; the type of the original variable does not change
25475  *
25476  * @note If the type changes from a continuous variable to a non-continuous variable the bounds of the variable get
25477  * adjusted w.r.t. to integrality information
25478  */
25480  SCIP* scip, /**< SCIP data structure */
25481  SCIP_VAR* var, /**< variable to change the bound for */
25482  SCIP_VARTYPE vartype, /**< new type of variable */
25483  SCIP_Bool* infeasible /**< pointer to store whether an infeasibility was detected (, due to
25484  * integrality condition of the new variable type) */
25485  )
25486 {
25487  SCIP_CALL( checkStage(scip, "SCIPchgVarType", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
25488 
25489  assert(var != NULL);
25490  assert(var->scip == scip);
25491 
25492  if( SCIPvarIsNegated(var) )
25493  {
25494  SCIPdebugMsg(scip, "upgrading type of negated variable <%s> from %d to %d\n", SCIPvarGetName(var), SCIPvarGetType(var), vartype);
25495  var = SCIPvarGetNegationVar(var);
25496  }
25497 #ifndef NDEBUG
25498  else
25499  {
25500  if( SCIPgetStage(scip) > SCIP_STAGE_PROBLEM )
25501  {
25502  SCIPdebugMsg(scip, "upgrading type of variable <%s> from %d to %d\n", SCIPvarGetName(var), SCIPvarGetType(var), vartype);
25503  }
25504  }
25505 #endif
25506 
25507  /* change variable type */
25508  switch( scip->set->stage )
25509  {
25510  case SCIP_STAGE_PROBLEM:
25511  assert(!SCIPvarIsTransformed(var));
25512 
25513  /* first adjust the variable due to new integrality information */
25514  SCIP_CALL( tightenBounds(scip, var, vartype, infeasible) );
25515 
25516  /* second change variable type */
25517  if( SCIPvarGetProbindex(var) >= 0 )
25518  {
25519  SCIP_CALL( SCIPprobChgVarType(scip->origprob, scip->mem->probmem, scip->set, scip->branchcand, scip->cliquetable, var, vartype) );
25520  }
25521  else
25522  {
25523  SCIP_CALL( SCIPvarChgType(var, vartype) );
25524  }
25525  break;
25526 
25527  case SCIP_STAGE_PRESOLVING:
25528  if( !SCIPvarIsTransformed(var) )
25529  {
25530  SCIP_VAR* transvar;
25531 
25532  SCIP_CALL( SCIPgetTransformedVar(scip, var, &transvar) );
25533  assert(transvar != NULL);
25534 
25535  /* recall method with transformed variable */
25536  SCIP_CALL( SCIPchgVarType(scip, transvar, vartype, infeasible) );
25537  return SCIP_OKAY;
25538  }
25539 
25540  /* first adjust the variable due to new integrality information */
25541  SCIP_CALL( tightenBounds(scip, var, vartype, infeasible) );
25542 
25543  /* second change variable type */
25544  if( SCIPvarGetProbindex(var) >= 0 )
25545  {
25546  SCIP_CALL( SCIPprobChgVarType(scip->transprob, scip->mem->probmem, scip->set, scip->branchcand, scip->cliquetable, var, vartype) );
25547  }
25548  else
25549  {
25550  SCIP_CALL( SCIPvarChgType(var, vartype) );
25551  }
25552  break;
25553 
25554  default:
25555  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
25556  return SCIP_INVALIDCALL;
25557  } /*lint !e788*/
25558 
25559  return SCIP_OKAY;
25560 }
25561 
25562 /** in problem creation and solving stage, both bounds of the variable are set to the given value;
25563  * in presolving stage, the variable is converted into a fixed variable, and bounds are changed respectively;
25564  * conversion into a fixed variable changes the vars array returned from SCIPgetVars() and SCIPgetVarsData(),
25565  * and also renders arrays returned from the SCIPvarGetImpl...() methods invalid
25566  *
25567  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25568  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25569  *
25570  * @pre This method can be called if @p scip is in one of the following stages:
25571  * - \ref SCIP_STAGE_PROBLEM
25572  * - \ref SCIP_STAGE_PRESOLVING
25573  * - \ref SCIP_STAGE_SOLVING
25574  */
25576  SCIP* scip, /**< SCIP data structure */
25577  SCIP_VAR* var, /**< variable to fix */
25578  SCIP_Real fixedval, /**< value to fix variable to */
25579  SCIP_Bool* infeasible, /**< pointer to store whether the fixing is infeasible */
25580  SCIP_Bool* fixed /**< pointer to store whether the fixing was performed (variable was unfixed) */
25581  )
25582 {
25583  assert(var != NULL);
25584  assert(infeasible != NULL);
25585  assert(fixed != NULL);
25586 
25587  SCIP_CALL( checkStage(scip, "SCIPfixVar", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25588 
25589  *infeasible = FALSE;
25590  *fixed = FALSE;
25591 
25592  /* in the problem creation stage, modify the bounds as requested, independently from the current bounds */
25593  if( scip->set->stage != SCIP_STAGE_PROBLEM )
25594  {
25595  if( (SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS && !SCIPsetIsFeasIntegral(scip->set, fixedval))
25596  || SCIPsetIsFeasLT(scip->set, fixedval, SCIPvarGetLbLocal(var))
25597  || SCIPsetIsFeasGT(scip->set, fixedval, SCIPvarGetUbLocal(var)) )
25598  {
25599  *infeasible = TRUE;
25600  return SCIP_OKAY;
25601  }
25602  else if( SCIPvarGetStatus(var) == SCIP_VARSTATUS_FIXED )
25603  {
25604  *infeasible = !SCIPsetIsFeasEQ(scip->set, fixedval, SCIPvarGetLbLocal(var));
25605  return SCIP_OKAY;
25606  }
25607  }
25608  else
25609  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_ORIGINAL);
25610 
25611  switch( scip->set->stage )
25612  {
25613  case SCIP_STAGE_PROBLEM:
25614  /* in the problem creation stage, modify the bounds as requested, independently from the current bounds;
25615  * we have to make sure, that the order of the bound changes does not intermediately produce an invalid
25616  * interval lb > ub
25617  */
25618  if( fixedval <= SCIPvarGetLbLocal(var) )
25619  {
25620  SCIP_CALL( SCIPchgVarLb(scip, var, fixedval) );
25621  SCIP_CALL( SCIPchgVarUb(scip, var, fixedval) );
25622  *fixed = TRUE;
25623  }
25624  else
25625  {
25626  SCIP_CALL( SCIPchgVarUb(scip, var, fixedval) );
25627  SCIP_CALL( SCIPchgVarLb(scip, var, fixedval) );
25628  *fixed = TRUE;
25629  }
25630  return SCIP_OKAY;
25631 
25632  case SCIP_STAGE_PRESOLVING:
25633  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 )
25634  {
25635  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
25636  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
25637  fixedval, infeasible, fixed) );
25638  return SCIP_OKAY;
25639  }
25640  /*lint -fallthrough*/
25641  case SCIP_STAGE_SOLVING:
25642  if( SCIPsetIsFeasGT(scip->set, fixedval, SCIPvarGetLbLocal(var)) )
25643  {
25644  SCIP_CALL( SCIPchgVarLb(scip, var, fixedval) );
25645  *fixed = TRUE;
25646  }
25647  if( SCIPsetIsFeasLT(scip->set, fixedval, SCIPvarGetUbLocal(var)) )
25648  {
25649  SCIP_CALL( SCIPchgVarUb(scip, var, fixedval) );
25650  *fixed = TRUE;
25651  }
25652  return SCIP_OKAY;
25653 
25654  default:
25655  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
25656  return SCIP_INVALIDCALL;
25657  } /*lint !e788*/
25658 }
25659 
25660 /** From a given equality a*x + b*y == c, aggregates one of the variables and removes it from the set of
25661  * active problem variables. This changes the vars array returned from SCIPgetVars() and SCIPgetVarsData(),
25662  * and also renders the arrays returned from the SCIPvarGetImpl...() methods for the two variables invalid.
25663  * In the first step, the equality is transformed into an equality with active problem variables
25664  * a'*x' + b'*y' == c'. If x' == y', this leads to the detection of redundancy if a' == -b' and c' == 0,
25665  * of infeasibility, if a' == -b' and c' != 0, or to a variable fixing x' == c'/(a'+b') (and possible
25666  * infeasibility) otherwise.
25667  * In the second step, the variable to be aggregated is chosen among x' and y', prefering a less strict variable
25668  * type as aggregation variable (i.e. continuous variables are preferred over implicit integers, implicit integers
25669  * over integers, and integers over binaries). If none of the variables is continuous, it is tried to find an integer
25670  * aggregation (i.e. integral coefficients a'' and b'', such that a''*x' + b''*y' == c''). This can lead to
25671  * the detection of infeasibility (e.g. if c'' is fractional), or to a rejection of the aggregation (denoted by
25672  * aggregated == FALSE), if the resulting integer coefficients are too large and thus numerically instable.
25673  *
25674  * The output flags have the following meaning:
25675  * - infeasible: the problem is infeasible
25676  * - redundant: the equality can be deleted from the constraint set
25677  * - aggregated: the aggregation was successfully performed (the variables were not aggregated before)
25678  *
25679  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25680  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25681  *
25682  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_PRESOLVING
25683  */
25685  SCIP* scip, /**< SCIP data structure */
25686  SCIP_VAR* varx, /**< variable x in equality a*x + b*y == c */
25687  SCIP_VAR* vary, /**< variable y in equality a*x + b*y == c */
25688  SCIP_Real scalarx, /**< multiplier a in equality a*x + b*y == c */
25689  SCIP_Real scalary, /**< multiplier b in equality a*x + b*y == c */
25690  SCIP_Real rhs, /**< right hand side c in equality a*x + b*y == c */
25691  SCIP_Bool* infeasible, /**< pointer to store whether the aggregation is infeasible */
25692  SCIP_Bool* redundant, /**< pointer to store whether the equality is (now) redundant */
25693  SCIP_Bool* aggregated /**< pointer to store whether the aggregation was successful */
25694  )
25695 {
25696  SCIP_Real constantx;
25697  SCIP_Real constanty;
25698 
25699  assert(infeasible != NULL);
25700  assert(redundant != NULL);
25701  assert(aggregated != NULL);
25702 
25703  SCIP_CALL( checkStage(scip, "SCIPaggregateVars", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
25704 
25705  *infeasible = FALSE;
25706  *redundant = FALSE;
25707  *aggregated = FALSE;
25708 
25709  if( SCIPtreeProbing(scip->tree) )
25710  {
25711  SCIPerrorMessage("cannot aggregate variables during probing\n");
25712  return SCIP_INVALIDCALL;
25713  }
25714  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
25715 
25716  /* do not perform aggregation if it is globally deactivated */
25717  if( scip->set->presol_donotaggr )
25718  return SCIP_OKAY;
25719 
25720  /* get the corresponding equality in active problem variable space:
25721  * transform both expressions "a*x + 0" and "b*y + 0" into problem variable space
25722  */
25723  constantx = 0.0;
25724  constanty = 0.0;
25725  SCIP_CALL( SCIPvarGetProbvarSum(&varx, scip->set, &scalarx, &constantx) );
25726  SCIP_CALL( SCIPvarGetProbvarSum(&vary, scip->set, &scalary, &constanty) );
25727 
25728  /* we cannot aggregate multi-aggregated variables */
25730  return SCIP_OKAY;
25731 
25732  /* move the constant to the right hand side to acquire the form "a'*x' + b'*y' == c'" */
25733  rhs -= (constantx + constanty);
25734 
25735  /* if a scalar is zero, treat the variable as fixed-to-zero variable */
25736  if( SCIPsetIsZero(scip->set, scalarx) )
25737  varx = NULL;
25738  if( SCIPsetIsZero(scip->set, scalary) )
25739  vary = NULL;
25740 
25741  /* capture the special cases that less than two variables are left, due to resolutions to a fixed variable or
25742  * to the same active variable
25743  */
25744  if( varx == NULL && vary == NULL )
25745  {
25746  /* both variables were resolved to fixed variables */
25747  *infeasible = !SCIPsetIsZero(scip->set, rhs);
25748  *redundant = TRUE;
25749  }
25750  else if( varx == NULL )
25751  {
25752  assert(SCIPsetIsZero(scip->set, scalarx));
25753  assert(!SCIPsetIsZero(scip->set, scalary));
25754 
25755  /* variable x was resolved to fixed variable: variable y can be fixed to c'/b' */
25756  SCIP_CALL( SCIPvarFix(vary, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
25757  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
25758  rhs/scalary, infeasible, aggregated) );
25759  *redundant = TRUE;
25760  }
25761  else if( vary == NULL )
25762  {
25763  assert(SCIPsetIsZero(scip->set, scalary));
25764  assert(!SCIPsetIsZero(scip->set, scalarx));
25765 
25766  /* variable y was resolved to fixed variable: variable x can be fixed to c'/a' */
25767  SCIP_CALL( SCIPvarFix(varx, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
25768  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
25769  rhs/scalarx, infeasible, aggregated) );
25770  *redundant = TRUE;
25771  }
25772  else if( varx == vary )
25773  {
25774  /* both variables were resolved to the same active problem variable: this variable can be fixed */
25775  scalarx += scalary;
25776  if( SCIPsetIsZero(scip->set, scalarx) )
25777  {
25778  /* left hand side of equality is zero: equality is potentially infeasible */
25779  *infeasible = !SCIPsetIsZero(scip->set, rhs);
25780  }
25781  else
25782  {
25783  /* sum of scalars is not zero: fix variable x' == y' to c'/(a'+b') */
25784  SCIP_CALL( SCIPvarFix(varx, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
25785  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
25786  rhs/scalarx, infeasible, aggregated) );
25787  }
25788  *redundant = TRUE;
25789  }
25790  else
25791  {
25792  /* both variables are different active problem variables, and both scalars are non-zero: try to aggregate them */
25793  SCIP_CALL( SCIPvarTryAggregateVars(scip->set, scip->mem->probmem, scip->stat, scip->transprob, scip->origprob,
25794  scip->primal, scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventfilter,
25795  scip->eventqueue, varx, vary, scalarx, scalary, rhs, infeasible, aggregated) );
25796  *redundant = *aggregated;
25797  }
25798 
25799  return SCIP_OKAY;
25800 }
25801 
25802 /** converts variable into multi-aggregated variable; this changes the variable array returned from
25803  * SCIPgetVars() and SCIPgetVarsData();
25804  *
25805  * @warning The integrality condition is not checked anymore on the multi-aggregated variable. You must not
25806  * multi-aggregate an integer variable without being sure, that integrality on the aggregation variables
25807  * implies integrality on the aggregated variable.
25808  *
25809  * The output flags have the following meaning:
25810  * - infeasible: the problem is infeasible
25811  * - aggregated: the aggregation was successfully performed (the variables were not aggregated before)
25812  *
25813  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25814  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25815  *
25816  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_PRESOLVING
25817  */
25819  SCIP* scip, /**< SCIP data structure */
25820  SCIP_VAR* var, /**< variable x to aggregate */
25821  int naggvars, /**< number n of variables in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
25822  SCIP_VAR** aggvars, /**< variables y_i in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
25823  SCIP_Real* scalars, /**< multipliers a_i in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
25824  SCIP_Real constant, /**< constant shift c in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
25825  SCIP_Bool* infeasible, /**< pointer to store whether the aggregation is infeasible */
25826  SCIP_Bool* aggregated /**< pointer to store whether the aggregation was successful */
25827  )
25828 {
25829  SCIP_CALL( checkStage(scip, "SCIPmultiaggregateVar", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
25830 
25831  assert(var->scip == scip);
25832 
25833  if( SCIPtreeProbing(scip->tree) )
25834  {
25835  SCIPerrorMessage("cannot multi-aggregate variables during probing\n");
25836  return SCIP_INVALIDCALL;
25837  }
25838  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
25839 
25840  SCIP_CALL( SCIPvarMultiaggregate(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
25841  scip->primal, scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventfilter,
25842  scip->eventqueue, naggvars, aggvars, scalars, constant, infeasible, aggregated) );
25843 
25844  return SCIP_OKAY;
25845 }
25846 
25847 /** returns whether aggregation of variables is not allowed */
25849  SCIP* scip /**< SCIP data structure */
25850  )
25851 {
25852  assert(scip != NULL);
25853 
25854  return scip->set->presol_donotaggr;
25855 }
25856 
25857 /** returns whether multi-aggregation is disabled */
25859  SCIP* scip /**< SCIP data structure */
25860  )
25861 {
25862  assert(scip != NULL);
25863 
25864  return scip->set->presol_donotmultaggr;
25865 }
25866 
25867 /** returns whether variable is not allowed to be multi-aggregated */
25869  SCIP* scip, /**< SCIP data structure */
25870  SCIP_VAR* var /**< variable x to aggregate */
25871  )
25872 {
25873  assert(scip != NULL);
25874  assert(var != NULL);
25875  assert(var->scip == scip);
25876 
25877  return scip->set->presol_donotmultaggr || SCIPvarDoNotMultaggr(var);
25878 }
25879 
25880 /** returns whether dual reduction are allowed during propagation and presolving
25881  *
25882  * @note A reduction is called dual, if it may discard feasible solutions, but leaves at least one optimal solution
25883  * intact. Often such reductions are based on analyzing the objective function, reduced costs and/or dual LPs.
25884  */
25886  SCIP* scip /**< SCIP data structure */
25887  )
25888 {
25889  assert(scip != NULL);
25890 
25891  return !scip->set->reopt_enable && scip->set->misc_allowdualreds;
25892 }
25893 
25894 /** returns whether propagation w.r.t. current objective is allowed */
25896  SCIP* scip /**< SCIP data structure */
25897  )
25898 {
25899  assert(scip != NULL);
25900 
25901  return !scip->set->reopt_enable && scip->set->misc_allowobjprop;
25902 }
25903 
25904 /** modifies an initial seed value with the global shift of random seeds */
25906  SCIP* scip, /**< SCIP data structure */
25907  int initialseedvalue /**< initial seed value to be modified */
25908  )
25909 {
25910  assert(scip != NULL);
25911 
25912  return (unsigned int)SCIPsetInitializeRandomSeed(scip->set, initialseedvalue);
25913 }
25914 
25915 /** marks the variable that it must not be multi-aggregated
25916  *
25917  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25918  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25919  *
25920  * @pre This method can be called if @p scip is in one of the following stages:
25921  * - \ref SCIP_STAGE_INIT
25922  * - \ref SCIP_STAGE_PROBLEM
25923  * - \ref SCIP_STAGE_TRANSFORMING
25924  * - \ref SCIP_STAGE_TRANSFORMED
25925  * - \ref SCIP_STAGE_INITPRESOLVE
25926  * - \ref SCIP_STAGE_PRESOLVING
25927  * - \ref SCIP_STAGE_EXITPRESOLVE
25928  *
25929  * @note There exists no "unmark" method since it has to be ensured that if a plugin requires that a variable is not
25930  * multi-aggregated that this is will be the case.
25931  */
25933  SCIP* scip, /**< SCIP data structure */
25934  SCIP_VAR* var /**< variable to delete */
25935  )
25936 {
25937  assert(scip != NULL);
25938  assert(var != NULL);
25939  assert(var->scip == scip);
25940 
25941  SCIP_CALL( checkStage(scip, "SCIPmarkDoNotMultaggrVar", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE) );
25942 
25944 
25945  return SCIP_OKAY;
25946 }
25947 
25948 /** enables the collection of statistics for a variable
25949  *
25950  * @pre This method can be called if @p scip is in one of the following stages:
25951  * - \ref SCIP_STAGE_PROBLEM
25952  * - \ref SCIP_STAGE_INITPRESOLVE
25953  * - \ref SCIP_STAGE_PRESOLVING
25954  * - \ref SCIP_STAGE_EXITPRESOLVE
25955  * - \ref SCIP_STAGE_SOLVING
25956  * - \ref SCIP_STAGE_SOLVED
25957  */
25959  SCIP* scip /**< SCIP data structure */
25960  )
25961 {
25962  SCIP_CALL_ABORT( checkStage(scip, "SCIPenableVarHistory", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25963 
25965 }
25966 
25967 /** disables the collection of any statistic for a variable
25968  *
25969  * @pre This method can be called if @p scip is in one of the following stages:
25970  * - \ref SCIP_STAGE_PROBLEM
25971  * - \ref SCIP_STAGE_INITPRESOLVE
25972  * - \ref SCIP_STAGE_PRESOLVING
25973  * - \ref SCIP_STAGE_EXITPRESOLVE
25974  * - \ref SCIP_STAGE_SOLVING
25975  * - \ref SCIP_STAGE_SOLVED
25976  */
25978  SCIP* scip /**< SCIP data structure */
25979  )
25980 {
25981  SCIP_CALL_ABORT( checkStage(scip, "SCIPdisableVarHistory", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25982 
25984 }
25985 
25986 /** updates the pseudo costs of the given variable and the global pseudo costs after a change of "solvaldelta" in the
25987  * variable's solution value and resulting change of "objdelta" in the in the LP's objective value;
25988  * the update is ignored, if the objective value difference is infinite
25989  *
25990  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25991  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25992  *
25993  * @pre This method can be called if @p scip is in one of the following stages:
25994  * - \ref SCIP_STAGE_SOLVING
25995  * - \ref SCIP_STAGE_SOLVED
25996  */
25998  SCIP* scip, /**< SCIP data structure */
25999  SCIP_VAR* var, /**< problem variable */
26000  SCIP_Real solvaldelta, /**< difference of variable's new LP value - old LP value */
26001  SCIP_Real objdelta, /**< difference of new LP's objective value - old LP's objective value */
26002  SCIP_Real weight /**< weight in (0,1] of this update in pseudo cost sum */
26003  )
26004 {
26005  SCIP_CALL( checkStage(scip, "SCIPupdateVarPseudocost", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26006 
26007  if( !SCIPsetIsInfinity(scip->set, 2*objdelta) ) /* differences infinity - eps should also be treated as infinity */
26008  {
26009  if( scip->set->branch_divingpscost || (!scip->lp->diving && !SCIPtreeProbing(scip->tree)) )
26010  {
26011  SCIP_CALL( SCIPvarUpdatePseudocost(var, scip->set, scip->stat, solvaldelta, objdelta, weight) );
26012  }
26013  }
26014 
26015  return SCIP_OKAY;
26016 }
26017 
26018 /** gets the variable's pseudo cost value for the given change of the variable's LP value
26019  *
26020  * @return the variable's pseudo cost value for the given change of the variable's LP value
26021  *
26022  * @pre This method can be called if @p scip is in one of the following stages:
26023  * - \ref SCIP_STAGE_INITPRESOLVE
26024  * - \ref SCIP_STAGE_PRESOLVING
26025  * - \ref SCIP_STAGE_EXITPRESOLVE
26026  * - \ref SCIP_STAGE_PRESOLVED
26027  * - \ref SCIP_STAGE_INITSOLVE
26028  * - \ref SCIP_STAGE_SOLVING
26029  * - \ref SCIP_STAGE_SOLVED
26030  */
26032  SCIP* scip, /**< SCIP data structure */
26033  SCIP_VAR* var, /**< problem variable */
26034  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
26035  )
26036 {
26037  assert( var->scip == scip );
26038 
26039  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostVal", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26040 
26041  return SCIPvarGetPseudocost(var, scip->stat, solvaldelta);
26042 }
26043 
26044 /** gets the variable's pseudo cost value for the given change of the variable's LP value,
26045  * only using the pseudo cost information of the current run
26046  *
26047  * @return the variable's pseudo cost value for the given change of the variable's LP value,
26048  * only using the pseudo cost information of the current run
26049  *
26050  * @pre This method can be called if @p scip is in one of the following stages:
26051  * - \ref SCIP_STAGE_INITPRESOLVE
26052  * - \ref SCIP_STAGE_PRESOLVING
26053  * - \ref SCIP_STAGE_EXITPRESOLVE
26054  * - \ref SCIP_STAGE_PRESOLVED
26055  * - \ref SCIP_STAGE_INITSOLVE
26056  * - \ref SCIP_STAGE_SOLVING
26057  * - \ref SCIP_STAGE_SOLVED
26058  */
26060  SCIP* scip, /**< SCIP data structure */
26061  SCIP_VAR* var, /**< problem variable */
26062  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
26063  )
26064 {
26065  assert( var->scip == scip );
26066 
26067  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostValCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26068 
26069  return SCIPvarGetPseudocostCurrentRun(var, scip->stat, solvaldelta);
26070 }
26071 
26072 /** gets the variable's pseudo cost value for the given direction
26073  *
26074  * @return the variable's pseudo cost value for the given direction
26075  *
26076  * @pre This method can be called if @p scip is in one of the following stages:
26077  * - \ref SCIP_STAGE_INITPRESOLVE
26078  * - \ref SCIP_STAGE_PRESOLVING
26079  * - \ref SCIP_STAGE_EXITPRESOLVE
26080  * - \ref SCIP_STAGE_PRESOLVED
26081  * - \ref SCIP_STAGE_INITSOLVE
26082  * - \ref SCIP_STAGE_SOLVING
26083  * - \ref SCIP_STAGE_SOLVED
26084  */
26086  SCIP* scip, /**< SCIP data structure */
26087  SCIP_VAR* var, /**< problem variable */
26088  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26089  )
26090 {
26091  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocost", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26092  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
26093  assert(var->scip == scip);
26094 
26095  return SCIPvarGetPseudocost(var, scip->stat, dir == SCIP_BRANCHDIR_DOWNWARDS ? -1.0 : 1.0);
26096 }
26097 
26098 /** gets the variable's pseudo cost value for the given direction,
26099  * only using the pseudo cost information of the current run
26100  *
26101  * @return the variable's pseudo cost value for the given direction,
26102  * only using the pseudo cost information of the current run
26103  *
26104  * @pre This method can be called if @p scip is in one of the following stages:
26105  * - \ref SCIP_STAGE_INITPRESOLVE
26106  * - \ref SCIP_STAGE_PRESOLVING
26107  * - \ref SCIP_STAGE_EXITPRESOLVE
26108  * - \ref SCIP_STAGE_PRESOLVED
26109  * - \ref SCIP_STAGE_INITSOLVE
26110  * - \ref SCIP_STAGE_SOLVING
26111  * - \ref SCIP_STAGE_SOLVED
26112  */
26114  SCIP* scip, /**< SCIP data structure */
26115  SCIP_VAR* var, /**< problem variable */
26116  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26117  )
26118 {
26119  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26120  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
26121  assert(var->scip == scip);
26122 
26123  return SCIPvarGetPseudocostCurrentRun(var, scip->stat, dir == SCIP_BRANCHDIR_DOWNWARDS ? -1.0 : 1.0);
26124 }
26125 
26126 /** gets the variable's (possible fractional) number of pseudo cost updates for the given direction
26127  *
26128  * @return the variable's (possible fractional) number of pseudo cost updates for the given direction
26129  *
26130  * @pre This method can be called if @p scip is in one of the following stages:
26131  * - \ref SCIP_STAGE_INITPRESOLVE
26132  * - \ref SCIP_STAGE_PRESOLVING
26133  * - \ref SCIP_STAGE_EXITPRESOLVE
26134  * - \ref SCIP_STAGE_PRESOLVED
26135  * - \ref SCIP_STAGE_INITSOLVE
26136  * - \ref SCIP_STAGE_SOLVING
26137  * - \ref SCIP_STAGE_SOLVED
26138  */
26140  SCIP* scip, /**< SCIP data structure */
26141  SCIP_VAR* var, /**< problem variable */
26142  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26143  )
26144 {
26145  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostCount", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26146  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
26147  assert(var->scip == scip);
26148 
26149  return SCIPvarGetPseudocostCount(var, dir);
26150 }
26151 
26152 /** gets the variable's (possible fractional) number of pseudo cost updates for the given direction,
26153  * only using the pseudo cost information of the current run
26154  *
26155  * @return the variable's (possible fractional) number of pseudo cost updates for the given direction,
26156  * only using the pseudo cost information of the current run
26157  *
26158  * @pre This method can be called if @p scip is in one of the following stages:
26159  * - \ref SCIP_STAGE_INITPRESOLVE
26160  * - \ref SCIP_STAGE_PRESOLVING
26161  * - \ref SCIP_STAGE_EXITPRESOLVE
26162  * - \ref SCIP_STAGE_PRESOLVED
26163  * - \ref SCIP_STAGE_INITSOLVE
26164  * - \ref SCIP_STAGE_SOLVING
26165  * - \ref SCIP_STAGE_SOLVED
26166  */
26168  SCIP* scip, /**< SCIP data structure */
26169  SCIP_VAR* var, /**< problem variable */
26170  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26171  )
26172 {
26173  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostCountCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26174  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
26175  assert(var->scip == scip);
26176 
26177  return SCIPvarGetPseudocostCountCurrentRun(var, dir);
26178 }
26179 
26180 /** get pseudo cost variance of the variable, either for entire solve or only for current branch and bound run
26181  *
26182  * @return returns the (corrected) variance of pseudo code information collected so far.
26183  *
26184  * @pre This method can be called if @p scip is in one of the following stages:
26185  * - \ref SCIP_STAGE_INITPRESOLVE
26186  * - \ref SCIP_STAGE_PRESOLVING
26187  * - \ref SCIP_STAGE_EXITPRESOLVE
26188  * - \ref SCIP_STAGE_PRESOLVED
26189  * - \ref SCIP_STAGE_INITSOLVE
26190  * - \ref SCIP_STAGE_SOLVING
26191  * - \ref SCIP_STAGE_SOLVED
26192  */
26194  SCIP* scip, /**< SCIP data structure */
26195  SCIP_VAR* var, /**< problem variable */
26196  SCIP_BRANCHDIR dir, /**< branching direction (downwards, or upwards) */
26197  SCIP_Bool onlycurrentrun /**< only for pseudo costs of current branch and bound run */
26198  )
26199 {
26200  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostVariance", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26201  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
26202  assert(var->scip == scip);
26203 
26204  return SCIPvarGetPseudocostVariance(var, dir, onlycurrentrun);
26205 }
26206 
26207 /** calculates a confidence bound for this variable under the assumption of normally distributed pseudo costs
26208  *
26209  * The confidence bound \f$ \theta \geq 0\f$ denotes the interval borders \f$ [X - \theta, \ X + \theta]\f$, which contains
26210  * the true pseudo costs of the variable, i.e., the expected value of the normal distribution, with a probability
26211  * of 2 * clevel - 1.
26212  *
26213  * @return value of confidence bound for this variable
26214  */
26216  SCIP* scip, /**< SCIP data structure */
26217  SCIP_VAR* var, /**< variable in question */
26218  SCIP_BRANCHDIR dir, /**< the branching direction for the confidence bound */
26219  SCIP_Bool onlycurrentrun, /**< should only the current run be taken into account */
26220  SCIP_CONFIDENCELEVEL clevel /**< confidence level for the interval */
26221  )
26222 {
26223  SCIP_CALL_ABORT( checkStage(scip, "SCIPcalculatePscostConfidenceBound", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26224 
26225  return SCIPvarCalcPscostConfidenceBound(var, scip->set, dir, onlycurrentrun, clevel);
26226 }
26227 
26228 /** check if variable pseudo-costs have a significant difference in location. The significance depends on
26229  * the choice of \p clevel and on the kind of tested hypothesis. The one-sided hypothesis, which
26230  * should be rejected, is that fracy * mu_y >= fracx * mu_x, where mu_y and mu_x denote the
26231  * unknown location means of the underlying pseudo-cost distributions of x and y.
26232  *
26233  * This method is applied best if variable x has a better pseudo-cost score than y. The method hypothesizes that y were actually
26234  * better than x (despite the current information), meaning that y can be expected to yield branching
26235  * decisions as least as good as x in the long run. If the method returns TRUE, the current history information is
26236  * sufficient to safely rely on the alternative hypothesis that x yields indeed a better branching score (on average)
26237  * than y.
26238  *
26239  * @note The order of x and y matters for the one-sided hypothesis
26240  *
26241  * @note set \p onesided to FALSE if you are not sure which variable is better. The hypothesis tested then reads
26242  * fracy * mu_y == fracx * mu_x vs the alternative hypothesis fracy * mu_y != fracx * mu_x.
26243  *
26244  * @return TRUE if the hypothesis can be safely rejected at the given confidence level
26245  */
26247  SCIP* scip, /**< SCIP data structure */
26248  SCIP_VAR* varx, /**< variable x */
26249  SCIP_Real fracx, /**< the fractionality of variable x */
26250  SCIP_VAR* vary, /**< variable y */
26251  SCIP_Real fracy, /**< the fractionality of variable y */
26252  SCIP_BRANCHDIR dir, /**< branching direction */
26253  SCIP_CONFIDENCELEVEL clevel, /**< confidence level for rejecting hypothesis */
26254  SCIP_Bool onesided /**< should a one-sided hypothesis y >= x be tested? */
26255  )
26256 {
26257  SCIP_CALL_ABORT( checkStage(scip, "SCIPsignificantVarPscostDifference", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26258 
26259  return SCIPvarSignificantPscostDifference(scip->set, scip->stat, varx, fracx, vary, fracy, dir, clevel, onesided);
26260 }
26261 
26262 /** tests at a given confidence level whether the variable pseudo-costs only have a small probability to
26263  * exceed a \p threshold. This is useful to determine if past observations provide enough evidence
26264  * to skip an expensive strong-branching step if there is already a candidate that has been proven to yield an improvement
26265  * of at least \p threshold.
26266  *
26267  * @note use \p clevel to adjust the level of confidence. For SCIP_CONFIDENCELEVEL_MIN, the method returns TRUE if
26268  * the estimated probability to exceed \p threshold is less than 25 %.
26269  *
26270  * @see SCIP_Confidencelevel for a list of available levels. The used probability limits refer to the one-sided levels
26271  * of confidence.
26272  *
26273  * @return TRUE if the variable pseudo-cost probabilistic model is likely to be smaller than \p threshold
26274  * at the given confidence level \p clevel.
26275  */
26277  SCIP* scip, /**< SCIP data structure */
26278  SCIP_VAR* var, /**< variable x */
26279  SCIP_Real frac, /**< the fractionality of variable x */
26280  SCIP_Real threshold, /**< the threshold to test against */
26281  SCIP_BRANCHDIR dir, /**< branching direction */
26282  SCIP_CONFIDENCELEVEL clevel /**< confidence level for rejecting hypothesis */
26283  )
26284 {
26285  SCIP_CALL_ABORT( checkStage(scip, "SCIPpscostThresholdProbabilityTest", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26286 
26287  return SCIPvarPscostThresholdProbabilityTest(scip->set, scip->stat, var, frac, threshold, dir, clevel);
26288 }
26289 
26290 /** check if the current pseudo cost relative error in a direction violates the given threshold. The Relative
26291  * Error is calculated at a specific confidence level
26292  *
26293  * @return TRUE if relative error in variable pseudo costs is smaller than \p threshold
26294  */
26296  SCIP* scip, /**< SCIP data structure */
26297  SCIP_VAR* var, /**< variable in question */
26298  SCIP_Real threshold, /**< threshold for relative errors to be considered reliable (enough) */
26299  SCIP_CONFIDENCELEVEL clevel /**< a given confidence level */
26300  )
26301 {
26302  SCIP_CALL_ABORT( checkStage(scip, "SCIPisVarPscostRelerrorReliable", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26303 
26304  return SCIPvarIsPscostRelerrorReliable(var, scip->set, scip->stat, threshold, clevel);
26305 }
26306 
26307 /** gets the variable's pseudo cost score value for the given LP solution value
26308  *
26309  * @return the variable's pseudo cost score value for the given LP solution value
26310  *
26311  * @pre This method can be called if @p scip is in one of the following stages:
26312  * - \ref SCIP_STAGE_INITPRESOLVE
26313  * - \ref SCIP_STAGE_PRESOLVING
26314  * - \ref SCIP_STAGE_EXITPRESOLVE
26315  * - \ref SCIP_STAGE_PRESOLVED
26316  * - \ref SCIP_STAGE_INITSOLVE
26317  * - \ref SCIP_STAGE_SOLVING
26318  * - \ref SCIP_STAGE_SOLVED
26319  */
26321  SCIP* scip, /**< SCIP data structure */
26322  SCIP_VAR* var, /**< problem variable */
26323  SCIP_Real solval /**< variable's LP solution value */
26324  )
26325 {
26326  SCIP_Real downsol;
26327  SCIP_Real upsol;
26328  SCIP_Real pscostdown;
26329  SCIP_Real pscostup;
26330 
26331  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26332 
26333  assert( var->scip == scip );
26334 
26335  downsol = SCIPsetFeasCeil(scip->set, solval-1.0);
26336  upsol = SCIPsetFeasFloor(scip->set, solval+1.0);
26337  pscostdown = SCIPvarGetPseudocost(var, scip->stat, downsol-solval);
26338  pscostup = SCIPvarGetPseudocost(var, scip->stat, upsol-solval);
26339 
26340  return SCIPbranchGetScore(scip->set, var, pscostdown, pscostup);
26341 }
26342 
26343 /** gets the variable's pseudo cost score value for the given LP solution value,
26344  * only using the pseudo cost information of the current run
26345  *
26346  * @return the variable's pseudo cost score value for the given LP solution value,
26347  * only using the pseudo cost information of the current run
26348  *
26349  * @pre This method can be called if @p scip is in one of the following stages:
26350  * - \ref SCIP_STAGE_INITPRESOLVE
26351  * - \ref SCIP_STAGE_PRESOLVING
26352  * - \ref SCIP_STAGE_EXITPRESOLVE
26353  * - \ref SCIP_STAGE_PRESOLVED
26354  * - \ref SCIP_STAGE_INITSOLVE
26355  * - \ref SCIP_STAGE_SOLVING
26356  * - \ref SCIP_STAGE_SOLVED
26357  */
26359  SCIP* scip, /**< SCIP data structure */
26360  SCIP_VAR* var, /**< problem variable */
26361  SCIP_Real solval /**< variable's LP solution value */
26362  )
26363 {
26364  SCIP_Real downsol;
26365  SCIP_Real upsol;
26366  SCIP_Real pscostdown;
26367  SCIP_Real pscostup;
26368 
26369  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26370 
26371  assert( var->scip == scip );
26372 
26373  downsol = SCIPsetFeasCeil(scip->set, solval-1.0);
26374  upsol = SCIPsetFeasFloor(scip->set, solval+1.0);
26375  pscostdown = SCIPvarGetPseudocostCurrentRun(var, scip->stat, downsol-solval);
26376  pscostup = SCIPvarGetPseudocostCurrentRun(var, scip->stat, upsol-solval);
26377 
26378  return SCIPbranchGetScore(scip->set, var, pscostdown, pscostup);
26379 }
26380 
26381 /** returns the variable's VSIDS value
26382  *
26383  * @return the variable's VSIDS value
26384  *
26385  * @pre This method can be called if @p scip is in one of the following stages:
26386  * - \ref SCIP_STAGE_INITPRESOLVE
26387  * - \ref SCIP_STAGE_PRESOLVING
26388  * - \ref SCIP_STAGE_EXITPRESOLVE
26389  * - \ref SCIP_STAGE_PRESOLVED
26390  * - \ref SCIP_STAGE_INITSOLVE
26391  * - \ref SCIP_STAGE_SOLVING
26392  * - \ref SCIP_STAGE_SOLVED
26393  */
26395  SCIP* scip, /**< SCIP data structure */
26396  SCIP_VAR* var, /**< problem variable */
26397  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26398  )
26399 {
26400  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarVSIDS", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26401 
26402  assert( var->scip == scip );
26403 
26404  if( dir != SCIP_BRANCHDIR_DOWNWARDS && dir != SCIP_BRANCHDIR_UPWARDS )
26405  {
26406  SCIPerrorMessage("invalid branching direction %d when asking for VSIDS value\n", dir);
26407  return SCIP_INVALID;
26408  }
26409 
26410  return SCIPvarGetVSIDS(var, scip->stat, dir);
26411 }
26412 
26413 /** returns the variable's VSIDS value only using conflicts of the current run
26414  *
26415  * @return the variable's VSIDS value only using conflicts of the current run
26416  *
26417  * @pre This method can be called if @p scip is in one of the following stages:
26418  * - \ref SCIP_STAGE_INITPRESOLVE
26419  * - \ref SCIP_STAGE_PRESOLVING
26420  * - \ref SCIP_STAGE_EXITPRESOLVE
26421  * - \ref SCIP_STAGE_PRESOLVED
26422  * - \ref SCIP_STAGE_INITSOLVE
26423  * - \ref SCIP_STAGE_SOLVING
26424  * - \ref SCIP_STAGE_SOLVED
26425  */
26427  SCIP* scip, /**< SCIP data structure */
26428  SCIP_VAR* var, /**< problem variable */
26429  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26430  )
26431 {
26432  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarVSIDSCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26433 
26434  assert( var->scip == scip );
26435 
26436  if( dir != SCIP_BRANCHDIR_DOWNWARDS && dir != SCIP_BRANCHDIR_UPWARDS )
26437  {
26438  SCIPerrorMessage("invalid branching direction %d when asking for VSIDS value\n", dir);
26439  return SCIP_INVALID;
26440  }
26441 
26442  return SCIPvarGetVSIDSCurrentRun(var, scip->stat, dir);
26443 }
26444 
26445 /** returns the variable's conflict score value
26446  *
26447  * @return the variable's conflict score value
26448  *
26449  * @pre This method can be called if @p scip is in one of the following stages:
26450  * - \ref SCIP_STAGE_INITPRESOLVE
26451  * - \ref SCIP_STAGE_PRESOLVING
26452  * - \ref SCIP_STAGE_EXITPRESOLVE
26453  * - \ref SCIP_STAGE_PRESOLVED
26454  * - \ref SCIP_STAGE_INITSOLVE
26455  * - \ref SCIP_STAGE_SOLVING
26456  * - \ref SCIP_STAGE_SOLVED
26457  */
26459  SCIP* scip, /**< SCIP data structure */
26460  SCIP_VAR* var /**< problem variable */
26461  )
26462 {
26463  SCIP_Real downscore;
26464  SCIP_Real upscore;
26465 
26466  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarConflictScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26467 
26468  assert( var->scip == scip );
26469 
26470  downscore = SCIPvarGetVSIDS(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
26471  upscore = SCIPvarGetVSIDS(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
26472 
26473  return SCIPbranchGetScore(scip->set, var, downscore, upscore);
26474 }
26475 
26476 /** returns the variable's conflict score value only using conflicts of the current run
26477  *
26478  * @return the variable's conflict score value only using conflicts of the current run
26479  *
26480  * @pre This method can be called if @p scip is in one of the following stages:
26481  * - \ref SCIP_STAGE_INITPRESOLVE
26482  * - \ref SCIP_STAGE_PRESOLVING
26483  * - \ref SCIP_STAGE_EXITPRESOLVE
26484  * - \ref SCIP_STAGE_PRESOLVED
26485  * - \ref SCIP_STAGE_INITSOLVE
26486  * - \ref SCIP_STAGE_SOLVING
26487  * - \ref SCIP_STAGE_SOLVED
26488  */
26490  SCIP* scip, /**< SCIP data structure */
26491  SCIP_VAR* var /**< problem variable */
26492  )
26493 {
26494  SCIP_Real downscore;
26495  SCIP_Real upscore;
26496 
26497  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarConflictScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26498 
26499  assert( var->scip == scip );
26500 
26501  downscore = SCIPvarGetVSIDSCurrentRun(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
26502  upscore = SCIPvarGetVSIDSCurrentRun(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
26503 
26504  return SCIPbranchGetScore(scip->set, var, downscore, upscore);
26505 }
26506 
26507 /** returns the variable's conflict length score
26508  *
26509  * @return the variable's conflict length score
26510  *
26511  * @pre This method can be called if @p scip is in one of the following stages:
26512  * - \ref SCIP_STAGE_INITPRESOLVE
26513  * - \ref SCIP_STAGE_PRESOLVING
26514  * - \ref SCIP_STAGE_EXITPRESOLVE
26515  * - \ref SCIP_STAGE_PRESOLVED
26516  * - \ref SCIP_STAGE_INITSOLVE
26517  * - \ref SCIP_STAGE_SOLVING
26518  * - \ref SCIP_STAGE_SOLVED
26519  */
26521  SCIP* scip, /**< SCIP data structure */
26522  SCIP_VAR* var /**< problem variable */
26523  )
26524 {
26525  SCIP_Real downscore;
26526  SCIP_Real upscore;
26527 
26528  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarConflictlengthScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26529 
26530  assert( var->scip == scip );
26531 
26534 
26535  return SCIPbranchGetScore(scip->set, var, downscore, upscore);
26536 }
26537 
26538 /** returns the variable's conflict length score only using conflicts of the current run
26539  *
26540  * @return the variable's conflict length score only using conflicts of the current run
26541  *
26542  * @pre This method can be called if @p scip is in one of the following stages:
26543  * - \ref SCIP_STAGE_INITPRESOLVE
26544  * - \ref SCIP_STAGE_PRESOLVING
26545  * - \ref SCIP_STAGE_EXITPRESOLVE
26546  * - \ref SCIP_STAGE_PRESOLVED
26547  * - \ref SCIP_STAGE_INITSOLVE
26548  * - \ref SCIP_STAGE_SOLVING
26549  * - \ref SCIP_STAGE_SOLVED
26550  */
26552  SCIP* scip, /**< SCIP data structure */
26553  SCIP_VAR* var /**< problem variable */
26554  )
26555 {
26556  SCIP_Real downscore;
26557  SCIP_Real upscore;
26558 
26559  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarConflictlengthScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26560 
26561  assert( var->scip == scip );
26562 
26565 
26566  return SCIPbranchGetScore(scip->set, var, downscore, upscore);
26567 }
26568 
26569 /** returns the variable's average conflict length
26570  *
26571  * @return the variable's average conflict length
26572  *
26573  * @pre This method can be called if @p scip is in one of the following stages:
26574  * - \ref SCIP_STAGE_INITPRESOLVE
26575  * - \ref SCIP_STAGE_PRESOLVING
26576  * - \ref SCIP_STAGE_EXITPRESOLVE
26577  * - \ref SCIP_STAGE_PRESOLVED
26578  * - \ref SCIP_STAGE_INITSOLVE
26579  * - \ref SCIP_STAGE_SOLVING
26580  * - \ref SCIP_STAGE_SOLVED
26581  */
26583  SCIP* scip, /**< SCIP data structure */
26584  SCIP_VAR* var, /**< problem variable */
26585  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26586  )
26587 {
26588  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgConflictlength", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26589 
26590  assert( var->scip == scip );
26591 
26592  return SCIPvarGetAvgConflictlength(var, dir);
26593 }
26594 
26595 /** returns the variable's average conflict length only using conflicts of the current run
26596  *
26597  * @return the variable's average conflict length only using conflicts of the current run
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_PRESOLVED
26604  * - \ref SCIP_STAGE_INITSOLVE
26605  * - \ref SCIP_STAGE_SOLVING
26606  * - \ref SCIP_STAGE_SOLVED
26607  */
26609  SCIP* scip, /**< SCIP data structure */
26610  SCIP_VAR* var, /**< problem variable */
26611  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26612  )
26613 {
26614  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgConflictlengthCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26615 
26616  assert( var->scip == scip );
26617 
26618  return SCIPvarGetAvgConflictlengthCurrentRun(var, dir);
26619 }
26620 
26621 /** returns the average number of inferences found after branching on the variable in given direction;
26622  * if branching on the variable in the given direction was yet evaluated, the average number of inferences
26623  * over all variables for branching in the given direction is returned
26624  *
26625  * @return the average number of inferences found after branching on the variable in given direction
26626  *
26627  * @pre This method can be called if @p scip is in one of the following stages:
26628  * - \ref SCIP_STAGE_INITPRESOLVE
26629  * - \ref SCIP_STAGE_PRESOLVING
26630  * - \ref SCIP_STAGE_EXITPRESOLVE
26631  * - \ref SCIP_STAGE_PRESOLVED
26632  * - \ref SCIP_STAGE_INITSOLVE
26633  * - \ref SCIP_STAGE_SOLVING
26634  * - \ref SCIP_STAGE_SOLVED
26635  */
26637  SCIP* scip, /**< SCIP data structure */
26638  SCIP_VAR* var, /**< problem variable */
26639  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26640  )
26641 {
26642  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferences", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26643 
26644  assert( var->scip == scip );
26645 
26646  return SCIPvarGetAvgInferences(var, scip->stat, dir);
26647 }
26648 
26649 /** returns the average number of inferences found after branching on the variable in given direction in the current run;
26650  * if branching on the variable in the given direction was yet evaluated, the average number of inferences
26651  * over all variables for branching in the given direction is returned
26652  *
26653  * @return the average number of inferences found after branching on the variable in given direction in the current run
26654  *
26655  * @pre This method can be called if @p scip is in one of the following stages:
26656  * - \ref SCIP_STAGE_INITPRESOLVE
26657  * - \ref SCIP_STAGE_PRESOLVING
26658  * - \ref SCIP_STAGE_EXITPRESOLVE
26659  * - \ref SCIP_STAGE_PRESOLVED
26660  * - \ref SCIP_STAGE_INITSOLVE
26661  * - \ref SCIP_STAGE_SOLVING
26662  * - \ref SCIP_STAGE_SOLVED
26663  */
26665  SCIP* scip, /**< SCIP data structure */
26666  SCIP_VAR* var, /**< problem variable */
26667  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26668  )
26669 {
26670  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferencesCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26671 
26672  assert( var->scip == scip );
26673 
26674  return SCIPvarGetAvgInferencesCurrentRun(var, scip->stat, dir);
26675 }
26676 
26677 /** returns the variable's average inference score value
26678  *
26679  * @return the variable's average inference score value
26680  *
26681  * @pre This method can be called if @p scip is in one of the following stages:
26682  * - \ref SCIP_STAGE_INITPRESOLVE
26683  * - \ref SCIP_STAGE_PRESOLVING
26684  * - \ref SCIP_STAGE_EXITPRESOLVE
26685  * - \ref SCIP_STAGE_PRESOLVED
26686  * - \ref SCIP_STAGE_INITSOLVE
26687  * - \ref SCIP_STAGE_SOLVING
26688  * - \ref SCIP_STAGE_SOLVED
26689  */
26691  SCIP* scip, /**< SCIP data structure */
26692  SCIP_VAR* var /**< problem variable */
26693  )
26694 {
26695  SCIP_Real inferdown;
26696  SCIP_Real inferup;
26697 
26698  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferenceScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26699 
26700  assert( var->scip == scip );
26701 
26702  inferdown = SCIPvarGetAvgInferences(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
26703  inferup = SCIPvarGetAvgInferences(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
26704 
26705  return SCIPbranchGetScore(scip->set, var, inferdown, inferup);
26706 }
26707 
26708 /** returns the variable's average inference score value only using inferences of the current run
26709  *
26710  * @return the variable's average inference score value only using inferences of the current run
26711  *
26712  * @pre This method can be called if @p scip is in one of the following stages:
26713  * - \ref SCIP_STAGE_INITPRESOLVE
26714  * - \ref SCIP_STAGE_PRESOLVING
26715  * - \ref SCIP_STAGE_EXITPRESOLVE
26716  * - \ref SCIP_STAGE_PRESOLVED
26717  * - \ref SCIP_STAGE_INITSOLVE
26718  * - \ref SCIP_STAGE_SOLVING
26719  * - \ref SCIP_STAGE_SOLVED
26720  */
26722  SCIP* scip, /**< SCIP data structure */
26723  SCIP_VAR* var /**< problem variable */
26724  )
26725 {
26726  SCIP_Real inferdown;
26727  SCIP_Real inferup;
26728 
26729  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferenceScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26730 
26731  assert( var->scip == scip );
26732 
26735 
26736  return SCIPbranchGetScore(scip->set, var, inferdown, inferup);
26737 }
26738 
26739 /** initializes the upwards and downwards pseudocosts, conflict scores, conflict lengths, inference scores, cutoff scores
26740  * of a variable to the given values
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_TRANSFORMED
26747  * - \ref SCIP_STAGE_INITPRESOLVE
26748  * - \ref SCIP_STAGE_PRESOLVING
26749  * - \ref SCIP_STAGE_EXITPRESOLVE
26750  * - \ref SCIP_STAGE_PRESOLVED
26751  * - \ref SCIP_STAGE_INITSOLVE
26752  * - \ref SCIP_STAGE_SOLVING
26753  */
26755  SCIP* scip, /**< SCIP data structure */
26756  SCIP_VAR* var, /**< variable which should be initialized */
26757  SCIP_Real downpscost, /**< value to which pseudocosts for downwards branching should be initialized */
26758  SCIP_Real uppscost, /**< value to which pseudocosts for upwards branching should be initialized */
26759  SCIP_Real downvsids, /**< value to which VSIDS score for downwards branching should be initialized */
26760  SCIP_Real upvsids, /**< value to which VSIDS score for upwards branching should be initialized */
26761  SCIP_Real downconflen, /**< value to which conflict length score for downwards branching should be initialized */
26762  SCIP_Real upconflen, /**< value to which conflict length score for upwards branching should be initialized */
26763  SCIP_Real downinfer, /**< value to which inference counter for downwards branching should be initialized */
26764  SCIP_Real upinfer, /**< value to which inference counter for upwards branching should be initialized */
26765  SCIP_Real downcutoff, /**< value to which cutoff counter for downwards branching should be initialized */
26766  SCIP_Real upcutoff /**< value to which cutoff counter for upwards branching should be initialized */
26767  )
26768 {
26769  SCIP_CALL( checkStage(scip, "SCIPinitVarBranchStats", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26770 
26771  assert(downpscost >= 0.0 && uppscost >= 0.0);
26772  assert(downvsids >= 0.0 && upvsids >= 0.0);
26773  assert(downconflen >= 0.0 && upconflen >= 0.0);
26774  assert(downinfer >= 0.0 && upinfer >= 0.0);
26775  assert(downcutoff >= 0.0 && upcutoff >= 0.0);
26776 
26777  if( !SCIPisFeasZero(scip, downpscost) || !SCIPisFeasZero(scip, downvsids)
26778  || !SCIPisFeasZero(scip, downinfer) || !SCIPisFeasZero(scip, downcutoff) )
26779  {
26781  SCIP_CALL( SCIPvarUpdatePseudocost(var, scip->set, scip->stat, -1.0, downpscost, 1.0) );
26782  SCIP_CALL( SCIPvarIncInferenceSum(var, NULL, NULL, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, SCIP_UNKNOWN, downinfer) );
26783  SCIP_CALL( SCIPvarIncVSIDS(var, NULL, scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, SCIP_UNKNOWN, downvsids) );
26784  SCIP_CALL( SCIPvarIncCutoffSum(var, NULL, NULL, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, SCIP_UNKNOWN, downcutoff) );
26785  }
26786 
26787  if( !SCIPisFeasZero(scip, downconflen) )
26788  {
26789  SCIP_CALL( SCIPvarIncNActiveConflicts(var, NULL, NULL, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, SCIP_UNKNOWN, downconflen) );
26790  }
26791 
26792  if( !SCIPisFeasZero(scip, uppscost) || !SCIPisFeasZero(scip, upvsids)
26793  || !SCIPisFeasZero(scip, upinfer) || !SCIPisFeasZero(scip, upcutoff) )
26794  {
26796  SCIP_CALL( SCIPvarUpdatePseudocost(var, scip->set, scip->stat, 1.0, uppscost, 1.0) );
26797  SCIP_CALL( SCIPvarIncInferenceSum(var, NULL, NULL, scip->stat, SCIP_BRANCHDIR_UPWARDS, SCIP_UNKNOWN, upinfer) );
26798  SCIP_CALL( SCIPvarIncVSIDS(var, NULL, scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, SCIP_UNKNOWN, upvsids) );
26799  SCIP_CALL( SCIPvarIncCutoffSum(var, NULL, NULL, scip->stat, SCIP_BRANCHDIR_UPWARDS, SCIP_UNKNOWN, upcutoff) );
26800  }
26801 
26802  if( !SCIPisFeasZero(scip, upconflen) )
26803  {
26804  SCIP_CALL( SCIPvarIncNActiveConflicts(var, NULL, NULL, scip->stat, SCIP_BRANCHDIR_UPWARDS, SCIP_UNKNOWN, upconflen) );
26805  }
26806 
26807  return SCIP_OKAY;
26808 }
26809 
26810 /** initializes the upwards and downwards conflict scores, conflict lengths, inference scores, cutoff scores of a
26811  * variable w.r.t. a value by the given values (SCIP_VALUEHISTORY)
26812  *
26813  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26814  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26815  *
26816  * @pre This method can be called if @p scip is in one of the following stages:
26817  * - \ref SCIP_STAGE_TRANSFORMED
26818  * - \ref SCIP_STAGE_INITPRESOLVE
26819  * - \ref SCIP_STAGE_PRESOLVING
26820  * - \ref SCIP_STAGE_EXITPRESOLVE
26821  * - \ref SCIP_STAGE_PRESOLVED
26822  * - \ref SCIP_STAGE_INITSOLVE
26823  * - \ref SCIP_STAGE_SOLVING
26824  */
26826  SCIP* scip, /**< SCIP data structure */
26827  SCIP_VAR* var, /**< variable which should be initialized */
26828  SCIP_Real value, /**< domain value, or SCIP_UNKNOWN */
26829  SCIP_Real downvsids, /**< value to which VSIDS score for downwards branching should be initialized */
26830  SCIP_Real upvsids, /**< value to which VSIDS score for upwards branching should be initialized */
26831  SCIP_Real downconflen, /**< value to which conflict length score for downwards branching should be initialized */
26832  SCIP_Real upconflen, /**< value to which conflict length score for upwards branching should be initialized */
26833  SCIP_Real downinfer, /**< value to which inference counter for downwards branching should be initialized */
26834  SCIP_Real upinfer, /**< value to which inference counter for upwards branching should be initialized */
26835  SCIP_Real downcutoff, /**< value to which cutoff counter for downwards branching should be initialized */
26836  SCIP_Real upcutoff /**< value to which cutoff counter for upwards branching should be initialized */
26837  )
26838 {
26839  SCIP_CALL( checkStage(scip, "SCIPinitVarValueBranchStats", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26840 
26841  assert(downvsids >= 0.0 && upvsids >= 0.0);
26842  assert(downconflen >= 0.0 && upconflen >= 0.0);
26843  assert(downinfer >= 0.0 && upinfer >= 0.0);
26844  assert(downcutoff >= 0.0 && upcutoff >= 0.0);
26845 
26846  if( !SCIPisFeasZero(scip, downvsids) || !SCIPisFeasZero(scip, downinfer) || !SCIPisFeasZero(scip, downcutoff) )
26847  {
26848  SCIP_CALL( SCIPvarIncNBranchings(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, 1) );
26849  SCIP_CALL( SCIPvarIncInferenceSum(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, downinfer) );
26850  SCIP_CALL( SCIPvarIncVSIDS(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, downvsids) );
26851  SCIP_CALL( SCIPvarIncCutoffSum(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, downcutoff) );
26852  }
26853 
26854  if( !SCIPisFeasZero(scip, downconflen) )
26855  {
26856  SCIP_CALL( SCIPvarIncNActiveConflicts(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, downconflen) );
26857  }
26858 
26859  if( !SCIPisFeasZero(scip, upvsids) || !SCIPisFeasZero(scip, upinfer) || !SCIPisFeasZero(scip, upcutoff) )
26860  {
26861  SCIP_CALL( SCIPvarIncNBranchings(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, 1) );
26862  SCIP_CALL( SCIPvarIncInferenceSum(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, upinfer) );
26863  SCIP_CALL( SCIPvarIncVSIDS(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, upvsids) );
26864  SCIP_CALL( SCIPvarIncCutoffSum(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, upcutoff) );
26865  }
26866 
26867  if( !SCIPisFeasZero(scip, upconflen) )
26868  {
26869  SCIP_CALL( SCIPvarIncNActiveConflicts(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, upconflen) );
26870  }
26871 
26872  return SCIP_OKAY;
26873 }
26874 
26875 /** returns the average number of cutoffs found after branching on the variable in given direction;
26876  * if branching on the variable in the given direction was yet evaluated, the average number of cutoffs
26877  * over all variables for branching in the given direction is returned
26878  *
26879  * @return the average number of cutoffs found after branching on the variable in given direction
26880  *
26881  * @pre This method can be called if @p scip is in one of the following stages:
26882  * - \ref SCIP_STAGE_INITPRESOLVE
26883  * - \ref SCIP_STAGE_PRESOLVING
26884  * - \ref SCIP_STAGE_EXITPRESOLVE
26885  * - \ref SCIP_STAGE_PRESOLVED
26886  * - \ref SCIP_STAGE_INITSOLVE
26887  * - \ref SCIP_STAGE_SOLVING
26888  * - \ref SCIP_STAGE_SOLVED
26889  */
26891  SCIP* scip, /**< SCIP data structure */
26892  SCIP_VAR* var, /**< problem variable */
26893  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26894  )
26895 {
26896  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgCutoffs", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26897 
26898  assert( var->scip == scip );
26899 
26900  return SCIPvarGetAvgCutoffs(var, scip->stat, dir);
26901 }
26902 
26903 /** returns the average number of cutoffs found after branching on the variable in given direction in the current run;
26904  * if branching on the variable in the given direction was yet evaluated, the average number of cutoffs
26905  * over all variables for branching in the given direction is returned
26906  *
26907  * @return the average number of cutoffs found after branching on the variable in given direction in the current run
26908  *
26909  * @pre This method can be called if @p scip is in one of the following stages:
26910  * - \ref SCIP_STAGE_INITPRESOLVE
26911  * - \ref SCIP_STAGE_PRESOLVING
26912  * - \ref SCIP_STAGE_EXITPRESOLVE
26913  * - \ref SCIP_STAGE_PRESOLVED
26914  * - \ref SCIP_STAGE_INITSOLVE
26915  * - \ref SCIP_STAGE_SOLVING
26916  * - \ref SCIP_STAGE_SOLVED
26917  */
26919  SCIP* scip, /**< SCIP data structure */
26920  SCIP_VAR* var, /**< problem variable */
26921  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26922  )
26923 {
26924  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgCutoffsCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26925 
26926  assert( var->scip == scip );
26927 
26928  return SCIPvarGetAvgCutoffsCurrentRun(var, scip->stat, dir);
26929 }
26930 
26931 /** returns the variable's average cutoff score value
26932  *
26933  * @return the variable's average cutoff score value
26934  *
26935  * @pre This method can be called if @p scip is in one of the following stages:
26936  * - \ref SCIP_STAGE_INITPRESOLVE
26937  * - \ref SCIP_STAGE_PRESOLVING
26938  * - \ref SCIP_STAGE_EXITPRESOLVE
26939  * - \ref SCIP_STAGE_PRESOLVED
26940  * - \ref SCIP_STAGE_INITSOLVE
26941  * - \ref SCIP_STAGE_SOLVING
26942  * - \ref SCIP_STAGE_SOLVED
26943  */
26945  SCIP* scip, /**< SCIP data structure */
26946  SCIP_VAR* var /**< problem variable */
26947  )
26948 {
26949  SCIP_Real cutoffdown;
26950  SCIP_Real cutoffup;
26951 
26952  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgCutoffScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26953 
26954  assert( var->scip == scip );
26955 
26956  cutoffdown = SCIPvarGetAvgCutoffs(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
26957  cutoffup = SCIPvarGetAvgCutoffs(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
26958 
26959  return SCIPbranchGetScore(scip->set, var, cutoffdown, cutoffup);
26960 }
26961 
26962 /** returns the variable's average cutoff score value, only using cutoffs of the current run
26963  *
26964  * @return the variable's average cutoff score value, only using cutoffs of the current run
26965  *
26966  * @pre This method can be called if @p scip is in one of the following stages:
26967  * - \ref SCIP_STAGE_INITPRESOLVE
26968  * - \ref SCIP_STAGE_PRESOLVING
26969  * - \ref SCIP_STAGE_EXITPRESOLVE
26970  * - \ref SCIP_STAGE_PRESOLVED
26971  * - \ref SCIP_STAGE_INITSOLVE
26972  * - \ref SCIP_STAGE_SOLVING
26973  * - \ref SCIP_STAGE_SOLVED
26974  */
26976  SCIP* scip, /**< SCIP data structure */
26977  SCIP_VAR* var /**< problem variable */
26978  )
26979 {
26980  SCIP_Real cutoffdown;
26981  SCIP_Real cutoffup;
26982 
26983  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgCutoffScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26984 
26985  assert( var->scip == scip );
26986 
26989 
26990  return SCIPbranchGetScore(scip->set, var, cutoffdown, cutoffup);
26991 }
26992 
26993 /** returns the variable's average inference/cutoff score value, weighting the cutoffs of the variable with the given
26994  * factor
26995  *
26996  * @return the variable's average inference/cutoff score value
26997  *
26998  * @pre This method can be called if @p scip is in one of the following stages:
26999  * - \ref SCIP_STAGE_INITPRESOLVE
27000  * - \ref SCIP_STAGE_PRESOLVING
27001  * - \ref SCIP_STAGE_EXITPRESOLVE
27002  * - \ref SCIP_STAGE_PRESOLVED
27003  * - \ref SCIP_STAGE_INITSOLVE
27004  * - \ref SCIP_STAGE_SOLVING
27005  * - \ref SCIP_STAGE_SOLVED
27006  */
27008  SCIP* scip, /**< SCIP data structure */
27009  SCIP_VAR* var, /**< problem variable */
27010  SCIP_Real cutoffweight /**< factor to weigh average number of cutoffs in branching score */
27011  )
27012 {
27013  SCIP_Real avginferdown;
27014  SCIP_Real avginferup;
27015  SCIP_Real avginfer;
27016  SCIP_Real inferdown;
27017  SCIP_Real inferup;
27018  SCIP_Real cutoffdown;
27019  SCIP_Real cutoffup;
27020 
27021  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferenceCutoffScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
27022 
27023  assert( var->scip == scip );
27024 
27027  avginfer = (avginferdown + avginferup)/2.0;
27028  inferdown = SCIPvarGetAvgInferences(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
27029  inferup = SCIPvarGetAvgInferences(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
27030  cutoffdown = SCIPvarGetAvgCutoffs(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
27031  cutoffup = SCIPvarGetAvgCutoffs(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
27032 
27033  return SCIPbranchGetScore(scip->set, var,
27034  inferdown + cutoffweight * avginfer * cutoffdown, inferup + cutoffweight * avginfer * cutoffup);
27035 }
27036 
27037 /** returns the variable's average inference/cutoff score value, weighting the cutoffs of the variable with the given
27038  * factor, only using inferences and cutoffs of the current run
27039  *
27040  * @return the variable's average inference/cutoff score value, only using inferences and cutoffs of the current run
27041  *
27042  * @pre This method can be called if @p scip is in one of the following stages:
27043  * - \ref SCIP_STAGE_INITPRESOLVE
27044  * - \ref SCIP_STAGE_PRESOLVING
27045  * - \ref SCIP_STAGE_EXITPRESOLVE
27046  * - \ref SCIP_STAGE_PRESOLVED
27047  * - \ref SCIP_STAGE_INITSOLVE
27048  * - \ref SCIP_STAGE_SOLVING
27049  * - \ref SCIP_STAGE_SOLVED
27050  */
27052  SCIP* scip, /**< SCIP data structure */
27053  SCIP_VAR* var, /**< problem variable */
27054  SCIP_Real cutoffweight /**< factor to weigh average number of cutoffs in branching score */
27055  )
27056 {
27057  SCIP_Real avginferdown;
27058  SCIP_Real avginferup;
27059  SCIP_Real avginfer;
27060  SCIP_Real inferdown;
27061  SCIP_Real inferup;
27062  SCIP_Real cutoffdown;
27063  SCIP_Real cutoffup;
27064 
27065  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferenceCutoffScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
27066 
27067  assert( var->scip == scip );
27068 
27071  avginfer = (avginferdown + avginferup)/2.0;
27076 
27077  return SCIPbranchGetScore(scip->set, var,
27078  inferdown + cutoffweight * avginfer * cutoffdown, inferup + cutoffweight * avginfer * cutoffup);
27079 }
27080 
27081 /** outputs variable information to file stream via the message system
27082  *
27083  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27084  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27085  *
27086  * @pre This method can be called if @p scip is in one of the following stages:
27087  * - \ref SCIP_STAGE_PROBLEM
27088  * - \ref SCIP_STAGE_TRANSFORMING
27089  * - \ref SCIP_STAGE_TRANSFORMED
27090  * - \ref SCIP_STAGE_INITPRESOLVE
27091  * - \ref SCIP_STAGE_PRESOLVING
27092  * - \ref SCIP_STAGE_EXITPRESOLVE
27093  * - \ref SCIP_STAGE_PRESOLVED
27094  * - \ref SCIP_STAGE_INITSOLVE
27095  * - \ref SCIP_STAGE_SOLVING
27096  * - \ref SCIP_STAGE_SOLVED
27097  * - \ref SCIP_STAGE_EXITSOLVE
27098  * - \ref SCIP_STAGE_FREETRANS
27099  *
27100  * @note If the message handler is set to a NULL pointer nothing will be printed
27101  */
27103  SCIP* scip, /**< SCIP data structure */
27104  SCIP_VAR* var, /**< problem variable */
27105  FILE* file /**< output file (or NULL for standard output) */
27106  )
27107 {
27108  SCIP_CALL( checkStage(scip, "SCIPprintVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
27109 
27110  SCIP_CALL( SCIPvarPrint(var, scip->set, scip->messagehdlr, file) );
27111 
27112  return SCIP_OKAY;
27113 }
27114 
27115 /*
27116  * conflict analysis methods
27117  */
27118 
27119 /** return TRUE if conflict analysis is applicable; In case the function return FALSE there is no need to initialize the
27120  * conflict analysis since it will not be applied
27121  *
27122  * @return return TRUE if conflict analysis is applicable; In case the function return FALSE there is no need to initialize the
27123  * conflict analysis since it will not be applied
27124  *
27125  * @pre This method can be called if SCIP is in one of the following stages:
27126  * - \ref SCIP_STAGE_INITPRESOLVE
27127  * - \ref SCIP_STAGE_PRESOLVING
27128  * - \ref SCIP_STAGE_EXITPRESOLVE
27129  * - \ref SCIP_STAGE_SOLVING
27130  *
27131  * @note SCIP stage does not get changed
27132  */
27134  SCIP* scip /**< SCIP data structure */
27135  )
27136 {
27137  SCIP_CALL_ABORT( checkStage(scip, "SCIPisConflictAnalysisApplicable", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27138 
27139  return (SCIPgetDepth(scip) > 0 && SCIPconflictApplicable(scip->set));
27140 }
27141 
27142 /** initializes the conflict analysis by clearing the conflict candidate queue; this method must be called before you
27143  * enter the conflict variables by calling SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(),
27144  * SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or SCIPaddConflictBinvar();
27145  *
27146  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27147  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27148  *
27149  * @pre This method can be called if SCIP is in one of the following stages:
27150  * - \ref SCIP_STAGE_PRESOLVING
27151  * - \ref SCIP_STAGE_SOLVING
27152  *
27153  * @note SCIP stage does not get changed
27154  */
27156  SCIP* scip, /**< SCIP data structure */
27157  SCIP_CONFTYPE conftype, /**< type of conflict */
27158  SCIP_Bool iscutoffinvolved /**< is the current cutoff bound involved? */
27159  )
27160 {
27161  SCIP_CALL( checkStage(scip, "SCIPinitConflictAnalysis", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27162 
27163  SCIP_CALL( SCIPconflictInit(scip->conflict, scip->set, scip->stat, scip->transprob, conftype, iscutoffinvolved) );
27164 
27165  return SCIP_OKAY;
27166 }
27167 
27168 /** adds lower bound of variable at the time of the given bound change index to the conflict analysis' candidate storage;
27169  * this method should be called in one of the following two cases:
27170  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictLb() should be called for each lower bound
27171  * that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
27172  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictLb() should be called
27173  * for each lower bound, whose current assignment led to the deduction of the given conflict bound.
27174  *
27175  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27176  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27177  *
27178  * @pre This method can be called if SCIP is in one of the following stages:
27179  * - \ref SCIP_STAGE_PRESOLVING
27180  * - \ref SCIP_STAGE_SOLVING
27181  *
27182  * @note SCIP stage does not get changed
27183  */
27185  SCIP* scip, /**< SCIP data structure */
27186  SCIP_VAR* var, /**< variable whose lower bound should be added to conflict candidate queue */
27187  SCIP_BDCHGIDX* bdchgidx /**< bound change index representing time on path to current node, when the
27188  * conflicting bound was valid, NULL for current local bound */
27189  )
27190 {
27191  SCIP_CALL( checkStage(scip, "SCIPaddConflictLb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27192 
27193  assert( var->scip == scip );
27194 
27195  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_LOWER, bdchgidx) );
27196 
27197  return SCIP_OKAY;
27198 }
27199 
27200 /** adds lower bound of variable at the time of the given bound change index to the conflict analysis' candidate storage
27201  * with the additional information of a relaxed lower bound; this relaxed lower bound is the one which would be enough
27202  * to explain a certain bound change;
27203  * this method should be called in one of the following two cases:
27204  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictRelaxedLb() should be called for each (relaxed) lower bound
27205  * that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
27206  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictRelexedLb() should be called
27207  * for each (relaxed) lower bound, whose current assignment led to the deduction of the given conflict bound.
27208  *
27209  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27210  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27211  *
27212  * @pre This method can be called if SCIP is in one of the following stages:
27213  * - \ref SCIP_STAGE_PRESOLVING
27214  * - \ref SCIP_STAGE_SOLVING
27215  *
27216  * @note SCIP stage does not get changed
27217  */
27219  SCIP* scip, /**< SCIP data structure */
27220  SCIP_VAR* var, /**< variable whose lower bound should be added to conflict candidate queue */
27221  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node, when the
27222  * conflicting bound was valid, NULL for current local bound */
27223  SCIP_Real relaxedlb /**< the relaxed lower bound */
27224  )
27225 {
27226  SCIP_CALL( checkStage(scip, "SCIPaddConflictRelaxedLb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27227 
27228  assert( var->scip == scip );
27229 
27230  SCIP_CALL( SCIPconflictAddRelaxedBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_LOWER, bdchgidx, relaxedlb) );
27231 
27232  return SCIP_OKAY;
27233 }
27234 
27235 /** adds upper bound of variable at the time of the given bound change index to the conflict analysis' candidate storage;
27236  * this method should be called in one of the following two cases:
27237  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictUb() should be called for each upper bound that
27238  * led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
27239  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictUb() should be called for
27240  * each upper bound, whose current assignment led to the deduction of the given conflict bound.
27241  *
27242  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27243  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27244  *
27245  * @pre This method can be called if SCIP is in one of the following stages:
27246  * - \ref SCIP_STAGE_PRESOLVING
27247  * - \ref SCIP_STAGE_SOLVING
27248  *
27249  * @note SCIP stage does not get changed
27250  */
27252  SCIP* scip, /**< SCIP data structure */
27253  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
27254  SCIP_BDCHGIDX* bdchgidx /**< bound change index representing time on path to current node, when the
27255  * conflicting bound was valid, NULL for current local bound */
27256  )
27257 {
27258  SCIP_CALL( checkStage(scip, "SCIPaddConflictUb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27259 
27260  assert( var->scip == scip );
27261 
27262  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_UPPER, bdchgidx) );
27263 
27264  return SCIP_OKAY;
27265 }
27266 
27267 /** adds upper bound of variable at the time of the given bound change index to the conflict analysis' candidate storage
27268  * with the additional information of a relaxed upper bound; this relaxed upper bound is the one which would be enough
27269  * to explain a certain bound change;
27270  * this method should be called in one of the following two cases:
27271  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictRelaxedUb() should be called for each (relaxed) upper
27272  * bound that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
27273  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictRelaxedUb() should be
27274  * called for each (relaxed) upper bound, whose current assignment led to the deduction of the given conflict
27275  * bound.
27276  *
27277  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27278  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27279  *
27280  * @pre This method can be called if SCIP is in one of the following stages:
27281  * - \ref SCIP_STAGE_PRESOLVING
27282  * - \ref SCIP_STAGE_SOLVING
27283  *
27284  * @note SCIP stage does not get changed
27285  */
27287  SCIP* scip, /**< SCIP data structure */
27288  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
27289  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node, when the
27290  * conflicting bound was valid, NULL for current local bound */
27291  SCIP_Real relaxedub /**< the relaxed upper bound */
27292  )
27293 {
27294  SCIP_CALL( checkStage(scip, "SCIPaddConflictRelaxedUb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27295 
27296  assert( var->scip == scip );
27297 
27298  SCIP_CALL( SCIPconflictAddRelaxedBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_UPPER, bdchgidx, relaxedub) );
27299 
27300  return SCIP_OKAY;
27301 }
27302 
27303 /** adds lower or upper bound of variable at the time of the given bound change index to the conflict analysis' candidate
27304  * storage; this method should be called in one of the following two cases:
27305  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictBd() should be called for each bound
27306  * that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
27307  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictBd() should be called
27308  * for each bound, whose current assignment led to the deduction of the given conflict bound.
27309  *
27310  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27311  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27312  *
27313  * @pre This method can be called if SCIP is in one of the following stages:
27314  * - \ref SCIP_STAGE_PRESOLVING
27315  * - \ref SCIP_STAGE_SOLVING
27316  *
27317  * @note SCIP stage does not get changed
27318  */
27320  SCIP* scip, /**< SCIP data structure */
27321  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
27322  SCIP_BOUNDTYPE boundtype, /**< the type of the conflicting bound (lower or upper bound) */
27323  SCIP_BDCHGIDX* bdchgidx /**< bound change index representing time on path to current node, when the
27324  * conflicting bound was valid, NULL for current local bound */
27325  )
27326 {
27327  SCIP_CALL( checkStage(scip, "SCIPaddConflictBd", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27328 
27329  assert( var->scip == scip );
27330 
27331  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, boundtype, bdchgidx) );
27332 
27333  return SCIP_OKAY;
27334 }
27335 
27336 /** adds lower or upper bound of variable at the time of the given bound change index to the conflict analysis'
27337  * candidate storage; with the additional information of a relaxed upper bound; this relaxed upper bound is the one
27338  * which would be enough to explain a certain bound change;
27339  * this method should be called in one of the following two cases:
27340  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictRelaxedBd() should be called for each (relaxed)
27341  * bound that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
27342  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictRelaxedBd() should be
27343  * called for each (relaxed) bound, whose current assignment led to the deduction of the given conflict bound.
27344  *
27345  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27346  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27347  *
27348  * @pre This method can be called if SCIP is in one of the following stages:
27349  * - \ref SCIP_STAGE_PRESOLVING
27350  * - \ref SCIP_STAGE_SOLVING
27351  *
27352  * @note SCIP stage does not get changed
27353  */
27355  SCIP* scip, /**< SCIP data structure */
27356  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
27357  SCIP_BOUNDTYPE boundtype, /**< the type of the conflicting bound (lower or upper bound) */
27358  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node, when the
27359  * conflicting bound was valid, NULL for current local bound */
27360  SCIP_Real relaxedbd /**< the relaxed bound */
27361  )
27362 {
27363  SCIP_CALL( checkStage(scip, "SCIPaddConflictRelaxedBd", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27364 
27365  assert( var->scip == scip );
27366 
27367  SCIP_CALL( SCIPconflictAddRelaxedBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, boundtype, bdchgidx, relaxedbd) );
27368 
27369  return SCIP_OKAY;
27370 }
27371 
27372 /** adds changed bound of fixed binary variable to the conflict analysis' candidate storage;
27373  * this method should be called in one of the following two cases:
27374  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictBinvar() should be called for each fixed binary
27375  * variable that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
27376  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictBinvar() should be called
27377  * for each binary variable, whose current fixing led to the deduction of the given conflict bound.
27378  *
27379  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27380  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27381  *
27382  * @pre This method can be called if SCIP is in one of the following stages:
27383  * - \ref SCIP_STAGE_PRESOLVING
27384  * - \ref SCIP_STAGE_SOLVING
27385  *
27386  * @note SCIP stage does not get changed
27387  */
27389  SCIP* scip, /**< SCIP data structure */
27390  SCIP_VAR* var /**< binary variable whose changed bound should be added to conflict queue */
27391  )
27392 {
27393  SCIP_CALL( checkStage(scip, "SCIPaddConflictBinvar", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27394 
27395  assert(var->scip == scip);
27396  assert(SCIPvarIsBinary(var));
27397 
27398  if( SCIPvarGetLbLocal(var) > 0.5 )
27399  {
27400  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_LOWER, NULL) );
27401  }
27402  else if( SCIPvarGetUbLocal(var) < 0.5 )
27403  {
27404  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_UPPER, NULL) );
27405  }
27406 
27407  return SCIP_OKAY;
27408 }
27409 
27410 /** checks if the given variable is already part of the current conflict set or queued for resolving with the same or
27411  * even stronger bound
27412  *
27413  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27414  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27415  *
27416  * @pre This method can be called if SCIP is in one of the following stages:
27417  * - \ref SCIP_STAGE_PRESOLVING
27418  * - \ref SCIP_STAGE_SOLVING
27419  *
27420  * @note SCIP stage does not get changed
27421  */
27423  SCIP* scip, /**< SCIP data structure */
27424  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
27425  SCIP_BOUNDTYPE boundtype, /**< the type of the conflicting bound (lower or upper bound) */
27426  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node, when the
27427  * conflicting bound was valid, NULL for current local bound */
27428  SCIP_Bool* used /**< pointer to store if the variable is already used */
27429  )
27430 {
27431  SCIP_CALL_ABORT( checkStage(scip, "SCIPisConflictVarUsed", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27432 
27433  assert( var->scip == scip );
27434 
27435  return SCIPconflictIsVarUsed(scip->conflict, var, scip->set, boundtype, bdchgidx, used);
27436 }
27437 
27438 /** returns the conflict lower bound if the variable is present in the current conflict set; otherwise the global lower
27439  * bound
27440  *
27441  * @return returns the conflict lower bound if the variable is present in the current conflict set; otherwise the global lower
27442  * bound
27443  *
27444  * @pre This method can be called if SCIP is in one of the following stages:
27445  * - \ref SCIP_STAGE_PRESOLVING
27446  * - \ref SCIP_STAGE_SOLVING
27447  *
27448  * @note SCIP stage does not get changed
27449  */
27451  SCIP* scip, /**< SCIP data structure */
27452  SCIP_VAR* var /**< problem variable */
27453  )
27454 {
27455  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetConflictVarLb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27456 
27457  assert( var->scip == scip );
27458 
27459  return SCIPconflictGetVarLb(scip->conflict, var);
27460 }
27461 
27462 /** returns the conflict upper bound if the variable is present in the current conflict set; otherwise minus global
27463  * upper bound
27464  *
27465  * @return returns the conflict upper bound if the variable is present in the current conflict set; otherwise minus global
27466  * upper bound
27467  *
27468  * @pre This method can be called if SCIP is in one of the following stages:
27469  * - \ref SCIP_STAGE_PRESOLVING
27470  * - \ref SCIP_STAGE_SOLVING
27471  *
27472  * @note SCIP stage does not get changed
27473  */
27475  SCIP* scip, /**< SCIP data structure */
27476  SCIP_VAR* var /**< problem variable */
27477  )
27478 {
27479  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetConflictVarUb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27480 
27481  assert( var->scip == scip );
27482 
27483  return SCIPconflictGetVarUb(scip->conflict, var);
27484 }
27485 
27486 /** analyzes conflict bounds that were added after a call to SCIPinitConflictAnalysis() with calls to
27487  * SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(), SCIPaddConflictRelaxedLb(),
27488  * SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or SCIPaddConflictBinvar(); on success, calls the conflict
27489  * handlers to create a conflict constraint out of the resulting conflict set; the given valid depth must be a depth
27490  * level, at which the conflict set defined by calls to SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(),
27491  * SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), and SCIPaddConflictBinvar() is
27492  * valid for the whole subtree; if the conflict was found by a violated constraint, use SCIPanalyzeConflictCons()
27493  * instead of SCIPanalyzeConflict() to make sure, that the correct valid depth is used
27494  *
27495  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27496  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27497  *
27498  * @pre This method can be called if SCIP is in one of the following stages:
27499  * - \ref SCIP_STAGE_PRESOLVING
27500  * - \ref SCIP_STAGE_SOLVING
27501  *
27502  * @note SCIP stage does not get changed
27503  */
27505  SCIP* scip, /**< SCIP data structure */
27506  int validdepth, /**< minimal depth level at which the initial conflict set is valid */
27507  SCIP_Bool* success /**< pointer to store whether a conflict constraint was created, or NULL */
27508  )
27509 {
27510  SCIP_CALL( checkStage(scip, "SCIPanalyzeConflict", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27511 
27512  SCIP_CALL( SCIPconflictAnalyze(scip->conflict, scip->mem->probmem, scip->set, scip->stat,
27513  scip->transprob, scip->tree, validdepth, success) );
27514 
27515  return SCIP_OKAY;
27516 }
27517 
27518 /** analyzes conflict bounds that were added with calls to SCIPaddConflictLb(), SCIPaddConflictUb(),
27519  * SCIPaddConflictBd(), SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or
27520  * SCIPaddConflictBinvar(); on success, calls the conflict handlers to create a conflict constraint out of the
27521  * resulting conflict set; the given constraint must be the constraint that detected the conflict, i.e. the constraint
27522  * that is infeasible in the local bounds of the initial conflict set (defined by calls to SCIPaddConflictLb(),
27523  * SCIPaddConflictUb(), SCIPaddConflictBd(), SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(),
27524  * SCIPaddConflictRelaxedBd(), and SCIPaddConflictBinvar())
27525  *
27526  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27527  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27528  *
27529  * @pre This method can be called if SCIP is in one of the following stages:
27530  * - \ref SCIP_STAGE_PRESOLVING
27531  * - \ref SCIP_STAGE_SOLVING
27532  *
27533  * @note SCIP stage does not get changed
27534  */
27536  SCIP* scip, /**< SCIP data structure */
27537  SCIP_CONS* cons, /**< constraint that detected the conflict */
27538  SCIP_Bool* success /**< pointer to store whether a conflict constraint was created, or NULL */
27539  )
27540 {
27541  SCIP_CALL( checkStage(scip, "SCIPanalyzeConflictCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27542 
27543  if( SCIPconsIsGlobal(cons) )
27544  {
27545  SCIP_CALL( SCIPconflictAnalyze(scip->conflict, scip->mem->probmem, scip->set, scip->stat,
27546  scip->transprob, scip->tree, 0, success) );
27547  }
27548  else if( SCIPconsIsActive(cons) )
27549  {
27550  SCIP_CALL( SCIPconflictAnalyze(scip->conflict, scip->mem->probmem, scip->set, scip->stat,
27551  scip->transprob, scip->tree, SCIPconsGetValidDepth(cons), success) );
27552  }
27553 
27554  return SCIP_OKAY;
27555 }
27556 
27557 /*
27558  * constraint methods
27559  */
27560 
27561 /** creates and captures a constraint of the given constraint handler
27562  *
27563  * @warning If a constraint is marked to be checked for feasibility but not to be enforced, a LP or pseudo solution may
27564  * be declared feasible even if it violates this particular constraint. This constellation should only be
27565  * used, if no LP or pseudo solution can violate the constraint -- e.g. if a local constraint is redundant due
27566  * to the variable's local bounds.
27567  *
27568  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27569  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27570  *
27571  * @pre This method can be called if @p scip is in one of the following stages:
27572  * - \ref SCIP_STAGE_PROBLEM
27573  * - \ref SCIP_STAGE_TRANSFORMING
27574  * - \ref SCIP_STAGE_INITPRESOLVE
27575  * - \ref SCIP_STAGE_PRESOLVING
27576  * - \ref SCIP_STAGE_EXITPRESOLVE
27577  * - \ref SCIP_STAGE_PRESOLVED
27578  * - \ref SCIP_STAGE_INITSOLVE
27579  * - \ref SCIP_STAGE_SOLVING
27580  * - \ref SCIP_STAGE_EXITSOLVE
27581  *
27582  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
27583  */
27585  SCIP* scip, /**< SCIP data structure */
27586  SCIP_CONS** cons, /**< pointer to constraint */
27587  const char* name, /**< name of constraint */
27588  SCIP_CONSHDLR* conshdlr, /**< constraint handler for this constraint */
27589  SCIP_CONSDATA* consdata, /**< data for this specific constraint */
27590  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
27591  * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
27592  SCIP_Bool separate, /**< should the constraint be separated during LP processing?
27593  * Usually set to TRUE. */
27594  SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
27595  * TRUE for model constraints, FALSE for additional, redundant constraints. */
27596  SCIP_Bool check, /**< should the constraint be checked for feasibility?
27597  * TRUE for model constraints, FALSE for additional, redundant constraints. */
27598  SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
27599  * Usually set to TRUE. */
27600  SCIP_Bool local, /**< is constraint only valid locally?
27601  * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
27602  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
27603  * Usually set to FALSE. In column generation applications, set to TRUE if pricing
27604  * adds coefficients to this constraint. */
27605  SCIP_Bool dynamic, /**< is constraint subject to aging?
27606  * Usually set to FALSE. Set to TRUE for own cuts which
27607  * are separated as constraints. */
27608  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
27609  * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
27610  SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
27611  * if it may be moved to a more global node?
27612  * Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
27613  )
27614 {
27615  assert(cons != NULL);
27616  assert(name != NULL);
27617  assert(conshdlr != NULL);
27618 
27619  SCIP_CALL( checkStage(scip, "SCIPcreateCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
27620 
27621  switch( scip->set->stage )
27622  {
27623  case SCIP_STAGE_PROBLEM:
27624  SCIP_CALL( SCIPconsCreate(cons, scip->mem->probmem, scip->set, name, conshdlr, consdata,
27625  initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, TRUE, TRUE) );
27626  return SCIP_OKAY;
27627 
27631  case SCIP_STAGE_PRESOLVING:
27633  case SCIP_STAGE_PRESOLVED:
27634  case SCIP_STAGE_INITSOLVE:
27635  case SCIP_STAGE_SOLVING:
27636  case SCIP_STAGE_EXITSOLVE:
27637  SCIP_CALL( SCIPconsCreate(cons, scip->mem->probmem, scip->set, name, conshdlr, consdata,
27638  initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, FALSE, TRUE) );
27639  return SCIP_OKAY;
27640 
27641  default:
27642  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
27643  return SCIP_INVALIDCALL;
27644  } /*lint !e788*/
27645 }
27646 
27647 /** parses constraint information (in cip format) out of a string; if the parsing process was successful a constraint is
27648  * creates and captures;
27649  *
27650  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27651  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27652  *
27653  * @pre This method can be called if @p scip is in one of the following stages:
27654  * - \ref SCIP_STAGE_PROBLEM
27655  * - \ref SCIP_STAGE_TRANSFORMING
27656  * - \ref SCIP_STAGE_INITPRESOLVE
27657  * - \ref SCIP_STAGE_PRESOLVING
27658  * - \ref SCIP_STAGE_EXITPRESOLVE
27659  * - \ref SCIP_STAGE_PRESOLVED
27660  * - \ref SCIP_STAGE_SOLVING
27661  * - \ref SCIP_STAGE_EXITSOLVE
27662  *
27663  * @warning If a constraint is marked to be checked for feasibility but not to be enforced, a LP or pseudo solution may
27664  * be declared feasible even if it violates this particular constraint. This constellation should only be
27665  * used, if no LP or pseudo solution can violate the constraint -- e.g. if a local constraint is redundant due
27666  * to the variable's local bounds.
27667  */
27669  SCIP* scip, /**< SCIP data structure */
27670  SCIP_CONS** cons, /**< pointer to store constraint */
27671  const char* str, /**< string to parse for constraint */
27672  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
27673  * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
27674  SCIP_Bool separate, /**< should the constraint be separated during LP processing?
27675  * Usually set to TRUE. */
27676  SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
27677  * TRUE for model constraints, FALSE for additional, redundant constraints. */
27678  SCIP_Bool check, /**< should the constraint be checked for feasibility?
27679  * TRUE for model constraints, FALSE for additional, redundant constraints. */
27680  SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
27681  * Usually set to TRUE. */
27682  SCIP_Bool local, /**< is constraint only valid locally?
27683  * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
27684  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
27685  * Usually set to FALSE. In column generation applications, set to TRUE if pricing
27686  * adds coefficients to this constraint. */
27687  SCIP_Bool dynamic, /**< is constraint subject to aging?
27688  * Usually set to FALSE. Set to TRUE for own cuts which
27689  * are separated as constraints. */
27690  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
27691  * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
27692  SCIP_Bool stickingatnode, /**< should the constraint always be kept at the node where it was added, even
27693  * if it may be moved to a more global node?
27694  * Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
27695  SCIP_Bool* success /**< pointer to store if the paring process was successful */
27696  )
27697 {
27698  assert(cons != NULL);
27699 
27700  SCIP_CALL( checkStage(scip, "SCIPparseCons", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
27701 
27702  SCIP_CALL( SCIPconsParse(cons, scip->set, scip->messagehdlr, str,
27703  initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, success) );
27704 
27705 
27706  return SCIP_OKAY;
27707 }
27708 
27709 /** increases usage counter of constraint
27710  *
27711  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27712  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27713  *
27714  * @pre This method can be called if @p scip is in one of the following stages:
27715  * - \ref SCIP_STAGE_PROBLEM
27716  * - \ref SCIP_STAGE_TRANSFORMING
27717  * - \ref SCIP_STAGE_TRANSFORMED
27718  * - \ref SCIP_STAGE_INITPRESOLVE
27719  * - \ref SCIP_STAGE_PRESOLVING
27720  * - \ref SCIP_STAGE_EXITPRESOLVE
27721  * - \ref SCIP_STAGE_PRESOLVED
27722  * - \ref SCIP_STAGE_INITSOLVE
27723  * - \ref SCIP_STAGE_SOLVING
27724  * - \ref SCIP_STAGE_SOLVED
27725  */
27727  SCIP* scip, /**< SCIP data structure */
27728  SCIP_CONS* cons /**< constraint to capture */
27729  )
27730 {
27731  SCIP_CALL( checkStage(scip, "SCIPcaptureCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
27732 
27733  assert( cons->scip == scip );
27734 
27735  SCIPconsCapture(cons);
27736 
27737  return SCIP_OKAY;
27738 }
27739 
27740 /** decreases usage counter of constraint, if the usage pointer reaches zero the constraint gets freed
27741  *
27742  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27743  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27744  *
27745  * @pre This method can be called if @p scip is in one of the following stages:
27746  * - \ref SCIP_STAGE_PROBLEM
27747  * - \ref SCIP_STAGE_TRANSFORMING
27748  * - \ref SCIP_STAGE_TRANSFORMED
27749  * - \ref SCIP_STAGE_INITPRESOLVE
27750  * - \ref SCIP_STAGE_PRESOLVING
27751  * - \ref SCIP_STAGE_EXITPRESOLVE
27752  * - \ref SCIP_STAGE_PRESOLVED
27753  * - \ref SCIP_STAGE_INITSOLVE
27754  * - \ref SCIP_STAGE_SOLVING
27755  * - \ref SCIP_STAGE_SOLVED
27756  * - \ref SCIP_STAGE_EXITSOLVE
27757  * - \ref SCIP_STAGE_FREETRANS
27758  *
27759  * @note the pointer of the constraint will be NULLed
27760  */
27762  SCIP* scip, /**< SCIP data structure */
27763  SCIP_CONS** cons /**< pointer to constraint */
27764  )
27765 {
27766  assert(cons != NULL);
27767  assert(*cons != NULL);
27768 
27769  SCIP_CALL( checkStage(scip, "SCIPreleaseCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
27770 
27771  switch( scip->set->stage )
27772  {
27773  case SCIP_STAGE_PROBLEM:
27774  SCIP_CALL( SCIPconsRelease(cons, scip->mem->probmem, scip->set) );
27775  return SCIP_OKAY;
27776 
27780  case SCIP_STAGE_PRESOLVING:
27782  case SCIP_STAGE_PRESOLVED:
27783  case SCIP_STAGE_INITSOLVE:
27784  case SCIP_STAGE_SOLVING:
27785  case SCIP_STAGE_SOLVED:
27786  case SCIP_STAGE_EXITSOLVE:
27787  case SCIP_STAGE_FREETRANS:
27788  if( SCIPconsIsOriginal(*cons) && (*cons)->nuses == 1 )
27789  {
27790  SCIPerrorMessage("cannot release last use of original constraint while the transformed problem exists\n");
27791  return SCIP_INVALIDCALL;
27792  }
27793  SCIP_CALL( SCIPconsRelease(cons, scip->mem->probmem, scip->set) );
27794  return SCIP_OKAY;
27795 
27796  default:
27797  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
27798  return SCIP_INVALIDCALL;
27799  } /*lint !e788*/
27800 }
27801 
27802 /** change constraint name
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 if @p scip is in one of the following stages:
27808  * - \ref SCIP_STAGE_PROBLEM
27809  *
27810  * @note to get the current name of a constraint, use SCIPconsGetName() from pub_cons.h
27811  */
27813  SCIP* scip, /**< SCIP data structure */
27814  SCIP_CONS* cons, /**< constraint */
27815  const char* name /**< new name of constraint */
27816  )
27817 {
27818  SCIP_CALL( checkStage(scip, "SCIPchgConsName", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE , FALSE, FALSE, FALSE) );
27819 
27820  assert( cons->scip == scip );
27821 
27822  if( SCIPgetStage(scip) != SCIP_STAGE_PROBLEM )
27823  {
27824  SCIPerrorMessage("constraint names can only be changed in problem creation stage\n");
27825  SCIPABORT();
27826  return SCIP_INVALIDCALL; /*lint !e527*/
27827  }
27828 
27829  /* remove constraint's name from the namespace if the constraint was already added */
27830  if( SCIPconsIsAdded(cons) )
27831  {
27832  SCIP_CALL( SCIPprobRemoveConsName(scip->origprob, cons) );
27833  }
27834 
27835  /* change constraint name */
27836  SCIP_CALL( SCIPconsChgName(cons, SCIPblkmem(scip), name) );
27837 
27838  /* add constraint's name to the namespace if the constraint was already added */
27839  if( SCIPconsIsAdded(cons) )
27840  {
27841  SCIP_CALL( SCIPprobAddConsName(scip->origprob, cons) );
27842  }
27843 
27844  return SCIP_OKAY;
27845 }
27846 
27847 /** sets the initial flag of the given constraint
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 if @p scip is in one of the following stages:
27853  * - \ref SCIP_STAGE_PROBLEM
27854  * - \ref SCIP_STAGE_TRANSFORMING
27855  * - \ref SCIP_STAGE_PRESOLVING
27856  * - \ref SCIP_STAGE_PRESOLVED
27857  * - \ref SCIP_STAGE_SOLVING
27858  */
27860  SCIP* scip, /**< SCIP data structure */
27861  SCIP_CONS* cons, /**< constraint */
27862  SCIP_Bool initial /**< new value */
27863  )
27864 {
27865  SCIP_CALL( checkStage(scip, "SCIPsetConsInitial", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27866 
27867  SCIP_CALL( SCIPconsSetInitial(cons, scip->set, scip->stat, initial) );
27868 
27869  return SCIP_OKAY;
27870 }
27871 
27872 /** sets the separate flag of the given constraint
27873  *
27874  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27875  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27876  *
27877  * @pre This method can be called if @p scip is in one of the following stages:
27878  * - \ref SCIP_STAGE_PROBLEM
27879  * - \ref SCIP_STAGE_TRANSFORMING
27880  * - \ref SCIP_STAGE_PRESOLVING
27881  * - \ref SCIP_STAGE_PRESOLVED
27882  * - \ref SCIP_STAGE_SOLVING
27883  */
27885  SCIP* scip, /**< SCIP data structure */
27886  SCIP_CONS* cons, /**< constraint */
27887  SCIP_Bool separate /**< new value */
27888  )
27889 {
27890  SCIP_CALL( checkStage(scip, "SCIPsetConsSeparated", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27891 
27892  SCIP_CALL( SCIPconsSetSeparated(cons, scip->set, separate) );
27893 
27894  return SCIP_OKAY;
27895 }
27896 
27897 /** sets the enforce flag of the given constraint
27898  *
27899  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27900  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27901  *
27902  * @pre This method can be called if @p scip is in one of the following stages:
27903  * - \ref SCIP_STAGE_PROBLEM
27904  * - \ref SCIP_STAGE_TRANSFORMING
27905  * - \ref SCIP_STAGE_PRESOLVING
27906  * - \ref SCIP_STAGE_PRESOLVED
27907  * - \ref SCIP_STAGE_SOLVING
27908  */
27910  SCIP* scip, /**< SCIP data structure */
27911  SCIP_CONS* cons, /**< constraint */
27912  SCIP_Bool enforce /**< new value */
27913  )
27914 {
27915  SCIP_CALL( checkStage(scip, "SCIPsetConsEnforced", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27916 
27917  SCIP_CALL( SCIPconsSetEnforced(cons, scip->set, enforce) );
27918 
27919  return SCIP_OKAY;
27920 }
27921 
27922 /** sets the check flag of the given constraint
27923  *
27924  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27925  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27926  *
27927  * @pre This method can be called if @p scip is in one of the following stages:
27928  * - \ref SCIP_STAGE_PROBLEM
27929  * - \ref SCIP_STAGE_TRANSFORMING
27930  * - \ref SCIP_STAGE_PRESOLVING
27931  * - \ref SCIP_STAGE_PRESOLVED
27932  * - \ref SCIP_STAGE_SOLVING
27933  */
27935  SCIP* scip, /**< SCIP data structure */
27936  SCIP_CONS* cons, /**< constraint */
27937  SCIP_Bool check /**< new value */
27938  )
27939 {
27940  SCIP_CALL( checkStage(scip, "SCIPsetConsChecked", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27941 
27942  SCIP_CALL( SCIPconsSetChecked(cons, scip->set, check) );
27943 
27944  return SCIP_OKAY;
27945 }
27946 
27947 /** sets the propagate flag of the given constraint
27948  *
27949  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27950  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27951  *
27952  * @pre This method can be called if @p scip is in one of the following stages:
27953  * - \ref SCIP_STAGE_PROBLEM
27954  * - \ref SCIP_STAGE_TRANSFORMING
27955  * - \ref SCIP_STAGE_PRESOLVING
27956  * - \ref SCIP_STAGE_PRESOLVED
27957  * - \ref SCIP_STAGE_SOLVING
27958  */
27960  SCIP* scip, /**< SCIP data structure */
27961  SCIP_CONS* cons, /**< constraint */
27962  SCIP_Bool propagate /**< new value */
27963  )
27964 {
27965  SCIP_CALL( checkStage(scip, "SCIPsetConsPropagated", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27966 
27967  SCIP_CALL( SCIPconsSetPropagated(cons, scip->set, propagate) );
27968 
27969  return SCIP_OKAY;
27970 }
27971 
27972 /** sets the local flag of the given constraint
27973  *
27974  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27975  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27976  *
27977  * @pre This method can be called if @p scip is in one of the following stages:
27978  * - \ref SCIP_STAGE_PROBLEM
27979  * - \ref SCIP_STAGE_TRANSFORMING
27980  * - \ref SCIP_STAGE_INITPRESOLVE
27981  * - \ref SCIP_STAGE_PRESOLVING
27982  * - \ref SCIP_STAGE_PRESOLVED
27983  * - \ref SCIP_STAGE_INITSOLVE
27984  * - \ref SCIP_STAGE_SOLVING
27985  */
27987  SCIP* scip, /**< SCIP data structure */
27988  SCIP_CONS* cons, /**< constraint */
27989  SCIP_Bool local /**< new value */
27990  )
27991 {
27992  SCIP_CALL( checkStage(scip, "SCIPsetConsLocal", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27993 
27994  SCIPconsSetLocal(cons, local);
27995 
27996  return SCIP_OKAY;
27997 }
27998 
27999 /** sets the modifiable flag of the given constraint
28000  *
28001  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28002  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28003  *
28004  * @pre This method can be called if @p scip is in one of the following stages:
28005  * - \ref SCIP_STAGE_PROBLEM
28006  * - \ref SCIP_STAGE_TRANSFORMING
28007  * - \ref SCIP_STAGE_PRESOLVING
28008  * - \ref SCIP_STAGE_PRESOLVED
28009  * - \ref SCIP_STAGE_SOLVING
28010  * - \ref SCIP_STAGE_EXITSOLVE
28011  */
28013  SCIP* scip, /**< SCIP data structure */
28014  SCIP_CONS* cons, /**< constraint */
28015  SCIP_Bool modifiable /**< new value */
28016  )
28017 {
28018  SCIP_CALL( checkStage(scip, "SCIPsetConsModifiable", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
28019 
28020  SCIPconsSetModifiable(cons, modifiable);
28021 
28022  return SCIP_OKAY;
28023 }
28024 
28025 /** sets the dynamic flag of the given constraint
28026  *
28027  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28028  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28029  *
28030  * @pre This method can be called if @p scip is in one of the following stages:
28031  * - \ref SCIP_STAGE_PROBLEM
28032  * - \ref SCIP_STAGE_TRANSFORMING
28033  * - \ref SCIP_STAGE_PRESOLVING
28034  * - \ref SCIP_STAGE_PRESOLVED
28035  * - \ref SCIP_STAGE_SOLVING
28036  */
28038  SCIP* scip, /**< SCIP data structure */
28039  SCIP_CONS* cons, /**< constraint */
28040  SCIP_Bool dynamic /**< new value */
28041  )
28042 {
28043  SCIP_CALL( checkStage(scip, "SCIPsetConsDynamic", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28044 
28045  SCIPconsSetDynamic(cons, dynamic);
28046 
28047  return SCIP_OKAY;
28048 }
28049 
28050 /** sets the removable flag of the given constraint
28051  *
28052  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28053  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28054  *
28055  * @pre This method can be called if @p scip is in one of the following stages:
28056  * - \ref SCIP_STAGE_PROBLEM
28057  * - \ref SCIP_STAGE_TRANSFORMING
28058  * - \ref SCIP_STAGE_PRESOLVING
28059  * - \ref SCIP_STAGE_PRESOLVED
28060  * - \ref SCIP_STAGE_SOLVING
28061  */
28063  SCIP* scip, /**< SCIP data structure */
28064  SCIP_CONS* cons, /**< constraint */
28065  SCIP_Bool removable /**< new value */
28066  )
28067 {
28068  SCIP_CALL( checkStage(scip, "SCIPsetConsRemovable", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28069 
28070  SCIPconsSetRemovable(cons, removable);
28071 
28072  return SCIP_OKAY;
28073 }
28074 
28075 /** sets the stickingatnode flag of the given constraint
28076  *
28077  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28078  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28079  *
28080  * @pre This method can be called if @p scip is in one of the following stages:
28081  * - \ref SCIP_STAGE_PROBLEM
28082  * - \ref SCIP_STAGE_TRANSFORMING
28083  * - \ref SCIP_STAGE_PRESOLVING
28084  * - \ref SCIP_STAGE_PRESOLVED
28085  * - \ref SCIP_STAGE_SOLVING
28086  */
28088  SCIP* scip, /**< SCIP data structure */
28089  SCIP_CONS* cons, /**< constraint */
28090  SCIP_Bool stickingatnode /**< new value */
28091  )
28092 {
28093  SCIP_CALL( checkStage(scip, "SCIPsetConsStickingAtNode", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28094 
28095  SCIPconsSetStickingAtNode(cons, stickingatnode);
28096 
28097  return SCIP_OKAY;
28098 }
28099 
28100 /** updates the flags of the first constraint according to the ones of the second constraint
28101  *
28102  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28103  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28104  *
28105  * @pre This method can be called if @p scip is in one of the following stages:
28106  * - \ref SCIP_STAGE_PROBLEM
28107  * - \ref SCIP_STAGE_TRANSFORMING
28108  * - \ref SCIP_STAGE_PRESOLVING
28109  * - \ref SCIP_STAGE_PRESOLVED
28110  * - \ref SCIP_STAGE_SOLVING
28111  */
28113  SCIP* scip, /**< SCIP data structure */
28114  SCIP_CONS* cons0, /**< constraint that should stay */
28115  SCIP_CONS* cons1 /**< constraint that should be deleted */
28116  )
28117 {
28118  SCIP_CALL( checkStage(scip, "SCIPupdateConsFlags", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28119 
28120  if( SCIPconsIsInitial(cons1) )
28121  {
28122  SCIP_CALL( SCIPsetConsInitial(scip, cons0, TRUE) );
28123  }
28124  if( SCIPconsIsSeparated(cons1) )
28125  {
28126  SCIP_CALL( SCIPsetConsSeparated(scip, cons0, TRUE) );
28127  }
28128  if( SCIPconsIsEnforced(cons1) )
28129  {
28130  SCIP_CALL( SCIPsetConsEnforced(scip, cons0, TRUE) );
28131  }
28132  if( SCIPconsIsChecked(cons1) )
28133  {
28134  SCIP_CALL( SCIPsetConsChecked(scip, cons0, TRUE) );
28135  }
28136  if( SCIPconsIsPropagated(cons1) )
28137  {
28138  SCIP_CALL( SCIPsetConsPropagated(scip, cons0, TRUE) );
28139  }
28140  if( !SCIPconsIsDynamic(cons1) )
28141  {
28142  SCIP_CALL( SCIPsetConsDynamic(scip, cons0, FALSE) );
28143  }
28144  if( !SCIPconsIsRemovable(cons1) )
28145  {
28146  SCIP_CALL( SCIPsetConsRemovable(scip, cons0, FALSE) );
28147  }
28148  if( SCIPconsIsStickingAtNode(cons1) )
28149  {
28150  SCIP_CALL( SCIPsetConsStickingAtNode(scip, cons0, TRUE) );
28151  }
28152 
28153  return SCIP_OKAY;
28154 }
28155 
28156 /** gets and captures transformed constraint of a given constraint; if the constraint is not yet transformed,
28157  * a new transformed constraint for this constraint is created
28158  *
28159  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28160  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28161  *
28162  * @pre This method can be called if @p scip is in one of the following stages:
28163  * - \ref SCIP_STAGE_TRANSFORMING
28164  * - \ref SCIP_STAGE_TRANSFORMED
28165  * - \ref SCIP_STAGE_INITPRESOLVE
28166  * - \ref SCIP_STAGE_PRESOLVING
28167  * - \ref SCIP_STAGE_EXITPRESOLVE
28168  * - \ref SCIP_STAGE_PRESOLVED
28169  * - \ref SCIP_STAGE_INITSOLVE
28170  * - \ref SCIP_STAGE_SOLVING
28171  */
28173  SCIP* scip, /**< SCIP data structure */
28174  SCIP_CONS* cons, /**< constraint to get/create transformed constraint for */
28175  SCIP_CONS** transcons /**< pointer to store the transformed constraint */
28176  )
28177 {
28178  assert(transcons != NULL);
28179  assert(cons->scip == scip);
28180 
28181  SCIP_CALL( checkStage(scip, "SCIPtransformCons", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28182 
28183  if( SCIPconsIsTransformed(cons) )
28184  {
28185  *transcons = cons;
28186  SCIPconsCapture(*transcons);
28187  }
28188  else
28189  {
28190  SCIP_CALL( SCIPconsTransform(cons, scip->mem->probmem, scip->set, transcons) );
28191  }
28192 
28193  return SCIP_OKAY;
28194 }
28195 
28196 /** gets and captures transformed constraints for an array of constraints;
28197  * if a constraint in the array is not yet transformed, a new transformed constraint for this constraint is created;
28198  * it is possible to call this method with conss == transconss
28199  *
28200  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28201  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28202  *
28203  * @pre This method can be called if @p scip is in one of the following stages:
28204  * - \ref SCIP_STAGE_TRANSFORMING
28205  * - \ref SCIP_STAGE_TRANSFORMED
28206  * - \ref SCIP_STAGE_INITPRESOLVE
28207  * - \ref SCIP_STAGE_PRESOLVING
28208  * - \ref SCIP_STAGE_EXITPRESOLVE
28209  * - \ref SCIP_STAGE_PRESOLVED
28210  * - \ref SCIP_STAGE_INITSOLVE
28211  * - \ref SCIP_STAGE_SOLVING
28212  */
28214  SCIP* scip, /**< SCIP data structure */
28215  int nconss, /**< number of constraints to get/create transformed constraints for */
28216  SCIP_CONS** conss, /**< array with constraints to get/create transformed constraints for */
28217  SCIP_CONS** transconss /**< array to store the transformed constraints */
28218  )
28219 {
28220  int c;
28221 
28222  assert(nconss == 0 || conss != NULL);
28223  assert(nconss == 0 || transconss != NULL);
28224 
28225  SCIP_CALL( checkStage(scip, "SCIPtransformConss", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28226 
28227  for( c = 0; c < nconss; ++c )
28228  {
28229  if( SCIPconsIsTransformed(conss[c]) )
28230  {
28231  transconss[c] = conss[c];
28232  SCIPconsCapture(transconss[c]);
28233  }
28234  else
28235  {
28236  SCIP_CALL( SCIPconsTransform(conss[c], scip->mem->probmem, scip->set, &transconss[c]) );
28237  }
28238  }
28239 
28240  return SCIP_OKAY;
28241 }
28242 
28243 /** gets corresponding transformed constraint of a given constraint;
28244  * returns NULL as transcons, if transformed constraint is not yet existing
28245  *
28246  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28247  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28248  *
28249  * @pre This method can be called if @p scip is in one of the following stages:
28250  * - \ref SCIP_STAGE_TRANSFORMING
28251  * - \ref SCIP_STAGE_TRANSFORMED
28252  * - \ref SCIP_STAGE_INITPRESOLVE
28253  * - \ref SCIP_STAGE_PRESOLVING
28254  * - \ref SCIP_STAGE_EXITPRESOLVE
28255  * - \ref SCIP_STAGE_PRESOLVED
28256  * - \ref SCIP_STAGE_INITSOLVE
28257  * - \ref SCIP_STAGE_SOLVING
28258  * - \ref SCIP_STAGE_SOLVED
28259  * - \ref SCIP_STAGE_EXITSOLVE
28260  * - \ref SCIP_STAGE_FREETRANS
28261  */
28263  SCIP* scip, /**< SCIP data structure */
28264  SCIP_CONS* cons, /**< constraint to get the transformed constraint for */
28265  SCIP_CONS** transcons /**< pointer to store the transformed constraint */
28266  )
28267 {
28268  assert(transcons != NULL);
28269  assert(cons->scip == scip);
28270 
28271  SCIP_CALL( checkStage(scip, "SCIPgetTransformedCons", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
28272 
28273  if( SCIPconsIsTransformed(cons) )
28274  *transcons = cons;
28275  else
28276  *transcons = SCIPconsGetTransformed(cons);
28277 
28278  return SCIP_OKAY;
28279 }
28280 
28281 /** gets corresponding transformed constraints for an array of constraints;
28282  * stores NULL in a transconss slot, if the transformed constraint is not yet existing;
28283  * it is possible to call this method with conss == transconss, but remember that constraints that are not
28284  * yet transformed will be replaced with NULL
28285  *
28286  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28287  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28288  *
28289  * @pre This method can be called if @p scip is in one of the following stages:
28290  * - \ref SCIP_STAGE_TRANSFORMING
28291  * - \ref SCIP_STAGE_TRANSFORMED
28292  * - \ref SCIP_STAGE_INITPRESOLVE
28293  * - \ref SCIP_STAGE_PRESOLVING
28294  * - \ref SCIP_STAGE_EXITPRESOLVE
28295  * - \ref SCIP_STAGE_PRESOLVED
28296  * - \ref SCIP_STAGE_INITSOLVE
28297  * - \ref SCIP_STAGE_SOLVING
28298  * - \ref SCIP_STAGE_SOLVED
28299  * - \ref SCIP_STAGE_EXITSOLVE
28300  * - \ref SCIP_STAGE_FREETRANS
28301  */
28303  SCIP* scip, /**< SCIP data structure */
28304  int nconss, /**< number of constraints to get the transformed constraints for */
28305  SCIP_CONS** conss, /**< constraints to get the transformed constraints for */
28306  SCIP_CONS** transconss /**< array to store the transformed constraints */
28307  )
28308 {
28309  int c;
28310 
28311  assert(nconss == 0 || conss != NULL);
28312  assert(nconss == 0 || transconss != NULL);
28313 
28314  SCIP_CALL( checkStage(scip, "SCIPgetTransformedConss", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
28315 
28316  for( c = 0; c < nconss; ++c )
28317  {
28318  if( SCIPconsIsTransformed(conss[c]) )
28319  transconss[c] = conss[c];
28320  else
28321  transconss[c] = SCIPconsGetTransformed(conss[c]);
28322  }
28323 
28324  return SCIP_OKAY;
28325 }
28326 
28327 /** adds given value to age of constraint, but age can never become negative;
28328  * should be called
28329  * - in constraint separation, if no cut was found for this constraint,
28330  * - in constraint enforcing, if constraint was feasible, and
28331  * - in constraint propagation, if no domain reduction was deduced;
28332  *
28333  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28334  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28335  *
28336  * @pre This method can be called if @p scip is in one of the following stages:
28337  * - \ref SCIP_STAGE_TRANSFORMED
28338  * - \ref SCIP_STAGE_PRESOLVING
28339  * - \ref SCIP_STAGE_PRESOLVED
28340  * - \ref SCIP_STAGE_SOLVING
28341  * - \ref SCIP_STAGE_SOLVED
28342  */
28344  SCIP* scip, /**< SCIP data structure */
28345  SCIP_CONS* cons, /**< constraint */
28346  SCIP_Real deltaage /**< value to add to the constraint's age */
28347  )
28348 {
28349  SCIP_CALL( checkStage(scip, "SCIPaddConsAge", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28350 
28351  SCIP_CALL( SCIPconsAddAge(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, deltaage, scip->reopt) );
28352 
28353  return SCIP_OKAY;
28354 }
28355 
28356 /** increases age of constraint by 1.0;
28357  * should be called
28358  * - in constraint separation, if no cut was found for this constraint,
28359  * - in constraint enforcing, if constraint was feasible, and
28360  * - in constraint propagation, if no domain reduction was deduced;
28361  *
28362  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28363  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28364  *
28365  * @pre This method can be called if @p scip is in one of the following stages:
28366  * - \ref SCIP_STAGE_TRANSFORMED
28367  * - \ref SCIP_STAGE_PRESOLVING
28368  * - \ref SCIP_STAGE_PRESOLVED
28369  * - \ref SCIP_STAGE_SOLVING
28370  * - \ref SCIP_STAGE_SOLVED
28371  */
28373  SCIP* scip, /**< SCIP data structure */
28374  SCIP_CONS* cons /**< constraint */
28375  )
28376 {
28377  SCIP_CALL( checkStage(scip, "SCIPincConsAge", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28378 
28379  SCIP_CALL( SCIPconsIncAge(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->reopt) );
28380 
28381  return SCIP_OKAY;
28382 }
28383 
28384 /** resets age of constraint to zero;
28385  * should be called
28386  * - in constraint separation, if a cut was found for this constraint,
28387  * - in constraint enforcing, if the constraint was violated, and
28388  * - in constraint propagation, if a domain reduction was deduced;
28389  *
28390  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28391  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28392  *
28393  * @pre This method can be called if @p scip is in one of the following stages:
28394  * - \ref SCIP_STAGE_TRANSFORMED
28395  * - \ref SCIP_STAGE_PRESOLVING
28396  * - \ref SCIP_STAGE_PRESOLVED
28397  * - \ref SCIP_STAGE_SOLVING
28398  * - \ref SCIP_STAGE_SOLVED
28399  */
28401  SCIP* scip, /**< SCIP data structure */
28402  SCIP_CONS* cons /**< constraint */
28403  )
28404 {
28405  SCIP_CALL( checkStage(scip, "SCIPresetConsAge", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28406 
28407  SCIP_CALL( SCIPconsResetAge(cons, scip->set) );
28408 
28409  return SCIP_OKAY;
28410 }
28411 
28412 /** enables constraint's separation, propagation, and enforcing capabilities
28413  *
28414  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28415  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28416  *
28417  * @pre This method can be called if @p scip is in one of the following stages:
28418  * - \ref SCIP_STAGE_TRANSFORMED
28419  * - \ref SCIP_STAGE_PRESOLVING
28420  * - \ref SCIP_STAGE_PRESOLVED
28421  * - \ref SCIP_STAGE_INITSOLVE
28422  * - \ref SCIP_STAGE_SOLVING
28423  * - \ref SCIP_STAGE_SOLVED
28424  */
28426  SCIP* scip, /**< SCIP data structure */
28427  SCIP_CONS* cons /**< constraint */
28428  )
28429 {
28430  SCIP_CALL( checkStage(scip, "SCIPenableCons", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28431 
28432  SCIP_CALL( SCIPconsEnable(cons, scip->set, scip->stat) );
28433 
28434  return SCIP_OKAY;
28435 }
28436 
28437 /** disables constraint's separation, propagation, and enforcing capabilities, s.t. the constraint is not propagated,
28438  * separated, and enforced anymore until it is enabled again with a call to SCIPenableCons();
28439  * in contrast to SCIPdelConsLocal() and SCIPdelConsNode(), the disabling is not associated to a node in the tree and
28440  * does not consume memory; therefore, the constraint is neither automatically enabled on leaving the node nor
28441  * automatically disabled again on entering the node again;
28442  * note that the constraints enforcing capabilities are necessary for the solution's feasibility, if the constraint
28443  * is a model constraint; that means, you must be sure that the constraint cannot be violated in the current subtree,
28444  * and you have to enable it again manually by calling SCIPenableCons(), if this subtree is left (e.g. by using
28445  * an appropriate event handler that watches the corresponding variables' domain changes)
28446  *
28447  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28448  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28449  *
28450  * @pre This method can be called if @p scip is in one of the following stages:
28451  * - \ref SCIP_STAGE_TRANSFORMED
28452  * - \ref SCIP_STAGE_INITPRESOLVE
28453  * - \ref SCIP_STAGE_PRESOLVING
28454  * - \ref SCIP_STAGE_PRESOLVED
28455  * - \ref SCIP_STAGE_INITSOLVE
28456  * - \ref SCIP_STAGE_SOLVING
28457  * - \ref SCIP_STAGE_SOLVED
28458  */
28460  SCIP* scip, /**< SCIP data structure */
28461  SCIP_CONS* cons /**< constraint */
28462  )
28463 {
28464  SCIP_CALL( checkStage(scip, "SCIPdisableCons", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28465 
28466  SCIP_CALL( SCIPconsDisable(cons, scip->set, scip->stat) );
28467 
28468  return SCIP_OKAY;
28469 }
28470 
28471 /** enables constraint's separation capabilities
28472  *
28473  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28474  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28475  *
28476  * @pre This method can be called if @p scip is in one of the following stages:
28477  * - \ref SCIP_STAGE_TRANSFORMED
28478  * - \ref SCIP_STAGE_PRESOLVING
28479  * - \ref SCIP_STAGE_PRESOLVED
28480  * - \ref SCIP_STAGE_INITSOLVE
28481  * - \ref SCIP_STAGE_SOLVING
28482  * - \ref SCIP_STAGE_SOLVED
28483  */
28485  SCIP* scip, /**< SCIP data structure */
28486  SCIP_CONS* cons /**< constraint */
28487  )
28488 {
28489  SCIP_CALL( checkStage(scip, "SCIPenableConsSeparation", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28490 
28491  SCIP_CALL( SCIPconsEnableSeparation(cons, scip->set) );
28492 
28493  return SCIP_OKAY;
28494 }
28495 
28496 /** disables constraint's separation capabilities s.t. the constraint is not separated anymore until the separation
28497  * is enabled again with a call to SCIPenableConsSeparation(); in contrast to SCIPdelConsLocal() and SCIPdelConsNode(),
28498  * the disabling is not associated to a node in the tree and does not consume memory; therefore, the constraint
28499  * is neither automatically enabled on leaving the node nor automatically disabled again on entering the node again
28500  *
28501  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28502  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28503  *
28504  * @pre This method can be called if @p scip is in one of the following stages:
28505  * - \ref SCIP_STAGE_TRANSFORMED
28506  * - \ref SCIP_STAGE_PRESOLVING
28507  * - \ref SCIP_STAGE_PRESOLVED
28508  * - \ref SCIP_STAGE_INITSOLVE
28509  * - \ref SCIP_STAGE_SOLVING
28510  * - \ref SCIP_STAGE_SOLVED
28511  */
28513  SCIP* scip, /**< SCIP data structure */
28514  SCIP_CONS* cons /**< constraint */
28515  )
28516 {
28517  SCIP_CALL( checkStage(scip, "SCIPdisableConsSeparation", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28518 
28519  SCIP_CALL( SCIPconsDisableSeparation(cons, scip->set) );
28520 
28521  return SCIP_OKAY;
28522 }
28523 
28524 /** enables constraint's propagation capabilities
28525  *
28526  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28527  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28528  *
28529  * @pre This method can be called if @p scip is in one of the following stages:
28530  * - \ref SCIP_STAGE_TRANSFORMED
28531  * - \ref SCIP_STAGE_INITPRESOLVE
28532  * - \ref SCIP_STAGE_PRESOLVING
28533  * - \ref SCIP_STAGE_EXITPRESOLVE
28534  * - \ref SCIP_STAGE_PRESOLVED
28535  * - \ref SCIP_STAGE_INITSOLVE
28536  * - \ref SCIP_STAGE_SOLVING
28537  * - \ref SCIP_STAGE_SOLVED
28538  */
28540  SCIP* scip, /**< SCIP data structure */
28541  SCIP_CONS* cons /**< constraint */
28542  )
28543 {
28544  SCIP_CALL( checkStage(scip, "SCIPenableConsPropagation", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28545 
28546  SCIP_CALL( SCIPconsEnablePropagation(cons, scip->set) );
28547 
28548  return SCIP_OKAY;
28549 }
28550 
28551 /** disables constraint's propagation capabilities s.t. the constraint is not propagated anymore until the propagation
28552  * is enabled again with a call to SCIPenableConsPropagation(); in contrast to SCIPdelConsLocal() and SCIPdelConsNode(),
28553  * the disabling is not associated to a node in the tree and does not consume memory; therefore, the constraint
28554  * is neither automatically enabled on leaving the node nor automatically disabled again on entering the node again
28555  *
28556  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28557  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28558  *
28559  * @pre This method can be called if @p scip is in one of the following stages:
28560  * - \ref SCIP_STAGE_TRANSFORMED
28561  * - \ref SCIP_STAGE_INITPRESOLVE
28562  * - \ref SCIP_STAGE_PRESOLVING
28563  * - \ref SCIP_STAGE_EXITPRESOLVE
28564  * - \ref SCIP_STAGE_PRESOLVED
28565  * - \ref SCIP_STAGE_INITSOLVE
28566  * - \ref SCIP_STAGE_SOLVING
28567  * - \ref SCIP_STAGE_SOLVED
28568  */
28570  SCIP* scip, /**< SCIP data structure */
28571  SCIP_CONS* cons /**< constraint */
28572  )
28573 {
28574  SCIP_CALL( checkStage(scip, "SCIPdisableConsPropagation", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28575 
28576  SCIP_CALL( SCIPconsDisablePropagation(cons, scip->set) );
28577 
28578  return SCIP_OKAY;
28579 }
28580 
28581 #undef SCIPmarkConsPropagate
28582 
28583 /** marks constraint to be propagated
28584  *
28585  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28586  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28587  *
28588  * @pre This method can be called if @p scip is in one of the following stages:
28589  * - \ref SCIP_STAGE_TRANSFORMING
28590  * - \ref SCIP_STAGE_TRANSFORMED
28591  * - \ref SCIP_STAGE_INITPRESOLVE
28592  * - \ref SCIP_STAGE_PRESOLVING
28593  * - \ref SCIP_STAGE_EXITPRESOLVE
28594  * - \ref SCIP_STAGE_PRESOLVED
28595  * - \ref SCIP_STAGE_INITSOLVE
28596  * - \ref SCIP_STAGE_SOLVING
28597  * - \ref SCIP_STAGE_SOLVED
28598  * - \ref SCIP_STAGE_EXITSOLVE
28599  *
28600  * @note if a constraint is marked to be propagated, the age of the constraint will be ignored for propagation
28601  */
28603  SCIP* scip, /**< SCIP data structure */
28604  SCIP_CONS* cons /**< constraint */
28605  )
28606 {
28607  SCIP_CALL( checkStage(scip, "SCIPmarkConsPropagate", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
28608 
28609  SCIP_CALL( SCIPconsMarkPropagate(cons, scip->set) );
28610 
28611  assert(!SCIPconsIsEnabled(cons) || SCIPconsIsMarkedPropagate(cons));
28612 
28613  return SCIP_OKAY;
28614 }
28615 
28616 /** unmarks the constraint to be propagated
28617  *
28618  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28619  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28620  *
28621  * @pre This method can be called if @p scip is in one of the following stages:
28622  * - \ref SCIP_STAGE_TRANSFORMED
28623  * - \ref SCIP_STAGE_PRESOLVING
28624  * - \ref SCIP_STAGE_EXITPRESOLVE
28625  * - \ref SCIP_STAGE_PRESOLVED
28626  * - \ref SCIP_STAGE_INITSOLVE
28627  * - \ref SCIP_STAGE_SOLVING
28628  * - \ref SCIP_STAGE_SOLVED
28629  */
28631  SCIP* scip, /**< SCIP data structure */
28632  SCIP_CONS* cons /**< constraint */
28633  )
28634 {
28635  SCIP_CALL( checkStage(scip, "SCIPunmarkConsPropagate", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28636 
28637  SCIP_CALL( SCIPconsUnmarkPropagate(cons, scip->set) );
28638 
28639  assert(!SCIPconsIsEnabled(cons) || !SCIPconsIsMarkedPropagate(cons));
28640 
28641  return SCIP_OKAY;
28642 }
28643 
28644 /** adds given values to lock status of the constraint and updates the rounding locks of the involved variables
28645  *
28646  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28647  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28648  *
28649  * @pre This method can be called if @p scip is in one of the following stages:
28650  * - \ref SCIP_STAGE_PROBLEM
28651  * - \ref SCIP_STAGE_TRANSFORMING
28652  * - \ref SCIP_STAGE_INITPRESOLVE
28653  * - \ref SCIP_STAGE_PRESOLVING
28654  * - \ref SCIP_STAGE_EXITPRESOLVE
28655  * - \ref SCIP_STAGE_INITSOLVE
28656  * - \ref SCIP_STAGE_SOLVING
28657  * - \ref SCIP_STAGE_EXITSOLVE
28658  * - \ref SCIP_STAGE_FREETRANS
28659  */
28661  SCIP* scip, /**< SCIP data structure */
28662  SCIP_CONS* cons, /**< constraint */
28663  int nlockspos, /**< increase in number of rounding locks for constraint */
28664  int nlocksneg /**< increase in number of rounding locks for constraint's negation */
28665  )
28666 {
28667  SCIP_CALL( checkStage(scip, "SCIPaddConsLocks", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE) );
28668 
28669  SCIP_CALL( SCIPconsAddLocks(cons, scip->set, nlockspos, nlocksneg) );
28670 
28671  return SCIP_OKAY;
28672 }
28673 
28674 /** checks single constraint for feasibility of the given solution
28675  *
28676  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28677  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28678  *
28679  * @pre This method can be called if @p scip is in one of the following stages:
28680  * - \ref SCIP_STAGE_PROBLEM
28681  * - \ref SCIP_STAGE_TRANSFORMED
28682  * - \ref SCIP_STAGE_INITPRESOLVE
28683  * - \ref SCIP_STAGE_PRESOLVING
28684  * - \ref SCIP_STAGE_EXITPRESOLVE
28685  * - \ref SCIP_STAGE_PRESOLVED
28686  * - \ref SCIP_STAGE_INITSOLVE
28687  * - \ref SCIP_STAGE_SOLVING
28688  * - \ref SCIP_STAGE_SOLVED
28689  */
28691  SCIP* scip, /**< SCIP data structure */
28692  SCIP_CONS* cons, /**< constraint to check */
28693  SCIP_SOL* sol, /**< primal CIP solution */
28694  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
28695  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
28696  SCIP_Bool printreason, /**< Should the reason for the violation be printed? */
28697  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28698  )
28699 {
28700  SCIP_CALL( checkStage(scip, "SCIPcheckCons", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28701 
28702  SCIP_CALL( SCIPconsCheck(cons, scip->set, sol, checkintegrality, checklprows, printreason, result) );
28703 
28704  return SCIP_OKAY;
28705 }
28706 
28707 /** enforces single constraint for a given pseudo solution
28708  *
28709  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28710  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28711  *
28712  * @pre This method can be called if @p scip is in one of the following stages:
28713  * - \ref SCIP_STAGE_SOLVING
28714  *
28715  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
28716  * added to SCIP beforehand.
28717  */
28719  SCIP* scip, /**< SCIP data structure */
28720  SCIP_CONS* cons, /**< constraint to enforce */
28721  SCIP_Bool solinfeasible, /**< was the solution already declared infeasible by a constraint handler? */
28722  SCIP_Bool objinfeasible, /**< is the solution infeasible anyway due to violating lower objective bound? */
28723  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28724  )
28725 {
28726  assert(scip != NULL);
28727  assert(cons != NULL);
28728  assert(!SCIPconsIsAdded(cons));
28729  assert(result != NULL);
28730 
28731  SCIP_CALL( checkStage(scip, "SCIPenfopsCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28732 
28733  SCIP_CALL( SCIPconsEnfops(cons, scip->set, solinfeasible, objinfeasible, result) );
28734 
28735  return SCIP_OKAY;
28736 }
28737 
28738 /** enforces single constraint for a given LP solution
28739  *
28740  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28741  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28742  *
28743  * @pre This method can be called if @p scip is in one of the following stages:
28744  * - \ref SCIP_STAGE_SOLVING
28745  *
28746  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
28747  * added to SCIP beforehand.
28748  */
28750  SCIP* scip, /**< SCIP data structure */
28751  SCIP_CONS* cons, /**< constraint to enforce */
28752  SCIP_Bool solinfeasible, /**< was the solution already declared infeasible by a constraint handler? */
28753  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28754  )
28755 {
28756  assert(scip != NULL);
28757  assert(cons != NULL);
28758  assert(!SCIPconsIsAdded(cons));
28759  assert(result != NULL);
28760 
28761  SCIP_CALL( checkStage(scip, "SCIPenfolpCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28762 
28763  SCIP_CALL( SCIPconsEnfolp(cons, scip->set, solinfeasible, result) );
28764 
28765  return SCIP_OKAY;
28766 }
28767 
28768 /** enforces single constraint for a given relaxation solution
28769  *
28770  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28771  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28772  *
28773  * @pre This method can be called if @p scip is in one of the following stages:
28774  * - \ref SCIP_STAGE_SOLVING
28775  *
28776  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
28777  * added to SCIP beforehand.
28778  */
28780  SCIP* scip, /**< SCIP data structure */
28781  SCIP_CONS* cons, /**< constraint to enforce */
28782  SCIP_SOL* sol, /**< solution to enforce */
28783  SCIP_Bool solinfeasible, /**< was the solution already declared infeasible by a constraint handler? */
28784  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28785  )
28786 {
28787  assert(scip != NULL);
28788  assert(cons != NULL);
28789  assert(!SCIPconsIsAdded(cons));
28790  assert(sol != NULL);
28791  assert(result != NULL);
28792 
28793  SCIP_CALL( checkStage(scip, "SCIPenforelaxCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28794 
28795  SCIP_CALL( SCIPconsEnforelax(cons, scip->set, sol, solinfeasible, result) );
28796 
28797  return SCIP_OKAY;
28798 }
28799 
28800 /** calls LP initialization method for single constraint
28801  *
28802  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28803  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28804  *
28805  * @pre This method can be called if @p scip is in one of the following stages:
28806  * - \ref SCIP_STAGE_SOLVING
28807  *
28808  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
28809  * added to SCIP beforehand.
28810  */
28812  SCIP* scip, /**< SCIP data structure */
28813  SCIP_CONS* cons, /**< constraint to initialize */
28814  SCIP_Bool* infeasible /**< pointer to store whether infeasibility was detected while building the LP */
28815  )
28816 {
28817  assert(scip != NULL);
28818  assert(cons != NULL);
28819  assert(!SCIPconsIsAdded(cons));
28820 
28821  SCIP_CALL( checkStage(scip, "SCIPinitlpCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28822 
28823  SCIP_CALL( SCIPconsInitlp(cons, scip->set, infeasible) );
28824 
28825  return SCIP_OKAY;
28826 }
28827 
28828 /** calls separation method of single constraint for LP solution
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 @p scip is in one of the following stages:
28834  * - \ref SCIP_STAGE_SOLVING
28835  *
28836  * @note This is an advanced method and should be used with caution.
28837  */
28839  SCIP* scip, /**< SCIP data structure */
28840  SCIP_CONS* cons, /**< constraint to separate */
28841  SCIP_RESULT* result /**< pointer to store the result of the separation call */
28842  )
28843 {
28844  assert(scip != NULL);
28845  assert(cons != NULL);
28846  assert(result != NULL);
28847 
28848  SCIP_CALL( checkStage(scip, "SCIPsepalpCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28849 
28850  SCIP_CALL( SCIPconsSepalp(cons, scip->set, result) );
28851 
28852  return SCIP_OKAY;
28853 }
28854 
28855 /** calls separation method of single constraint for given primal solution
28856  *
28857  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28858  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28859  *
28860  * @pre This method can be called if @p scip is in one of the following stages:
28861  * - \ref SCIP_STAGE_SOLVING
28862  *
28863  * @note This is an advanced method and should be used with caution.
28864  */
28866  SCIP* scip, /**< SCIP data structure */
28867  SCIP_CONS* cons, /**< constraint to separate */
28868  SCIP_SOL* sol, /**< primal solution that should be separated*/
28869  SCIP_RESULT* result /**< pointer to store the result of the separation call */
28870  )
28871 {
28872  assert(scip != NULL);
28873  assert(cons != NULL);
28874  assert(sol != NULL);
28875  assert(result != NULL);
28876 
28877  SCIP_CALL( checkStage(scip, "SCIPsepasolCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28878 
28879  SCIP_CALL( SCIPconsSepasol(cons, scip->set, sol, result) );
28880 
28881  return SCIP_OKAY;
28882 }
28883 
28884 /** calls domain propagation method of single constraint
28885  *
28886  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28887  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28888  *
28889  * @pre This method can be called if @p scip is in one of the following stages:
28890  * - \ref SCIP_STAGE_PRESOLVING
28891  * - \ref SCIP_STAGE_SOLVING
28892  *
28893  * @note This is an advanced method and should be used with caution.
28894  */
28896  SCIP* scip, /**< SCIP data structure */
28897  SCIP_CONS* cons, /**< constraint to propagate */
28898  SCIP_PROPTIMING proptiming, /**< current point in the node solving loop */
28899  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28900  )
28901 {
28902  assert(scip != NULL);
28903  assert(cons != NULL);
28904  assert(result != NULL);
28905 
28906  SCIP_CALL( checkStage(scip, "SCIPpropCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28907 
28908  SCIP_CALL( SCIPconsProp(cons, scip->set, proptiming, result) );
28909 
28910  return SCIP_OKAY;
28911 }
28912 
28913 /** resolves propagation conflict of single constraint
28914  *
28915  *
28916  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28917  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28918  *
28919  * @pre This method can be called if @p scip is in one of the following stages:
28920  * - \ref SCIP_STAGE_PRESOLVING
28921  * - \ref SCIP_STAGE_SOLVING
28922  *
28923  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
28924  * added to SCIP beforehand.
28925  */
28927  SCIP* scip, /**< SCIP data structure */
28928  SCIP_CONS* cons, /**< constraint to resolve conflict for */
28929  SCIP_VAR* infervar, /**< the conflict variable whose bound change has to be resolved */
28930  int inferinfo, /**< the user information passed to the corresponding SCIPinferVarLbCons() or SCIPinferVarUbCons() call */
28931  SCIP_BOUNDTYPE boundtype, /**< the type of the changed bound (lower or upper bound) */
28932  SCIP_BDCHGIDX* bdchgidx, /**< the index of the bound change, representing the point of time where the change took place */
28933  SCIP_Real relaxedbd, /**< the relaxed bound which is sufficient to be explained */
28934  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28935  )
28936 {
28937  assert(scip != NULL);
28938  assert(cons != NULL);
28939  assert(!SCIPconsIsAdded(cons));
28940  assert(infervar != NULL);
28941  assert(bdchgidx != NULL);
28942  assert(result != NULL);
28943 
28944  SCIP_CALL( checkStage(scip, "SCIPrespropCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28945 
28946  SCIP_CALL( SCIPconsResprop(cons, scip->set, infervar, inferinfo, boundtype, bdchgidx, relaxedbd, result) );
28947 
28948  return SCIP_OKAY;
28949 }
28950 
28951 /** presolves of single constraint
28952  *
28953  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28954  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28955  *
28956  * @pre This method can be called if @p scip is in one of the following stages:
28957  * - \ref SCIP_STAGE_PRESOLVING
28958  *
28959  * @note This is an advanced method and should be used with caution.
28960  */
28962  SCIP* scip, /**< SCIP data structure */
28963  SCIP_CONS* cons, /**< constraint to presolve */
28964  int nrounds, /**< number of presolving rounds already done */
28965  SCIP_PRESOLTIMING presoltiming, /**< presolving timing(s) to be performed */
28966  int nnewfixedvars, /**< number of variables fixed since the last call to the presolving method */
28967  int nnewaggrvars, /**< number of variables aggregated since the last call to the presolving method */
28968  int nnewchgvartypes, /**< number of variable type changes since the last call to the presolving method */
28969  int nnewchgbds, /**< number of variable bounds tightened since the last call to the presolving method */
28970  int nnewholes, /**< number of domain holes added since the last call to the presolving method */
28971  int nnewdelconss, /**< number of deleted constraints since the last call to the presolving method */
28972  int nnewaddconss, /**< number of added constraints since the last call to the presolving method */
28973  int nnewupgdconss, /**< number of upgraded constraints since the last call to the presolving method */
28974  int nnewchgcoefs, /**< number of changed coefficients since the last call to the presolving method */
28975  int nnewchgsides, /**< number of changed left or right hand sides since the last call to the presolving method */
28976  int* nfixedvars, /**< pointer to count total number of variables fixed of all presolvers */
28977  int* naggrvars, /**< pointer to count total number of variables aggregated of all presolvers */
28978  int* nchgvartypes, /**< pointer to count total number of variable type changes of all presolvers */
28979  int* nchgbds, /**< pointer to count total number of variable bounds tightened of all presolvers */
28980  int* naddholes, /**< pointer to count total number of domain holes added of all presolvers */
28981  int* ndelconss, /**< pointer to count total number of deleted constraints of all presolvers */
28982  int* naddconss, /**< pointer to count total number of added constraints of all presolvers */
28983  int* nupgdconss, /**< pointer to count total number of upgraded constraints of all presolvers */
28984  int* nchgcoefs, /**< pointer to count total number of changed coefficients of all presolvers */
28985  int* nchgsides, /**< pointer to count total number of changed left/right hand sides of all presolvers */
28986  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28987  )
28988 {
28989  assert(scip != NULL);
28990  assert(cons != NULL);
28991  assert(nfixedvars != NULL);
28992  assert(naggrvars != NULL);
28993  assert(nchgvartypes != NULL);
28994  assert(nchgbds != NULL);
28995  assert(naddholes != NULL);
28996  assert(ndelconss != NULL);
28997  assert(naddconss != NULL);
28998  assert(nupgdconss != NULL);
28999  assert(nchgcoefs != NULL);
29000  assert(nchgsides != NULL);
29001  assert(result != NULL);
29002 
29003  SCIP_CALL( checkStage(scip, "SCIPpresolCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
29004 
29005  SCIP_CALL( SCIPconsPresol(cons, scip->set, nrounds, presoltiming, nnewfixedvars, nnewaggrvars, nnewchgvartypes, nnewchgbds, nnewholes,
29006  nnewdelconss, nnewaddconss, nnewupgdconss, nnewchgcoefs, nnewchgsides, nfixedvars, naggrvars, nchgvartypes,
29007  nchgbds, naddholes, ndelconss, naddconss, nupgdconss, nchgcoefs, nchgsides , result) );
29008 
29009  return SCIP_OKAY;
29010 }
29011 
29012 /** calls constraint activation notification method of single constraint
29013  *
29014  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29015  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29016  *
29017  * @pre This method can be called if @p scip is in one of the following stages:
29018  * - \ref SCIP_STAGE_TRANSFORMING
29019  *
29020  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
29021  * added to SCIP beforehand.
29022  */
29024  SCIP* scip, /**< SCIP data structure */
29025  SCIP_CONS* cons /**< constraint to notify */
29026  )
29027 {
29028  assert(scip != NULL);
29029  assert(cons != NULL);
29030  assert(!SCIPconsIsAdded(cons));
29031  assert(!SCIPconsIsDeleted(cons));
29032 
29033  SCIP_CALL( checkStage(scip, "SCIPactiveCons", FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
29034 
29035  SCIP_CALL( SCIPconsActive(cons, scip->set) );
29036 
29037  return SCIP_OKAY;
29038 }
29039 
29040 /** calls constraint deactivation notification method of single constraint
29041  *
29042  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29043  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29044  *
29045  * @pre This method can be called if @p scip is in one of the following stages:
29046  * - \ref SCIP_STAGE_PRESOLVING
29047  * - \ref SCIP_STAGE_SOLVING
29048  *
29049  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
29050  * added to SCIP beforehand.
29051  */
29053  SCIP* scip, /**< SCIP data structure */
29054  SCIP_CONS* cons /**< constraint to notify */
29055  )
29056 {
29057  assert(scip != NULL);
29058  assert(cons != NULL);
29059  assert(!SCIPconsIsAdded(cons));
29060 
29061  SCIP_CALL( checkStage(scip, "SCIPdeactiveCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29062 
29063  SCIP_CALL( SCIPconsDeactive(cons, scip->set) );
29064 
29065  return SCIP_OKAY;
29066 }
29067 
29068 /** outputs constraint information to file stream via the message handler system
29069  *
29070  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29071  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29072  *
29073  * @pre This method can be called if @p scip is in one of the following stages:
29074  * - \ref SCIP_STAGE_PROBLEM
29075  * - \ref SCIP_STAGE_TRANSFORMING
29076  * - \ref SCIP_STAGE_TRANSFORMED
29077  * - \ref SCIP_STAGE_INITPRESOLVE
29078  * - \ref SCIP_STAGE_PRESOLVING
29079  * - \ref SCIP_STAGE_EXITPRESOLVE
29080  * - \ref SCIP_STAGE_PRESOLVED
29081  * - \ref SCIP_STAGE_INITSOLVE
29082  * - \ref SCIP_STAGE_SOLVING
29083  * - \ref SCIP_STAGE_SOLVED
29084  * - \ref SCIP_STAGE_EXITSOLVE
29085  * - \ref SCIP_STAGE_FREETRANS
29086  *
29087  * @note If the message handler is set to a NULL pointer nothing will be printed.
29088  * @note The file stream will not be flushed directly, this can be achieved by calling SCIPinfoMessage() printing a
29089  * newline character.
29090  */
29092  SCIP* scip, /**< SCIP data structure */
29093  SCIP_CONS* cons, /**< constraint */
29094  FILE* file /**< output file (or NULL for standard output) */
29095  )
29096 {
29097  SCIP_CALL( checkStage(scip, "SCIPprintCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
29098 
29099  SCIP_CALL( SCIPconsPrint(cons, scip->set, scip->messagehdlr, file) );
29100 
29101  return SCIP_OKAY;
29102 }
29103 
29104 /** method to collect the variables of a constraint
29105  *
29106  * If the number of variables is greater than the available slots in the variable array, nothing happens except that
29107  * the success point is set to FALSE. With the method SCIPgetConsNVars() it is possible to get the number of variables
29108  * a constraint has in its scope.
29109  *
29110  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29111  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29112  *
29113  * @pre This method can be called if @p scip is in one of the following stages:
29114  * - \ref SCIP_STAGE_PROBLEM
29115  * - \ref SCIP_STAGE_TRANSFORMING
29116  * - \ref SCIP_STAGE_TRANSFORMED
29117  * - \ref SCIP_STAGE_INITPRESOLVE
29118  * - \ref SCIP_STAGE_PRESOLVING
29119  * - \ref SCIP_STAGE_EXITPRESOLVE
29120  * - \ref SCIP_STAGE_PRESOLVED
29121  * - \ref SCIP_STAGE_INITSOLVE
29122  * - \ref SCIP_STAGE_SOLVING
29123  * - \ref SCIP_STAGE_SOLVED
29124  * - \ref SCIP_STAGE_EXITSOLVE
29125  * - \ref SCIP_STAGE_FREETRANS
29126  *
29127  * @note The success pointer indicates if all variables were copied into the vars arrray.
29128  *
29129  * @note It might be that a constraint handler does not support this functionality, in that case the success pointer is
29130  * set to FALSE.
29131  */
29133  SCIP* scip, /**< SCIP data structure */
29134  SCIP_CONS* cons, /**< constraint for which the variables are wanted */
29135  SCIP_VAR** vars, /**< array to store the involved variable of the constraint */
29136  int varssize, /**< available slots in vars array which is needed to check if the array is large enough */
29137  SCIP_Bool* success /**< pointer to store whether the variables are successfully copied */
29138  )
29139 {
29140  SCIP_CALL( checkStage(scip, "SCIPgetConsVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
29141 
29142  assert(scip != NULL);
29143  assert(cons != NULL);
29144  assert(vars != NULL);
29145  assert(success != NULL);
29146 
29147  SCIP_CALL( SCIPconsGetVars(cons, scip->set, vars, varssize, success) );
29148 
29149  return SCIP_OKAY;
29150 }
29151 
29152 /** method to collect the number of variables of a constraint
29153  *
29154  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29155  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29156  *
29157  * @pre This method can be called if @p scip is in one of the following stages:
29158  * - \ref SCIP_STAGE_PROBLEM
29159  * - \ref SCIP_STAGE_TRANSFORMING
29160  * - \ref SCIP_STAGE_TRANSFORMED
29161  * - \ref SCIP_STAGE_INITPRESOLVE
29162  * - \ref SCIP_STAGE_PRESOLVING
29163  * - \ref SCIP_STAGE_EXITPRESOLVE
29164  * - \ref SCIP_STAGE_PRESOLVED
29165  * - \ref SCIP_STAGE_INITSOLVE
29166  * - \ref SCIP_STAGE_SOLVING
29167  * - \ref SCIP_STAGE_SOLVED
29168  * - \ref SCIP_STAGE_EXITSOLVE
29169  * - \ref SCIP_STAGE_FREETRANS
29170  *
29171  * @note The success pointer indicates if the contraint handler was able to return the number of variables
29172  *
29173  * @note It might be that a constraint handler does not support this functionality, in that case the success pointer is
29174  * set to FALSE
29175  */
29177  SCIP* scip, /**< SCIP data structure */
29178  SCIP_CONS* cons, /**< constraint for which the number of variables is wanted */
29179  int* nvars, /**< pointer to store the number of variables */
29180  SCIP_Bool* success /**< pointer to store whether the constraint successfully returned the number of variables */
29181  )
29182 {
29183  SCIP_CALL( checkStage(scip, "SCIPgetConsNVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
29184 
29185  assert(scip != NULL);
29186  assert(cons != NULL);
29187  assert(nvars != NULL);
29188  assert(success != NULL);
29189 
29190  SCIP_CALL( SCIPconsGetNVars(cons, scip->set, nvars, success) );
29191 
29192  return SCIP_OKAY;
29193 }
29194 
29195 /*
29196  * LP methods
29197  */
29198 
29199 /** returns, whether the LP was or is to be solved in the current node
29200  *
29201  * @return whether the LP was or is to be solved in the current node.
29202  *
29203  * @pre This method can be called if @p scip is in one of the following stages:
29204  * - \ref SCIP_STAGE_SOLVING
29205  *
29206  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29207  */
29209  SCIP* scip /**< SCIP data structure */
29210  )
29211 {
29212  SCIP_CALL_ABORT( checkStage(scip, "SCIPhasCurrentNodeLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29213 
29214  return SCIPtreeHasCurrentNodeLP(scip->tree);
29215 }
29216 
29217 /** returns, whether the LP of the current node is already constructed
29218  *
29219  * @return whether the LP of the current node is already constructed.
29220  *
29221  * @pre This method can be called if @p scip is in one of the following stages:
29222  * - \ref SCIP_STAGE_SOLVING
29223  *
29224  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29225  */
29227  SCIP* scip /**< SCIP data structure */
29228  )
29229 {
29230  SCIP_CALL_ABORT( checkStage(scip, "SCIPisLPConstructed", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29231 
29232  return SCIPtreeIsFocusNodeLPConstructed(scip->tree);
29233 }
29234 
29235 /** makes sure that the LP of the current node is loaded and may be accessed through the LP information methods
29236  *
29237  * @warning Contructing the LP might change the amount of variables known in the transformed problem and therefore also
29238  * the variables array of SCIP (returned by SCIPgetVars() and SCIPgetVarsData()), so it might be necessary to
29239  * call one of the later method after this one
29240  *
29241  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29242  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29243  *
29244  * @pre This method can be called if @p scip is in one of the following stages:
29245  * - \ref SCIP_STAGE_SOLVING
29246  *
29247  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29248  */
29250  SCIP* scip, /**< SCIP data structure */
29251  SCIP_Bool* cutoff /**< pointer to store whether the node can be cut off */
29252  )
29253 {
29254  SCIP_CALL( checkStage(scip, "SCIPconstructLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29255 
29256  SCIP_CALL( SCIPconstructCurrentLP(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
29257  scip->tree, scip->reopt, scip->lp, scip->pricestore, scip->sepastore, scip->cutpool, scip->branchcand,
29258  scip->eventqueue, scip->eventfilter, scip->cliquetable, FALSE, cutoff) );
29259 
29260  return SCIP_OKAY;
29261 }
29262 
29263 /** makes sure that the LP of the current node is flushed
29264  *
29265  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29266  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29267  *
29268  * @pre This method can be called if @p scip is in one of the following stages:
29269  * - \ref SCIP_STAGE_SOLVING
29270  *
29271  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29272  */
29274  SCIP* scip /**< SCIP data structure */
29275  )
29276 {
29277  SCIP_CALL( checkStage(scip, "SCIPflushLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29278 
29279  SCIP_CALL( SCIPlpFlush(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue) );
29280 
29281  return SCIP_OKAY;
29282 }
29283 
29284 /** gets solution status of current LP
29285  *
29286  * @return the solution status of current LP.
29287  *
29288  * @pre This method can be called if @p scip is in one of the following stages:
29289  * - \ref SCIP_STAGE_SOLVING
29290  *
29291  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29292  */
29294  SCIP* scip /**< SCIP data structure */
29295  )
29296 {
29297  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPSolstat", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29298 
29300  return SCIPlpGetSolstat(scip->lp);
29301  else
29302  return SCIP_LPSOLSTAT_NOTSOLVED;
29303 }
29304 
29305 /** returns whether the current LP solution passed the primal feasibility check
29306  *
29307  * @return whether the current LP solution passed the primal feasibility check.
29308  *
29309  * @pre This method can be called if @p scip is in one of the following stages:
29310  * - \ref SCIP_STAGE_SOLVING
29311  *
29312  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29313  */
29315  SCIP* scip /**< SCIP data structure */
29316  )
29317 {
29318  SCIP_CALL_ABORT( checkStage(scip, "SCIPisLPPrimalReliable", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29319 
29320  return SCIPlpIsPrimalReliable(scip->lp);
29321 }
29322 
29323 /** returns whether the current LP solution passed the dual feasibility check
29324  *
29325  * @returns whether the current LP solution passed the dual feasibility check.
29326  *
29327  * @pre This method can be called if @p scip is in one of the following stages:
29328  * - \ref SCIP_STAGE_SOLVING
29329  *
29330  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29331  */
29333  SCIP* scip /**< SCIP data structure */
29334  )
29335 {
29336  SCIP_CALL_ABORT( checkStage(scip, "SCIPisLPDualReliable", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29337 
29338  return SCIPlpIsDualReliable(scip->lp);
29339 }
29340 
29341 /** returns whether the current lp is a relaxation of the current problem and its optimal objective value is a local lower bound
29342  *
29343  * @return whether the current lp is a relaxation of the current problem and its optimal objective value is a local lower bound.
29344  *
29345  * @pre This method can be called if @p scip is in one of the following stages:
29346  * - \ref SCIP_STAGE_SOLVING
29347  *
29348  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29349  */
29351  SCIP* scip /**< SCIP data structure */
29352  )
29353 {
29354  SCIP_CALL_ABORT( checkStage(scip, "SCIPisLPRelax", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29355 
29356  return SCIPlpIsRelax(scip->lp);
29357 }
29358 
29359 /** gets objective value of current LP (which is the sum of column and loose objective value)
29360  *
29361  * @return the objective value of current LP (which is the sum of column and loose objective value).
29362  *
29363  * @pre This method can be called if @p scip is in one of the following stages:
29364  * - \ref SCIP_STAGE_SOLVING
29365  *
29366  * @note This method returns the objective value of the current LP solution, which might be primal or dual infeasible
29367  * if a limit was hit during solving. It must not be used as a dual bound if the LP solution status returned by
29368  * SCIPgetLPSolstat() is SCIP_LPSOLSTAT_ITERLIMIT or SCIP_LPSOLSTAT_TIMELIMIT.
29369  *
29370  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29371  */
29373  SCIP* scip /**< SCIP data structure */
29374  )
29375 {
29376  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29377 
29378  return SCIPlpGetObjval(scip->lp, scip->set, scip->transprob);
29379 }
29380 
29381 /** gets part of objective value of current LP that results from COLUMN variables only
29382  *
29383  * @return the part of objective value of current LP that results from COLUMN variables only.
29384  *
29385  * @pre This method can be called if @p scip is in one of the following stages:
29386  * - \ref SCIP_STAGE_SOLVING
29387  *
29388  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29389  */
29391  SCIP* scip /**< SCIP data structure */
29392  )
29393 {
29394  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPColumnObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29395 
29396  return SCIPlpGetColumnObjval(scip->lp);
29397 }
29398 
29399 /** gets part of objective value of current LP that results from LOOSE variables only
29400  *
29401  * @return part of objective value of current LP that results from LOOSE variables only.
29402  *
29403  * @pre This method can be called if @p scip is in one of the following stages:
29404  * - \ref SCIP_STAGE_SOLVING
29405  *
29406  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29407  */
29409  SCIP* scip /**< SCIP data structure */
29410  )
29411 {
29412  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPLooseObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29413 
29414  return SCIPlpGetLooseObjval(scip->lp, scip->set, scip->transprob);
29415 }
29416 
29417 /** gets the global pseudo objective value; that is all variables set to their best (w.r.t. the objective
29418  * function) global bound
29419  *
29420  * @return the global pseudo objective value; that is all variables set to their best (w.r.t. the objective
29421  * function) global bound.
29422  *
29423  * @pre This method can be called if @p scip is in one of the following stages:
29424  * - \ref SCIP_STAGE_INITPRESOLVE
29425  * - \ref SCIP_STAGE_PRESOLVING
29426  * - \ref SCIP_STAGE_EXITPRESOLVE
29427  * - \ref SCIP_STAGE_PRESOLVED
29428  * - \ref SCIP_STAGE_INITSOLVE
29429  * - \ref SCIP_STAGE_SOLVING
29430  *
29431  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29432  */
29434  SCIP* scip /**< SCIP data structure */
29435  )
29436 {
29437  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetGlobalPseudoObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29438 
29439  return SCIPlpGetGlobalPseudoObjval(scip->lp, scip->set, scip->transprob);
29440 }
29441 
29442 /** gets the pseudo objective value for the current search node; that is all variables set to their best (w.r.t. the
29443  * objective function) local bound
29444  *
29445  * @return the pseudo objective value for the current search node; that is all variables set to their best (w.r.t. the
29446  * objective function) local bound.
29447  *
29448  * @pre This method can be called if @p scip is in one of the following stages:
29449  * - \ref SCIP_STAGE_INITPRESOLVE
29450  * - \ref SCIP_STAGE_PRESOLVING
29451  * - \ref SCIP_STAGE_EXITPRESOLVE
29452  * - \ref SCIP_STAGE_PRESOLVED
29453  * - \ref SCIP_STAGE_INITSOLVE
29454  * - \ref SCIP_STAGE_SOLVING
29455  *
29456  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29457  */
29459  SCIP* scip /**< SCIP data structure */
29460  )
29461 {
29462  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPseudoObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29463 
29464  return SCIPlpGetPseudoObjval(scip->lp, scip->set, scip->transprob);
29465 }
29466 
29467 /** returns whether the root lp is a relaxation of the problem and its optimal objective value is a global lower bound
29468  *
29469  * @return whether the root lp is a relaxation of the problem and its optimal objective value is a global lower bound.
29470  *
29471  * @pre This method can be called if @p scip is in one of the following stages:
29472  * - \ref SCIP_STAGE_SOLVING
29473  *
29474  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29475  */
29477  SCIP* scip /**< SCIP data structure */
29478  )
29479 {
29480  SCIP_CALL_ABORT( checkStage(scip, "SCIPisRootLPRelax", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29481 
29482  return SCIPlpIsRootLPRelax(scip->lp);
29483 }
29484 
29485 /** gets the objective value of the root node LP or SCIP_INVALID if the root node LP was not (yet) solved
29486  *
29487  * @return the objective value of the root node LP or SCIP_INVALID if the root node LP was not (yet) solved.
29488  *
29489  * @pre This method can be called if @p scip is in one of the following stages:
29490  * - \ref SCIP_STAGE_INITPRESOLVE
29491  * - \ref SCIP_STAGE_PRESOLVING
29492  * - \ref SCIP_STAGE_EXITPRESOLVE
29493  * - \ref SCIP_STAGE_SOLVING
29494  *
29495  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29496  */
29498  SCIP* scip /**< SCIP data structure */
29499  )
29500 {
29501  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPRootObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29502 
29503  return SCIPlpGetRootObjval(scip->lp);
29504 }
29505 
29506 /** gets part of the objective value of the root node LP that results from COLUMN variables only;
29507  * returns SCIP_INVALID if the root node LP was not (yet) solved
29508  *
29509  * @return the part of the objective value of the root node LP that results from COLUMN variables only;
29510  * or SCIP_INVALID if the root node LP was not (yet) solved.
29511  *
29512  * @pre This method can be called if @p scip is in one of the following stages:
29513  * - \ref SCIP_STAGE_INITPRESOLVE
29514  * - \ref SCIP_STAGE_PRESOLVING
29515  * - \ref SCIP_STAGE_EXITPRESOLVE
29516  * - \ref SCIP_STAGE_SOLVING
29517  *
29518  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29519  */
29521  SCIP* scip /**< SCIP data structure */
29522  )
29523 {
29524  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPRootColumnObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29525 
29526  return SCIPlpGetRootColumnObjval(scip->lp);
29527 }
29528 
29529 /** gets part of the objective value of the root node LP that results from LOOSE variables only;
29530  * returns SCIP_INVALID if the root node LP was not (yet) solved
29531  *
29532  * @return the part of the objective value of the root node LP that results from LOOSE variables only;
29533  * or SCIP_INVALID if the root node LP was not (yet) solved.
29534  *
29535  * @pre This method can be called if @p scip is in one of the following stages:
29536  * - \ref SCIP_STAGE_INITPRESOLVE
29537  * - \ref SCIP_STAGE_PRESOLVING
29538  * - \ref SCIP_STAGE_EXITPRESOLVE
29539  * - \ref SCIP_STAGE_SOLVING
29540  *
29541  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29542  */
29544  SCIP* scip /**< SCIP data structure */
29545  )
29546 {
29547  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPRootLooseObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29548 
29549  return SCIPlpGetRootLooseObjval(scip->lp);
29550 }
29551 
29552 /** gets current LP columns along with the current number of LP columns
29553  *
29554  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29555  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29556  *
29557  * @pre This method can be called if @p scip is in one of the following stages:
29558  * - \ref SCIP_STAGE_SOLVING
29559  *
29560  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29561  */
29563  SCIP* scip, /**< SCIP data structure */
29564  SCIP_COL*** cols, /**< pointer to store the array of LP columns, or NULL */
29565  int* ncols /**< pointer to store the number of LP columns, or NULL */
29566  )
29567 {
29568  SCIP_CALL( checkStage(scip, "SCIPgetLPColsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29569 
29571  {
29572  if( cols != NULL )
29573  *cols = SCIPlpGetCols(scip->lp);
29574  if( ncols != NULL )
29575  *ncols = SCIPlpGetNCols(scip->lp);
29576  }
29577  else
29578  {
29579  if( cols != NULL )
29580  *cols = NULL;
29581  if( ncols != NULL )
29582  *ncols = 0;
29583  }
29584 
29585  return SCIP_OKAY;
29586 }
29587 
29588 /** gets current LP columns
29589  *
29590  * @return the current LP columns.
29591  *
29592  * @pre This method can be called if @p scip is in one of the following stages:
29593  * - \ref SCIP_STAGE_SOLVING
29594  *
29595  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29596  */
29598  SCIP* scip /**< SCIP data structure */
29599  )
29600 {
29601  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPCols", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29602 
29604  return SCIPlpGetCols(scip->lp);
29605  else
29606  return NULL;
29607 }
29608 
29609 /** gets current number of LP columns
29610  *
29611  * @return the current number of LP columns.
29612  *
29613  * @pre This method can be called if @p scip is in one of the following stages:
29614  * - \ref SCIP_STAGE_SOLVING
29615  *
29616  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29617  */
29619  SCIP* scip /**< SCIP data structure */
29620  )
29621 {
29622  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPCols", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29623 
29625  return SCIPlpGetNCols(scip->lp);
29626  else
29627  return 0;
29628 }
29629 
29630 /** gets current LP rows along with the current number of LP rows
29631  *
29632  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29633  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29634  *
29635  * @pre This method can be called if @p scip is in one of the following stages:
29636  * - \ref SCIP_STAGE_SOLVING
29637  *
29638  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29639  */
29641  SCIP* scip, /**< SCIP data structure */
29642  SCIP_ROW*** rows, /**< pointer to store the array of LP rows, or NULL */
29643  int* nrows /**< pointer to store the number of LP rows, or NULL */
29644  )
29645 {
29646  SCIP_CALL( checkStage(scip, "SCIPgetLPRowsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29647 
29649  {
29650  if( rows != NULL )
29651  *rows = SCIPlpGetRows(scip->lp);
29652  if( nrows != NULL )
29653  *nrows = SCIPlpGetNRows(scip->lp);
29654  }
29655  else
29656  {
29657  if( rows != NULL )
29658  *rows = NULL;
29659  if( nrows != NULL )
29660  *nrows = 0;
29661  }
29662 
29663  return SCIP_OKAY;
29664 }
29665 
29666 /** gets current LP rows
29667  *
29668  * @return the current LP rows.
29669  *
29670  * @pre This method can be called if @p scip is in one of the following stages:
29671  * - \ref SCIP_STAGE_SOLVING
29672  *
29673  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29674  */
29676  SCIP* scip /**< SCIP data structure */
29677  )
29678 {
29679  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29680 
29682  return SCIPlpGetRows(scip->lp);
29683  else
29684  return NULL;
29685 }
29686 
29687 /** gets current number of LP rows
29688  *
29689  * @return the current number of LP rows.
29690  *
29691  * @pre This method can be called if @p scip is in one of the following stages:
29692  * - \ref SCIP_STAGE_SOLVING
29693  *
29694  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29695  */
29697  SCIP* scip /**< SCIP data structure */
29698  )
29699 {
29700  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29701 
29703  return SCIPlpGetNRows(scip->lp);
29704  else
29705  return 0;
29706 }
29707 
29708 /** returns TRUE iff all columns, i.e. every variable with non-empty column w.r.t. all ever created rows, are present
29709  * in the LP, and FALSE, if there are additional already existing columns, that may be added to the LP in pricing
29710  *
29711  * @return TRUE iff all columns, i.e. every variable with non-empty column w.r.t. all ever created rows, are present
29712  * in the LP, and FALSE, if there are additional already existing columns, that may be added to the LP in pricing.
29713  *
29714  * @pre This method can be called if @p scip is in one of the following stages:
29715  * - \ref SCIP_STAGE_SOLVING
29716  *
29717  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29718  */
29720  SCIP* scip /**< SCIP data structure */
29721  )
29722 {
29723  SCIP_CALL_ABORT( checkStage(scip, "SCIPallColsInLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29724 
29725  return SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp);
29726 }
29727 
29728 /** returns whether the current LP solution is basic, i.e. is defined by a valid simplex basis
29729  *
29730  * @return whether the current LP solution is basic, i.e. is defined by a valid simplex basis.
29731  *
29732  * @pre This method can be called if @p scip is in one of the following stages:
29733  * - \ref SCIP_STAGE_SOLVING
29734  *
29735  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29736  */
29738  SCIP* scip /**< SCIP data structure */
29739  )
29740 {
29741  SCIP_CALL_ABORT( checkStage(scip, "SCIPisLPSolBasic", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29742 
29743  return SCIPlpIsSolBasic(scip->lp);
29744 }
29745 
29746 /** gets all indices of basic columns and rows: index i >= 0 corresponds to column i, index i < 0 to row -i-1
29747  *
29748  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29749  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29750  *
29751  * @pre This method can be called if @p scip is in one of the following stages:
29752  * - \ref SCIP_STAGE_SOLVING
29753  *
29754  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29755  */
29757  SCIP* scip, /**< SCIP data structure */
29758  int* basisind /**< pointer to store basis indices ready to keep number of rows entries */
29759  )
29760 {
29761  SCIP_CALL( checkStage(scip, "SCIPgetLPBasisInd", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29762 
29763  if( !SCIPlpIsSolBasic(scip->lp) )
29764  {
29765  SCIPerrorMessage("current LP solution is not basic\n");
29766  return SCIP_INVALIDCALL;
29767  }
29768 
29769  SCIP_CALL( SCIPlpGetBasisInd(scip->lp, basisind) );
29770 
29771  return SCIP_OKAY;
29772 }
29773 
29774 /** gets a row from the inverse basis matrix B^-1
29775  *
29776  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29777  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29778  *
29779  * @pre This method can be called if @p scip is in one of the following stages:
29780  * - \ref SCIP_STAGE_SOLVING
29781  *
29782  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29783  */
29785  SCIP* scip, /**< SCIP data structure */
29786  int r, /**< row number */
29787  SCIP_Real* coefs, /**< array to store the coefficients of the row */
29788  int* inds, /**< array to store the non-zero indices, or NULL */
29789  int* ninds /**< pointer to store the number of non-zero indices, or NULL
29790  * (-1: if we do not store sparsity informations) */
29791  )
29792 {
29793  SCIP_CALL( checkStage(scip, "SCIPgetLPBInvRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29794 
29795  if( !SCIPlpIsSolBasic(scip->lp) )
29796  {
29797  SCIPerrorMessage("current LP solution is not basic\n");
29798  return SCIP_INVALIDCALL;
29799  }
29800 
29801  SCIP_CALL( SCIPlpGetBInvRow(scip->lp, r, coefs, inds, ninds) );
29802 
29803  /* debug check if the coef is the r-th line of the inverse matrix B^-1 */
29804  SCIP_CALL( SCIPdebugCheckBInvRow(scip, r, coefs) ); /*lint !e506 !e774*/
29805 
29806  return SCIP_OKAY;
29807 }
29808 
29809 /** gets a column from the inverse basis matrix B^-1
29810  *
29811  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29812  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29813  *
29814  * @pre This method can be called if @p scip is in one of the following stages:
29815  * - \ref SCIP_STAGE_SOLVING
29816  *
29817  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29818  */
29820  SCIP* scip, /**< SCIP data structure */
29821  int c, /**< column number of B^-1; this is NOT the number of the column in the LP
29822  * returned by SCIPcolGetLPPos(); you have to call SCIPgetBasisInd()
29823  * to get the array which links the B^-1 column numbers to the row and
29824  * column numbers of the LP! c must be between 0 and nrows-1, since the
29825  * basis has the size nrows * nrows */
29826  SCIP_Real* coefs, /**< array to store the coefficients of the column */
29827  int* inds, /**< array to store the non-zero indices, or NULL */
29828  int* ninds /**< pointer to store the number of non-zero indices, or NULL
29829  * (-1: if we do not store sparsity informations) */
29830  )
29831 {
29832  SCIP_CALL( checkStage(scip, "SCIPgetLPBInvCol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29833 
29834  if( !SCIPlpIsSolBasic(scip->lp) )
29835  {
29836  SCIPerrorMessage("current LP solution is not basic\n");
29837  return SCIP_INVALIDCALL;
29838  }
29839 
29840  SCIP_CALL( SCIPlpGetBInvCol(scip->lp, c, coefs, inds, ninds) );
29841 
29842  return SCIP_OKAY;
29843 }
29844 
29845 /** gets a row from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A)
29846  *
29847  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29848  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29849  *
29850  * @pre This method can be called if @p scip is in one of the following stages:
29851  * - \ref SCIP_STAGE_SOLVING
29852  *
29853  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29854  */
29856  SCIP* scip, /**< SCIP data structure */
29857  int r, /**< row number */
29858  SCIP_Real* binvrow, /**< row in B^-1 from prior call to SCIPgetLPBInvRow(), or NULL */
29859  SCIP_Real* coefs, /**< array to store the coefficients of the row */
29860  int* inds, /**< array to store the non-zero indices, or NULL */
29861  int* ninds /**< pointer to store the number of non-zero indices, or NULL
29862  * (-1: if we do not store sparsity informations) */
29863  )
29864 {
29865  SCIP_CALL( checkStage(scip, "SCIPgetLPBInvARow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29866 
29867  if( !SCIPlpIsSolBasic(scip->lp) )
29868  {
29869  SCIPerrorMessage("current LP solution is not basic\n");
29870  return SCIP_INVALIDCALL;
29871  }
29872 
29873  SCIP_CALL( SCIPlpGetBInvARow(scip->lp, r, binvrow, coefs, inds, ninds) );
29874 
29875  return SCIP_OKAY;
29876 }
29877 
29878 /** gets a column from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A),
29879  * i.e., it computes B^-1 * A_c with A_c being the c'th column of A
29880  *
29881  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29882  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29883  *
29884  * @pre This method can be called if @p scip is in one of the following stages:
29885  * - \ref SCIP_STAGE_SOLVING
29886  *
29887  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29888  */
29890  SCIP* scip, /**< SCIP data structure */
29891  int c, /**< column number which can be accessed by SCIPcolGetLPPos() */
29892  SCIP_Real* coefs, /**< array to store the coefficients of the column */
29893  int* inds, /**< array to store the non-zero indices, or NULL */
29894  int* ninds /**< pointer to store the number of non-zero indices, or NULL
29895  * (-1: if we do not store sparsity informations) */
29896  )
29897 {
29898  SCIP_CALL( checkStage(scip, "SCIPgetLPBInvACol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29899 
29900  if( !SCIPlpIsSolBasic(scip->lp) )
29901  {
29902  SCIPerrorMessage("current LP solution is not basic\n");
29903  return SCIP_INVALIDCALL;
29904  }
29905 
29906  SCIP_CALL( SCIPlpGetBInvACol(scip->lp, c, coefs, inds, ninds) );
29907 
29908  return SCIP_OKAY;
29909 }
29910 
29911 /** calculates a weighted sum of all LP rows; for negative weights, the left and right hand side of the corresponding
29912  * LP row are swapped in the summation
29913  *
29914  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29915  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29916  *
29917  * @pre This method can be called if @p scip is in one of the following stages:
29918  * - \ref SCIP_STAGE_SOLVING
29919  *
29920  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29921  */
29923  SCIP* scip, /**< SCIP data structure */
29924  SCIP_Real* weights, /**< row weights in row summation */
29925  SCIP_REALARRAY* sumcoef, /**< array to store sum coefficients indexed by variables' probindex */
29926  SCIP_Real* sumlhs, /**< pointer to store the left hand side of the row summation */
29927  SCIP_Real* sumrhs /**< pointer to store the right hand side of the row summation */
29928  )
29929 {
29930  SCIP_CALL( checkStage(scip, "SCIPsumLPRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29931 
29932  SCIP_CALL( SCIPlpSumRows(scip->lp, scip->set, scip->transprob, weights, sumcoef, sumlhs, sumrhs) );
29933 
29934  return SCIP_OKAY;
29935 }
29936 
29937 /** writes current LP to a file
29938  *
29939  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29940  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29941  *
29942  * @pre This method can be called if @p scip is in one of the following stages:
29943  * - \ref SCIP_STAGE_SOLVING
29944  *
29945  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29946  */
29948  SCIP* scip, /**< SCIP data structure */
29949  const char* filename /**< file name */
29950  )
29951 {
29952  SCIP_Bool cutoff;
29953 
29954  SCIP_CALL( checkStage(scip, "SCIPwriteLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29955 
29957  {
29958  SCIP_CALL( SCIPconstructCurrentLP(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
29959  scip->tree, scip->reopt, scip->lp, scip->pricestore, scip->sepastore, scip->cutpool, scip->branchcand,
29960  scip->eventqueue, scip->eventfilter, scip->cliquetable, FALSE, &cutoff) );
29961  }
29962 
29963  /* we need a flushed lp to write the current lp */
29964  SCIP_CALL( SCIPlpFlush(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue) );
29965 
29966  SCIP_CALL( SCIPlpWrite(scip->lp, filename) );
29967 
29968  return SCIP_OKAY;
29969 }
29970 
29971 /** writes MIP relaxation of the current branch-and-bound node to a file
29972  *
29973  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29974  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29975  *
29976  * @pre This method can be called if @p scip is in one of the following stages:
29977  * - \ref SCIP_STAGE_SOLVING
29978  *
29979  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29980  */
29982  SCIP* scip, /**< SCIP data structure */
29983  const char* filename, /**< file name */
29984  SCIP_Bool genericnames, /**< should generic names like x_i and row_j be used in order to avoid
29985  * troubles with reserved symbols? */
29986  SCIP_Bool origobj, /**< should the original objective function be used? */
29987  SCIP_Bool lazyconss /**< output removable rows as lazy constraints? */
29988  )
29989 {
29990  SCIP_CALL( checkStage(scip, "SCIPwriteMIP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29991 
29992  /* we need a flushed lp to write the current mip */
29993  SCIP_CALL( SCIPlpFlush(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue) );
29994 
29995  SCIP_CALL( SCIPlpWriteMip(scip->lp, scip->set, scip->messagehdlr, filename, genericnames,
29996  origobj, scip->origprob->objsense, scip->transprob->objscale, scip->transprob->objoffset, lazyconss) );
29997 
29998  return SCIP_OKAY;
29999 }
30000 
30001 /** gets the LP interface of SCIP;
30002  * with the LPI you can use all of the methods defined in lpi/lpi.h;
30003  *
30004  * @warning You have to make sure, that the full internal state of the LPI does not change or is recovered completely
30005  * after the end of the method that uses the LPI. In particular, if you manipulate the LP or its solution
30006  * (e.g. by calling one of the SCIPlpiAdd...() or one of the SCIPlpiSolve...() methods), you have to check in
30007  * advance with SCIPlpiWasSolved() whether the LP is currently solved. If this is the case, you have to make
30008  * sure, the internal solution status is recovered completely at the end of your method. This can be achieved
30009  * by getting the LPI state before applying any LPI manipulations with SCIPlpiGetState() and restoring it
30010  * afterwards with SCIPlpiSetState() and SCIPlpiFreeState(). Additionally you have to resolve the LP with the
30011  * appropriate SCIPlpiSolve...() call in order to reinstall the internal solution status.
30012  *
30013  * @warning Make also sure, that all parameter values that you have changed are set back to their original values.
30014  *
30015  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30016  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30017  *
30018  * @pre This method can be called if @p scip is in one of the following stages:
30019  * - \ref SCIP_STAGE_TRANSFORMED
30020  * - \ref SCIP_STAGE_INITPRESOLVE
30021  * - \ref SCIP_STAGE_PRESOLVING
30022  * - \ref SCIP_STAGE_EXITPRESOLVE
30023  * - \ref SCIP_STAGE_PRESOLVED
30024  * - \ref SCIP_STAGE_INITSOLVE
30025  * - \ref SCIP_STAGE_SOLVING
30026  * - \ref SCIP_STAGE_SOLVED
30027  * - \ref SCIP_STAGE_EXITSOLVE
30028  *
30029  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
30030  */
30032  SCIP* scip, /**< SCIP data structure */
30033  SCIP_LPI** lpi /**< pointer to store the LP interface */
30034  )
30035 {
30036  assert(lpi != NULL);
30037 
30038  SCIP_CALL( checkStage(scip, "SCIPgetLPI", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
30039 
30040  *lpi = SCIPlpGetLPI(scip->lp);
30041 
30042  return SCIP_OKAY;
30043 }
30044 
30045 /** displays quality information about the current LP solution. An LP solution need to be available; information printed
30046  * is subject to what the LP solver supports
30047  *
30048  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30049  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30050  *
30051  * @pre This method can be called if @p scip is in one of the following stages:
30052  * - \ref SCIP_STAGE_INIT
30053  * - \ref SCIP_STAGE_PROBLEM
30054  * - \ref SCIP_STAGE_TRANSFORMED
30055  * - \ref SCIP_STAGE_INITPRESOLVE
30056  * - \ref SCIP_STAGE_PRESOLVING
30057  * - \ref SCIP_STAGE_EXITPRESOLVE
30058  * - \ref SCIP_STAGE_PRESOLVED
30059  * - \ref SCIP_STAGE_SOLVING
30060  * - \ref SCIP_STAGE_SOLVED
30061  * - \ref SCIP_STAGE_FREE
30062  *
30063  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
30064  *
30065  * @note The printing process is done via the message handler system.
30066  */
30068  SCIP* scip, /**< SCIP data structure */
30069  FILE* file /**< output file (or NULL for standard output) */
30070  )
30071 {
30072  SCIP_LPI* lpi;
30073  SCIP_Real quality;
30074 
30075  SCIP_CALL( checkStage(scip, "SCIPprintLPSolutionQuality", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE) );
30076 
30077  switch( scip->set->stage )
30078  {
30079  case SCIP_STAGE_INIT:
30080  case SCIP_STAGE_PROBLEM:
30083  case SCIP_STAGE_PRESOLVING:
30085  case SCIP_STAGE_PRESOLVED:
30086  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Problem not solving yet, no LP available.\n");
30087  return SCIP_OKAY;
30088 
30089  case SCIP_STAGE_SOLVING:
30090  case SCIP_STAGE_SOLVED:
30091  break;
30092 
30093  default:
30094  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
30095  return SCIP_INVALIDCALL;
30096  } /*lint !e788*/
30097 
30098  /* note that after diving mode, the LPI may only have the basis information, but SCIPlpiWasSolved() can be false; in
30099  * this case, we will (depending on the LP solver) probably not obtain the quality measure; one solution would be to
30100  * store the results of SCIPlpiGetRealSolQuality() within the SCIP_LP after each LP solve; this would have the added
30101  * advantage, that we reduce direct access to the LPI, but it sounds potentially expensive
30102  */
30103  lpi = SCIPlpGetLPI(scip->lp);
30104  assert(lpi != NULL);
30105 
30107  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Basis matrix condition (estimated): ");
30108  if( quality != SCIP_INVALID ) /*lint !e777*/
30109  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%.6e\n", quality);
30110  else
30111  SCIPmessageFPrintInfo(scip->messagehdlr, file, "not available\n", quality);
30112 
30114  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Basis matrix condition (exact): ");
30115  if( quality != SCIP_INVALID ) /*lint !e777*/
30116  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%.6e\n", quality);
30117  else
30118  SCIPmessageFPrintInfo(scip->messagehdlr, file, "not available\n", quality);
30119 
30120  return SCIP_OKAY;
30121 }
30122 
30123 /** compute relative interior point to current LP
30124  * @see SCIPlpComputeRelIntPoint
30125  *
30126  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30127  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30128  *
30129  * @pre This method can be called if @p scip is in one of the following stages:
30130  * - \ref SCIP_STAGE_TRANSFORMED
30131  * - \ref SCIP_STAGE_INITPRESOLVE
30132  * - \ref SCIP_STAGE_PRESOLVING
30133  * - \ref SCIP_STAGE_EXITPRESOLVE
30134  * - \ref SCIP_STAGE_PRESOLVED
30135  * - \ref SCIP_STAGE_SOLVING
30136  * - \ref SCIP_STAGE_SOLVED
30137  *
30138  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
30139  */
30141  SCIP* scip, /**< SCIP data structure */
30142  SCIP_Bool relaxrows, /**< should the rows be relaxed */
30143  SCIP_Bool inclobjcutoff, /**< should a row for the objective cutoff be included */
30144  SCIP_Real timelimit, /**< time limit for LP solver */
30145  int iterlimit, /**< iteration limit for LP solver */
30146  SCIP_SOL** point /**< relative interior point on exit */
30147  )
30148 {
30149  SCIP_Real* pointvals;
30150  SCIP_Bool success;
30151 
30152  SCIP_CALL( checkStage(scip, "SCIPcomputeLPRelIntPoint", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
30153 
30154  assert(scip != NULL);
30155  assert(scip->lp != NULL);
30156  assert(point != NULL);
30157 
30158  *point = NULL;
30159 
30160  SCIP_CALL( SCIPallocBufferArray(scip, &pointvals, SCIPlpGetNCols(scip->lp)) );
30161 
30162  SCIP_CALL( SCIPlpComputeRelIntPoint(scip->set, scip->messagehdlr, scip->lp, scip->transprob,
30163  relaxrows, inclobjcutoff, timelimit, iterlimit, pointvals, &success) );
30164 
30165  /* if successful, create new solution with point values */
30166  if( success )
30167  {
30168  int i;
30169 
30170  SCIP_CALL( SCIPcreateSol(scip, point, NULL) );
30171 
30172  for( i = 0; i < SCIPlpGetNCols(scip->lp); ++i )
30173  {
30174  SCIP_CALL( SCIPsetSolVal(scip, *point, SCIPcolGetVar(SCIPlpGetCols(scip->lp)[i]), pointvals[i]) );
30175  }
30176  }
30177 
30178  SCIPfreeBufferArray(scip, &pointvals);
30179 
30180  return SCIP_OKAY;
30181 }
30182 
30183 /*
30184  * LP column methods
30185  */
30186 
30187 /** returns the reduced costs of a column in the last (feasible) LP
30188  *
30189  * @return the reduced costs of a column in the last (feasible) LP
30190  *
30191  * @pre this method can be called in one of the following stages of the SCIP solving process:
30192  * - \ref SCIP_STAGE_SOLVING
30193  * - \ref SCIP_STAGE_SOLVED
30194  *
30195  * @note calling this method in SCIP_STAGE_SOLVED is only recommended to experienced users and should only be called
30196  * for pure LP instances (without presolving)
30197  *
30198  * @note The return value of this method should be used carefully if the dual feasibility check was explictely disabled.
30199  */
30201  SCIP* scip, /**< SCIP data structure */
30202  SCIP_COL* col /**< LP column */
30203  )
30204 {
30205  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetColRedcost", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
30206 
30207  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
30208  {
30209  SCIPerrorMessage("cannot get reduced costs, because node LP is not processed\n");
30210  SCIPABORT();
30211  return 0.0; /*lint !e527*/
30212  }
30213 
30214  return SCIPcolGetRedcost(col, scip->stat, scip->lp);
30215 }
30216 
30217 
30218 /** returns the Farkas coefficient of a column in the last (infeasible) LP
30219  *
30220  * @return the Farkas coefficient of a column in the last (infeasible) LP
30221  *
30222  * @pre this method can be called in one of the following stages of the SCIP solving process:
30223  * - \ref SCIP_STAGE_SOLVING
30224  */
30226  SCIP* scip, /**< SCIP data structure */
30227  SCIP_COL* col /**< LP column */
30228  )
30229 {
30230  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetColFarkasCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30231 
30232  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
30233  {
30234  SCIPerrorMessage("cannot get Farkas coeff, because node LP is not processed\n");
30235  SCIPABORT();
30236  return 0.0; /*lint !e527*/
30237  }
30238 
30239  return SCIPcolGetFarkasCoef(col, scip->stat, scip->lp);
30240 }
30241 
30242 /** marks a column to be not removable from the LP in the current node
30243  *
30244  * @pre this method can be called in the following stage of the SCIP solving process:
30245  * - \ref SCIP_STAGE_SOLVING
30246  */
30248  SCIP* scip, /**< SCIP data structure */
30249  SCIP_COL* col /**< LP column */
30250  )
30251 {
30252  SCIP_CALL_ABORT( checkStage(scip, "SCIPmarkColNotRemovableLocal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30253 
30254  SCIPcolMarkNotRemovableLocal(col, scip->stat);
30255 }
30256 
30257 /*
30258  * LP row methods
30259  */
30260 
30261 /** creates and captures an LP row from a constraint handler
30262  *
30263  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30264  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30265  *
30266  * @pre this method can be called in one of the following stages of the SCIP solving process:
30267  * - \ref SCIP_STAGE_INITSOLVE
30268  * - \ref SCIP_STAGE_SOLVING
30269  */
30271  SCIP* scip, /**< SCIP data structure */
30272  SCIP_ROW** row, /**< pointer to row */
30273  SCIP_CONSHDLR* conshdlr, /**< constraint handler that creates the row */
30274  const char* name, /**< name of row */
30275  int len, /**< number of nonzeros in the row */
30276  SCIP_COL** cols, /**< array with columns of row entries */
30277  SCIP_Real* vals, /**< array with coefficients of row entries */
30278  SCIP_Real lhs, /**< left hand side of row */
30279  SCIP_Real rhs, /**< right hand side of row */
30280  SCIP_Bool local, /**< is row only valid locally? */
30281  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30282  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30283  )
30284 {
30285  assert(conshdlr != NULL);
30286 
30287  SCIP_CALL( checkStage(scip, "SCIPcreateRowCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30288 
30289  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
30290  name, len, cols, vals, lhs, rhs, SCIP_ROWORIGINTYPE_CONS, (void*) conshdlr, local, modifiable, removable) );
30291 
30292  return SCIP_OKAY;
30293 }
30294 
30295 /** creates and captures an LP row from a separator
30296  *
30297  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30298  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30299  *
30300  * @pre this method can be called in one of the following stages of the SCIP solving process:
30301  * - \ref SCIP_STAGE_INITSOLVE
30302  * - \ref SCIP_STAGE_SOLVING
30303  */
30305  SCIP* scip, /**< SCIP data structure */
30306  SCIP_ROW** row, /**< pointer to row */
30307  SCIP_SEPA* sepa, /**< separator that creates the row */
30308  const char* name, /**< name of row */
30309  int len, /**< number of nonzeros in the row */
30310  SCIP_COL** cols, /**< array with columns of row entries */
30311  SCIP_Real* vals, /**< array with coefficients of row entries */
30312  SCIP_Real lhs, /**< left hand side of row */
30313  SCIP_Real rhs, /**< right hand side of row */
30314  SCIP_Bool local, /**< is row only valid locally? */
30315  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30316  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30317  )
30318 {
30319  assert(sepa != NULL);
30320 
30321  SCIP_CALL( checkStage(scip, "SCIPcreateRowSepa", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30322 
30323  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
30324  name, len, cols, vals, lhs, rhs, SCIP_ROWORIGINTYPE_SEPA, (void*) sepa, local, modifiable, removable) );
30325 
30326  return SCIP_OKAY;
30327 }
30328 
30329 /** creates and captures an LP row from an unspecified source
30330  *
30331  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30332  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30333  *
30334  * @pre this method can be called in one of the following stages of the SCIP solving process:
30335  * - \ref SCIP_STAGE_INITSOLVE
30336  * - \ref SCIP_STAGE_SOLVING
30337  */
30339  SCIP* scip, /**< SCIP data structure */
30340  SCIP_ROW** row, /**< pointer to row */
30341  const char* name, /**< name of row */
30342  int len, /**< number of nonzeros in the row */
30343  SCIP_COL** cols, /**< array with columns of row entries */
30344  SCIP_Real* vals, /**< array with coefficients of row entries */
30345  SCIP_Real lhs, /**< left hand side of row */
30346  SCIP_Real rhs, /**< right hand side of row */
30347  SCIP_Bool local, /**< is row only valid locally? */
30348  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30349  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30350  )
30351 {
30352  SCIP_CALL( checkStage(scip, "SCIPcreateRowUnspec", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30353 
30354  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
30355  name, len, cols, vals, lhs, rhs, SCIP_ROWORIGINTYPE_UNSPEC, NULL, local, modifiable, removable) );
30356 
30357  return SCIP_OKAY;
30358 }
30359 
30360 /** creates and captures an LP row
30361  *
30362  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30363  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30364  *
30365  * @pre this method can be called in one of the following stages of the SCIP solving process:
30366  * - \ref SCIP_STAGE_INITSOLVE
30367  * - \ref SCIP_STAGE_SOLVING
30368  *
30369  * @deprecated Please use SCIPcreateRowCons() or SCIPcreateRowSepa() when calling from a constraint handler or separator in order
30370  * to facilitate correct statistics. If the call is from neither a constraint handler or separator, use SCIPcreateRowUnspec().
30371  */
30373  SCIP* scip, /**< SCIP data structure */
30374  SCIP_ROW** row, /**< pointer to row */
30375  const char* name, /**< name of row */
30376  int len, /**< number of nonzeros in the row */
30377  SCIP_COL** cols, /**< array with columns of row entries */
30378  SCIP_Real* vals, /**< array with coefficients of row entries */
30379  SCIP_Real lhs, /**< left hand side of row */
30380  SCIP_Real rhs, /**< right hand side of row */
30381  SCIP_Bool local, /**< is row only valid locally? */
30382  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30383  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30384  )
30385 {
30386  SCIP_CALL( checkStage(scip, "SCIPcreateRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30387 
30388  SCIP_CALL( SCIPcreateRowUnspec(scip, row, name, len, cols, vals, lhs, rhs, local, modifiable, removable) );
30389 
30390  return SCIP_OKAY;
30391 }
30392 
30393 /** creates and captures an LP row without any coefficients from a constraint handler
30394  *
30395  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30396  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30397  *
30398  * @pre this method can be called in one of the following stages of the SCIP solving process:
30399  * - \ref SCIP_STAGE_INITSOLVE
30400  * - \ref SCIP_STAGE_SOLVING
30401  */
30403  SCIP* scip, /**< SCIP data structure */
30404  SCIP_ROW** row, /**< pointer to row */
30405  SCIP_CONSHDLR* conshdlr, /**< constraint handler that creates the row */
30406  const char* name, /**< name of row */
30407  SCIP_Real lhs, /**< left hand side of row */
30408  SCIP_Real rhs, /**< right hand side of row */
30409  SCIP_Bool local, /**< is row only valid locally? */
30410  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30411  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30412  )
30413 {
30414  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyRowCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30415 
30416  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
30417  name, 0, NULL, NULL, lhs, rhs, SCIP_ROWORIGINTYPE_CONS, (void*) conshdlr, local, modifiable, removable) );
30418 
30419  return SCIP_OKAY;
30420 }
30421 
30422 /** creates and captures an LP row without any coefficients from a separator
30423  *
30424  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30425  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30426  *
30427  * @pre this method can be called in one of the following stages of the SCIP solving process:
30428  * - \ref SCIP_STAGE_INITSOLVE
30429  * - \ref SCIP_STAGE_SOLVING
30430  */
30432  SCIP* scip, /**< SCIP data structure */
30433  SCIP_ROW** row, /**< pointer to row */
30434  SCIP_SEPA* sepa, /**< separator that creates the row */
30435  const char* name, /**< name of row */
30436  SCIP_Real lhs, /**< left hand side of row */
30437  SCIP_Real rhs, /**< right hand side of row */
30438  SCIP_Bool local, /**< is row only valid locally? */
30439  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30440  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30441  )
30442 {
30443  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyRowSepa", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30444 
30445  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
30446  name, 0, NULL, NULL, lhs, rhs, SCIP_ROWORIGINTYPE_SEPA, (void*) sepa, local, modifiable, removable) );
30447 
30448  return SCIP_OKAY;
30449 }
30450 
30451 /** creates and captures an LP row without any coefficients from an unspecified source
30452  *
30453  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30454  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30455  *
30456  * @pre this method can be called in one of the following stages of the SCIP solving process:
30457  * - \ref SCIP_STAGE_INITSOLVE
30458  * - \ref SCIP_STAGE_SOLVING
30459  */
30461  SCIP* scip, /**< SCIP data structure */
30462  SCIP_ROW** row, /**< pointer to row */
30463  const char* name, /**< name of row */
30464  SCIP_Real lhs, /**< left hand side of row */
30465  SCIP_Real rhs, /**< right hand side of row */
30466  SCIP_Bool local, /**< is row only valid locally? */
30467  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30468  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30469  )
30470 {
30471  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyRowUnspec", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30472 
30473  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
30474  name, 0, NULL, NULL, lhs, rhs, SCIP_ROWORIGINTYPE_UNSPEC, NULL, local, modifiable, removable) );
30475 
30476  return SCIP_OKAY;
30477 }
30478 
30479 /** creates and captures an LP row without any coefficients
30480  *
30481  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30482  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30483  *
30484  * @pre this method can be called in one of the following stages of the SCIP solving process:
30485  * - \ref SCIP_STAGE_INITSOLVE
30486  * - \ref SCIP_STAGE_SOLVING
30487  *
30488  * @deprecated Please use SCIPcreateEmptyRowCons() or SCIPcreateEmptyRowSepa() when calling from a constraint handler or separator in order
30489  * to facilitate correct statistics. If the call is from neither a constraint handler or separator, use SCIPcreateEmptyRowUnspec().
30490  */
30492  SCIP* scip, /**< SCIP data structure */
30493  SCIP_ROW** row, /**< pointer to row */
30494  const char* name, /**< name of row */
30495  SCIP_Real lhs, /**< left hand side of row */
30496  SCIP_Real rhs, /**< right hand side of row */
30497  SCIP_Bool local, /**< is row only valid locally? */
30498  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30499  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30500  )
30501 {
30502  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30503 
30504  SCIP_CALL( SCIPcreateEmptyRowUnspec(scip, row, name, lhs, rhs, local, modifiable, removable) );
30505 
30506  return SCIP_OKAY;
30507 }
30508 
30509 /** increases usage counter of LP row
30510  *
30511  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30512  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30513  *
30514  * @pre this method can be called in one of the following stages of the SCIP solving process:
30515  * - \ref SCIP_STAGE_INITSOLVE
30516  * - \ref SCIP_STAGE_SOLVING
30517  */
30519  SCIP* scip, /**< SCIP data structure */
30520  SCIP_ROW* row /**< row to capture */
30521  )
30522 {
30523  SCIP_CALL( checkStage(scip, "SCIPcaptureRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30524 
30525  SCIProwCapture(row);
30526 
30527  return SCIP_OKAY;
30528 }
30529 
30530 /** decreases usage counter of LP row, and frees memory if necessary
30531  *
30532  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30533  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30534  *
30535  * @pre this method can be called in one of the following stages of the SCIP solving process:
30536  * - \ref SCIP_STAGE_INITSOLVE
30537  * - \ref SCIP_STAGE_SOLVING
30538  * - \ref SCIP_STAGE_EXITSOLVE
30539  */
30541  SCIP* scip, /**< SCIP data structure */
30542  SCIP_ROW** row /**< pointer to LP row */
30543  )
30544 {
30545  SCIP_CALL( checkStage(scip, "SCIPreleaseRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
30546 
30547  SCIP_CALL( SCIProwRelease(row, scip->mem->probmem, scip->set, scip->lp) );
30548 
30549  return SCIP_OKAY;
30550 }
30551 
30552 /** changes left hand side of LP row
30553  *
30554  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30555  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30556  *
30557  * @pre this method can be called in one of the following stages of the SCIP solving process:
30558  * - \ref SCIP_STAGE_INITSOLVE
30559  * - \ref SCIP_STAGE_SOLVING
30560  */
30562  SCIP* scip, /**< SCIP data structure */
30563  SCIP_ROW* row, /**< LP row */
30564  SCIP_Real lhs /**< new left hand side */
30565  )
30566 {
30567  SCIP_CALL( checkStage(scip, "SCIPchgRowLhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30568 
30569  assert(!SCIPlpDiving(scip->lp) || (row->lppos == -1));
30570 
30571  SCIP_CALL( SCIProwChgLhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, lhs) );
30572 
30573  return SCIP_OKAY;
30574 }
30575 
30576 /** changes right hand side of LP row
30577  *
30578  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30579  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30580  *
30581  * @pre this method can be called in one of the following stages of the SCIP solving process:
30582  * - \ref SCIP_STAGE_INITSOLVE
30583  * - \ref SCIP_STAGE_SOLVING
30584  */
30586  SCIP* scip, /**< SCIP data structure */
30587  SCIP_ROW* row, /**< LP row */
30588  SCIP_Real rhs /**< new right hand side */
30589  )
30590 {
30591  SCIP_CALL( checkStage(scip, "SCIPchgRowRhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30592 
30593  assert(!SCIPlpDiving(scip->lp) || (row->lppos == -1));
30594 
30595  SCIP_CALL( SCIProwChgRhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, rhs) );
30596 
30597  return SCIP_OKAY;
30598 }
30599 
30600 /** informs row, that all subsequent additions of variables to the row should be cached and not directly applied;
30601  * after all additions were applied, SCIPflushRowExtensions() must be called;
30602  * while the caching of row extensions is activated, information methods of the row give invalid results;
30603  * caching should be used, if a row is build with SCIPaddVarToRow() calls variable by variable to increase
30604  * the performance
30605  *
30606  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30607  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30608  *
30609  * @pre this method can be called in one of the following stages of the SCIP solving process:
30610  * - \ref SCIP_STAGE_INITSOLVE
30611  * - \ref SCIP_STAGE_SOLVING
30612  */
30614  SCIP* scip, /**< SCIP data structure */
30615  SCIP_ROW* row /**< LP row */
30616  )
30617 {
30618  SCIP_CALL( checkStage(scip, "SCIPcacheRowExtensions", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30619 
30620  /* delay the row sorting */
30621  SCIProwDelaySort(row);
30622 
30623  return SCIP_OKAY;
30624 }
30625 
30626 /** flushes all cached row extensions after a call of SCIPcacheRowExtensions() and merges coefficients with
30627  * equal columns into a single coefficient
30628  *
30629  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30630  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30631  *
30632  * @pre this method can be called in one of the following stages of the SCIP solving process:
30633  * - \ref SCIP_STAGE_INITSOLVE
30634  * - \ref SCIP_STAGE_SOLVING
30635  */
30637  SCIP* scip, /**< SCIP data structure */
30638  SCIP_ROW* row /**< LP row */
30639  )
30640 {
30641  SCIP_CALL( checkStage(scip, "SCIPflushRowExtensions", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30642 
30643  /* force the row sorting, and merge equal column entries */
30644  SCIProwForceSort(row, scip->set);
30645 
30646  return SCIP_OKAY;
30647 }
30648 
30649 /** resolves variable to columns and adds them with the coefficient to the row
30650  *
30651  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30652  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30653  *
30654  * @attention If the absolute value of val is below the SCIP epsilon tolerance, the variable will not added.
30655  *
30656  * @pre this method can be called in one of the following stages of the SCIP solving process:
30657  * - \ref SCIP_STAGE_INITSOLVE
30658  * - \ref SCIP_STAGE_SOLVING
30659  *
30660  * @note In case calling this method in the enforcement process of an lp solution, it might be that some variables,
30661  * that were not yet in the LP (e.g. dynamic columns) will change their lp solution value returned by SCIP.
30662  * For example, a variable, which has a negative objective value, that has no column in the lp yet, is in the lp solution
30663  * on its upper bound (variables with status SCIP_VARSTATUS_LOOSE are in an lp solution on it's best bound), but
30664  * creating the column, changes the solution value (variable than has status SCIP_VARSTATUS_COLUMN, and the
30665  * initialization sets the lp solution value) to 0.0. (This leads to the conclusion that, if a constraint was
30666  * violated, the linear relaxation might not be violated anymore.)
30667  */
30669  SCIP* scip, /**< SCIP data structure */
30670  SCIP_ROW* row, /**< LP row */
30671  SCIP_VAR* var, /**< problem variable */
30672  SCIP_Real val /**< value of coefficient */
30673  )
30674 {
30675  SCIP_CALL( checkStage(scip, "SCIPaddVarToRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30676 
30677  SCIP_CALL( SCIPvarAddToRow(var, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->transprob, scip->lp, row, val) );
30678 
30679  return SCIP_OKAY;
30680 }
30681 
30682 /** resolves variables to columns and adds them with the coefficients to the row;
30683  * this method caches the row extensions and flushes them afterwards to gain better performance
30684  *
30685  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30686  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30687  *
30688  * @attention If a coefficients absolute value is below the SCIP epsilon tolerance, the variable with its value is not added.
30689  *
30690  * @pre this method can be called in one of the following stages of the SCIP solving process:
30691  * - \ref SCIP_STAGE_INITSOLVE
30692  * - \ref SCIP_STAGE_SOLVING
30693  */
30695  SCIP* scip, /**< SCIP data structure */
30696  SCIP_ROW* row, /**< LP row */
30697  int nvars, /**< number of variables to add to the row */
30698  SCIP_VAR** vars, /**< problem variables to add */
30699  SCIP_Real* vals /**< values of coefficients */
30700  )
30701 {
30702  int v;
30703 
30704  assert(nvars == 0 || vars != NULL);
30705  assert(nvars == 0 || vals != NULL);
30706 
30707  SCIP_CALL( checkStage(scip, "SCIPaddVarsToRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30708 
30709  /* resize the row to be able to store all variables (at least, if they are COLUMN variables) */
30710  SCIP_CALL( SCIProwEnsureSize(row, scip->mem->probmem, scip->set, SCIProwGetNNonz(row) + nvars) );
30711 
30712  /* delay the row sorting */
30713  SCIProwDelaySort(row);
30714 
30715  /* add the variables to the row */
30716  for( v = 0; v < nvars; ++v )
30717  {
30718  SCIP_CALL( SCIPvarAddToRow(vars[v], scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->transprob, scip->lp,
30719  row, vals[v]) );
30720  }
30721 
30722  /* force the row sorting */
30723  SCIProwForceSort(row, scip->set);
30724 
30725  return SCIP_OKAY;
30726 }
30727 
30728 /** resolves variables to columns and adds them with the same single coefficient to the row;
30729  * this method caches the row extensions and flushes them afterwards to gain better performance
30730  *
30731  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30732  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30733  *
30734  * @attention If the absolute value of val is below the SCIP epsilon tolerance, the variables will not added.
30735  *
30736  * @pre this method can be called in one of the following stages of the SCIP solving process:
30737  * - \ref SCIP_STAGE_INITSOLVE
30738  * - \ref SCIP_STAGE_SOLVING
30739  */
30741  SCIP* scip, /**< SCIP data structure */
30742  SCIP_ROW* row, /**< LP row */
30743  int nvars, /**< number of variables to add to the row */
30744  SCIP_VAR** vars, /**< problem variables to add */
30745  SCIP_Real val /**< unique value of all coefficients */
30746  )
30747 {
30748  int v;
30749 
30750  assert(nvars == 0 || vars != NULL);
30751 
30752  SCIP_CALL( checkStage(scip, "SCIPaddVarsToRowSameCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30753 
30754  /* resize the row to be able to store all variables (at least, if they are COLUMN variables) */
30755  SCIP_CALL( SCIProwEnsureSize(row, scip->mem->probmem, scip->set, SCIProwGetNNonz(row) + nvars) );
30756 
30757  /* delay the row sorting */
30758  SCIProwDelaySort(row);
30759 
30760  /* add the variables to the row */
30761  for( v = 0; v < nvars; ++v )
30762  {
30763  SCIP_CALL( SCIPvarAddToRow(vars[v], scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->transprob, scip->lp,
30764  row, val) );
30765  }
30766 
30767  /* force the row sorting */
30768  SCIProwForceSort(row, scip->set);
30769 
30770  return SCIP_OKAY;
30771 }
30772 
30773 /** tries to find a value, such that all row coefficients, if scaled with this value become integral
30774  *
30775  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30776  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30777  *
30778  * @pre this method can be called in one of the following stages of the SCIP solving process:
30779  * - \ref SCIP_STAGE_INITSOLVE
30780  * - \ref SCIP_STAGE_SOLVING
30781  */
30783  SCIP* scip, /**< SCIP data structure */
30784  SCIP_ROW* row, /**< LP row */
30785  SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
30786  SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
30787  SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
30788  SCIP_Real maxscale, /**< maximal allowed scalar */
30789  SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */
30790  SCIP_Real* intscalar, /**< pointer to store scalar that would make the coefficients integral, or NULL */
30791  SCIP_Bool* success /**< stores whether returned value is valid */
30792  )
30793 {
30794  SCIP_CALL( checkStage(scip, "SCIPcalcRowIntegralScalar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30795 
30796  SCIP_CALL( SCIProwCalcIntegralScalar(row, scip->set, mindelta, maxdelta, maxdnom, maxscale,
30797  usecontvars, intscalar, success) );
30798 
30799  return SCIP_OKAY;
30800 }
30801 
30802 /** tries to scale row, s.t. all coefficients (of integer variables) become integral
30803  *
30804  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30805  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30806  *
30807  * @pre this method can be called in one of the following stages of the SCIP solving process:
30808  * - \ref SCIP_STAGE_INITSOLVE
30809  * - \ref SCIP_STAGE_SOLVING
30810  */
30812  SCIP* scip, /**< SCIP data structure */
30813  SCIP_ROW* row, /**< LP row */
30814  SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
30815  SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
30816  SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
30817  SCIP_Real maxscale, /**< maximal value to scale row with */
30818  SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */
30819  SCIP_Bool* success /**< stores whether row could be made rational */
30820  )
30821 {
30822  SCIP_CALL( checkStage(scip, "SCIPmakeRowIntegral", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30823 
30824  SCIP_CALL( SCIProwMakeIntegral(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->stat, scip->lp, mindelta, maxdelta, maxdnom, maxscale,
30825  usecontvars, success) );
30826 
30827  return SCIP_OKAY;
30828 }
30829 
30830 /** marks a row to be not removable from the LP in the current node
30831  *
30832  * @pre this method can be called in the following stage of the SCIP solving process:
30833  * - \ref SCIP_STAGE_SOLVING
30834  */
30836  SCIP* scip, /**< SCIP data structure */
30837  SCIP_ROW* row /**< LP row */
30838  )
30839 {
30840  SCIP_CALL_ABORT( checkStage(scip, "SCIPmarkRowNotRemovableLocal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30841 
30842  SCIProwMarkNotRemovableLocal(row, scip->stat);
30843 }
30844 
30845 /** returns number of integral columns in the row
30846  *
30847  * @return number of integral columns in the row
30848  *
30849  * @pre this method can be called in one of the following stages of the SCIP solving process:
30850  * - \ref SCIP_STAGE_INITSOLVE
30851  * - \ref SCIP_STAGE_SOLVING
30852  */
30854  SCIP* scip, /**< SCIP data structure */
30855  SCIP_ROW* row /**< LP row */
30856  )
30857 {
30858  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowNumIntCols", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30859 
30860  return SCIProwGetNumIntCols(row, scip->set);
30861 }
30862 
30863 /** returns minimal absolute value of row vector's non-zero coefficients
30864  *
30865  * @return minimal absolute value of row vector's non-zero coefficients
30866  *
30867  * @pre this method can be called in one of the following stages of the SCIP solving process:
30868  * - \ref SCIP_STAGE_INITSOLVE
30869  * - \ref SCIP_STAGE_SOLVING
30870  */
30872  SCIP* scip, /**< SCIP data structure */
30873  SCIP_ROW* row /**< LP row */
30874  )
30875 {
30876  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowMinCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30877 
30878  return SCIProwGetMinval(row, scip->set);
30879 }
30880 
30881 /** returns maximal absolute value of row vector's non-zero coefficients
30882  *
30883  * @return maximal absolute value of row vector's non-zero coefficients
30884  *
30885  * @pre this method can be called in one of the following stages of the SCIP solving process:
30886  * - \ref SCIP_STAGE_INITSOLVE
30887  * - \ref SCIP_STAGE_SOLVING
30888  */
30890  SCIP* scip, /**< SCIP data structure */
30891  SCIP_ROW* row /**< LP row */
30892  )
30893 {
30894  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowMaxCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30895 
30896  return SCIProwGetMaxval(row, scip->set);
30897 }
30898 
30899 /** returns the minimal activity of a row w.r.t. the column's bounds
30900  *
30901  * @return the minimal activity of a row w.r.t. the column's bounds
30902  *
30903  * @pre this method can be called in one of the following stages of the SCIP solving process:
30904  * - \ref SCIP_STAGE_SOLVING
30905  */
30907  SCIP* scip, /**< SCIP data structure */
30908  SCIP_ROW* row /**< LP row */
30909  )
30910 {
30911  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowMinActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30912 
30913  return SCIProwGetMinActivity(row, scip->set, scip->stat);
30914 }
30915 
30916 /** returns the maximal activity of a row w.r.t. the column's bounds
30917  *
30918  * @return the maximal activity of a row w.r.t. the column's bounds
30919  *
30920  * @pre this method can be called in one of the following stages of the SCIP solving process:
30921  * - \ref SCIP_STAGE_SOLVING
30922  */
30924  SCIP* scip, /**< SCIP data structure */
30925  SCIP_ROW* row /**< LP row */
30926  )
30927 {
30928  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowMaxActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30929 
30930  return SCIProwGetMaxActivity(row, scip->set, scip->stat);
30931 }
30932 
30933 /** recalculates the activity of a row in the last LP solution
30934  *
30935  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30936  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30937  *
30938  * @pre this method can be called in one of the following stages of the SCIP solving process:
30939  * - \ref SCIP_STAGE_SOLVING
30940  */
30942  SCIP* scip, /**< SCIP data structure */
30943  SCIP_ROW* row /**< LP row */
30944  )
30945 {
30946  SCIP_CALL( checkStage(scip, "SCIPrecalcRowLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30947 
30948  SCIProwRecalcLPActivity(row, scip->stat);
30949 
30950  return SCIP_OKAY;
30951 }
30952 
30953 /** returns the activity of a row in the last LP solution
30954  *
30955  * @return activity of a row in the last LP solution
30956  *
30957  * @pre this method can be called in one of the following stages of the SCIP solving process:
30958  * - \ref SCIP_STAGE_SOLVING
30959  */
30961  SCIP* scip, /**< SCIP data structure */
30962  SCIP_ROW* row /**< LP row */
30963  )
30964 {
30965  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30966 
30967  return SCIProwGetLPActivity(row, scip->set, scip->stat, scip->lp);
30968 }
30969 
30970 /** returns the feasibility of a row in the last LP solution
30971  *
30972  * @return the feasibility of a row in the last LP solution: negative value means infeasibility
30973  *
30974  * @pre this method can be called in one of the following stages of the SCIP solving process:
30975  * - \ref SCIP_STAGE_SOLVING
30976  */
30978  SCIP* scip, /**< SCIP data structure */
30979  SCIP_ROW* row /**< LP row */
30980  )
30981 {
30982  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowLPFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30983 
30984  return SCIProwGetLPFeasibility(row, scip->set, scip->stat, scip->lp);
30985 }
30986 
30987 /** recalculates the activity of a row for the current pseudo solution
30988  *
30989  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30990  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30991  *
30992  * @pre this method can be called in one of the following stages of the SCIP solving process:
30993  * - \ref SCIP_STAGE_SOLVING
30994  */
30996  SCIP* scip, /**< SCIP data structure */
30997  SCIP_ROW* row /**< LP row */
30998  )
30999 {
31000  SCIP_CALL( checkStage(scip, "SCIPrecalcRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31001 
31002  SCIProwRecalcPseudoActivity(row, scip->stat);
31003 
31004  return SCIP_OKAY;
31005 }
31006 
31007 /** returns the activity of a row for the current pseudo solution
31008  *
31009  * @return the activity of a row for the current pseudo solution
31010  *
31011  * @pre this method can be called in one of the following stages of the SCIP solving process:
31012  * - \ref SCIP_STAGE_SOLVING
31013  */
31015  SCIP* scip, /**< SCIP data structure */
31016  SCIP_ROW* row /**< LP row */
31017  )
31018 {
31019  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31020 
31021  return SCIProwGetPseudoActivity(row, scip->set, scip->stat);
31022 }
31023 
31024 /** returns the feasibility of a row for the current pseudo solution: negative value means infeasibility
31025  *
31026  * @return the feasibility of a row for the current pseudo solution: negative value means infeasibility
31027  *
31028  * @pre this method can be called in one of the following stages of the SCIP solving process:
31029  * - \ref SCIP_STAGE_SOLVING
31030  */
31032  SCIP* scip, /**< SCIP data structure */
31033  SCIP_ROW* row /**< LP row */
31034  )
31035 {
31036  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowPseudoFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31037 
31038  return SCIProwGetPseudoFeasibility(row, scip->set, scip->stat);
31039 }
31040 
31041 /** recalculates the activity of a row in the last LP or pseudo solution
31042  *
31043  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31044  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31045  *
31046  * @pre this method can be called in one of the following stages of the SCIP solving process:
31047  * - \ref SCIP_STAGE_SOLVING
31048  */
31050  SCIP* scip, /**< SCIP data structure */
31051  SCIP_ROW* row /**< LP row */
31052  )
31053 {
31054  SCIP_CALL( checkStage(scip, "SCIPrecalcRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31055 
31056  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
31057  SCIProwRecalcLPActivity(row, scip->stat);
31058  else
31059  SCIProwRecalcPseudoActivity(row, scip->stat);
31060 
31061  return SCIP_OKAY;
31062 }
31063 
31064 /** returns the activity of a row in the last LP or pseudo solution
31065  *
31066  * @return the activity of a row in the last LP or pseudo solution
31067  *
31068  * @pre this method can be called in one of the following stages of the SCIP solving process:
31069  * - \ref SCIP_STAGE_SOLVING
31070  */
31072  SCIP* scip, /**< SCIP data structure */
31073  SCIP_ROW* row /**< LP row */
31074  )
31075 {
31076  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31077 
31078  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
31079  return SCIProwGetLPActivity(row, scip->set, scip->stat, scip->lp);
31080  else
31081  return SCIProwGetPseudoActivity(row, scip->set, scip->stat);
31082 }
31083 
31084 /** returns the feasibility of a row in the last LP or pseudo solution
31085  *
31086  * @return the feasibility of a row in the last LP or pseudo solution
31087  *
31088  * @pre this method can be called in one of the following stages of the SCIP solving process:
31089  * - \ref SCIP_STAGE_SOLVING
31090  */
31092  SCIP* scip, /**< SCIP data structure */
31093  SCIP_ROW* row /**< LP row */
31094  )
31095 {
31096  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31097 
31098  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
31099  return SCIProwGetLPFeasibility(row, scip->set, scip->stat, scip->lp);
31100  else
31101  return SCIProwGetPseudoFeasibility(row, scip->set, scip->stat);
31102 }
31103 
31104 /** returns the activity of a row for the given primal solution
31105  *
31106  * @return the activitiy of a row for the given primal solution
31107  *
31108  * @pre this method can be called in one of the following stages of the SCIP solving process:
31109  * - \ref SCIP_STAGE_SOLVING
31110  */
31112  SCIP* scip, /**< SCIP data structure */
31113  SCIP_ROW* row, /**< LP row */
31114  SCIP_SOL* sol /**< primal CIP solution */
31115  )
31116 {
31117  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowSolActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
31118 
31119  if( sol != NULL )
31120  return SCIProwGetSolActivity(row, scip->set, scip->stat, sol);
31121  else if( SCIPtreeHasCurrentNodeLP(scip->tree) )
31122  return SCIProwGetLPActivity(row, scip->set, scip->stat, scip->lp);
31123  else
31124  return SCIProwGetPseudoActivity(row, scip->set, scip->stat);
31125 }
31126 
31127 /** returns the feasibility of a row for the given primal solution
31128  *
31129  * @return the feasibility of a row for the given primal solution
31130  *
31131  * @pre this method can be called in one of the following stages of the SCIP solving process:
31132  * - \ref SCIP_STAGE_SOLVING
31133  */
31135  SCIP* scip, /**< SCIP data structure */
31136  SCIP_ROW* row, /**< LP row */
31137  SCIP_SOL* sol /**< primal CIP solution */
31138  )
31139 {
31140  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowSolFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31141 
31142  if( sol != NULL )
31143  return SCIProwGetSolFeasibility(row, scip->set, scip->stat, sol);
31144  else if( SCIPtreeHasCurrentNodeLP(scip->tree) )
31145  return SCIProwGetLPFeasibility(row, scip->set, scip->stat, scip->lp);
31146  else
31147  return SCIProwGetPseudoFeasibility(row, scip->set, scip->stat);
31148 }
31149 
31150 /** output row to file stream via the message handler system
31151  *
31152  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31153  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31154  *
31155  * @pre this method can be called in one of the following stages of the SCIP solving process:
31156  * - \ref SCIP_STAGE_SOLVING
31157  * - \ref SCIP_STAGE_SOLVED
31158  * - \ref SCIP_STAGE_EXITSOLVE
31159  */
31161  SCIP* scip, /**< SCIP data structure */
31162  SCIP_ROW* row, /**< LP row */
31163  FILE* file /**< output file (or NULL for standard output) */
31164  )
31165 {
31166  assert(row != NULL);
31167 
31168  SCIP_CALL( checkStage(scip, "SCIPprintRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
31169 
31170  SCIProwPrint(row, scip->messagehdlr, file);
31171 
31172  return SCIP_OKAY;
31173 }
31174 
31175 
31176 /*
31177  * NLP methods
31178  */
31179 
31180 /** returns whether the NLP relaxation has been enabled
31181  *
31182  * If the NLP relaxation is enabled, then SCIP will construct the NLP relaxation when the solving process is about to begin.
31183  * To check whether an NLP is existing, use SCIPisNLPConstructed().
31184  *
31185  * @pre This method can be called if SCIP is in one of the following stages:
31186  * - \ref SCIP_STAGE_INITPRESOLVE
31187  * - \ref SCIP_STAGE_PRESOLVING
31188  * - \ref SCIP_STAGE_EXITPRESOLVE
31189  * - \ref SCIP_STAGE_PRESOLVED
31190  * - \ref SCIP_STAGE_INITSOLVE
31191  * - \ref SCIP_STAGE_SOLVING
31192  *
31193  * @see SCIPenableNLP
31194  */
31196  SCIP* scip /**< SCIP data structure */
31197  )
31198 {
31199  SCIP_CALL_ABORT( checkStage(scip, "SCIPisNLPEnabled", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31200 
31201  return scip->transprob->nlpenabled;
31202 }
31203 
31204 /** marks that there are constraints that are representable by nonlinear rows
31205  *
31206  * This method should be called by a constraint handler if it has constraints that have a representation as nonlinear rows.
31207  *
31208  * The function should be called before the branch-and-bound process is initialized, e.g., when presolve is exiting.
31209  *
31210  * @pre This method can be called if SCIP is in one of the following stages:
31211  * - \ref SCIP_STAGE_INITPRESOLVE
31212  * - \ref SCIP_STAGE_PRESOLVING
31213  * - \ref SCIP_STAGE_EXITPRESOLVE
31214  * - \ref SCIP_STAGE_PRESOLVED
31215  * - \ref SCIP_STAGE_INITSOLVE
31216  * - \ref SCIP_STAGE_SOLVING
31217  */
31219  SCIP* scip /**< SCIP data structure */
31220  )
31221 {
31222  SCIP_CALL_ABORT( checkStage(scip, "SCIPenableNLP", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31223 
31224  scip->transprob->nlpenabled = TRUE;
31225 }
31226 
31227 /** returns, whether an NLP has been constructed
31228  *
31229  * @pre This method can be called if SCIP is in one of the following stages:
31230  * - \ref SCIP_STAGE_INITSOLVE
31231  * - \ref SCIP_STAGE_SOLVING
31232  */
31234  SCIP* scip /**< SCIP data structure */
31235  )
31236 {
31237  SCIP_CALL_ABORT( checkStage(scip, "SCIPisNLPConstructed", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31238 
31239  return (scip->nlp != NULL);
31240 }
31241 
31242 /** returns whether the NLP has a continuous variable in a nonlinear term
31243  *
31244  * @pre This method can be called if SCIP is in one of the following stages:
31245  * - \ref SCIP_STAGE_INITSOLVE
31246  * - \ref SCIP_STAGE_SOLVING
31247  */
31249  SCIP* scip /**< SCIP data structure */
31250  )
31251 {
31252  SCIP_CALL_ABORT( checkStage(scip, "SCIPhasNLPContinuousNonlinearity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31253 
31254  if( scip->nlp == NULL )
31255  {
31256  SCIPerrorMessage("NLP has not been not constructed.\n");
31257  SCIPABORT();
31258  return FALSE; /*lint !e527*/
31259  }
31260 
31261  return SCIPnlpHasContinuousNonlinearity(scip->nlp);
31262 }
31263 
31264 /** gets current NLP variables along with the current number of NLP variables
31265  *
31266  * @pre This method can be called if SCIP is in one of the following stages:
31267  * - \ref SCIP_STAGE_INITSOLVE
31268  * - \ref SCIP_STAGE_SOLVING
31269  */
31271  SCIP* scip, /**< SCIP data structure */
31272  SCIP_VAR*** vars, /**< pointer to store the array of NLP variables, or NULL */
31273  int* nvars /**< pointer to store the number of NLP variables, or NULL */
31274  )
31275 {
31276  SCIP_CALL( checkStage(scip, "SCIPgetNLPVarsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31277 
31278  if( scip->nlp != NULL )
31279  {
31280  if( vars != NULL )
31281  *vars = SCIPnlpGetVars(scip->nlp);
31282  if( nvars != NULL )
31283  *nvars = SCIPnlpGetNVars(scip->nlp);
31284  }
31285  else
31286  {
31287  SCIPerrorMessage("NLP has not been constructed.\n");
31288  return SCIP_INVALIDCALL;
31289  }
31290 
31291  return SCIP_OKAY;
31292 }
31293 
31294 /** gets array with variables of the NLP
31295  *
31296  * @pre This method can be called if SCIP is in one of the following stages:
31297  * - \ref SCIP_STAGE_INITSOLVE
31298  * - \ref SCIP_STAGE_SOLVING
31299  */
31301  SCIP* scip /**< SCIP data structure */
31302  )
31303 {
31304  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPVars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31305 
31306  if( scip->nlp == NULL )
31307  {
31308  SCIPerrorMessage("NLP has not been constructed.\n");
31309  SCIPABORT();
31310  return NULL; /*lint !e527*/
31311  }
31312 
31313  return SCIPnlpGetVars(scip->nlp);
31314 }
31315 
31316 /** gets current number of variables in NLP
31317  *
31318  * @pre This method can be called if SCIP is in one of the following stages:
31319  * - \ref SCIP_STAGE_INITSOLVE
31320  * - \ref SCIP_STAGE_SOLVING
31321  */
31323  SCIP* scip /**< SCIP data structure */
31324  )
31325 {
31326  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNLPVars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31327 
31328  if( scip->nlp == NULL )
31329  {
31330  SCIPerrorMessage("NLP has not been constructed.\n");
31331  SCIPABORT();
31332  return 0; /*lint !e527*/
31333  }
31334 
31335  return SCIPnlpGetNVars(scip->nlp);
31336 }
31337 
31338 /** computes for each variables the number of NLP rows in which the variable appears in a nonlinear var
31339  *
31340  * @pre This method can be called if SCIP is in one of the following stages:
31341  * - \ref SCIP_STAGE_INITSOLVE
31342  * - \ref SCIP_STAGE_SOLVING
31343  */
31345  SCIP* scip, /**< SCIP data structure */
31346  int* nlcount /**< an array of length at least SCIPnlpGetNVars() to store nonlinearity counts of variables */
31347  )
31348 {
31349  SCIP_CALL( checkStage(scip, "SCIPgetNLPVarsNonlinearity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31350 
31351  if( scip->nlp == NULL )
31352  {
31353  SCIPerrorMessage("NLP has not been constructed.\n");
31354  return SCIP_INVALIDCALL;
31355  }
31356 
31357  SCIP_CALL( SCIPnlpGetVarsNonlinearity(scip->nlp, nlcount) );
31358 
31359  return SCIP_OKAY;
31360 }
31361 
31362 /** returns dual solution values associated with lower bounds of NLP variables
31363  *
31364  * @pre This method can be called if SCIP is in one of the following stages:
31365  * - \ref SCIP_STAGE_INITSOLVE
31366  * - \ref SCIP_STAGE_SOLVING
31367  */
31369  SCIP* scip /**< SCIP data structure */
31370  )
31371 {
31372  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPVarsLbDualsol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31373 
31374  if( scip->nlp == NULL )
31375  {
31376  SCIPerrorMessage("NLP has not been constructed.\n");
31377  SCIPABORT();
31378  return NULL; /*lint !e527*/
31379  }
31380 
31381  return SCIPnlpGetVarsLbDualsol(scip->nlp);
31382 }
31383 
31384 /** returns dual solution values associated with upper bounds of NLP variables
31385  *
31386  * @pre This method can be called if SCIP is in one of the following stages:
31387  * - \ref SCIP_STAGE_INITSOLVE
31388  * - \ref SCIP_STAGE_SOLVING
31389  */
31391  SCIP* scip /**< SCIP data structure */
31392  )
31393 {
31394  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPVarsUbDualsol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31395 
31396  if( scip->nlp == NULL )
31397  {
31398  SCIPerrorMessage("NLP has not been constructed.\n");
31399  SCIPABORT();
31400  return NULL; /*lint !e527*/
31401  }
31402 
31403  return SCIPnlpGetVarsUbDualsol(scip->nlp);
31404 }
31405 
31406 /** gets current NLP nonlinear rows along with the current number of NLP nonlinear rows
31407  *
31408  * @pre This method can be called if SCIP is in one of the following stages:
31409  * - \ref SCIP_STAGE_INITSOLVE
31410  * - \ref SCIP_STAGE_SOLVING
31411  */
31413  SCIP* scip, /**< SCIP data structure */
31414  SCIP_NLROW*** nlrows, /**< pointer to store the array of NLP nonlinear rows, or NULL */
31415  int* nnlrows /**< pointer to store the number of NLP nonlinear rows, or NULL */
31416  )
31417 {
31418  SCIP_CALL( checkStage(scip, "SCIPgetNLPNlRowsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31419 
31420  if( scip->nlp == NULL )
31421  {
31422  SCIPerrorMessage("NLP has not been constructed.\n");
31423  return SCIP_INVALIDCALL;
31424  }
31425 
31426  if( nlrows != NULL )
31427  *nlrows = SCIPnlpGetNlRows(scip->nlp);
31428  if( nnlrows != NULL )
31429  *nnlrows = SCIPnlpGetNNlRows(scip->nlp);
31430 
31431  return SCIP_OKAY;
31432 }
31433 
31434 /** gets array with nonlinear rows of the NLP
31435  *
31436  * @pre This method can be called if SCIP is in one of the following stages:
31437  * - \ref SCIP_STAGE_INITSOLVE
31438  * - \ref SCIP_STAGE_SOLVING
31439  */
31441  SCIP* scip /**< SCIP data structure */
31442  )
31443 {
31444  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPNlRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31445 
31446  if( scip->nlp == NULL )
31447  {
31448  SCIPerrorMessage("NLP has not been constructed.\n");
31449  SCIPABORT();
31450  return NULL; /*lint !e527*/
31451  }
31452 
31453  return SCIPnlpGetNlRows(scip->nlp);
31454 }
31455 
31456 /** gets current number of nonlinear rows in NLP
31457  *
31458  * @pre This method can be called if SCIP is in one of the following stages:
31459  * - \ref SCIP_STAGE_INITSOLVE
31460  * - \ref SCIP_STAGE_SOLVING
31461  */
31463  SCIP* scip /**< SCIP data structure */
31464  )
31465 {
31466  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNLPNlRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31467 
31468  if( scip->nlp == NULL )
31469  {
31470  SCIPerrorMessage("NLP has not been constructed.\n");
31471  SCIPABORT();
31472  return 0; /*lint !e527*/
31473  }
31474 
31475  return SCIPnlpGetNNlRows(scip->nlp);
31476 }
31477 
31478 /** adds a nonlinear row to the NLP. This row is captured by the NLP.
31479  *
31480  * @pre This method can be called if SCIP is in one of the following stages:
31481  * - \ref SCIP_STAGE_INITSOLVE
31482  * - \ref SCIP_STAGE_SOLVING
31483  */
31485  SCIP* scip, /**< SCIP data structure */
31486  SCIP_NLROW* nlrow /**< nonlinear row to add to NLP */
31487  )
31488 {
31489  SCIP_CALL( checkStage(scip, "SCIPaddNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31490 
31491  if( scip->nlp == NULL )
31492  {
31493  SCIPerrorMessage("NLP has not been constructed.\n");
31494  return SCIP_INVALIDCALL;
31495  }
31496 
31497  SCIP_CALL( SCIPnlpAddNlRow(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat, nlrow) );
31498 
31499  return SCIP_OKAY;
31500 }
31501 
31502 /** makes sure that the NLP of the current node is flushed
31503  *
31504  * @pre This method can be called if SCIP is in one of the following stages:
31505  * - \ref SCIP_STAGE_INITSOLVE
31506  * - \ref SCIP_STAGE_SOLVING
31507  */
31509  SCIP* scip /**< SCIP data structure */
31510  )
31511 {
31512  SCIP_CALL( checkStage(scip, "SCIPflushNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31513 
31514  if( scip->nlp == NULL )
31515  {
31516  SCIPerrorMessage("NLP has not been constructed.\n");
31517  return SCIP_INVALIDCALL;
31518  }
31519 
31520  SCIP_CALL( SCIPnlpFlush(scip->nlp, scip->mem->probmem, scip->set) );
31521 
31522  return SCIP_OKAY;
31523 }
31524 
31525 /** sets or clears initial primal guess for NLP solution (start point for NLP solver)
31526  *
31527  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31528  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31529  *
31530  * @pre This method can be called if SCIP is in one of the following stages:
31531  * - \ref SCIP_STAGE_INITSOLVE
31532  * - \ref SCIP_STAGE_SOLVING
31533  */
31535  SCIP* scip, /**< SCIP data structure */
31536  SCIP_Real* initialguess /**< values of initial guess (corresponding to variables from SCIPgetNLPVarsData), or NULL to use no start point */
31537  )
31538 {
31539  SCIP_CALL( checkStage(scip, "SCIPsetNLPInitialGuess", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31540 
31541  if( scip->nlp == NULL )
31542  {
31543  SCIPerrorMessage("NLP has not been constructed.\n");
31544  return SCIP_INVALIDCALL;
31545  }
31546 
31547  SCIP_CALL( SCIPnlpSetInitialGuess(scip->nlp, SCIPblkmem(scip), initialguess) );
31548 
31549  return SCIP_OKAY;
31550 }
31551 
31552 /** sets initial primal guess for NLP solution (start point for NLP solver)
31553  *
31554  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31555  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31556  *
31557  * @pre This method can be called if SCIP is in one of the following stages:
31558  * - \ref SCIP_STAGE_INITSOLVE
31559  * - \ref SCIP_STAGE_SOLVING
31560  */
31562  SCIP* scip, /**< SCIP data structure */
31563  SCIP_SOL* sol /**< solution which values should be taken as initial guess, or NULL for LP solution */
31564  )
31565 {
31566  SCIP_Real* vals;
31567 
31568  SCIP_CALL( checkStage(scip, "SCIPsetNLPInitialGuessSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31569 
31570  if( scip->nlp == NULL )
31571  {
31572  SCIPerrorMessage("NLP has not been constructed.\n");
31573  return SCIP_INVALIDCALL;
31574  }
31575 
31576  SCIP_CALL( SCIPallocBufferArray(scip, &vals, SCIPnlpGetNVars(scip->nlp)) );
31577  SCIP_CALL( SCIPgetSolVals(scip, sol, SCIPnlpGetNVars(scip->nlp), SCIPnlpGetVars(scip->nlp), vals) );
31578  SCIP_CALL( SCIPnlpSetInitialGuess(scip->nlp, SCIPblkmem(scip), vals) );
31579  SCIPfreeBufferArray(scip, &vals);
31580 
31581  return SCIP_OKAY;
31582 }
31583 
31584 /** solves the current NLP
31585  *
31586  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31587  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31588  *
31589  * @pre This method can be called if SCIP is in one of the following stages:
31590  * - \ref SCIP_STAGE_INITSOLVE
31591  * - \ref SCIP_STAGE_SOLVING
31592  */
31594  SCIP* scip /**< SCIP data structure */
31595  )
31596 {
31597  SCIP_CALL( checkStage(scip, "SCIPsolveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31598 
31599  if( scip->nlp == NULL )
31600  {
31601  SCIPerrorMessage("NLP has not been constructed.\n");
31602  return SCIP_INVALIDCALL;
31603  }
31604 
31605  SCIP_CALL( SCIPnlpSolve(scip->nlp, SCIPblkmem(scip), scip->set, scip->messagehdlr, scip->stat) );
31606 
31607  return SCIP_OKAY;
31608 }
31609 
31610 /** gets solution status of current NLP
31611  *
31612  * @pre This method can be called if SCIP is in one of the following stages:
31613  * - \ref SCIP_STAGE_INITSOLVE
31614  * - \ref SCIP_STAGE_SOLVING
31615  */
31617  SCIP* scip /**< SCIP data structure */
31618  )
31619 {
31620  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPSolstat", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31621 
31622  if( scip->nlp == NULL )
31623  {
31624  SCIPerrorMessage("NLP has not been constructed.\n");
31625  SCIPABORT();
31626  return SCIP_NLPSOLSTAT_UNKNOWN; /*lint !e527*/
31627  }
31628 
31629  return SCIPnlpGetSolstat(scip->nlp);
31630 }
31631 
31632 /** gets termination status of last NLP solve
31633  *
31634  * @pre This method can be called if SCIP is in one of the following stages:
31635  * - \ref SCIP_STAGE_INITSOLVE
31636  * - \ref SCIP_STAGE_SOLVING
31637  */
31639  SCIP* scip /**< SCIP data structure */
31640  )
31641 {
31642  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPTermstat", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31643 
31644  if( scip->nlp == NULL )
31645  {
31646  SCIPerrorMessage("NLP has not been constructed.\n");
31647  SCIPABORT();
31648  return SCIP_NLPTERMSTAT_OTHER; /*lint !e527*/
31649  }
31650 
31651  return SCIPnlpGetTermstat(scip->nlp);
31652 }
31653 
31654 /** gives statistics (number of iterations, solving time, ...) of last NLP solve
31655  *
31656  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31657  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31658  *
31659  * @pre This method can be called if SCIP is in one of the following stages:
31660  * - \ref SCIP_STAGE_INITSOLVE
31661  * - \ref SCIP_STAGE_SOLVING
31662  */
31664  SCIP* scip, /**< SCIP data structure */
31665  SCIP_NLPSTATISTICS* statistics /**< pointer to store statistics */
31666  )
31667 {
31668  SCIP_CALL( checkStage(scip, "SCIPgetNLPStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31669 
31670  if( scip->nlp == NULL )
31671  {
31672  SCIPerrorMessage("NLP has not been constructed.\n");
31673  return SCIP_INVALIDCALL;
31674  }
31675 
31676  SCIP_CALL( SCIPnlpGetStatistics(scip->nlp, statistics) );
31677 
31678  return SCIP_OKAY;
31679 }
31680 
31681 /** gets objective value of current NLP
31682  *
31683  * @pre This method can be called if SCIP is in one of the following stages:
31684  * - \ref SCIP_STAGE_INITSOLVE
31685  * - \ref SCIP_STAGE_SOLVING
31686  */
31688  SCIP* scip /**< SCIP data structure */
31689  )
31690 {
31691  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31692 
31693  if( scip->nlp != NULL )
31694  {
31695  return SCIPnlpGetObjval(scip->nlp);
31696  }
31697  else
31698  {
31699  SCIPerrorMessage("NLP has not been constructed.\n");
31700  return SCIP_INVALID;
31701  }
31702 }
31703 
31704 /** indicates whether a feasible solution for the current NLP is available
31705  * thus, returns whether the solution status <= feasible
31706  *
31707  * @pre This method can be called if SCIP is in one of the following stages:
31708  * - \ref SCIP_STAGE_INITSOLVE
31709  * - \ref SCIP_STAGE_SOLVING
31710  */
31712  SCIP* scip /**< SCIP data structure */
31713  )
31714 {
31715  SCIP_CALL_ABORT( checkStage(scip, "SCIPhasNLPSolution", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31716 
31717  if( scip->nlp == NULL )
31718  {
31719  SCIPerrorMessage("NLP has not been constructed.\n");
31720  SCIPABORT();
31721  return FALSE; /*lint !e527*/
31722  }
31723 
31724  return SCIPnlpHasSolution(scip->nlp);
31725 }
31726 
31727 /** gets fractional variables of last NLP solution along with solution values and fractionalities
31728  *
31729  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31730  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31731  *
31732  * @pre This method can be called if SCIP is in one of the following stages:
31733  * - \ref SCIP_STAGE_INITSOLVE
31734  * - \ref SCIP_STAGE_SOLVING
31735  */
31737  SCIP* scip, /**< SCIP data structure */
31738  SCIP_VAR*** fracvars, /**< pointer to store the array of NLP fractional variables, or NULL */
31739  SCIP_Real** fracvarssol, /**< pointer to store the array of NLP fractional variables solution values, or NULL */
31740  SCIP_Real** fracvarsfrac, /**< pointer to store the array of NLP fractional variables fractionalities, or NULL */
31741  int* nfracvars, /**< pointer to store the number of NLP fractional variables , or NULL */
31742  int* npriofracvars /**< pointer to store the number of NLP fractional variables with maximal branching priority, or NULL */
31743  )
31744 {
31745  SCIP_CALL( checkStage(scip, "SCIPgetNLPFracVars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31746 
31747  if( scip->nlp == NULL )
31748  {
31749  SCIPerrorMessage("NLP has not been constructed.\n");
31750  return SCIP_INVALIDCALL;
31751  }
31752 
31753  SCIP_CALL( SCIPnlpGetFracVars(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat, fracvars, fracvarssol, fracvarsfrac, nfracvars, npriofracvars) );
31754 
31755  return SCIP_OKAY;
31756 }
31757 
31758 /** gets integer parameter of NLP
31759  *
31760  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31761  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31762  *
31763  * @pre This method can be called if SCIP is in one of the following stages:
31764  * - \ref SCIP_STAGE_INITSOLVE
31765  * - \ref SCIP_STAGE_SOLVING
31766  */
31768  SCIP* scip, /**< SCIP data structure */
31769  SCIP_NLPPARAM type, /**< parameter number */
31770  int* ival /**< pointer to store the parameter value */
31771  )
31772 {
31773  SCIP_CALL( checkStage(scip, "SCIPgetNLPIntPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31774 
31775  if( scip->nlp == NULL )
31776  {
31777  SCIPerrorMessage("NLP has not been constructed.\n");
31778  return SCIP_INVALIDCALL;
31779  }
31780 
31781  SCIP_CALL( SCIPnlpGetIntPar(scip->nlp, type, ival) );
31782 
31783  return SCIP_OKAY;
31784 }
31785 
31786 /** sets integer parameter of NLP
31787  *
31788  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31789  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31790  *
31791  * @pre This method can be called if SCIP is in one of the following stages:
31792  * - \ref SCIP_STAGE_INITSOLVE
31793  * - \ref SCIP_STAGE_SOLVING
31794  */
31796  SCIP* scip, /**< SCIP data structure */
31797  SCIP_NLPPARAM type, /**< parameter number */
31798  int ival /**< parameter value */
31799  )
31800 {
31801  SCIP_CALL( checkStage(scip, "SCIPsetNLPIntPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31802 
31803  if( scip->nlp == NULL )
31804  {
31805  SCIPerrorMessage("NLP has not been constructed.\n");
31806  return SCIP_INVALIDCALL;
31807  }
31808 
31809  SCIP_CALL( SCIPnlpSetIntPar(scip->nlp, type, ival) );
31810 
31811  return SCIP_OKAY;
31812 }
31813 
31814 /** gets floating point parameter of NLP
31815  *
31816  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31817  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31818  *
31819  * @pre This method can be called if SCIP is in one of the following stages:
31820  * - \ref SCIP_STAGE_INITSOLVE
31821  * - \ref SCIP_STAGE_SOLVING
31822  */
31824  SCIP* scip, /**< SCIP data structure */
31825  SCIP_NLPPARAM type, /**< parameter number */
31826  SCIP_Real* dval /**< pointer to store the parameter value */
31827  )
31828 {
31829  SCIP_CALL( checkStage(scip, "SCIPgetNLPRealPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31830 
31831  if( scip->nlp == NULL )
31832  {
31833  SCIPerrorMessage("NLP has not been constructed.\n");
31834  return SCIP_INVALIDCALL;
31835  }
31836 
31837  SCIP_CALL( SCIPnlpGetRealPar(scip->nlp, type, dval) );
31838 
31839  return SCIP_OKAY;
31840 }
31841 
31842 /** sets floating point parameter of NLP
31843  *
31844  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31845  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31846  *
31847  * @pre This method can be called if SCIP is in one of the following stages:
31848  * - \ref SCIP_STAGE_INITSOLVE
31849  * - \ref SCIP_STAGE_SOLVING
31850  */
31852  SCIP* scip, /**< SCIP data structure */
31853  SCIP_NLPPARAM type, /**< parameter number */
31854  SCIP_Real dval /**< parameter value */
31855  )
31856 {
31857  SCIP_CALL( checkStage(scip, "SCIPsetNLPRealPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31858 
31859  if( scip->nlp == NULL )
31860  {
31861  SCIPerrorMessage("NLP has not been constructed.\n");
31862  return SCIP_INVALIDCALL;
31863  }
31864 
31865  SCIP_CALL( SCIPnlpSetRealPar(scip->nlp, type, dval) );
31866 
31867  return SCIP_OKAY;
31868 }
31869 
31870 /** gets string parameter of NLP
31871  *
31872  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31873  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31874  *
31875  * @pre This method can be called if SCIP is in one of the following stages:
31876  * - \ref SCIP_STAGE_INITSOLVE
31877  * - \ref SCIP_STAGE_SOLVING
31878  */
31880  SCIP* scip, /**< SCIP data structure */
31881  SCIP_NLPPARAM type, /**< parameter number */
31882  const char** sval /**< pointer to store the parameter value */
31883  )
31884 {
31885  SCIP_CALL( checkStage(scip, "SCIPgetNLPStringPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31886 
31887  if( scip->nlp == NULL )
31888  {
31889  SCIPerrorMessage("NLP has not been constructed.\n");
31890  return SCIP_INVALIDCALL;
31891  }
31892 
31893  SCIP_CALL( SCIPnlpGetStringPar(scip->nlp, type, sval) );
31894 
31895  return SCIP_OKAY;
31896 }
31897 
31898 /** sets string parameter of NLP
31899  *
31900  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31901  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31902  *
31903  * @pre This method can be called if SCIP is in one of the following stages:
31904  * - \ref SCIP_STAGE_INITSOLVE
31905  * - \ref SCIP_STAGE_SOLVING
31906  */
31908  SCIP* scip, /**< SCIP data structure */
31909  SCIP_NLPPARAM type, /**< parameter number */
31910  const char* sval /**< parameter value */
31911  )
31912 {
31913  SCIP_CALL( checkStage(scip, "SCIPsetNLPStringPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31914 
31915  if( scip->nlp == NULL )
31916  {
31917  SCIPerrorMessage("NLP has not been constructed.\n");
31918  return SCIP_INVALIDCALL;
31919  }
31920 
31921  SCIP_CALL( SCIPnlpSetStringPar(scip->nlp, type, sval) );
31922 
31923  return SCIP_OKAY;
31924 }
31925 
31926 /** writes current NLP to a file
31927  *
31928  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31929  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31930  *
31931  * @pre This method can be called if SCIP is in one of the following stages:
31932  * - \ref SCIP_STAGE_INITSOLVE
31933  * - \ref SCIP_STAGE_SOLVING
31934  */
31936  SCIP* scip, /**< SCIP data structure */
31937  const char* filename /**< file name */
31938  )
31939 {
31940  SCIP_CALL( checkStage(scip, "SCIPwriteNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31941 
31942  if( scip->nlp == NULL )
31943  {
31944  SCIPerrorMessage("NLP has not been constructed.\n");
31945  return SCIP_INVALIDCALL;
31946  }
31947 
31948  SCIP_CALL( SCIPnlpWrite(scip->nlp, scip->set, scip->messagehdlr, filename) );
31949 
31950  return SCIP_OKAY;
31951 }
31952 
31953 /** gets the NLP interface and problem used by the SCIP NLP;
31954  * with the NLPI and its problem you can use all of the methods defined in nlpi/nlpi.h;
31955  *
31956  * @warning You have to make sure, that the full internal state of the NLPI does not change or is recovered completely
31957  * after the end of the method that uses the NLPI. In particular, if you manipulate the NLP or its solution
31958  * (e.g. by calling one of the SCIPnlpiAdd...() or the SCIPnlpiSolve() method), you have to check in advance
31959  * whether the NLP is currently solved. If this is the case, you have to make sure, the internal solution
31960  * status is recovered completely at the end of your method. Additionally you have to resolve the NLP with
31961  * SCIPnlpiSolve() in order to reinstall the internal solution status.
31962  *
31963  * @warning Make also sure, that all parameter values that you have changed are set back to their original values.
31964  *
31965  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31966  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31967  *
31968  * @pre This method can be called if SCIP is in one of the following stages:
31969  * - \ref SCIP_STAGE_INITSOLVE
31970  * - \ref SCIP_STAGE_SOLVING
31971  */
31973  SCIP* scip, /**< SCIP data structure */
31974  SCIP_NLPI** nlpi, /**< pointer to store the NLP solver interface */
31975  SCIP_NLPIPROBLEM** nlpiproblem /**< pointer to store the NLP solver interface problem */
31976  )
31977 {
31978  assert(nlpi != NULL);
31979  assert(nlpiproblem != NULL);
31980 
31981  SCIP_CALL( checkStage(scip, "SCIPgetNLPI", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31982 
31983  if( scip->nlp == NULL )
31984  {
31985  SCIPerrorMessage("NLP has not been constructed.\n");
31986  return SCIP_INVALIDCALL;
31987  }
31988 
31989  *nlpi = SCIPnlpGetNLPI(scip->nlp);
31990  *nlpiproblem = SCIPnlpGetNLPIProblem(scip->nlp);
31991 
31992  return SCIP_OKAY;
31993 }
31994 
31995 
31996 /*
31997  * NLP diving methods
31998  */
31999 
32000 /**@name NLP Diving Methods */
32001 /**@{ */
32002 
32003 /** initiates NLP diving making methods SCIPchgVarObjDiveNLP(), SCIPchgVarBoundsDiveNLP(), SCIPchgVarsBoundsDiveNLP(), and SCIPsolveDiveNLP() available
32004  *
32005  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32006  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32007  *
32008  * @pre This method can be called if SCIP is in one of the following stages:
32009  * - \ref SCIP_STAGE_INITSOLVE
32010  * - \ref SCIP_STAGE_SOLVING
32011  */
32013  SCIP* scip /**< SCIP data structure */
32014  )
32015 {
32016  SCIP_CALL( checkStage(scip, "SCIPstartDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32017 
32018  if( scip->nlp == NULL )
32019  {
32020  SCIPerrorMessage("NLP has not been constructed.\n");
32021  return SCIP_INVALIDCALL;
32022  }
32023 
32024  SCIP_CALL( SCIPnlpStartDive(scip->nlp, SCIPblkmem(scip), scip->set) );
32025 
32026  return SCIP_OKAY;
32027 }
32028 
32029 /** ends NLP diving
32030  *
32031  * Resets changes made by SCIPchgVarObjDiveNLP(), SCIPchgVarBoundsDiveNLP(), and SCIPchgVarsBoundsDiveNLP().
32032  *
32033  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32034  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32035  *
32036  * @pre This method can be called if SCIP is in one of the following stages:
32037  * - \ref SCIP_STAGE_INITSOLVE
32038  * - \ref SCIP_STAGE_SOLVING
32039  */
32041  SCIP* scip /**< SCIP data structure */
32042  )
32043 {
32044  SCIP_CALL( checkStage(scip, "SCIPendDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32045 
32046  if( scip->nlp == NULL )
32047  {
32048  SCIPerrorMessage("NLP has not been constructed.\n");
32049  return SCIP_INVALIDCALL;
32050  }
32051 
32052  SCIP_CALL( SCIPnlpEndDive(scip->nlp, SCIPblkmem(scip), scip->set) );
32053 
32054  return SCIP_OKAY;
32055 }
32056 
32057 /** changes linear objective coefficient of a variable in diving NLP
32058  *
32059  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32060  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32061  *
32062  * @pre This method can be called if SCIP is in one of the following stages:
32063  * - \ref SCIP_STAGE_INITSOLVE
32064  * - \ref SCIP_STAGE_SOLVING
32065  */
32067  SCIP* scip, /**< SCIP data structure */
32068  SCIP_VAR* var, /**< variable which coefficient to change */
32069  SCIP_Real coef /**< new value for coefficient */
32070  )
32071 {
32072  SCIP_CALL( checkStage(scip, "SCIPchgVarObjDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32073 
32074  assert( var->scip == scip );
32075 
32076  if( scip->nlp == NULL )
32077  {
32078  SCIPerrorMessage("NLP has not been constructed.\n");
32079  return SCIP_INVALIDCALL;
32080  }
32081 
32082  SCIP_CALL( SCIPnlpChgVarObjDive(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat, var, coef) );
32083 
32084  return SCIP_OKAY;
32085 }
32086 
32087 /** changes bounds of a variable in diving NLP
32088  *
32089  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32090  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32091  *
32092  * @pre This method can be called if SCIP is in one of the following stages:
32093  * - \ref SCIP_STAGE_INITSOLVE
32094  * - \ref SCIP_STAGE_SOLVING
32095  */
32097  SCIP* scip, /**< SCIP data structure */
32098  SCIP_VAR* var, /**< variable which bounds to change */
32099  SCIP_Real lb, /**< new lower bound */
32100  SCIP_Real ub /**< new upper bound */
32101  )
32102 {
32103  SCIP_CALL( checkStage(scip, "SCIPchgVarBoundsDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32104 
32105  assert( var->scip == scip );
32106 
32107  if( scip->nlp == NULL )
32108  {
32109  SCIPerrorMessage("NLP has not been constructed.\n");
32110  return SCIP_INVALIDCALL;
32111  }
32112 
32113  SCIP_CALL( SCIPnlpChgVarBoundsDive(scip->nlp, var, lb, ub) );
32114 
32115  return SCIP_OKAY;
32116 }
32117 
32118 /** changes bounds of a set of variables in diving NLP
32119  *
32120  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32121  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32122  *
32123  * @pre This method can be called if SCIP is in one of the following stages:
32124  * - \ref SCIP_STAGE_INITSOLVE
32125  * - \ref SCIP_STAGE_SOLVING
32126  */
32128  SCIP* scip, /**< SCIP data structure */
32129  int nvars, /**< number of variables which bounds to changes */
32130  SCIP_VAR** vars, /**< variables which bounds to change */
32131  SCIP_Real* lbs, /**< new lower bounds */
32132  SCIP_Real* ubs /**< new upper bounds */
32133  )
32134 {
32135  SCIP_CALL( checkStage(scip, "SCIPchgVarsBoundsDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32136 
32137  if( scip->nlp == NULL )
32138  {
32139  SCIPerrorMessage("NLP has not been constructed.\n");
32140  return SCIP_INVALIDCALL;
32141  }
32142 
32143  SCIP_CALL( SCIPnlpChgVarsBoundsDive(scip->nlp, scip->set, nvars, vars, lbs, ubs) );
32144 
32145  return SCIP_OKAY;
32146 }
32147 
32148 /** solves diving NLP
32149  *
32150  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32151  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32152  *
32153  * @pre This method can be called if SCIP is in one of the following stages:
32154  * - \ref SCIP_STAGE_INITSOLVE
32155  * - \ref SCIP_STAGE_SOLVING
32156  */
32158  SCIP* scip /**< SCIP data structure */
32159  )
32160 {
32161  SCIP_CALL( checkStage(scip, "SCIPsolveDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32162 
32163  if( scip->nlp == NULL )
32164  {
32165  SCIPerrorMessage("NLP has not been constructed.\n");
32166  return SCIP_INVALIDCALL;
32167  }
32168 
32169  SCIP_CALL( SCIPnlpSolveDive(scip->nlp, SCIPblkmem(scip), scip->set, scip->messagehdlr, scip->stat) );
32170 
32171  return SCIP_OKAY;
32172 }
32173 
32174 /**@} */
32175 
32176 
32177 /*
32178  * NLP nonlinear row methods
32179  */
32180 
32181 /** creates and captures an NLP row
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 SCIP is in one of the following stages:
32187  * - \ref SCIP_STAGE_PRESOLVED
32188  * - \ref SCIP_STAGE_INITSOLVE
32189  * - \ref SCIP_STAGE_SOLVING
32190  */
32192  SCIP* scip, /**< SCIP data structure */
32193  SCIP_NLROW** nlrow, /**< buffer to store pointer to nonlinear row */
32194  const char* name, /**< name of nonlinear row */
32195  SCIP_Real constant, /**< constant */
32196  int nlinvars, /**< number of linear variables */
32197  SCIP_VAR** linvars, /**< linear variables, or NULL if nlinvars == 0 */
32198  SCIP_Real* lincoefs, /**< linear coefficients, or NULL if nlinvars == 0 */
32199  int nquadvars, /**< number variables in quadratic terms */
32200  SCIP_VAR** quadvars, /**< variables in quadratic terms, or NULL if nquadvars == 0 */
32201  int nquadelems, /**< number of elements in quadratic term */
32202  SCIP_QUADELEM* quadelems, /**< elements (i.e., monomials) in quadratic term, or NULL if nquadelems == 0 */
32203  SCIP_EXPRTREE* expression, /**< nonlinear expression, or NULL */
32204  SCIP_Real lhs, /**< left hand side */
32205  SCIP_Real rhs, /**< right hand side */
32206  SCIP_EXPRCURV curvature /**< curvature of the nonlinear row */
32207  )
32208 {
32209  SCIP_CALL( checkStage(scip, "SCIPcreateNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32210 
32211  SCIP_CALL( SCIPnlrowCreate(nlrow, scip->mem->probmem, scip->set,
32212  name, constant, nlinvars, linvars, lincoefs, nquadvars, quadvars, nquadelems, quadelems, expression, lhs, rhs, curvature) );
32213 
32214  return SCIP_OKAY;
32215 }
32216 
32217 /** creates and captures an NLP nonlinear row without any coefficients
32218  *
32219  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32220  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32221  *
32222  * @pre This method can be called if SCIP is in one of the following stages:
32223  * - \ref SCIP_STAGE_PRESOLVED
32224  * - \ref SCIP_STAGE_INITSOLVE
32225  * - \ref SCIP_STAGE_SOLVING
32226  */
32228  SCIP* scip, /**< SCIP data structure */
32229  SCIP_NLROW** nlrow, /**< pointer to nonlinear row */
32230  const char* name, /**< name of nonlinear row */
32231  SCIP_Real lhs, /**< left hand side */
32232  SCIP_Real rhs /**< right hand side */
32233  )
32234 {
32235  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32236 
32237  SCIP_CALL( SCIPnlrowCreate(nlrow, scip->mem->probmem, scip->set,
32238  name, 0.0, 0, NULL, NULL, 0, NULL, 0, NULL, NULL, lhs, rhs, SCIP_EXPRCURV_UNKNOWN) );
32239 
32240  return SCIP_OKAY;
32241 }
32242 
32243 /** creates and captures an NLP row from a linear row
32244  *
32245  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32246  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32247  *
32248  * @pre This method can be called if SCIP is in one of the following stages:
32249  * - \ref SCIP_STAGE_PRESOLVED
32250  * - \ref SCIP_STAGE_INITSOLVE
32251  * - \ref SCIP_STAGE_SOLVING
32252  */
32254  SCIP* scip, /**< SCIP data structure */
32255  SCIP_NLROW** nlrow, /**< pointer to nonlinear row */
32256  SCIP_ROW* row /**< the linear row to copy */
32257  )
32258 {
32259  SCIP_CALL( checkStage(scip, "SCIPcreateNlRowFromRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32260 
32261  SCIP_CALL( SCIPnlrowCreateFromRow(nlrow, scip->mem->probmem, scip->set, row) );
32262 
32263  return SCIP_OKAY;
32264 }
32265 
32266 /** increases usage counter of NLP nonlinear row
32267  *
32268  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32269  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32270  *
32271  * @pre This method can be called if SCIP is in one of the following stages:
32272  * - \ref SCIP_STAGE_PRESOLVED
32273  * - \ref SCIP_STAGE_INITSOLVE
32274  * - \ref SCIP_STAGE_SOLVING
32275  */
32277  SCIP* scip, /**< SCIP data structure */
32278  SCIP_NLROW* nlrow /**< nonlinear row to capture */
32279  )
32280 {
32281  SCIP_CALL( checkStage(scip, "SCIPcaptureNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32282 
32283  SCIPnlrowCapture(nlrow);
32284 
32285  return SCIP_OKAY;
32286 }
32287 
32288 /** decreases usage counter of NLP nonlinear row, and frees memory if necessary
32289  *
32290  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32291  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32292  *
32293  * @pre This method can be called if SCIP is in one of the following stages:
32294  * - \ref SCIP_STAGE_PRESOLVED
32295  * - \ref SCIP_STAGE_INITSOLVE
32296  * - \ref SCIP_STAGE_SOLVING
32297  * - \ref SCIP_STAGE_EXITSOLVE
32298  */
32300  SCIP* scip, /**< SCIP data structure */
32301  SCIP_NLROW** nlrow /**< pointer to nonlinear row */
32302  )
32303 {
32304  SCIP_CALL( checkStage(scip, "SCIPreleaseNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
32305 
32306  SCIP_CALL( SCIPnlrowRelease(nlrow, scip->mem->probmem, scip->set) );
32307 
32308  return SCIP_OKAY;
32309 }
32310 
32311 /** changes left hand side of NLP nonlinear row
32312  *
32313  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32314  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32315  *
32316  * @pre This method can be called if SCIP is in one of the following stages:
32317  * - \ref SCIP_STAGE_PRESOLVED
32318  * - \ref SCIP_STAGE_INITSOLVE
32319  * - \ref SCIP_STAGE_SOLVING
32320  */
32322  SCIP* scip, /**< SCIP data structure */
32323  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32324  SCIP_Real lhs /**< new left hand side */
32325  )
32326 {
32327  SCIP_CALL( checkStage(scip, "SCIPchgNlRowLhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32328 
32329  SCIP_CALL( SCIPnlrowChgLhs(nlrow, scip->set, scip->stat, scip->nlp, lhs) );
32330 
32331  return SCIP_OKAY;
32332 }
32333 
32334 /** changes right hand side of NLP nonlinear row
32335  *
32336  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32337  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32338  *
32339  * @pre This method can be called if SCIP is in one of the following stages:
32340  * - \ref SCIP_STAGE_PRESOLVED
32341  * - \ref SCIP_STAGE_INITSOLVE
32342  * - \ref SCIP_STAGE_SOLVING
32343  */
32345  SCIP* scip, /**< SCIP data structure */
32346  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32347  SCIP_Real rhs /**< new right hand side */
32348  )
32349 {
32350  SCIP_CALL( checkStage(scip, "SCIPchgNlRowRhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32351 
32352  SCIP_CALL( SCIPnlrowChgRhs(nlrow, scip->set, scip->stat, scip->nlp, rhs) );
32353 
32354  return SCIP_OKAY;
32355 }
32356 
32357 /** changes constant of NLP nonlinear row
32358  *
32359  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32360  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32361  *
32362  * @pre This method can be called if SCIP is in one of the following stages:
32363  * - \ref SCIP_STAGE_PRESOLVED
32364  * - \ref SCIP_STAGE_INITSOLVE
32365  * - \ref SCIP_STAGE_SOLVING
32366  */
32368  SCIP* scip, /**< SCIP data structure */
32369  SCIP_NLROW* nlrow, /**< NLP row */
32370  SCIP_Real constant /**< new value for constant */
32371  )
32372 {
32373  SCIP_CALL( checkStage(scip, "SCIPchgNlRowConstant", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32374 
32375  SCIP_CALL( SCIPnlrowChgConstant(nlrow, scip->set, scip->stat, scip->nlp, constant) );
32376 
32377  return SCIP_OKAY;
32378 }
32379 
32380 /** adds variable with a linear coefficient to the nonlinear row
32381  *
32382  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32383  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32384  *
32385  * @pre This method can be called if SCIP is in one of the following stages:
32386  * - \ref SCIP_STAGE_PRESOLVED
32387  * - \ref SCIP_STAGE_INITSOLVE
32388  * - \ref SCIP_STAGE_SOLVING
32389  */
32391  SCIP* scip, /**< SCIP data structure */
32392  SCIP_NLROW* nlrow, /**< NLP row */
32393  SCIP_VAR* var, /**< problem variable */
32394  SCIP_Real val /**< value of coefficient in linear part of row */
32395  )
32396 {
32397  SCIP_CALL( checkStage(scip, "SCIPaddLinearCoefToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32398 
32399  SCIP_CALL( SCIPnlrowAddLinearCoef(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, var, val) );
32400 
32401  return SCIP_OKAY;
32402 }
32403 
32404 /** adds variables with linear coefficients to the row
32405  *
32406  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32407  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32408  *
32409  * @pre This method can be called if SCIP is in one of the following stages:
32410  * - \ref SCIP_STAGE_PRESOLVED
32411  * - \ref SCIP_STAGE_INITSOLVE
32412  * - \ref SCIP_STAGE_SOLVING
32413  */
32415  SCIP* scip, /**< SCIP data structure */
32416  SCIP_NLROW* nlrow, /**< NLP row */
32417  int nvars, /**< number of variables to add to the row */
32418  SCIP_VAR** vars, /**< problem variables to add */
32419  SCIP_Real* vals /**< values of coefficients in linear part of row */
32420  )
32421 {
32422  int v;
32423 
32424  assert(nvars == 0 || vars != NULL);
32425  assert(nvars == 0 || vals != NULL);
32426 
32427  SCIP_CALL( checkStage(scip, "SCIPaddLinearCoefsToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32428 
32429  /* add the variables to the row */
32430  for( v = 0; v < nvars; ++v )
32431  {
32432  SCIP_CALL( SCIPnlrowAddLinearCoef(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, vars[v], vals[v]) );
32433  }
32434 
32435  return SCIP_OKAY;
32436 }
32437 
32438 /** changes linear coefficient of a variables in a row
32439  *
32440  * Setting the coefficient to 0.0 means that it is removed from the row
32441  * the variable does not need to exists before.
32442  *
32443  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32444  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32445  *
32446  * @pre This method can be called if SCIP is in one of the following stages:
32447  * - \ref SCIP_STAGE_PRESOLVED
32448  * - \ref SCIP_STAGE_INITSOLVE
32449  * - \ref SCIP_STAGE_SOLVING
32450  */
32452  SCIP* scip, /**< SCIP data structure */
32453  SCIP_NLROW* nlrow, /**< NLP row */
32454  SCIP_VAR* var, /**< variable */
32455  SCIP_Real coef /**< new value of coefficient */
32456  )
32457 {
32458  assert(var != NULL);
32459 
32460  SCIP_CALL( checkStage(scip, "SCIPchgNlRowLinearCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32461 
32462  SCIP_CALL( SCIPnlrowChgLinearCoef(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, var, coef) );
32463 
32464  return SCIP_OKAY;
32465 }
32466 
32467 /** adds quadratic variable to the nonlinear row
32468  *
32469  * After adding a quadratic variable, it can be used to add quadratic elements.
32470  *
32471  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32472  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32473  *
32474  * @pre This method can be called if SCIP is in one of the following stages:
32475  * - \ref SCIP_STAGE_PRESOLVED
32476  * - \ref SCIP_STAGE_INITSOLVE
32477  * - \ref SCIP_STAGE_SOLVING
32478  */
32480  SCIP* scip, /**< SCIP data structure */
32481  SCIP_NLROW* nlrow, /**< NLP row */
32482  SCIP_VAR* var /**< problem variable */
32483  )
32484 {
32485  SCIP_CALL( checkStage(scip, "SCIPaddQuadVarToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32486 
32487  SCIP_CALL( SCIPnlrowAddQuadVar(nlrow, scip->mem->probmem, scip->set, var) );
32488 
32489  return SCIP_OKAY;
32490 }
32491 
32492 /** adds quadratic variables to the nonlinear row
32493  *
32494  * After adding quadratic variables, they can be used to add quadratic elements.
32495  *
32496  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32497  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32498  *
32499  * @pre This method can be called if SCIP is in one of the following stages:
32500  * - \ref SCIP_STAGE_PRESOLVED
32501  * - \ref SCIP_STAGE_INITSOLVE
32502  * - \ref SCIP_STAGE_SOLVING
32503  */
32505  SCIP* scip, /**< SCIP data structure */
32506  SCIP_NLROW* nlrow, /**< NLP row */
32507  int nvars, /**< number of problem variables */
32508  SCIP_VAR** vars /**< problem variables */
32509  )
32510 {
32511  int v;
32512 
32513  assert(nvars == 0 || vars != NULL);
32514 
32515  SCIP_CALL( checkStage(scip, "SCIPaddQuadVarsToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32516 
32517  SCIP_CALL( SCIPnlrowEnsureQuadVarsSize(nlrow, scip->mem->probmem, scip->set, SCIPnlrowGetNQuadVars(nlrow) + nvars) );
32518  for( v = 0; v < nvars; ++v )
32519  {
32520  SCIP_CALL( SCIPnlrowAddQuadVar(nlrow, scip->mem->probmem, scip->set, vars[v]) );
32521  }
32522 
32523  return SCIP_OKAY;
32524 }
32525 
32526 /** add a quadratic element to the nonlinear row
32527  *
32528  * Variable indices of the quadratic element need to be relative to quadratic variables array of row.
32529  *
32530  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32531  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32532  *
32533  * @pre This method can be called if SCIP is in one of the following stages:
32534  * - \ref SCIP_STAGE_PRESOLVED
32535  * - \ref SCIP_STAGE_INITSOLVE
32536  * - \ref SCIP_STAGE_SOLVING
32537  */
32539  SCIP* scip, /**< SCIP data structure */
32540  SCIP_NLROW* nlrow, /**< NLP row */
32541  SCIP_QUADELEM quadelem /**< quadratic element */
32542  )
32543 {
32544  SCIP_CALL( checkStage(scip, "SCIPaddQuadElementToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32545 
32546  SCIP_CALL( SCIPnlrowAddQuadElement(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, quadelem) );
32547 
32548  /* invalidate curvature */
32549  if( quadelem.coef != 0.0 )
32551 
32552  return SCIP_OKAY;
32553 }
32554 
32555 /** adds quadratic elements to the nonlinear row
32556  *
32557  * Variable indices of the quadratic elements need to be relative to quadratic variables array of row.
32558  *
32559  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32560  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32561  *
32562  * @pre This method can be called if SCIP is in one of the following stages:
32563  * - \ref SCIP_STAGE_PRESOLVED
32564  * - \ref SCIP_STAGE_INITSOLVE
32565  * - \ref SCIP_STAGE_SOLVING
32566  */
32568  SCIP* scip, /**< SCIP data structure */
32569  SCIP_NLROW* nlrow, /**< NLP row */
32570  int nquadelems, /**< number of quadratic elements */
32571  SCIP_QUADELEM* quadelems /**< quadratic elements */
32572  )
32573 {
32574  int v;
32575 
32576  assert(nquadelems == 0 || quadelems != NULL);
32577 
32578  SCIP_CALL( checkStage(scip, "SCIPaddQuadElementsToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32579 
32580  SCIP_CALL( SCIPnlrowEnsureQuadElementsSize(nlrow, scip->mem->probmem, scip->set, SCIPnlrowGetNQuadElems(nlrow) + nquadelems) );
32581  for( v = 0; v < nquadelems; ++v )
32582  {
32583  SCIP_CALL( SCIPnlrowAddQuadElement(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, quadelems[v]) );
32584  }
32585 
32586  /* invalidate curvature */
32588 
32589  return SCIP_OKAY;
32590 }
32591 
32592 /** changes coefficient in quadratic part of a row
32593  *
32594  * Setting the coefficient in the quadelement to 0.0 means that it is removed from the row
32595  * the element does not need to exists before.
32596  *
32597  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32598  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32599  *
32600  * @pre This method can be called if SCIP is in one of the following stages:
32601  * - \ref SCIP_STAGE_PRESOLVED
32602  * - \ref SCIP_STAGE_INITSOLVE
32603  * - \ref SCIP_STAGE_SOLVING
32604  */
32606  SCIP* scip, /**< SCIP data structure */
32607  SCIP_NLROW* nlrow, /**< NLP row */
32608  SCIP_QUADELEM quadelement /**< new quadratic element, or update for existing one */
32609  )
32610 {
32611  SCIP_CALL( checkStage(scip, "SCIPchgNlRowQuadElement", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32612 
32613  SCIP_CALL( SCIPnlrowChgQuadElem(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, quadelement) );
32614 
32615  return SCIP_OKAY;
32616 }
32617 
32618 /** sets or deletes expression tree in the nonlinear row
32619  *
32620  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32621  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32622  *
32623  * @pre This method can be called if SCIP is in one of the following stages:
32624  * - \ref SCIP_STAGE_PRESOLVED
32625  * - \ref SCIP_STAGE_INITSOLVE
32626  * - \ref SCIP_STAGE_SOLVING
32627  */
32629  SCIP* scip, /**< SCIP data structure */
32630  SCIP_NLROW* nlrow, /**< NLP row */
32631  SCIP_EXPRTREE* exprtree /**< expression tree, or NULL */
32632  )
32633 {
32634  SCIP_CALL( checkStage(scip, "SCIPsetNlRowExprtree", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32635 
32636  SCIP_CALL( SCIPnlrowChgExprtree(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, exprtree) );
32637 
32638  /* invalidate curvature */
32640 
32641  return SCIP_OKAY;
32642 }
32643 
32644 /** sets a parameter of expression tree in the nonlinear row
32645  *
32646  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32647  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32648  *
32649  * @pre This method can be called if SCIP is in one of the following stages:
32650  * - \ref SCIP_STAGE_PRESOLVED
32651  * - \ref SCIP_STAGE_INITSOLVE
32652  * - \ref SCIP_STAGE_SOLVING
32653  */
32655  SCIP* scip, /**< SCIP data structure */
32656  SCIP_NLROW* nlrow, /**< NLP row */
32657  int paramidx, /**< index of parameter in expression tree */
32658  SCIP_Real paramval /**< new value of parameter in expression tree */
32659  )
32660 {
32661  SCIP_CALL( checkStage(scip, "SCIPsetNlRowExprtreeParam", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32662 
32663  SCIP_CALL( SCIPnlrowChgExprtreeParam(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, paramidx, paramval) );
32664 
32665  return SCIP_OKAY;
32666 }
32667 
32668 /** sets parameters of expression tree in the nonlinear row
32669  *
32670  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32671  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32672  *
32673  * @pre This method can be called if SCIP is in one of the following stages:
32674  * - \ref SCIP_STAGE_PRESOLVED
32675  * - \ref SCIP_STAGE_INITSOLVE
32676  * - \ref SCIP_STAGE_SOLVING
32677  */
32679  SCIP* scip, /**< SCIP data structure */
32680  SCIP_NLROW* nlrow, /**< NLP row */
32681  SCIP_Real* paramvals /**< new values of parameter in expression tree */
32682  )
32683 {
32684  SCIP_CALL( checkStage(scip, "SCIPsetNlRowExprtreeParams", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32685 
32686  SCIP_CALL( SCIPnlrowChgExprtreeParams(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, paramvals) );
32687 
32688  return SCIP_OKAY;
32689 }
32690 
32691 /** recalculates the activity of a nonlinear row in the last NLP solution
32692  *
32693  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32694  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32695  *
32696  * @pre This method can be called if SCIP is in one of the following stages:
32697  * - \ref SCIP_STAGE_PRESOLVED
32698  * - \ref SCIP_STAGE_INITSOLVE
32699  * - \ref SCIP_STAGE_SOLVING
32700  */
32702  SCIP* scip, /**< SCIP data structure */
32703  SCIP_NLROW* nlrow /**< NLP nonlinear row */
32704  )
32705 {
32706  SCIP_CALL( checkStage(scip, "SCIPrecalcNlRowNLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32707 
32708  if( scip->nlp == NULL )
32709  {
32710  SCIPerrorMessage("do not have NLP for computing NLP activity\n");
32711  return SCIP_INVALIDCALL;
32712  }
32713 
32714  SCIP_CALL( SCIPnlrowRecalcNLPActivity(nlrow, scip->set, scip->stat, scip->nlp) );
32715 
32716  return SCIP_OKAY;
32717 }
32718 
32719 /** returns the activity of a nonlinear row in the last NLP solution
32720  *
32721  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32722  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32723  *
32724  * @pre This method can be called if SCIP is in one of the following stages:
32725  * - \ref SCIP_STAGE_INITSOLVE
32726  * - \ref SCIP_STAGE_SOLVING
32727  */
32729  SCIP* scip, /**< SCIP data structure */
32730  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32731  SCIP_Real* activity /**< pointer to store activity value */
32732  )
32733 {
32734  SCIP_CALL( checkStage(scip, "SCIPgetNlRowNLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32735 
32736  if( scip->nlp == NULL )
32737  {
32738  SCIPerrorMessage("do not have NLP for computing NLP activity\n");
32739  return SCIP_INVALIDCALL;
32740  }
32741 
32742  SCIP_CALL( SCIPnlrowGetNLPActivity(nlrow, scip->set, scip->stat, scip->nlp, activity) );
32743 
32744  return SCIP_OKAY;
32745 }
32746 
32747 /** gives the feasibility of a nonlinear row in the last NLP solution: negative value means infeasibility
32748  *
32749  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32750  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32751  *
32752  * @pre This method can be called if SCIP is in one of the following stages:
32753  * - \ref SCIP_STAGE_INITSOLVE
32754  * - \ref SCIP_STAGE_SOLVING
32755  */
32757  SCIP* scip, /**< SCIP data structure */
32758  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32759  SCIP_Real* feasibility /**< pointer to store feasibility value */
32760  )
32761 {
32762  SCIP_CALL( checkStage(scip, "SCIPgetNlRowNLPFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32763 
32764  if( scip->nlp == NULL )
32765  {
32766  SCIPerrorMessage("do not have NLP for computing NLP feasibility\n");
32767  return SCIP_INVALIDCALL;
32768  }
32769 
32770  SCIP_CALL( SCIPnlrowGetNLPFeasibility(nlrow, scip->set, scip->stat, scip->nlp, feasibility) );
32771 
32772  return SCIP_OKAY;
32773 }
32774 
32775 /** recalculates the activity of a nonlinear row for the current pseudo solution
32776  *
32777  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32778  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32779  *
32780  * @pre This method can be called if SCIP is in one of the following stages:
32781  * - \ref SCIP_STAGE_INITSOLVE
32782  * - \ref SCIP_STAGE_SOLVING
32783  */
32785  SCIP* scip, /**< SCIP data structure */
32786  SCIP_NLROW* nlrow /**< NLP nonlinear row */
32787  )
32788 {
32789  SCIP_CALL( checkStage(scip, "SCIPrecalcNlRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32790 
32791  SCIP_CALL( SCIPnlrowRecalcPseudoActivity(nlrow, scip->set, scip->stat) );
32792 
32793  return SCIP_OKAY;
32794 }
32795 
32796 /** gives the activity of a nonlinear row for the current pseudo solution
32797  *
32798  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32799  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32800  *
32801  * @pre This method can be called if SCIP is in one of the following stages:
32802  * - \ref SCIP_STAGE_INITSOLVE
32803  * - \ref SCIP_STAGE_SOLVING
32804  */
32806  SCIP* scip, /**< SCIP data structure */
32807  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32808  SCIP_Real* pseudoactivity /**< pointer to store pseudo activity value */
32809  )
32810 {
32811  SCIP_CALL( checkStage(scip, "SCIPgetNlRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32812 
32813  SCIP_CALL( SCIPnlrowGetPseudoActivity(nlrow, scip->set, scip->stat, pseudoactivity) );
32814 
32815  return SCIP_OKAY;
32816 }
32817 
32818 /** gives the feasibility of a nonlinear row for the current pseudo solution: negative value means infeasibility
32819  *
32820  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32821  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32822  *
32823  * @pre This method can be called if SCIP is in one of the following stages:
32824  * - \ref SCIP_STAGE_INITSOLVE
32825  * - \ref SCIP_STAGE_SOLVING
32826  */
32828  SCIP* scip, /**< SCIP data structure */
32829  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32830  SCIP_Real* pseudofeasibility /**< pointer to store pseudo feasibility value */
32831  )
32832 {
32833  SCIP_CALL( checkStage(scip, "SCIPgetNlRowPseudoFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32834 
32835  SCIP_CALL( SCIPnlrowGetPseudoFeasibility(nlrow, scip->set, scip->stat, pseudofeasibility) );
32836 
32837  return SCIP_OKAY;
32838 }
32839 
32840 /** recalculates the activity of a nonlinear row in the last NLP or pseudo solution
32841  *
32842  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32843  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32844  *
32845  * @pre This method can be called if SCIP is in one of the following stages:
32846  * - \ref SCIP_STAGE_INITSOLVE
32847  * - \ref SCIP_STAGE_SOLVING
32848  */
32850  SCIP* scip, /**< SCIP data structure */
32851  SCIP_NLROW* nlrow /**< NLP nonlinear row */
32852  )
32853 {
32854  SCIP_CALL( checkStage(scip, "SCIPrecalcNlRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32855 
32856  if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
32857  {
32858  SCIP_CALL( SCIPnlrowRecalcNLPActivity(nlrow, scip->set, scip->stat, scip->nlp) );
32859  }
32860  else
32861  {
32862  SCIP_CALL( SCIPnlrowRecalcPseudoActivity(nlrow, scip->set, scip->stat) );
32863  }
32864 
32865  return SCIP_OKAY;
32866 }
32867 
32868 /** gives the activity of a nonlinear row in the last NLP or pseudo solution
32869  *
32870  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32871  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32872  *
32873  * @pre This method can be called if SCIP is in one of the following stages:
32874  * - \ref SCIP_STAGE_INITSOLVE
32875  * - \ref SCIP_STAGE_SOLVING
32876  */
32878  SCIP* scip, /**< SCIP data structure */
32879  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32880  SCIP_Real* activity /**< pointer to store activity value */
32881  )
32882 {
32883  SCIP_CALL( checkStage(scip, "SCIPgetNlRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32884 
32885  if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
32886  {
32887  SCIP_CALL( SCIPnlrowGetNLPActivity(nlrow, scip->set, scip->stat, scip->nlp, activity) );
32888  }
32889  else
32890  {
32891  SCIP_CALL( SCIPnlrowGetPseudoActivity(nlrow, scip->set, scip->stat, activity) );
32892  }
32893 
32894  return SCIP_OKAY;
32895 }
32896 
32897 /** gives the feasibility of a nonlinear row in the last NLP or pseudo solution
32898  *
32899  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32900  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32901  *
32902  * @pre This method can be called if SCIP is in one of the following stages:
32903  * - \ref SCIP_STAGE_INITSOLVE
32904  * - \ref SCIP_STAGE_SOLVING
32905  */
32907  SCIP* scip, /**< SCIP data structure */
32908  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32909  SCIP_Real* feasibility /**< pointer to store feasibility value */
32910  )
32911 {
32912  SCIP_CALL( checkStage(scip, "SCIPgetNlRowFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32913 
32914  if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
32915  {
32916  SCIP_CALL( SCIPnlrowGetNLPFeasibility(nlrow, scip->set, scip->stat, scip->nlp, feasibility) );
32917  }
32918  else
32919  {
32920  SCIP_CALL( SCIPnlrowGetPseudoFeasibility(nlrow, scip->set, scip->stat, feasibility) );
32921  }
32922 
32923  return SCIP_OKAY;
32924 }
32925 
32926 /** gives the activity of a nonlinear row for the given primal solution or NLP solution or pseudo solution
32927  *
32928  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32929  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32930  *
32931  * @pre This method can be called if SCIP is in one of the following stages:
32932  * - \ref SCIP_STAGE_INITSOLVE
32933  * - \ref SCIP_STAGE_SOLVING
32934  */
32936  SCIP* scip, /**< SCIP data structure */
32937  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32938  SCIP_SOL* sol, /**< primal CIP solution, or NULL for NLP solution of pseudo solution */
32939  SCIP_Real* activity /**< pointer to store activity value */
32940  )
32941 {
32942  SCIP_CALL( checkStage(scip, "SCIPgetNlRowSolActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32943 
32944  if( sol != NULL )
32945  {
32946  SCIP_CALL( SCIPnlrowGetSolActivity(nlrow, scip->set, scip->stat, sol, activity) );
32947  }
32948  else if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
32949  {
32950  SCIP_CALL( SCIPnlrowGetNLPActivity(nlrow, scip->set, scip->stat, scip->nlp, activity) );
32951  }
32952  else
32953  {
32954  SCIP_CALL( SCIPnlrowGetPseudoActivity(nlrow, scip->set, scip->stat, activity) );
32955  }
32956 
32957  return SCIP_OKAY;
32958 }
32959 
32960 /** gives the feasibility of a nonlinear row for the given primal solution
32961  *
32962  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32963  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32964  *
32965  * @pre This method can be called if SCIP is in one of the following stages:
32966  * - \ref SCIP_STAGE_INITSOLVE
32967  * - \ref SCIP_STAGE_SOLVING
32968  */
32970  SCIP* scip, /**< SCIP data structure */
32971  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32972  SCIP_SOL* sol, /**< primal CIP solution */
32973  SCIP_Real* feasibility /**< pointer to store feasibility value */
32974  )
32975 {
32976  SCIP_CALL( checkStage(scip, "SCIPgetNlRowSolFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32977 
32978  if( sol != NULL )
32979  {
32980  SCIP_CALL( SCIPnlrowGetSolFeasibility(nlrow, scip->set, scip->stat, sol, feasibility) );
32981  }
32982  else if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
32983  {
32984  SCIP_CALL( SCIPnlrowGetNLPFeasibility(nlrow, scip->set, scip->stat, scip->nlp, feasibility) );
32985  }
32986  else
32987  {
32988  SCIP_CALL( SCIPnlrowGetPseudoFeasibility(nlrow, scip->set, scip->stat, feasibility) );
32989  }
32990 
32991  return SCIP_OKAY;
32992 }
32993 
32994 /** gives the minimal and maximal activity of a nonlinear row w.r.t. the variable's bounds
32995  *
32996  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32997  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32998  *
32999  * @pre This method can be called if SCIP is in one of the following stages:
33000  * - \ref SCIP_STAGE_PRESOLVED
33001  * - \ref SCIP_STAGE_INITSOLVE
33002  * - \ref SCIP_STAGE_SOLVING
33003  */
33005  SCIP* scip, /**< SCIP data structure */
33006  SCIP_NLROW* nlrow, /**< NLP row */
33007  SCIP_Real* minactivity, /**< buffer to store minimal activity, or NULL */
33008  SCIP_Real* maxactivity /**< buffer to store maximal activity, or NULL */
33009  )
33010 {
33011  SCIP_CALL( checkStage(scip, "SCIPgetNlRowActivityBounds", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33012 
33013  SCIP_CALL( SCIPnlrowGetActivityBounds(nlrow, scip->set, scip->stat, minactivity, maxactivity) );
33014 
33015  return SCIP_OKAY;
33016 }
33017 
33018 /** output nonlinear row to file stream
33019  *
33020  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33021  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33022  *
33023  * @pre This method can be called if SCIP is in one of the following stages:
33024  * - \ref SCIP_STAGE_PRESOLVED
33025  * - \ref SCIP_STAGE_INITSOLVE
33026  * - \ref SCIP_STAGE_SOLVING
33027  */
33029  SCIP* scip, /**< SCIP data structure */
33030  SCIP_NLROW* nlrow, /**< NLP row */
33031  FILE* file /**< output file (or NULL for standard output) */
33032  )
33033 {
33034  assert(nlrow != NULL);
33035 
33036  SCIP_CALL( checkStage(scip, "SCIPprintNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33037 
33038  SCIP_CALL( SCIPnlrowPrint(nlrow, scip->messagehdlr, file) );
33039 
33040  return SCIP_OKAY;
33041 }
33042 
33043 /**@name Expression tree methods */
33044 /**@{ */
33045 
33046 /** translate from one value of infinity to another
33047  *
33048  * if val is >= infty1, then give infty2, else give val
33049  */
33050 #define infty2infty(infty1, infty2, val) (val >= infty1 ? infty2 : val)
33051 
33052 /** replaces array of variables in expression tree by corresponding transformed variables
33053  *
33054  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33055  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33056  *
33057  * @pre This method can be called if @p scip is in one of the following stages:
33058  * - \ref SCIP_STAGE_TRANSFORMING
33059  * - \ref SCIP_STAGE_TRANSFORMED
33060  * - \ref SCIP_STAGE_INITPRESOLVE
33061  * - \ref SCIP_STAGE_PRESOLVING
33062  * - \ref SCIP_STAGE_EXITPRESOLVE
33063  * - \ref SCIP_STAGE_PRESOLVED
33064  * - \ref SCIP_STAGE_INITSOLVE
33065  * - \ref SCIP_STAGE_SOLVING
33066  * - \ref SCIP_STAGE_SOLVED
33067  * - \ref SCIP_STAGE_EXITSOLVE
33068  * - \ref SCIP_STAGE_FREETRANS
33069  *
33070  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33071  */
33073  SCIP* scip, /**< SCIP data structure */
33074  SCIP_EXPRTREE* tree /**< expression tree */
33075  )
33076 {
33077  assert(scip != NULL);
33078  assert(tree != NULL);
33079 
33080  SCIP_CALL( checkStage(scip, "SCIPgetExprtreeTransformedVars", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
33081 
33082  if( SCIPexprtreeGetNVars(tree) == 0 )
33083  return SCIP_OKAY;
33084 
33086 
33087  return SCIP_OKAY;
33088 }
33089 
33090 /** evaluates an expression tree for a primal solution or LP solution
33091  *
33092  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33093  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33094  *
33095  * @pre This method can be called if @p scip is in one of the following stages:
33096  * - \ref SCIP_STAGE_PROBLEM
33097  * - \ref SCIP_STAGE_TRANSFORMING
33098  * - \ref SCIP_STAGE_TRANSFORMED
33099  * - \ref SCIP_STAGE_INITPRESOLVE
33100  * - \ref SCIP_STAGE_PRESOLVING
33101  * - \ref SCIP_STAGE_EXITPRESOLVE
33102  * - \ref SCIP_STAGE_PRESOLVED
33103  * - \ref SCIP_STAGE_INITSOLVE
33104  * - \ref SCIP_STAGE_SOLVING
33105  * - \ref SCIP_STAGE_SOLVED
33106  * - \ref SCIP_STAGE_EXITSOLVE
33107  * - \ref SCIP_STAGE_FREETRANS
33108  *
33109  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33110  */
33112  SCIP* scip, /**< SCIP data structure */
33113  SCIP_EXPRTREE* tree, /**< expression tree */
33114  SCIP_SOL* sol, /**< a solution, or NULL for current LP solution */
33115  SCIP_Real* val /**< buffer to store value */
33116  )
33117 {
33118  SCIP_Real* varvals;
33119  int nvars;
33120 
33121  assert(scip != NULL);
33122  assert(tree != NULL);
33123  assert(val != NULL);
33124 
33125  SCIP_CALL( checkStage(scip, "SCIPevalExprtreeSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
33126 
33127  nvars = SCIPexprtreeGetNVars(tree);
33128 
33129  if( nvars == 0 )
33130  {
33131  SCIP_CALL( SCIPexprtreeEval(tree, NULL, val) );
33132  return SCIP_OKAY;
33133  }
33134 
33135  SCIP_CALL( SCIPallocBufferArray(scip, &varvals, nvars) );
33136  SCIP_CALL( SCIPgetSolVals(scip, sol, nvars, SCIPexprtreeGetVars(tree), varvals) );
33137 
33138  SCIP_CALL( SCIPexprtreeEval(tree, varvals, val) );
33139 
33140  SCIPfreeBufferArray(scip, &varvals);
33141 
33142  return SCIP_OKAY;
33143 }
33144 
33145 /** evaluates an expression tree w.r.t. current global bounds
33146  *
33147  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33148  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33149  *
33150  * @pre This method can be called if @p scip is in one of the following stages:
33151  * - \ref SCIP_STAGE_PROBLEM
33152  * - \ref SCIP_STAGE_TRANSFORMING
33153  * - \ref SCIP_STAGE_TRANSFORMED
33154  * - \ref SCIP_STAGE_INITPRESOLVE
33155  * - \ref SCIP_STAGE_PRESOLVING
33156  * - \ref SCIP_STAGE_EXITPRESOLVE
33157  * - \ref SCIP_STAGE_PRESOLVED
33158  * - \ref SCIP_STAGE_INITSOLVE
33159  * - \ref SCIP_STAGE_SOLVING
33160  * - \ref SCIP_STAGE_SOLVED
33161  * - \ref SCIP_STAGE_EXITSOLVE
33162  * - \ref SCIP_STAGE_FREETRANS
33163  *
33164  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33165  */
33167  SCIP* scip, /**< SCIP data structure */
33168  SCIP_EXPRTREE* tree, /**< expression tree */
33169  SCIP_Real infinity, /**< value to use for infinity */
33170  SCIP_INTERVAL* val /**< buffer to store result */
33171  )
33172 {
33173  SCIP_INTERVAL* varvals;
33174  SCIP_VAR** vars;
33175  int nvars;
33176  int i;
33177 
33178  assert(scip != NULL);
33179  assert(tree != NULL);
33180  assert(val != NULL);
33181 
33182  SCIP_CALL( checkStage(scip, "SCIPevalExprtreeGlobalBounds", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
33183 
33184  nvars = SCIPexprtreeGetNVars(tree);
33185 
33186  if( nvars == 0 )
33187  {
33188  SCIP_CALL( SCIPexprtreeEvalInt(tree, infinity, NULL, val) );
33189  return SCIP_OKAY;
33190  }
33191 
33192  vars = SCIPexprtreeGetVars(tree);
33193  assert(vars != NULL);
33194 
33195  SCIP_CALL( SCIPallocBufferArray(scip, &varvals, nvars) );
33196  for( i = 0; i < nvars; ++i )
33197  {
33198  SCIPintervalSetBounds(&varvals[i],
33199  -infty2infty(SCIPinfinity(scip), infinity, -SCIPvarGetLbGlobal(vars[i])), /*lint !e666*/
33200  infty2infty(SCIPinfinity(scip), infinity, SCIPvarGetUbGlobal(vars[i]))); /*lint !e666*/
33201  }
33202 
33203  SCIP_CALL( SCIPexprtreeEvalInt(tree, infinity, varvals, val) );
33204 
33205  SCIPfreeBufferArray(scip, &varvals);
33206 
33207  return SCIP_OKAY;
33208 }
33209 
33210 /** evaluates an expression tree w.r.t. current local bounds
33211  *
33212  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33213  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33214  *
33215  * @pre This method can be called if @p scip is in one of the following stages:
33216  * - \ref SCIP_STAGE_PROBLEM
33217  * - \ref SCIP_STAGE_TRANSFORMING
33218  * - \ref SCIP_STAGE_TRANSFORMED
33219  * - \ref SCIP_STAGE_INITPRESOLVE
33220  * - \ref SCIP_STAGE_PRESOLVING
33221  * - \ref SCIP_STAGE_EXITPRESOLVE
33222  * - \ref SCIP_STAGE_PRESOLVED
33223  * - \ref SCIP_STAGE_INITSOLVE
33224  * - \ref SCIP_STAGE_SOLVING
33225  * - \ref SCIP_STAGE_SOLVED
33226  * - \ref SCIP_STAGE_EXITSOLVE
33227  * - \ref SCIP_STAGE_FREETRANS
33228  *
33229  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33230  */
33232  SCIP* scip, /**< SCIP data structure */
33233  SCIP_EXPRTREE* tree, /**< expression tree */
33234  SCIP_Real infinity, /**< value to use for infinity */
33235  SCIP_INTERVAL* val /**< buffer to store result */
33236  )
33237 {
33238  SCIP_INTERVAL* varvals;
33239  SCIP_VAR** vars;
33240  int nvars;
33241  int i;
33242 
33243  assert(scip != NULL);
33244  assert(tree != NULL);
33245  assert(val != NULL);
33246 
33247  SCIP_CALL( checkStage(scip, "SCIPevalExprtreeLocalBounds", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
33248 
33249  nvars = SCIPexprtreeGetNVars(tree);
33250 
33251  if( nvars == 0 )
33252  {
33253  SCIP_CALL( SCIPexprtreeEvalInt(tree, infinity, NULL, val) );
33254  return SCIP_OKAY;
33255  }
33256 
33257  vars = SCIPexprtreeGetVars(tree);
33258  assert(vars != NULL);
33259 
33260  SCIP_CALL( SCIPallocBufferArray(scip, &varvals, nvars) );
33261  for( i = 0; i < nvars; ++i )
33262  {
33263  /* due to numerics, the lower bound on a variable in SCIP can be slightly higher than the upper bound
33264  * in this case, we take the most conservative way and switch the bounds
33265  * further, we translate SCIP's value for infinity to the users value for infinity
33266  */
33267  SCIPintervalSetBounds(&varvals[i],
33268  -infty2infty(SCIPinfinity(scip), infinity, -MIN(SCIPvarGetLbLocal(vars[i]), SCIPvarGetUbLocal(vars[i]))), /*lint !e666*/
33269  infty2infty(SCIPinfinity(scip), infinity, MAX(SCIPvarGetLbLocal(vars[i]), SCIPvarGetUbLocal(vars[i])))); /*lint !e666*/
33270  }
33271 
33272  SCIP_CALL( SCIPexprtreeEvalInt(tree, infinity, varvals, val) );
33273 
33274  SCIPfreeBufferArray(scip, &varvals);
33275 
33276  return SCIP_OKAY;
33277 }
33278 
33279 #undef infty2infty
33280 
33281 /**@} */
33282 
33283 /*
33284  * nonlinear methods
33285  */
33286 
33287 /**@name Nonlinear Methods */
33288 /**@{ */
33289 
33290 /** computes coefficients of linearization of a square term in a reference point */
33292  SCIP* scip, /**< SCIP data structure */
33293  SCIP_Real sqrcoef, /**< coefficient of square term */
33294  SCIP_Real refpoint, /**< point where to linearize */
33295  SCIP_Bool isint, /**< whether corresponding variable is a discrete variable, and thus linearization could be moved */
33296  SCIP_Real* lincoef, /**< buffer to add coefficient of linearization */
33297  SCIP_Real* linconstant, /**< buffer to add constant of linearization */
33298  SCIP_Bool* success /**< buffer to set to FALSE if linearization has failed due to large numbers */
33299  )
33300 {
33301  assert(scip != NULL);
33302  assert(lincoef != NULL);
33303  assert(linconstant != NULL);
33304  assert(success != NULL);
33305 
33306  if( sqrcoef == 0.0 )
33307  return;
33308 
33309  if( SCIPisInfinity(scip, REALABS(refpoint)) )
33310  {
33311  *success = FALSE;
33312  return;
33313  }
33314 
33315  if( !isint || SCIPisIntegral(scip, refpoint) )
33316  {
33317  SCIP_Real tmp;
33318 
33319  /* sqrcoef * x^2 -> tangent in refpoint = sqrcoef * 2 * refpoint * (x - refpoint) */
33320 
33321  tmp = sqrcoef * refpoint;
33322 
33323  if( SCIPisInfinity(scip, 2.0 * REALABS(tmp)) )
33324  {
33325  *success = FALSE;
33326  return;
33327  }
33328 
33329  *lincoef += 2.0 * tmp;
33330  tmp *= refpoint;
33331  *linconstant -= tmp;
33332  }
33333  else
33334  {
33335  /* sqrcoef * x^2 -> secant between f=floor(refpoint) and f+1 = sqrcoef * (f^2 + ((f+1)^2 - f^2) * (x-f))
33336  * = sqrcoef * (-f*(f+1) + (2*f+1)*x)
33337  */
33338  SCIP_Real f;
33339  SCIP_Real coef;
33340  SCIP_Real constant;
33341 
33342  f = SCIPfloor(scip, refpoint);
33343 
33344  coef = sqrcoef * (2.0 * f + 1.0);
33345  constant = -sqrcoef * f * (f + 1.0);
33346 
33347  if( SCIPisInfinity(scip, REALABS(coef)) || SCIPisInfinity(scip, REALABS(constant)) )
33348  {
33349  *success = FALSE;
33350  return;
33351  }
33352 
33353  *lincoef += coef;
33354  *linconstant += constant;
33355  }
33356 }
33357 
33358 /** computes coefficients of secant of a square term */
33360  SCIP* scip, /**< SCIP data structure */
33361  SCIP_Real sqrcoef, /**< coefficient of square term */
33362  SCIP_Real lb, /**< lower bound on variable */
33363  SCIP_Real ub, /**< upper bound on variable */
33364  SCIP_Real refpoint, /**< point for which to compute value of linearization */
33365  SCIP_Real* lincoef, /**< buffer to add coefficient of secant */
33366  SCIP_Real* linconstant, /**< buffer to add constant of secant */
33367  SCIP_Bool* success /**< buffer to set to FALSE if secant has failed due to large numbers or unboundedness */
33368  )
33369 {
33370  SCIP_Real coef;
33371  SCIP_Real constant;
33372 
33373  assert(scip != NULL);
33374  assert(!SCIPisInfinity(scip, lb));
33375  assert(!SCIPisInfinity(scip, -ub));
33376  assert(SCIPisLE(scip, lb, ub));
33377  assert(SCIPisLE(scip, lb, refpoint));
33378  assert(SCIPisGE(scip, ub, refpoint));
33379  assert(lincoef != NULL);
33380  assert(linconstant != NULL);
33381  assert(success != NULL);
33382 
33383  if( sqrcoef == 0.0 )
33384  return;
33385 
33386  if( SCIPisInfinity(scip, -lb) || SCIPisInfinity(scip, ub) )
33387  {
33388  /* unboundedness */
33389  *success = FALSE;
33390  return;
33391  }
33392 
33393  /* sqrcoef * x^2 -> sqrcoef * (lb * lb + (ub*ub - lb*lb)/(ub-lb) * (x-lb)) = sqrcoef * (lb*lb + (ub+lb)*(x-lb))
33394  * = sqrcoef * ((lb+ub)*x - lb*ub)
33395  */
33396  coef = sqrcoef * (lb + ub);
33397  constant = -sqrcoef * lb * ub;
33398  if( SCIPisInfinity(scip, REALABS(coef)) || SCIPisInfinity(scip, REALABS(constant)) )
33399  {
33400  *success = FALSE;
33401  return;
33402  }
33403 
33404  *lincoef += coef;
33405  *linconstant += constant;
33406 }
33407 
33408 /** computes coefficients of linearization of a bilinear term in a reference point */
33410  SCIP* scip, /**< SCIP data structure */
33411  SCIP_Real bilincoef, /**< coefficient of bilinear term */
33412  SCIP_Real refpointx, /**< point where to linearize first variable */
33413  SCIP_Real refpointy, /**< point where to linearize second variable */
33414  SCIP_Real* lincoefx, /**< buffer to add coefficient of first variable in linearization */
33415  SCIP_Real* lincoefy, /**< buffer to add coefficient of second variable in linearization */
33416  SCIP_Real* linconstant, /**< buffer to add constant of linearization */
33417  SCIP_Bool* success /**< buffer to set to FALSE if linearization has failed due to large numbers */
33418  )
33419 {
33420  SCIP_Real constant;
33421 
33422  assert(scip != NULL);
33423  assert(lincoefx != NULL);
33424  assert(lincoefy != NULL);
33425  assert(linconstant != NULL);
33426  assert(success != NULL);
33427 
33428  if( bilincoef == 0.0 )
33429  return;
33430 
33431  if( SCIPisInfinity(scip, REALABS(refpointx)) || SCIPisInfinity(scip, REALABS(refpointy)) )
33432  {
33433  *success = FALSE;
33434  return;
33435  }
33436 
33437  /* bilincoef * x * y -> bilincoef * (refpointx * refpointy + refpointy * (x - refpointx) + refpointx * (y - refpointy))
33438  * = -bilincoef * refpointx * refpointy + bilincoef * refpointy * x + bilincoef * refpointx * y
33439  */
33440 
33441  constant = -bilincoef * refpointx * refpointy;
33442 
33443  if( SCIPisInfinity(scip, REALABS(bilincoef * refpointx)) || SCIPisInfinity(scip, REALABS(bilincoef * refpointy))
33444  || SCIPisInfinity(scip, REALABS(constant)) )
33445  {
33446  *success = FALSE;
33447  return;
33448  }
33449 
33450  *lincoefx += bilincoef * refpointy;
33451  *lincoefy += bilincoef * refpointx;
33452  *linconstant += constant;
33453 }
33454 
33455 /** computes coefficients of McCormick under- or overestimation of a bilinear term */
33457  SCIP* scip, /**< SCIP data structure */
33458  SCIP_Real bilincoef, /**< coefficient of bilinear term */
33459  SCIP_Real lbx, /**< lower bound on first variable */
33460  SCIP_Real ubx, /**< upper bound on first variable */
33461  SCIP_Real refpointx, /**< reference point for first variable */
33462  SCIP_Real lby, /**< lower bound on second variable */
33463  SCIP_Real uby, /**< upper bound on second variable */
33464  SCIP_Real refpointy, /**< reference point for second variable */
33465  SCIP_Bool overestimate, /**< whether to compute an overestimator instead of an underestimator */
33466  SCIP_Real* lincoefx, /**< buffer to add coefficient of first variable in linearization */
33467  SCIP_Real* lincoefy, /**< buffer to add coefficient of second variable in linearization */
33468  SCIP_Real* linconstant, /**< buffer to add constant of linearization */
33469  SCIP_Bool* success /**< buffer to set to FALSE if linearization has failed due to large numbers */
33470  )
33471 {
33472  SCIP_Real constant;
33473  SCIP_Real coefx;
33474  SCIP_Real coefy;
33475 
33476  assert(scip != NULL);
33477  assert(!SCIPisInfinity(scip, lbx));
33478  assert(!SCIPisInfinity(scip, -ubx));
33479  assert(!SCIPisInfinity(scip, lby));
33480  assert(!SCIPisInfinity(scip, -uby));
33481  assert(SCIPisLE(scip, lbx, ubx));
33482  assert(SCIPisLE(scip, lby, uby));
33483  assert(SCIPisLE(scip, lbx, refpointx));
33484  assert(SCIPisGE(scip, ubx, refpointx));
33485  assert(SCIPisLE(scip, lby, refpointy));
33486  assert(SCIPisGE(scip, uby, refpointy));
33487  assert(lincoefx != NULL);
33488  assert(lincoefy != NULL);
33489  assert(linconstant != NULL);
33490  assert(success != NULL);
33491 
33492  if( bilincoef == 0.0 )
33493  return;
33494 
33495  if( overestimate )
33496  bilincoef = -bilincoef;
33497 
33498  if( SCIPisRelEQ(scip, lbx, ubx) && SCIPisRelEQ(scip, lby, uby) )
33499  {
33500  /* both x and y are mostly fixed */
33501  SCIP_Real cand1;
33502  SCIP_Real cand2;
33503  SCIP_Real cand3;
33504  SCIP_Real cand4;
33505 
33506  coefx = 0.0;
33507  coefy = 0.0;
33508 
33509  /* estimate x * y by constant */
33510  cand1 = lbx * lby;
33511  cand2 = lbx * uby;
33512  cand3 = ubx * lby;
33513  cand4 = ubx * uby;
33514 
33515  /* take most conservative value for underestimator */
33516  if( bilincoef < 0.0 )
33517  constant = bilincoef * MAX( MAX(cand1, cand2), MAX(cand3, cand4) );
33518  else
33519  constant = bilincoef * MIN( MIN(cand1, cand2), MIN(cand3, cand4) );
33520  }
33521  else if( bilincoef > 0.0 )
33522  {
33523  /* either x or y is not fixed and coef > 0.0 */
33524  if( !SCIPisInfinity(scip, -lbx) && !SCIPisInfinity(scip, -lby) &&
33525  (SCIPisInfinity(scip, ubx) || SCIPisInfinity(scip, uby)
33526  || (uby - refpointy) * (ubx - refpointx) >= (refpointy - lby) * (refpointx - lbx)) )
33527  {
33528  if( SCIPisRelEQ(scip, lbx, ubx) )
33529  {
33530  /* x*y = lbx * y + (x-lbx) * y >= lbx * y + (x-lbx) * lby >= lbx * y + min{(ubx-lbx) * lby, 0 * lby} */
33531  coefx = 0.0;
33532  coefy = bilincoef * lbx;
33533  constant = bilincoef * (lby < 0.0 ? (ubx-lbx) * lby : 0.0);
33534  }
33535  else if( SCIPisRelEQ(scip, lby, uby) )
33536  {
33537  /* x*y = lby * x + (y-lby) * x >= lby * x + (y-lby) * lbx >= lby * x + min{(uby-lby) * lbx, 0 * lbx} */
33538  coefx = bilincoef * lby;
33539  coefy = 0.0;
33540  constant = bilincoef * (lbx < 0.0 ? (uby-lby) * lbx : 0.0);
33541  }
33542  else
33543  {
33544  coefx = bilincoef * lby;
33545  coefy = bilincoef * lbx;
33546  constant = -bilincoef * lbx * lby;
33547  }
33548  }
33549  else if( !SCIPisInfinity(scip, ubx) && !SCIPisInfinity(scip, uby) )
33550  {
33551  if( SCIPisRelEQ(scip, lbx, ubx) )
33552  {
33553  /* x*y = ubx * y + (x-ubx) * y >= ubx * y + (x-ubx) * uby >= ubx * y + min{(lbx-ubx) * uby, 0 * uby} */
33554  coefx = 0.0;
33555  coefy = bilincoef * ubx;
33556  constant = bilincoef * (uby > 0.0 ? (lbx-ubx) * uby : 0.0);
33557  }
33558  else if( SCIPisRelEQ(scip, lby, uby) )
33559  {
33560  /* x*y = uby * x + (y-uby) * x >= uby * x + (y-uby) * ubx >= uby * x + min{(lby-uby) * ubx, 0 * ubx} */
33561  coefx = bilincoef * uby;
33562  coefy = 0.0;
33563  constant = bilincoef * (ubx > 0.0 ? (lby-uby) * ubx : 0.0);
33564  }
33565  else
33566  {
33567  coefx = bilincoef * uby;
33568  coefy = bilincoef * ubx;
33569  constant = -bilincoef * ubx * uby;
33570  }
33571  }
33572  else
33573  {
33574  *success = FALSE;
33575  return;
33576  }
33577  }
33578  else
33579  {
33580  /* either x or y is not fixed and coef < 0.0 */
33581  if( !SCIPisInfinity(scip, ubx) && !SCIPisInfinity(scip, -lby) &&
33582  (SCIPisInfinity(scip, -lbx) || SCIPisInfinity(scip, uby)
33583  || (ubx - lbx) * (refpointy - lby) <= (uby - lby) * (refpointx - lbx)) )
33584  {
33585  if( SCIPisRelEQ(scip, lbx, ubx) )
33586  {
33587  /* x*y = ubx * y + (x-ubx) * y <= ubx * y + (x-ubx) * lby <= ubx * y + max{(lbx-ubx) * lby, 0 * lby} */
33588  coefx = 0.0;
33589  coefy = bilincoef * ubx;
33590  constant = bilincoef * (lby < 0.0 ? (lbx - ubx) * lby : 0.0);
33591  }
33592  else if( SCIPisRelEQ(scip, lby, uby) )
33593  {
33594  /* x*y = lby * x + (y-lby) * x <= lby * x + (y-lby) * ubx <= lby * x + max{(uby-lby) * ubx, 0 * ubx} */
33595  coefx = bilincoef * lby;
33596  coefy = 0.0;
33597  constant = bilincoef * (ubx > 0.0 ? (uby - lby) * ubx : 0.0);
33598  }
33599  else
33600  {
33601  coefx = bilincoef * lby;
33602  coefy = bilincoef * ubx;
33603  constant = -bilincoef * ubx * lby;
33604  }
33605  }
33606  else if( !SCIPisInfinity(scip, -lbx) && !SCIPisInfinity(scip, uby) )
33607  {
33608  if( SCIPisRelEQ(scip, lbx, ubx) )
33609  {
33610  /* x*y = lbx * y + (x-lbx) * y <= lbx * y + (x-lbx) * uby <= lbx * y + max{(ubx-lbx) * uby, 0 * uby} */
33611  coefx = 0.0;
33612  coefy = bilincoef * lbx;
33613  constant = bilincoef * (uby > 0.0 ? (ubx-lbx) * uby : 0.0);
33614  }
33615  else if( SCIPisRelEQ(scip, lby, uby) )
33616  {
33617  /* x*y = uby * x + (y-uby) * x <= uby * x + (y-uby) * lbx <= uby * x + max{(lby-uby) * lbx, 0 * lbx} */
33618  coefx = bilincoef * uby;
33619  coefy = 0.0;
33620  constant = bilincoef * (lbx < 0.0 ? (lby-uby) * lbx : 0.0);
33621  }
33622  else
33623  {
33624  coefx = bilincoef * uby;
33625  coefy = bilincoef * lbx;
33626  constant = -bilincoef * lbx * uby;
33627  }
33628  }
33629  else
33630  {
33631  *success = FALSE;
33632  return;
33633  }
33634  }
33635 
33636  if( SCIPisInfinity(scip, REALABS(coefx)) || SCIPisInfinity(scip, REALABS(coefy))
33637  || SCIPisInfinity(scip, REALABS(constant)) )
33638  {
33639  *success = FALSE;
33640  return;
33641  }
33642 
33643  if( overestimate )
33644  {
33645  coefx = -coefx;
33646  coefy = -coefy;
33647  constant = -constant;
33648  }
33649 
33650  SCIPdebugMsg(scip, "%.20g * x[%.20g,%.20g] * y[%.20g,%.20g] %c= %.20g * x %+.20g * y %+.20g\n", bilincoef, lbx, ubx,
33651  lby, uby, overestimate ? '<' : '>', coefx, coefy, constant);
33652 
33653  *lincoefx += coefx;
33654  *lincoefy += coefy;
33655  *linconstant += constant;
33656 }
33657 
33658 
33659 /** computes coefficients of linearization of a bilinear term in a reference point when given a linear inequality
33660  * involving only the variables of the bilinear term
33661  *
33662  * @note the formulas are extracted from "Convex envelopes of bivariate functions through the solution of KKT systems"
33663  * by Marco Locatelli
33664  */
33666  SCIP* scip, /**< SCIP data structure */
33667  SCIP_Real bilincoef, /**< coefficient of bilinear term */
33668  SCIP_Real lbx, /**< lower bound on first variable */
33669  SCIP_Real ubx, /**< upper bound on first variable */
33670  SCIP_Real refpointx, /**< reference point for first variable */
33671  SCIP_Real lby, /**< lower bound on second variable */
33672  SCIP_Real uby, /**< upper bound on second variable */
33673  SCIP_Real refpointy, /**< reference point for second variable */
33674  SCIP_Bool overestimate, /**< whether to compute an overestimator instead of an underestimator */
33675  SCIP_Real xcoef, /**< x coefficient of linear inequality; must be in {-1,0,1} */
33676  SCIP_Real ycoef, /**< y coefficient of linear inequality */
33677  SCIP_Real constant, /**< constant of linear inequality */
33678  SCIP_Real* RESTRICT lincoefx, /**< buffer to store coefficient of first variable in linearization */
33679  SCIP_Real* RESTRICT lincoefy, /**< buffer to store coefficient of second variable in linearization */
33680  SCIP_Real* RESTRICT linconstant, /**< buffer to store constant of linearization */
33681  SCIP_Bool* RESTRICT success /**< buffer to store whether linearization was successful */
33682  )
33683 {
33684  SCIP_Real xs[2] = {lbx, ubx};
33685  SCIP_Real ys[2] = {lby, uby};
33686  SCIP_Real minx;
33687  SCIP_Real maxx;
33688  SCIP_Real miny;
33689  SCIP_Real maxy;
33690  SCIP_Real tmp;
33691  SCIP_Real mj;
33692  SCIP_Real qj;
33693  SCIP_Real xj;
33694  SCIP_Real yj;
33695  SCIP_Real vx;
33696  SCIP_Real vy;
33697  int n;
33698  int i;
33699 
33700  assert(scip != NULL);
33701  assert(!SCIPisInfinity(scip, lbx));
33702  assert(!SCIPisInfinity(scip, -ubx));
33703  assert(!SCIPisInfinity(scip, lby));
33704  assert(!SCIPisInfinity(scip, -uby));
33705  assert(SCIPisLE(scip, lbx, ubx));
33706  assert(SCIPisLE(scip, lby, uby));
33707  assert(SCIPisLE(scip, lbx, refpointx));
33708  assert(SCIPisGE(scip, ubx, refpointx));
33709  assert(SCIPisLE(scip, lby, refpointy));
33710  assert(SCIPisGE(scip, uby, refpointy));
33711  assert(lincoefx != NULL);
33712  assert(lincoefy != NULL);
33713  assert(linconstant != NULL);
33714  assert(success != NULL);
33715  assert(xcoef == 0.0 || xcoef == -1.0 || xcoef == 1.0); /*lint !e777*/
33716  assert(ycoef != SCIP_INVALID && ycoef != 0.0); /*lint !e777*/
33717  assert(constant != SCIP_INVALID); /*lint !e777*/
33718 
33719  *success = FALSE;
33720  *lincoefx = SCIP_INVALID;
33721  *lincoefy = SCIP_INVALID;
33722  *linconstant = SCIP_INVALID;
33723 
33724  /* reference point does not satisfy linear inequality */
33725  if( SCIPisFeasGT(scip, xcoef * refpointx - ycoef * refpointy - constant, 0.0) )
33726  return;
33727 
33728  /* compute minimal and maximal bounds on x and y for accepting the reference point */
33729  minx = lbx + 0.01 * (ubx-lbx);
33730  maxx = ubx - 0.01 * (ubx-lbx);
33731  miny = lby + 0.01 * (uby-lby);
33732  maxy = uby - 0.01 * (uby-lby);
33733 
33734  /* check whether the reference point is in [minx,maxx]x[miny,maxy] */
33735  if( SCIPisLE(scip, refpointx, minx) || SCIPisGE(scip, refpointx, maxx)
33736  || SCIPisLE(scip, refpointy, miny) || SCIPisGE(scip, refpointy, maxy) )
33737  return;
33738 
33739  /* always consider xy without the bilinear coefficient */
33740  if( bilincoef < 0.0 )
33741  overestimate = !overestimate;
33742 
33743  /* we use same notation as in "Convex envelopes of bivariate functions through the solution of KKT systems", 2016 */
33744  mj = xcoef / ycoef;
33745  qj = -constant / ycoef;
33746 
33747  /* mj > 0 => underestimate; mj < 0 => overestimate */
33748  if( SCIPisNegative(scip, mj) != overestimate )
33749  return;
33750 
33751  /* get the corner point that satisfies the linear inequality xcoef*x <= ycoef*y + constant */
33752  if( !overestimate )
33753  {
33754  ys[0] = uby;
33755  ys[1] = lby;
33756  }
33757 
33758  vx = SCIP_INVALID;
33759  vy = SCIP_INVALID;
33760  n = 0;
33761  for( i = 0; i < 2; ++i )
33762  {
33763  SCIP_Real activity = xcoef * xs[i] - ycoef * ys[i] - constant;
33764  if( SCIPisLE(scip, activity, 0.0) )
33765  {
33766  /* corner point is satisfies inequality */
33767  vx = xs[i];
33768  vy = ys[i];
33769  }
33770  else if( SCIPisFeasGT(scip, activity, 0.0) )
33771  /* corner point is clearly cut off */
33772  ++n;
33773  }
33774 
33775  /* skip if no corner point satisfies the inequality or if no corner point is cut off (that is, all corner points satisfy the inequality almost [1e-9..1e-6]) */
33776  if( n != 1 || vx == SCIP_INVALID || vy == SCIP_INVALID ) /*lint !e777*/
33777  return;
33778 
33779  tmp = mj*(refpointx - vx) + vy - refpointy;
33780  if( SCIPisZero(scip, tmp) )
33781  return;
33782 
33783  /* (xj,yj) is the projection onto the line xcoef*x = ycoef*y + constant */
33784  xj = (refpointx*(vy - qj) - vx*(refpointy - qj)) / tmp;
33785  yj = mj * xj + qj;
33786 
33787  assert(SCIPisFeasEQ(scip, xcoef*xj - ycoef*yj - constant, 0.0));
33788 
33789  /* check whether the projection is in [minx,maxx] x [miny,maxy]; this avoids numerical difficulties when the
33790  * projection is close to the variable bounds
33791  */
33792  if( SCIPisLE(scip, xj, minx) || SCIPisGE(scip, xj, maxx) || SCIPisLE(scip, yj, miny) || SCIPisGE(scip, yj, maxy) )
33793  return;
33794 
33795  assert(vy - mj*vx - qj != 0.0);
33796 
33797  *lincoefy = (mj*SQR(xj) - 2.0*mj*vx*xj - qj*vx + vx*vy) / (vy - mj*vx - qj);
33798  *lincoefx = 2.0*mj*xj + qj - mj*(*lincoefy);
33799  *linconstant = -mj*SQR(xj) - (*lincoefy)*qj;
33800 
33801  /* consider the bilinear coefficient */
33802  *lincoefx *= bilincoef;
33803  *lincoefy *= bilincoef;
33804  *linconstant *= bilincoef;
33805 
33806  /* cut needs to be tight at (vx,vy) and (xj,yj); otherwise we consider the cut to be numerically bad */
33807  *success = SCIPisFeasEQ(scip, (*lincoefx)*vx + (*lincoefy)*vy + (*linconstant), bilincoef*vx*vy)
33808  && SCIPisFeasEQ(scip, (*lincoefx)*xj + (*lincoefy)*yj + (*linconstant), bilincoef*xj*yj);
33809 
33810 #ifndef NDEBUG
33811  {
33812  SCIP_Real activity = (*lincoefx)*refpointx + (*lincoefy)*refpointy + (*linconstant);
33813 
33814  /* cut needs to under- or overestimate the bilinear term at the reference point */
33815  if( bilincoef < 0.0 )
33816  overestimate = !overestimate;
33817 
33818  if( overestimate )
33819  assert(SCIPisFeasGE(scip, activity, bilincoef*refpointx*refpointy));
33820  else
33821  assert(SCIPisFeasLE(scip, activity, bilincoef*refpointx*refpointy));
33822  }
33823 #endif
33824 }
33825 
33826 /** helper function to compute the convex envelope of a bilinear term when two linear inequalities are given; we
33827  * use the same notation and formulas as in Locatelli 2016
33828  */
33829 static
33831  SCIP* scip, /**< SCIP data structure */
33832  SCIP_Real x, /**< reference point for x */
33833  SCIP_Real y, /**< reference point for y */
33834  SCIP_Real mi, /**< coefficient of x in the first linear inequality */
33835  SCIP_Real qi, /**< constant in the first linear inequality */
33836  SCIP_Real mj, /**< coefficient of x in the second linear inequality */
33837  SCIP_Real qj, /**< constant in the second linear inequality */
33838  SCIP_Real* RESTRICT xi, /**< buffer to store x coordinate of the first point */
33839  SCIP_Real* RESTRICT yi, /**< buffer to store y coordinate of the first point */
33840  SCIP_Real* RESTRICT xj, /**< buffer to store x coordinate of the second point */
33841  SCIP_Real* RESTRICT yj, /**< buffer to store y coordinate of the second point */
33842  SCIP_Real* RESTRICT xcoef, /**< buffer to store the x coefficient of the envelope */
33843  SCIP_Real* RESTRICT ycoef, /**< buffer to store the y coefficient of the envelope */
33844  SCIP_Real* RESTRICT constant /**< buffer to store the constant of the envelope */
33845  )
33846 {
33847  assert(xi != NULL);
33848  assert(yi != NULL);
33849  assert(xj != NULL);
33850  assert(yj != NULL);
33851  assert(xcoef != NULL);
33852  assert(ycoef != NULL);
33853  assert(constant != NULL);
33854 
33855  if( SCIPisEQ(scip, mi, mj) )
33856  {
33857  *xi = (x + mi * y - qi) / (2.0*mi);
33858  *yi = mi*(*xi) + qi;
33859  *xj = (*xi) + (qi - qj)/ (2.0*mi);
33860  *yj = mj * (*xj) + qj;
33861  *ycoef = (*xi) + (qi - qj) / (4.0*mi); /* note that this is wrong in Locatelli 2016 */
33862  *xcoef = 2.0*mi*(*xi) - mi * (*ycoef) + qi;
33863  *constant = -mj*SQR(*xj) - (*ycoef) * qj;
33864  }
33865  else if( mi > 0.0 )
33866  {
33867  assert(mj > 0.0);
33868 
33869  *xi = (y + SQRT(mi*mj)*x - qi) / (REALABS(mi) + SQRT(mi*mj));
33870  *yi = mi*(*xi) + qi;
33871  *xj = (y + SQRT(mi*mj)*x - qj) / (REALABS(mj) + SQRT(mi*mj));
33872  *yj = mj*(*xj) + qj;
33873  *ycoef = (2.0*mj*(*xj) + qj - 2.0*mi*(*xi) - qi) / (mj - mi);
33874  *xcoef = 2.0*mj*(*xj) + qj - mj*(*ycoef);
33875  *constant = -mj*SQR(*xj) - (*ycoef) * qj;
33876  }
33877  else
33878  {
33879  assert(mi < 0.0 && mj < 0.0);
33880 
33881  /* apply variable transformation x = -x in case for overestimation */
33882  computeBilinEnvelope2(scip, -x, y, -mi, qi, -mj, qj, xi, yi, xj, yj, xcoef, ycoef, constant);
33883 
33884  /* revert transformation; multiply cut by -1 and change -x by x */
33885  *xi = -(*xi);
33886  *xj = -(*xj);
33887  *ycoef = -(*ycoef);
33888  *constant = -(*constant);
33889  }
33890 }
33891 
33892 /** computes coefficients of linearization of a bilinear term in a reference point when given two linear inequality
33893  * involving only the variables of the bilinear term
33894  *
33895  * @note the formulas are extracted from "Convex envelopes of bivariate functions through the solution of KKT systems"
33896  * by Marco Locatelli
33897  *
33898  */
33900  SCIP* scip, /**< SCIP data structure */
33901  SCIP_Real bilincoef, /**< coefficient of bilinear term */
33902  SCIP_Real lbx, /**< lower bound on first variable */
33903  SCIP_Real ubx, /**< upper bound on first variable */
33904  SCIP_Real refpointx, /**< reference point for first variable */
33905  SCIP_Real lby, /**< lower bound on second variable */
33906  SCIP_Real uby, /**< upper bound on second variable */
33907  SCIP_Real refpointy, /**< reference point for second variable */
33908  SCIP_Bool overestimate, /**< whether to compute an overestimator instead of an underestimator */
33909  SCIP_Real xcoef1, /**< x coefficient of linear inequality; must be in {-1,0,1} */
33910  SCIP_Real ycoef1, /**< y coefficient of linear inequality */
33911  SCIP_Real constant1, /**< constant of linear inequality */
33912  SCIP_Real xcoef2, /**< x coefficient of linear inequality; must be in {-1,0,1} */
33913  SCIP_Real ycoef2, /**< y coefficient of linear inequality */
33914  SCIP_Real constant2, /**< constant of linear inequality */
33915  SCIP_Real* RESTRICT lincoefx, /**< buffer to store coefficient of first variable in linearization */
33916  SCIP_Real* RESTRICT lincoefy, /**< buffer to store coefficient of second variable in linearization */
33917  SCIP_Real* RESTRICT linconstant, /**< buffer to store constant of linearization */
33918  SCIP_Bool* RESTRICT success /**< buffer to store whether linearization was successful */
33919  )
33920 {
33921  SCIP_Real mi, mj, qi, qj, xi, xj, yi, yj;
33922  SCIP_Real xcoef, ycoef, constant;
33923  SCIP_Real minx, maxx, miny, maxy;
33924 
33925  assert(scip != NULL);
33926  assert(!SCIPisInfinity(scip, lbx));
33927  assert(!SCIPisInfinity(scip, -ubx));
33928  assert(!SCIPisInfinity(scip, lby));
33929  assert(!SCIPisInfinity(scip, -uby));
33930  assert(SCIPisLE(scip, lbx, ubx));
33931  assert(SCIPisLE(scip, lby, uby));
33932  assert(SCIPisLE(scip, lbx, refpointx));
33933  assert(SCIPisGE(scip, ubx, refpointx));
33934  assert(SCIPisLE(scip, lby, refpointy));
33935  assert(SCIPisGE(scip, uby, refpointy));
33936  assert(lincoefx != NULL);
33937  assert(lincoefy != NULL);
33938  assert(linconstant != NULL);
33939  assert(success != NULL);
33940  assert(xcoef1 != 0.0 && xcoef1 != SCIP_INVALID); /*lint !e777*/
33941  assert(ycoef1 != SCIP_INVALID && ycoef1 != 0.0); /*lint !e777*/
33942  assert(constant1 != SCIP_INVALID); /*lint !e777*/
33943  assert(xcoef2 != 0.0 && xcoef2 != SCIP_INVALID); /*lint !e777*/
33944  assert(ycoef2 != SCIP_INVALID && ycoef2 != 0.0); /*lint !e777*/
33945  assert(constant2 != SCIP_INVALID); /*lint !e777*/
33946 
33947  *success = FALSE;
33948  *lincoefx = SCIP_INVALID;
33949  *lincoefy = SCIP_INVALID;
33950  *linconstant = SCIP_INVALID;
33951 
33952  /* reference point does not satisfy linear inequalities */
33953  if( SCIPisFeasGT(scip, xcoef1 * refpointx - ycoef1 * refpointy - constant1, 0.0)
33954  || SCIPisFeasGT(scip, xcoef2 * refpointx - ycoef2 * refpointy - constant2, 0.0) )
33955  return;
33956 
33957  /* compute minimal and maximal bounds on x and y for accepting the reference point */
33958  minx = lbx + 0.01 * (ubx-lbx);
33959  maxx = ubx - 0.01 * (ubx-lbx);
33960  miny = lby + 0.01 * (uby-lby);
33961  maxy = uby - 0.01 * (uby-lby);
33962 
33963  /* check the reference point is in the interior of the domain */
33964  if( SCIPisLE(scip, refpointx, minx) || SCIPisGE(scip, refpointx, maxx)
33965  || SCIPisLE(scip, refpointy, miny) || SCIPisFeasGE(scip, refpointy, maxy) )
33966  return;
33967 
33968  /* the sign of the x-coefficients of the two inequalities must be different; otherwise the convex or concave
33969  * envelope can be computed via SCIPcomputeBilinEnvelope1 for each inequality separately
33970  */
33971  if( (xcoef1 > 0) == (xcoef2 > 0) )
33972  return;
33973 
33974  /* always consider xy without the bilinear coefficient */
33975  if( bilincoef < 0.0 )
33976  overestimate = !overestimate;
33977 
33978  /* we use same notation as in "Convex envelopes of bivariate functions through the solution of KKT systems", 2016 */
33979  mi = xcoef1 / ycoef1;
33980  qi = -constant1 / ycoef1;
33981  mj = xcoef2 / ycoef2;
33982  qj = -constant2 / ycoef2;
33983 
33984  /* mi, mj > 0 => underestimate; mi, mj < 0 => overestimate */
33985  if( SCIPisNegative(scip, mi) != overestimate || SCIPisNegative(scip, mj) != overestimate )
33986  return;
33987 
33988  /* compute cut according to Locatelli 2016 */
33989  computeBilinEnvelope2(scip, refpointx, refpointy, mi, qi, mj, qj, &xi, &yi, &xj, &yj, &xcoef, &ycoef, &constant);
33990  assert(SCIPisEQ(scip, mi*xi + qi, yi));
33991  assert(SCIPisEQ(scip, mj*xj + qj, yj));
33992 
33993  /* it might happen that (xi,yi) = (xj,yj) if the two lines intersect */
33994  if( SCIPisEQ(scip, xi, xj) && SCIPisEQ(scip, yi, yj) )
33995  return;
33996 
33997  /* check whether projected points are in the interior */
33998  if( SCIPisLE(scip, xi, minx) || SCIPisGE(scip, xi, maxx) || SCIPisLE(scip, yi, miny) || SCIPisGE(scip, yi, maxy) )
33999  return;
34000  if( SCIPisLE(scip, xj, minx) || SCIPisGE(scip, xj, maxx) || SCIPisLE(scip, yj, miny) || SCIPisGE(scip, yj, maxy) )
34001  return;
34002 
34003  *lincoefx = bilincoef * xcoef;
34004  *lincoefy = bilincoef * ycoef;
34005  *linconstant = bilincoef * constant;
34006 
34007  /* cut needs to be tight at (vx,vy) and (xj,yj) */
34008  *success = SCIPisFeasEQ(scip, (*lincoefx)*xi + (*lincoefy)*yi + (*linconstant), bilincoef*xi*yi)
34009  && SCIPisFeasEQ(scip, (*lincoefx)*xj + (*lincoefy)*yj + (*linconstant), bilincoef*xj*yj);
34010 
34011 #ifndef NDEBUG
34012  {
34013  SCIP_Real activity = (*lincoefx)*refpointx + (*lincoefy)*refpointy + (*linconstant);
34014 
34015  /* cut needs to under- or overestimate the bilinear term at the reference point */
34016  if( bilincoef < 0.0 )
34017  overestimate = !overestimate;
34018 
34019  if( overestimate )
34020  assert(SCIPisFeasGE(scip, activity, bilincoef*refpointx*refpointy));
34021  else
34022  assert(SCIPisFeasLE(scip, activity, bilincoef*refpointx*refpointy));
34023  }
34024 #endif
34025 }
34026 
34027 /** creates an NLP relaxation and stores it in a given NLPI problem; the function computes for each variable which the
34028  * number of non-linearly occurrences and stores it in the nlscore array
34029  *
34030  * @note the first row corresponds always to the cutoff row (even if cutoffbound is SCIPinfinity(scip))
34031  **/
34033  SCIP* scip, /**< SCIP data structure */
34034  SCIP_NLPI* nlpi, /**< interface to NLP solver */
34035  SCIP_NLROW** nlrows, /**< nonlinear rows */
34036  int nnlrows, /**< total number of nonlinear rows */
34037  SCIP_NLPIPROBLEM* nlpiprob, /**< empty nlpi problem */
34038  SCIP_HASHMAP* var2idx, /**< empty hash map to store mapping between variables and indices in nlpi
34039  * problem */
34040  SCIP_Real* nlscore, /**< array to store the score of each nonlinear variable (NULL if not
34041  * needed) */
34042  SCIP_Real cutoffbound, /**< cutoff bound */
34043  SCIP_Bool setobj, /**< should the objective function be set? */
34044  SCIP_Bool onlyconvex /**< filter only for convex constraints */
34045  )
34046 {
34047  SCIP_EXPRTREE** exprtrees;
34048  int** exprvaridxs;
34049  SCIP_QUADELEM** quadelems;
34050  int* nquadelems;
34051  SCIP_Real** linvals;
34052  int** lininds;
34053  int* nlininds;
34054  SCIP_Real* lhss;
34055  SCIP_Real* rhss;
34056  const char** names;
34057  SCIP_VAR** vars;
34058  int nvars;
34059  SCIP_Real* lbs;
34060  SCIP_Real* ubs;
34061  SCIP_Real* objvals = NULL;
34062  int* objinds = NULL;
34063  const char** varnames;
34064  int nobjinds;
34065  int nconss;
34066  int i;
34067 
34068  assert(nlpiprob != NULL);
34069  assert(var2idx != NULL);
34070  assert(nlrows != NULL);
34071  assert(nnlrows > 0);
34072  assert(nlpi != NULL);
34073 
34074  SCIPdebugMsg(scip, "call SCIPcreateConvexNlpNlobbt() with cutoffbound %g\n", cutoffbound);
34075 
34076  if( nlscore != NULL )
34077  {
34078  BMSclearMemoryArray(nlscore, SCIPgetNVars(scip));
34079  }
34080  vars = SCIPgetVars(scip);
34081  nvars = SCIPgetNVars(scip);
34082  nconss = 0;
34083 
34084  SCIP_CALL( SCIPallocBufferArray(scip, &exprtrees, nnlrows + 1) );
34085  SCIP_CALL( SCIPallocBufferArray(scip, &exprvaridxs, nnlrows + 1) );
34086  SCIP_CALL( SCIPallocBufferArray(scip, &quadelems, nnlrows + 1) );
34087  SCIP_CALL( SCIPallocBufferArray(scip, &nquadelems, nnlrows + 1) );
34088  SCIP_CALL( SCIPallocBufferArray(scip, &linvals, nnlrows + 1) );
34089  SCIP_CALL( SCIPallocBufferArray(scip, &lininds, nnlrows + 1) );
34090  SCIP_CALL( SCIPallocBufferArray(scip, &nlininds, nnlrows + 1) );
34091  SCIP_CALL( SCIPallocBufferArray(scip, &names, nnlrows + 1) );
34092  SCIP_CALL( SCIPallocBufferArray(scip, &lhss, nnlrows + 1) );
34093  SCIP_CALL( SCIPallocBufferArray(scip, &rhss, nnlrows + 1) );
34094 
34095  if( setobj )
34096  {
34097  SCIP_CALL( SCIPallocBufferArray(scip, &objvals, nvars) );
34098  SCIP_CALL( SCIPallocBufferArray(scip, &objinds, nvars) );
34099  }
34100 
34101  SCIP_CALL( SCIPallocBufferArray(scip, &lbs, nvars) );
34102  SCIP_CALL( SCIPallocBufferArray(scip, &ubs, nvars) );
34103  SCIP_CALL( SCIPallocBufferArray(scip, &varnames, nvars) );
34104 
34105  /* create a unique mapping between variables and {0,..,nvars-1} */
34106  nobjinds = 0;
34107  for( i = 0; i < nvars; ++i )
34108  {
34109  assert(vars[i] != NULL);
34110  SCIP_CALL( SCIPhashmapInsert(var2idx, (void*)vars[i], (void*)(size_t)i) );
34111 
34112  lbs[i] = SCIPvarGetLbLocal(vars[i]);
34113  ubs[i] = SCIPvarGetUbLocal(vars[i]);
34114  varnames[i] = SCIPvarGetName(vars[i]);
34115 
34116  /* collect non-zero objective coefficients */
34117  if( setobj && !SCIPisZero(scip, SCIPvarGetObj(vars[i])) )
34118  {
34119  assert(objvals != NULL);
34120  assert(objinds != NULL);
34121 
34122  objvals[nobjinds] = SCIPvarGetObj(vars[i]);
34123  objinds[nobjinds] = i;
34124  ++nobjinds;
34125  }
34126  }
34127 
34128  /* add variables */
34129  SCIP_CALL( SCIPnlpiAddVars(nlpi, nlpiprob, nvars, lbs, ubs, varnames) );
34130  SCIPfreeBufferArray(scip, &varnames);
34131  SCIPfreeBufferArray(scip, &ubs);
34132  SCIPfreeBufferArray(scip, &lbs);
34133 
34134  /* set the objective function */
34135  if( setobj )
34136  {
34137  if( nobjinds > 0 )
34138  {
34139  SCIP_CALL( SCIPnlpiSetObjective(nlpi, nlpiprob, nobjinds, objinds, objvals, 0, NULL, NULL, NULL, 0.0) );
34140  }
34141 
34142  SCIPfreeBufferArray(scip, &objinds);
34143  SCIPfreeBufferArray(scip, &objvals);
34144  }
34145 
34146  /* add row for cutoff bound even if cutoffbound == SCIPinfinity() */
34147  lhss[nconss] = -SCIPinfinity(scip);
34148  rhss[nconss] = cutoffbound;
34149  names[nconss] = "objcutoff";
34150  lininds[nconss] = NULL;
34151  linvals[nconss] = NULL;
34152  nlininds[nconss] = 0;
34153  nquadelems[nconss] = 0;
34154  quadelems[nconss] = NULL;
34155  exprtrees[nconss] = NULL;
34156  exprvaridxs[nconss] = NULL;
34157 
34158  SCIP_CALL( SCIPallocBufferArray(scip, &lininds[nconss], nvars) ); /*lint !e866*/
34159  SCIP_CALL( SCIPallocBufferArray(scip, &linvals[nconss], nvars) ); /*lint !e866*/
34160 
34161  for( i = 0; i < nvars; ++i )
34162  {
34163  if( !SCIPisZero(scip, SCIPvarGetObj(vars[i])) )
34164  {
34165  linvals[nconss][nlininds[nconss]] = SCIPvarGetObj(vars[i]);
34166  lininds[nconss][nlininds[nconss]] = i;
34167  ++nlininds[nconss];
34168  }
34169  }
34170  ++nconss;
34171 
34172  /* add convex nonlinear rows to NLPI problem */
34173  for( i = 0; i < nnlrows; ++i )
34174  {
34175  SCIP_Bool userhs;
34176  SCIP_Bool uselhs;
34177  int k;
34178 
34179  assert(nlrows[i] != NULL);
34180 
34181  uselhs = FALSE;
34182  userhs = FALSE;
34183 
34184  /* check curvature together with constraint sides of a nonlinear row */
34185  if( SCIPnlrowGetNQuadElems(nlrows[i]) == 0 && SCIPnlrowGetExprtree(nlrows[i]) == NULL )
34186  {
34187  uselhs = TRUE;
34188  userhs = TRUE;
34189  }
34190  else
34191  {
34192  if( (!onlyconvex || SCIPnlrowGetCurvature(nlrows[i]) == SCIP_EXPRCURV_CONVEX)
34193  && !SCIPisInfinity(scip, SCIPnlrowGetRhs(nlrows[i])) )
34194  userhs = TRUE;
34195  if( (!onlyconvex || SCIPnlrowGetCurvature(nlrows[i]) == SCIP_EXPRCURV_CONCAVE)
34196  && !SCIPisInfinity(scip, SCIPnlrowGetLhs(nlrows[i])) )
34197  uselhs = TRUE;
34198  }
34199 
34200  if( !uselhs && !userhs )
34201  continue;
34202 
34203  lhss[nconss] = uselhs ? SCIPnlrowGetLhs(nlrows[i]) - SCIPnlrowGetConstant(nlrows[i]) : -SCIPinfinity(scip);
34204  rhss[nconss] = userhs ? SCIPnlrowGetRhs(nlrows[i]) - SCIPnlrowGetConstant(nlrows[i]) : SCIPinfinity(scip);
34205  names[nconss] = SCIPnlrowGetName(nlrows[i]);
34206  nlininds[nconss] = 0;
34207  lininds[nconss] = NULL;
34208  linvals[nconss] = NULL;
34209  nquadelems[nconss] = 0;
34210  quadelems[nconss] = NULL;
34211  exprtrees[nconss] = NULL;
34212  exprvaridxs[nconss] = NULL;
34213 
34214  /* copy linear part */
34215  if( SCIPnlrowGetNLinearVars(nlrows[i]) > 0 )
34216  {
34217  SCIP_VAR* var;
34218 
34219  nlininds[nconss] = SCIPnlrowGetNLinearVars(nlrows[i]);
34220 
34221  SCIP_CALL( SCIPallocBufferArray(scip, &lininds[nconss], nlininds[nconss]) ); /*lint !e866*/
34222  SCIP_CALL( SCIPallocBufferArray(scip, &linvals[nconss], nlininds[nconss]) ); /*lint !e866*/
34223 
34224  for( k = 0; k < nlininds[nconss]; ++k )
34225  {
34226  var = SCIPnlrowGetLinearVars(nlrows[i])[k];
34227  assert(var != NULL);
34228  assert(SCIPhashmapExists(var2idx, (void*)var));
34229 
34230  lininds[nconss][k] = (int)(size_t)SCIPhashmapGetImage(var2idx, (void*)var);
34231  assert(var == vars[lininds[nconss][k]]);
34232  linvals[nconss][k] = SCIPnlrowGetLinearCoefs(nlrows[i])[k];
34233  }
34234  }
34235 
34236  /* copy quadratic part */
34237  if( SCIPnlrowGetNQuadElems(nlrows[i]) > 0 )
34238  {
34239  SCIP_QUADELEM quadelem;
34240  SCIP_VAR* var1;
34241  SCIP_VAR* var2;
34242 
34243  nquadelems[nconss] = SCIPnlrowGetNQuadElems(nlrows[i]);
34244  SCIP_CALL( SCIPallocBufferArray(scip, &quadelems[nconss], nquadelems[nconss]) ); /*lint !e866*/
34245 
34246  for( k = 0; k < nquadelems[nconss]; ++k )
34247  {
34248  quadelem = SCIPnlrowGetQuadElems(nlrows[i])[k];
34249 
34250  var1 = SCIPnlrowGetQuadVars(nlrows[i])[quadelem.idx1];
34251  assert(var1 != NULL);
34252  assert(SCIPhashmapExists(var2idx, (void*)var1));
34253 
34254  var2 = SCIPnlrowGetQuadVars(nlrows[i])[quadelem.idx2];
34255  assert(var2 != NULL);
34256  assert(SCIPhashmapExists(var2idx, (void*)var2));
34257 
34258  quadelems[nconss][k].coef = quadelem.coef;
34259  quadelems[nconss][k].idx1 = (int)(size_t)SCIPhashmapGetImage(var2idx, (void*)var1);
34260  quadelems[nconss][k].idx2 = (int)(size_t)SCIPhashmapGetImage(var2idx, (void*)var2);
34261 
34262  /* expr.c assumes that the indices are ordered */
34263  if( quadelems[nconss][k].idx1 > quadelems[nconss][k].idx2 )
34264  {
34265  SCIPswapInts(&quadelems[nconss][k].idx1, &quadelems[nconss][k].idx2);
34266  }
34267  assert(quadelems[nconss][k].idx1 <= quadelems[nconss][k].idx2);
34268 
34269  /* update nlscore */
34270  if( nlscore != NULL )
34271  {
34272  ++nlscore[quadelems[nconss][k].idx1];
34273  if( quadelems[nconss][k].idx1 != quadelems[nconss][k].idx2 )
34274  ++nlscore[quadelems[nconss][k].idx2];
34275  }
34276  }
34277  }
34278 
34279  /* copy expression tree */
34280  if( SCIPnlrowGetExprtree(nlrows[i]) != NULL )
34281  {
34282  SCIP_VAR* var;
34283 
34284  /* note that we don't need to copy the expression tree here since only the mapping between variables in the
34285  * tree and the corresponding indices change; this mapping is stored in the exprvaridxs array
34286  */
34287  exprtrees[nconss] = SCIPnlrowGetExprtree(nlrows[i]);
34288 
34289  SCIP_CALL( SCIPallocBufferArray(scip, &exprvaridxs[nconss], SCIPexprtreeGetNVars(exprtrees[nconss])) ); /*lint !e866*/
34290 
34291  for( k = 0; k < SCIPexprtreeGetNVars(exprtrees[nconss]); ++k )
34292  {
34293  var = SCIPexprtreeGetVars(exprtrees[nconss])[k];
34294  assert(var != NULL);
34295  assert(SCIPhashmapExists(var2idx, (void*)var));
34296 
34297  exprvaridxs[nconss][k] = (int)(size_t)SCIPhashmapGetImage(var2idx, (void*)var);
34298 
34299  /* update nlscore */
34300  if( nlscore != NULL )
34301  ++nlscore[exprvaridxs[nconss][k]];
34302  }
34303  }
34304 
34305  ++nconss;
34306  }
34307  assert(nconss > 0);
34308 
34309  /* pass all constraint information to nlpi */
34310  SCIP_CALL( SCIPnlpiAddConstraints(nlpi, nlpiprob, nconss, lhss, rhss, nlininds, lininds, linvals, nquadelems,
34311  quadelems, exprvaridxs, exprtrees, names) );
34312 
34313  /* free memory */
34314  for( i = nconss - 1; i > 0; --i )
34315  {
34316  if( exprtrees[i] != NULL )
34317  {
34318  assert(exprvaridxs[i] != NULL);
34319  SCIPfreeBufferArray(scip, &exprvaridxs[i]);
34320  }
34321 
34322  if( nquadelems[i] > 0 )
34323  {
34324  assert(quadelems[i] != NULL);
34325  SCIPfreeBufferArray(scip, &quadelems[i]);
34326  }
34327 
34328  if( nlininds[i] > 0 )
34329  {
34330  assert(linvals[i] != NULL);
34331  assert(lininds[i] != NULL);
34332  SCIPfreeBufferArray(scip, &linvals[i]);
34333  SCIPfreeBufferArray(scip, &lininds[i]);
34334  }
34335  }
34336  /* free row for cutoff bound even if objective is 0 */
34337  SCIPfreeBufferArray(scip, &linvals[i]);
34338  SCIPfreeBufferArray(scip, &lininds[i]);
34339 
34340  SCIPfreeBufferArray(scip, &rhss);
34341  SCIPfreeBufferArray(scip, &lhss);
34342  SCIPfreeBufferArray(scip, &names);
34343  SCIPfreeBufferArray(scip, &nlininds);
34344  SCIPfreeBufferArray(scip, &lininds);
34345  SCIPfreeBufferArray(scip, &linvals);
34346  SCIPfreeBufferArray(scip, &nquadelems);
34347  SCIPfreeBufferArray(scip, &quadelems);
34348  SCIPfreeBufferArray(scip, &exprvaridxs);
34349  SCIPfreeBufferArray(scip, &exprtrees);
34350 
34351  return SCIP_OKAY;
34352 }
34353 
34354 /** updates bounds of each variable and the cutoff row in the nlpiproblem */
34356  SCIP* scip, /**< SCIP data structure */
34357  SCIP_NLPI* nlpi, /**< interface to NLP solver */
34358  SCIP_NLPIPROBLEM* nlpiprob, /**< nlpi problem representing the convex NLP relaxation */
34359  SCIP_HASHMAP* var2nlpiidx, /**< mapping between variables and nlpi indices */
34360  SCIP_VAR** nlpivars, /**< array containing all variables of the nlpi */
34361  int nlpinvars, /**< total number of nlpi variables */
34362  SCIP_Real cutoffbound /**< new cutoff bound */
34363  )
34364 {
34365  SCIP_Real* lbs;
34366  SCIP_Real* ubs;
34367  SCIP_Real lhs;
34368  SCIP_Real rhs;
34369  int* inds;
34370  int i;
34371 
34372  SCIPdebugMsg(scip, "call SCIPupdateConvexNlpNlobbt()\n");
34373 
34374  /* update variable bounds */
34375  SCIP_CALL( SCIPallocBufferArray(scip, &lbs, nlpinvars) );
34376  SCIP_CALL( SCIPallocBufferArray(scip, &ubs, nlpinvars) );
34377  SCIP_CALL( SCIPallocBufferArray(scip, &inds, nlpinvars) );
34378 
34379  for( i = 0; i < nlpinvars; ++i )
34380  {
34381  assert(nlpivars[i] != NULL);
34382  assert(SCIPhashmapExists(var2nlpiidx, (void*)nlpivars[i]));
34383 
34384  lbs[i] = SCIPvarGetLbLocal(nlpivars[i]);
34385  ubs[i] = SCIPvarGetUbLocal(nlpivars[i]);
34386  inds[i] = (int)(uintptr_t)SCIPhashmapGetImage(var2nlpiidx, (void*)nlpivars[i]);
34387  assert(inds[i] >= 0 && inds[i] < nlpinvars);
34388  }
34389 
34390  SCIP_CALL( SCIPnlpiChgVarBounds(nlpi, nlpiprob, nlpinvars, inds, lbs, ubs) );
34391 
34392  SCIPfreeBufferArray(scip, &inds);
34393  SCIPfreeBufferArray(scip, &ubs);
34394  SCIPfreeBufferArray(scip, &lbs);
34395 
34396  /* update cutoff row */
34397  lhs = -SCIPinfinity(scip);
34398  rhs = cutoffbound;
34399  i = 0;
34400 
34401  SCIP_CALL( SCIPnlpiChgConsSides(nlpi, nlpiprob, 1, &i, &lhs, &rhs) );
34402 
34403  return SCIP_OKAY;
34404 }
34405 
34406 /** adds linear rows to the NLP relaxation */
34408  SCIP* scip, /**< SCIP data structure */
34409  SCIP_NLPI* nlpi, /**< interface to NLP solver */
34410  SCIP_NLPIPROBLEM* nlpiprob, /**< nlpi problem */
34411  SCIP_HASHMAP* var2idx, /**< empty hash map to store mapping between variables and indices in nlpi
34412  * problem */
34413  SCIP_ROW** rows, /**< rows to add */
34414  int nrows /**< total number of rows to add */
34415  )
34416 {
34417  const char** names;
34418  SCIP_Real* lhss;
34419  SCIP_Real* rhss;
34420  SCIP_Real** linvals;
34421  int** lininds;
34422  int* nlininds;
34423  int i;
34424 
34425  assert(nlpi != NULL);
34426  assert(nlpiprob != NULL);
34427  assert(var2idx != NULL);
34428  assert(nrows == 0 || rows != NULL);
34429 
34430  SCIPdebugMsg(scip, "call SCIPaddConvexNlpRowsNlobbt() with %d rows\n", nrows);
34431 
34432  if( nrows <= 0 )
34433  return SCIP_OKAY;
34434 
34435  SCIP_CALL( SCIPallocBufferArray(scip, &names, nrows) );
34436  SCIP_CALL( SCIPallocBufferArray(scip, &lhss, nrows) );
34437  SCIP_CALL( SCIPallocBufferArray(scip, &rhss, nrows) );
34438  SCIP_CALL( SCIPallocBufferArray(scip, &linvals, nrows) );
34439  SCIP_CALL( SCIPallocBufferArray(scip, &lininds, nrows) );
34440  SCIP_CALL( SCIPallocBufferArray(scip, &nlininds, nrows) );
34441 
34442  for( i = 0; i < nrows; ++i )
34443  {
34444  int k;
34445 
34446  assert(rows[i] != NULL);
34447  assert(SCIProwGetNNonz(rows[i]) <= SCIPgetNVars(scip));
34448 
34449  names[i] = SCIProwGetName(rows[i]);
34450  lhss[i] = SCIProwGetLhs(rows[i]) - SCIProwGetConstant(rows[i]);
34451  rhss[i] = SCIProwGetRhs(rows[i]) - SCIProwGetConstant(rows[i]);
34452  nlininds[i] = SCIProwGetNNonz(rows[i]);
34453  linvals[i] = SCIProwGetVals(rows[i]);
34454  lininds[i] = NULL;
34455 
34456  SCIP_CALL( SCIPallocBufferArray(scip, &lininds[i], SCIProwGetNNonz(rows[i])) ); /*lint !e866*/
34457 
34458  for( k = 0; k < SCIProwGetNNonz(rows[i]); ++k )
34459  {
34460  SCIP_VAR* var;
34461 
34462  var = SCIPcolGetVar(SCIProwGetCols(rows[i])[k]);
34463  assert(var != NULL);
34464  assert(SCIPhashmapExists(var2idx, (void*)var));
34465 
34466  lininds[i][k] = (int)(size_t)SCIPhashmapGetImage(var2idx, (void*)var);
34467  assert(lininds[i][k] >= 0 && lininds[i][k] < SCIPgetNVars(scip));
34468  }
34469  }
34470 
34471  /* pass all linear rows to the nlpi */
34472  SCIP_CALL( SCIPnlpiAddConstraints(nlpi, nlpiprob, nrows, lhss, rhss, nlininds, lininds, linvals, NULL,
34473  NULL, NULL, NULL, names) );
34474 
34475  /* free memory */
34476  for( i = nrows - 1; i >= 0; --i )
34477  {
34478  SCIPfreeBufferArray(scip, &lininds[i]);
34479  }
34480  SCIPfreeBufferArray(scip, &nlininds);
34481  SCIPfreeBufferArray(scip, &lininds);
34482  SCIPfreeBufferArray(scip, &linvals);
34483  SCIPfreeBufferArray(scip, &rhss);
34484  SCIPfreeBufferArray(scip, &lhss);
34485  SCIPfreeBufferArray(scip, &names);
34486 
34487  return SCIP_OKAY;
34488 }
34489 
34490 /**@} */
34491 
34492 /*
34493  * cutting plane methods
34494  */
34495 
34496 /** returns efficacy of the cut with respect to the given primal solution or the current LP solution:
34497  * e = -feasibility/norm
34498  *
34499  * @return the efficacy of the cut with respect to the given primal solution or the current LP solution:
34500  * e = -feasibility/norm
34501  *
34502  * @pre This method can be called if @p scip is in one of the following stages:
34503  * - \ref SCIP_STAGE_SOLVING
34504  */
34506  SCIP* scip, /**< SCIP data structure */
34507  SCIP_SOL* sol, /**< primal CIP solution, or NULL for current LP solution */
34508  SCIP_ROW* cut /**< separated cut */
34509  )
34510 {
34511  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCutEfficacy", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34512 
34513  if( sol == NULL )
34514  return SCIProwGetLPEfficacy(cut, scip->set, scip->stat, scip->lp);
34515  else
34516  return SCIProwGetSolEfficacy(cut, scip->set, scip->stat, sol);
34517 }
34518 
34519 /** returns whether the cut's efficacy with respect to the given primal solution or the current LP solution is greater
34520  * than the minimal cut efficacy
34521  *
34522  * @return TRUE if the cut's efficacy with respect to the given primal solution or the current LP solution is greater
34523  * than the minimal cut efficacy, otherwise FALSE
34524  *
34525  * @pre This method can be called if @p scip is in one of the following stages:
34526  * - \ref SCIP_STAGE_SOLVING
34527  */
34529  SCIP* scip, /**< SCIP data structure */
34530  SCIP_SOL* sol, /**< primal CIP solution, or NULL for current LP solution */
34531  SCIP_ROW* cut /**< separated cut */
34532  )
34533 {
34534  SCIP_CALL_ABORT( checkStage(scip, "SCIPisCutEfficacious", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34535 
34536  if( sol == NULL )
34537  return SCIProwIsLPEfficacious(cut, scip->set, scip->stat, scip->lp, (SCIPtreeGetCurrentDepth(scip->tree) == 0));
34538  else
34539  return SCIProwIsSolEfficacious(cut, scip->set, scip->stat, sol, (SCIPtreeGetCurrentDepth(scip->tree) == 0));
34540 }
34541 
34542 /** checks, if the given cut's efficacy is larger than the minimal cut efficacy
34543  *
34544  * @return TRUE if the given cut's efficacy is larger than the minimal cut efficacy, otherwise FALSE
34545  */
34547  SCIP* scip, /**< SCIP data structure */
34548  SCIP_Real efficacy /**< efficacy of the cut */
34549  )
34550 {
34551  assert(scip != NULL);
34552 
34553  return SCIPsetIsEfficacious(scip->set, (SCIPtreeGetCurrentDepth(scip->tree) == 0), efficacy);
34554 }
34555 
34556 /** calculates the efficacy norm of the given vector, which depends on the "separating/efficacynorm" parameter
34557  *
34558  * @return the efficacy norm of the given vector, which depends on the "separating/efficacynorm" parameter
34559  */
34561  SCIP* scip, /**< SCIP data structure */
34562  SCIP_Real* vals, /**< array of values */
34563  int nvals /**< number of values */
34564  )
34565 {
34566  SCIP_Real norm;
34567  int i;
34568 
34569  assert(scip != NULL);
34570  assert(scip->set != NULL);
34571 
34572  norm = 0.0;
34573  switch( scip->set->sepa_efficacynorm )
34574  {
34575  case 'e':
34576  for( i = 0; i < nvals; ++i )
34577  norm += SQR(vals[i]);
34578  norm = SQRT(norm);
34579  break;
34580  case 'm':
34581  for( i = 0; i < nvals; ++i )
34582  {
34583  SCIP_Real absval;
34584 
34585  absval = REALABS(vals[i]);
34586  norm = MAX(norm, absval);
34587  }
34588  break;
34589  case 's':
34590  for( i = 0; i < nvals; ++i )
34591  norm += REALABS(vals[i]);
34592  break;
34593  case 'd':
34594  for( i = 0; i < nvals; ++i )
34595  {
34596  if( !SCIPisZero(scip, vals[i]) )
34597  {
34598  norm = 1.0;
34599  break;
34600  }
34601  }
34602  break;
34603  default:
34604  SCIPerrorMessage("invalid efficacy norm parameter '%c'\n", scip->set->sepa_efficacynorm);
34605  assert(FALSE);
34606  }
34607 
34608  return norm;
34609 }
34610 
34611 /** indicates whether a cut is applicable, i.e., will modify the LP when applied
34612  *
34613  * @pre This method can be called if @p scip is in one of the following stages:
34614  * - \ref SCIP_STAGE_SOLVING
34615  *
34616  * @return whether the cut is modifiable, not a bound change, or a bound change that changes bounds by at least epsilon
34617  */
34619  SCIP* scip, /**< SCIP data structure */
34620  SCIP_ROW* cut /**< separated cut */
34621  )
34622 {
34623  SCIP_CALL_ABORT( checkStage(scip, "SCIPisCutApplicable", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34624 
34625  return SCIPsepastoreIsCutApplicable(scip->set, cut);
34626 }
34627 
34628 /** adds cut to separation storage
34629  *
34630  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34631  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34632  *
34633  * @pre This method can be called if @p scip is in one of the following stages:
34634  * - \ref SCIP_STAGE_SOLVING
34635  *
34636  * @deprecated Please use SCIPaddRow() instead, or, if the row is a global cut, add it only to the global cutpool.
34637  */
34639  SCIP* scip, /**< SCIP data structure */
34640  SCIP_SOL* sol, /**< primal solution that was separated, or NULL for LP solution */
34641  SCIP_ROW* cut, /**< separated cut */
34642  SCIP_Bool forcecut, /**< should the cut be forced to enter the LP? */
34643  SCIP_Bool* infeasible /**< pointer to store whether cut has been detected to be infeasible for local bounds */
34644  )
34645 {
34646  SCIP_CALL( checkStage(scip, "SCIPaddCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34647 
34648  SCIP_UNUSED(sol);
34649 
34650  return SCIPaddRow(scip, cut, forcecut, infeasible);
34651 }
34652 
34653 /** adds row to separation storage
34654  *
34655  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34656  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34657  *
34658  * @pre This method can be called if @p scip is in one of the following stages:
34659  * - \ref SCIP_STAGE_SOLVING
34660  */
34662  SCIP* scip, /**< SCIP data structure */
34663  SCIP_ROW* row, /**< row */
34664  SCIP_Bool forcecut, /**< should the row be forced to enter the LP? */
34665  SCIP_Bool* infeasible /**< pointer to store whether row has been detected to be infeasible for local bounds */
34666  )
34667 {
34668  SCIP_CALL( checkStage(scip, "SCIPaddRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34669 
34670  assert(SCIPtreeGetCurrentNode(scip->tree) != NULL);
34671 
34672  SCIP_CALL( SCIPsepastoreAddCut(scip->sepastore, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
34673  scip->eventfilter, scip->lp, row, forcecut, (SCIPtreeGetCurrentDepth(scip->tree) == 0), infeasible) );
34674 
34675  /* possibly run conflict analysis */
34676  if ( *infeasible && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && SCIPisConflictAnalysisApplicable(scip) )
34677  {
34678  SCIP_Real act;
34679  SCIP_VAR* var;
34680  SCIP_Real val;
34681  int ncols;
34682  int j;
34683 
34684  /* initialize conflict analysis */
34686 
34687  if ( ! SCIPisInfinity(scip, -row->lhs) )
34688  {
34689  act = SCIProwGetMaxActivity(row, scip->set, scip->stat);
34690  if ( SCIPisLT(scip, act, row->lhs) )
34691  {
34692  ncols = SCIProwGetNNonz(row);
34693  for (j = 0; j < ncols; ++j)
34694  {
34695  val = row->vals[j];
34696  if ( ! SCIPisZero(scip, val) )
34697  {
34698  var = SCIPcolGetVar(row->cols[j]);
34699  assert( var != NULL );
34700 
34701  if ( val > 0.0 )
34702  {
34703  SCIP_CALL( SCIPaddConflictUb(scip, var, NULL) );
34704  }
34705  else
34706  {
34707  SCIP_CALL( SCIPaddConflictLb(scip, var, NULL) );
34708  }
34709  }
34710  }
34711  }
34712  }
34713  else if ( ! SCIPisInfinity(scip, row->rhs) )
34714  {
34715  act = SCIProwGetMinActivity(row, scip->set, scip->stat);
34716  if ( SCIPisGT(scip, act, row->rhs) )
34717  {
34718  ncols = SCIProwGetNNonz(row);
34719  for (j = 0; j < ncols; ++j)
34720  {
34721  val = row->vals[j];
34722  if ( ! SCIPisZero(scip, val) )
34723  {
34724  var = SCIPcolGetVar(row->cols[j]);
34725  assert( var != NULL );
34726 
34727  if ( val > 0.0 )
34728  {
34729  SCIP_CALL( SCIPaddConflictLb(scip, var, NULL) );
34730  }
34731  else
34732  {
34733  SCIP_CALL( SCIPaddConflictUb(scip, var, NULL) );
34734  }
34735  }
34736  }
34737  }
34738  }
34739 
34740  /* analyze the conflict */
34741  SCIP_CALL( SCIPanalyzeConflict(scip, SCIPgetDepth(scip), NULL) );
34742  }
34743 
34744  return SCIP_OKAY;
34745 }
34746 
34747 /** checks if cut is already existing in global cutpool
34748  *
34749  * @return TRUE is returned if the cut is not already existing in the global cutpool, FALSE otherwise
34750  *
34751  * @pre This method can be called if @p scip is in one of the following stages:
34752  * - \ref SCIP_STAGE_SOLVING
34753  */
34755  SCIP* scip, /**< SCIP data structure */
34756  SCIP_ROW* row /**< cutting plane to add */
34757  )
34758 {
34759  SCIP_CALL_ABORT( checkStage(scip, "SCIPisCutNew", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34760 
34761  return SCIPcutpoolIsCutNew(scip->cutpool, scip->set, row);
34762 }
34763 
34764 /** if not already existing, adds row to global cut pool
34765  *
34766  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34767  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34768  *
34769  * @pre This method can be called if @p scip is in one of the following stages:
34770  * - \ref SCIP_STAGE_SOLVING
34771  */
34773  SCIP* scip, /**< SCIP data structure */
34774  SCIP_ROW* row /**< row to remove */
34775  )
34776 {
34777  SCIP_CALL( checkStage(scip, "SCIPaddPoolCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34778 
34779  SCIP_CALL( SCIPcutpoolAddRow(scip->cutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
34780 
34781  return SCIP_OKAY;
34782 }
34783 
34784 /** removes the row from the global cut pool
34785  *
34786  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34787  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34788  *
34789  * @pre This method can be called if @p scip is in one of the following stages:
34790  * - \ref SCIP_STAGE_SOLVING
34791  */
34793  SCIP* scip, /**< SCIP data structure */
34794  SCIP_ROW* row /**< cutting plane to add */
34795  )
34796 {
34797  SCIP_CALL( checkStage(scip, "SCIPdelPoolCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34798 
34799  SCIP_CALL( SCIPcutpoolDelRow(scip->cutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
34800 
34801  return SCIP_OKAY;
34802 }
34803 
34804 /** gets current cuts in the global cut pool
34805  *
34806  * @return the current cuts in the global cut pool
34807  *
34808  * @pre This method can be called if @p scip is in one of the following stages:
34809  * - \ref SCIP_STAGE_SOLVING
34810  * - \ref SCIP_STAGE_SOLVED
34811  * - \ref SCIP_STAGE_EXITSOLVE
34812  */
34814  SCIP* scip /**< SCIP data structure */
34815  )
34816 {
34817  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPoolCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
34818 
34819  return SCIPcutpoolGetCuts(scip->cutpool);
34820 }
34821 
34822 /** gets current number of rows in the global cut pool
34823  *
34824  * @return the current number of rows in the global cut pool
34825  *
34826  * @pre This method can be called if @p scip is in one of the following stages:
34827  * - \ref SCIP_STAGE_SOLVING
34828  * - \ref SCIP_STAGE_SOLVED
34829  * - \ref SCIP_STAGE_EXITSOLVE
34830  */
34832  SCIP* scip /**< SCIP data structure */
34833  )
34834 {
34835  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPoolCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
34836 
34837  return SCIPcutpoolGetNCuts(scip->cutpool);
34838 }
34839 
34840 /** gets the global cut pool used by SCIP
34841  *
34842  * @return the global cut pool used by SCIP
34843  *
34844  * @pre This method can be called if @p scip is in one of the following stages:
34845  * - \ref SCIP_STAGE_SOLVING
34846  * - \ref SCIP_STAGE_SOLVED
34847  * - \ref SCIP_STAGE_EXITSOLVE
34848  */
34850  SCIP* scip /**< SCIP data structure */
34851  )
34852 {
34853  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetGlobalCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
34854 
34855  return scip->cutpool;
34856 }
34857 
34858 /** creates a cut pool
34859  *
34860  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34861  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34862  *
34863  * @pre This method can be called if @p scip is in one of the following stages:
34864  * - \ref SCIP_STAGE_TRANSFORMING
34865  * - \ref SCIP_STAGE_TRANSFORMED
34866  * - \ref SCIP_STAGE_INITPRESOLVE
34867  * - \ref SCIP_STAGE_PRESOLVING
34868  * - \ref SCIP_STAGE_EXITPRESOLVE
34869  * - \ref SCIP_STAGE_PRESOLVED
34870  * - \ref SCIP_STAGE_INITSOLVE
34871  * - \ref SCIP_STAGE_SOLVING
34872  */
34874  SCIP* scip, /**< SCIP data structure */
34875  SCIP_CUTPOOL** cutpool, /**< pointer to store cut pool */
34876  int agelimit /**< maximum age a cut can reach before it is deleted from the pool */
34877  )
34878 {
34879  SCIP_CALL( checkStage(scip, "SCIPcreateCutpool", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34880 
34881  SCIP_CALL( SCIPcutpoolCreate(cutpool, scip->mem->probmem, scip->set, agelimit, FALSE) );
34882 
34883  return SCIP_OKAY;
34884 }
34885 
34886 /** frees a cut pool
34887  *
34888  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34889  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34890  *
34891  * @pre This method can be called if @p scip is in one of the following stages:
34892  * - \ref SCIP_STAGE_TRANSFORMING
34893  * - \ref SCIP_STAGE_TRANSFORMED
34894  * - \ref SCIP_STAGE_INITPRESOLVE
34895  * - \ref SCIP_STAGE_PRESOLVING
34896  * - \ref SCIP_STAGE_EXITPRESOLVE
34897  * - \ref SCIP_STAGE_PRESOLVED
34898  * - \ref SCIP_STAGE_INITSOLVE
34899  * - \ref SCIP_STAGE_SOLVING
34900  * - \ref SCIP_STAGE_SOLVED
34901  * - \ref SCIP_STAGE_EXITSOLVE
34902  * - \ref SCIP_STAGE_FREETRANS
34903  */
34905  SCIP* scip, /**< SCIP data structure */
34906  SCIP_CUTPOOL** cutpool /**< pointer to store cut pool */
34907  )
34908 {
34909  SCIP_CALL( checkStage(scip, "SCIPfreeCutpool", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
34910 
34911  SCIP_CALL( SCIPcutpoolFree(cutpool, scip->mem->probmem, scip->set, scip->lp) );
34912 
34913  return SCIP_OKAY;
34914 }
34915 
34916 /** if not already existing, adds row to a cut pool and captures it
34917  *
34918  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34919  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34920  *
34921  * @pre This method can be called if @p scip is in one of the following stages:
34922  * - \ref SCIP_STAGE_INITSOLVE
34923  * - \ref SCIP_STAGE_SOLVING
34924  */
34926  SCIP* scip, /**< SCIP data structure */
34927  SCIP_CUTPOOL* cutpool, /**< cut pool */
34928  SCIP_ROW* row /**< cutting plane to add */
34929  )
34930 {
34931  SCIP_CALL( checkStage(scip, "SCIPaddRowCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34932 
34933  SCIP_CALL( SCIPcutpoolAddRow(cutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
34934 
34935  return SCIP_OKAY;
34936 }
34937 
34938 /** adds row to a cut pool and captures it; doesn't check for multiple cuts
34939  *
34940  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34941  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34942  *
34943  * @pre This method can be called if @p scip is in one of the following stages:
34944  * - \ref SCIP_STAGE_INITSOLVE
34945  * - \ref SCIP_STAGE_SOLVING
34946  */
34948  SCIP* scip, /**< SCIP data structure */
34949  SCIP_CUTPOOL* cutpool, /**< cut pool */
34950  SCIP_ROW* row /**< cutting plane to add */
34951  )
34952 {
34953  SCIP_CALL( checkStage(scip, "SCIPaddNewRowCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34954 
34955  SCIP_CALL( SCIPcutpoolAddNewRow(cutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
34956 
34957  return SCIP_OKAY;
34958 }
34959 
34960 /** removes the LP row from a cut pool
34961  *
34962  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34963  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34964  *
34965  * @pre This method can be called if @p scip is in one of the following stages:
34966  * - \ref SCIP_STAGE_INITSOLVE
34967  * - \ref SCIP_STAGE_SOLVING
34968  * - \ref SCIP_STAGE_SOLVED
34969  */
34971  SCIP* scip, /**< SCIP data structure */
34972  SCIP_CUTPOOL* cutpool, /**< cut pool */
34973  SCIP_ROW* row /**< row to remove */
34974  )
34975 {
34976  SCIP_CALL( checkStage(scip, "SCIPdelRowCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
34977 
34978  SCIP_CALL( SCIPcutpoolDelRow(cutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
34979 
34980  return SCIP_OKAY;
34981 }
34982 
34983 /** separates cuts from a cut pool
34984  *
34985  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34986  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34987  *
34988  * @pre This method can be called if @p scip is in one of the following stages:
34989  * - \ref SCIP_STAGE_SOLVING
34990  */
34992  SCIP* scip, /**< SCIP data structure */
34993  SCIP_CUTPOOL* cutpool, /**< cut pool */
34994  SCIP_RESULT* result /**< pointer to store the result of the separation call */
34995  )
34996 {
34997  SCIP_CALL( checkStage(scip, "SCIPseparateCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34998 
34999  assert(SCIPtreeGetCurrentNode(scip->tree) != NULL);
35000 
35001  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
35002  {
35003  SCIPerrorMessage("cannot add cuts, because node LP is not processed\n");
35004  return SCIP_INVALIDCALL;
35005  }
35006 
35007  SCIP_CALL( SCIPcutpoolSeparate(cutpool, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->eventfilter,
35008  scip->lp, scip->sepastore, NULL, FALSE, (SCIPtreeGetCurrentDepth(scip->tree) == 0), result) );
35009 
35010  return SCIP_OKAY;
35011 }
35012 
35013 /** separates cuts w.r.t. given solution from a cut pool
35014  *
35015  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35016  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35017  *
35018  * @pre This method can be called if @p scip is in one of the following stages:
35019  * - \ref SCIP_STAGE_SOLVING
35020  */
35022  SCIP* scip, /**< SCIP data structure */
35023  SCIP_CUTPOOL* cutpool, /**< cut pool */
35024  SCIP_SOL* sol, /**< solution to be separated */
35025  SCIP_RESULT* result /**< pointer to store the result of the separation call */
35026  )
35027 {
35028  SCIP_CALL( checkStage(scip, "SCIPseparateSolCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35029 
35030  assert(SCIPtreeGetCurrentNode(scip->tree) != NULL);
35031 
35032  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
35033  {
35034  SCIPerrorMessage("cannot add cuts, because node LP is not processed\n");
35035  return SCIP_INVALIDCALL;
35036  }
35037 
35038  SCIP_CALL( SCIPcutpoolSeparate(cutpool, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->eventfilter,
35039  scip->lp, scip->sepastore, sol, FALSE, (SCIPtreeGetCurrentDepth(scip->tree) == 0), result) );
35040 
35041  return SCIP_OKAY;
35042 }
35043 
35044 /** if not already existing, adds row to delayed global cut pool
35045  *
35046  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35047  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35048  *
35049  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
35050  */
35052  SCIP* scip, /**< SCIP data structure */
35053  SCIP_ROW* row /**< cutting plane to add */
35054  )
35055 {
35056  SCIP_CALL( checkStage(scip, "SCIPaddDelayedPoolCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35057 
35058  SCIP_CALL( SCIPcutpoolAddRow(scip->delayedcutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
35059 
35060  return SCIP_OKAY;
35061 }
35062 
35063 /** removes the row from the delayed global cut pool
35064  *
35065  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35066  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35067  *
35068  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
35069  */
35071  SCIP* scip, /**< SCIP data structure */
35072  SCIP_ROW* row /**< cutting plane to add */
35073  )
35074 {
35075  SCIP_CALL( checkStage(scip, "SCIPdelDelayedPoolCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35076 
35077  SCIP_CALL( SCIPcutpoolDelRow(scip->delayedcutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
35078 
35079  return SCIP_OKAY;
35080 }
35081 
35082 /** gets current cuts in the delayed global cut pool
35083  *
35084  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35085  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35086  *
35087  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
35088  */
35090  SCIP* scip /**< SCIP data structure */
35091  )
35092 {
35093  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDelayedPoolCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
35094 
35095  return SCIPcutpoolGetCuts(scip->delayedcutpool);
35096 }
35097 
35098 /** gets current number of rows in the delayed global cut pool
35099  *
35100  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35101  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35102  *
35103  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
35104  */
35106  SCIP* scip /**< SCIP data structure */
35107  )
35108 {
35109  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDelayedPoolCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
35110 
35111  return SCIPcutpoolGetNCuts(scip->delayedcutpool);
35112 }
35113 
35114 /** gets the delayed global cut pool used by SCIP
35115  *
35116  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35117  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35118  *
35119  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
35120  */
35122  SCIP* scip /**< SCIP data structure */
35123  )
35124 {
35125  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDelayedGlobalCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
35126 
35127  return scip->delayedcutpool;
35128 }
35129 
35130 /** separates the given primal solution or the current LP solution by calling the separators and constraint handlers'
35131  * separation methods;
35132  * the generated cuts are stored in the separation storage and can be accessed with the methods SCIPgetCuts() and
35133  * SCIPgetNCuts();
35134  * after evaluating the cuts, you have to call SCIPclearCuts() in order to remove the cuts from the
35135  * separation storage;
35136  * it is possible to call SCIPseparateSol() multiple times with different solutions and evaluate the found cuts
35137  * afterwards
35138  *
35139  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35140  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35141  *
35142  * @pre This method can be called if @p scip is in one of the following stages:
35143  * - \ref SCIP_STAGE_SOLVING
35144  */
35146  SCIP* scip, /**< SCIP data structure */
35147  SCIP_SOL* sol, /**< primal solution that should be separated, or NULL for LP solution */
35148  SCIP_Bool pretendroot, /**< should the cut separators be called as if we are at the root node? */
35149  SCIP_Bool allowlocal, /**< should the separator be asked to separate local cuts */
35150  SCIP_Bool onlydelayed, /**< should only separators be called that were delayed in the previous round? */
35151  SCIP_Bool* delayed, /**< pointer to store whether a separator was delayed */
35152  SCIP_Bool* cutoff /**< pointer to store whether the node can be cut off */
35153  )
35154 {
35155  int actdepth;
35156 
35157  SCIP_CALL( checkStage(scip, "SCIPseparateSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35158 
35159  /* get current depth */
35160  actdepth = (pretendroot ? 0 : SCIPtreeGetCurrentDepth(scip->tree));
35161 
35162  /* apply separation round */
35163  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,
35164  sol, actdepth, allowlocal, onlydelayed, delayed, cutoff) );
35165 
35166  return SCIP_OKAY;
35167 }
35168 
35169 /** gets the array of cuts currently stored in the separation storage
35170  *
35171  * @return the array of cuts currently stored in the separation storage
35172  *
35173  * @pre This method can be called if @p scip is in one of the following stages:
35174  * - \ref SCIP_STAGE_PRESOLVED
35175  * - \ref SCIP_STAGE_SOLVING
35176  * - \ref SCIP_STAGE_SOLVED
35177  */
35179  SCIP* scip /**< SCIP data structure */
35180  )
35181 {
35182  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
35183 
35184  return SCIPsepastoreGetCuts(scip->sepastore);
35185 }
35186 
35187 /** get current number of cuts in the separation storage
35188  *
35189  * @return the current number of cuts in the separation storage
35190  *
35191  * @pre This method can be called if @p scip is in one of the following stages:
35192  * - \ref SCIP_STAGE_PRESOLVED
35193  * - \ref SCIP_STAGE_SOLVING
35194  * - \ref SCIP_STAGE_SOLVED
35195  */
35197  SCIP* scip /**< SCIP data structure */
35198  )
35199 {
35200  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
35201 
35202  return SCIPsepastoreGetNCuts(scip->sepastore);
35203 }
35204 
35205 /** clears the separation storage
35206  *
35207  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35208  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35209  *
35210  * @pre This method can be called if @p scip is in one of the following stages:
35211  * - \ref SCIP_STAGE_SOLVING
35212  */
35214  SCIP* scip /**< SCIP data structure */
35215  )
35216 {
35217  SCIP_CALL( checkStage(scip, "SCIPclearCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35218 
35219  SCIP_CALL( SCIPsepastoreClearCuts(scip->sepastore, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter, scip->lp) );
35220 
35221  return SCIP_OKAY;
35222 }
35223 
35224 /** removes cuts that are inefficacious w.r.t. the current LP solution from separation storage without adding the cuts to the LP
35225  *
35226  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35227  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35228  *
35229  * @pre This method can be called if @p scip is in one of the following stages:
35230  * - \ref SCIP_STAGE_SOLVING
35231  */
35233  SCIP* scip /**< SCIP data structure */
35234  )
35235 {
35236  SCIP_Bool isroot;
35237 
35238  SCIP_CALL( checkStage(scip, "SCIPremoveInefficaciousCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35239 
35240  isroot = FALSE;
35241  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 )
35242  isroot = TRUE;
35244  scip->eventqueue, scip->eventfilter, scip->lp, isroot, SCIP_EFFICIACYCHOICE_LP) );
35245 
35246  return SCIP_OKAY;
35247 }
35248 
35249 /*
35250  * LP diving methods
35251  */
35252 
35253 /** initiates LP diving, making methods SCIPchgVarObjDive(), SCIPchgVarLbDive(), and SCIPchgVarUbDive() available
35254  *
35255  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35256  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35257  *
35258  * @pre This method can be called if @p scip is in one of the following stages:
35259  * - \ref SCIP_STAGE_SOLVING
35260  *
35261  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35262  *
35263  * @note diving is allowed even if the current LP is not flushed, not solved, or not solved to optimality; be aware
35264  * that solving the (first) diving LP may take longer than expect and that the latter two cases could stem from
35265  * numerical troubles during the last LP solve; because of this, most users will want to call this method only if
35266  * SCIPgetLPSolstat(scip) == SCIP_LPSOLSTAT_OPTIMAL
35267  */
35269  SCIP* scip /**< SCIP data structure */
35270  )
35271 {
35272  assert(scip != NULL);
35273 
35274  SCIP_CALL( checkStage(scip, "SCIPstartDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35276 
35277  if( SCIPlpDiving(scip->lp) )
35278  {
35279  SCIPerrorMessage("already in diving mode\n");
35280  return SCIP_INVALIDCALL;
35281  }
35282 
35283  if( SCIPtreeProbing(scip->tree) )
35284  {
35285  SCIPerrorMessage("cannot start diving while being in probing mode\n");
35286  return SCIP_INVALIDCALL;
35287  }
35288 
35290  {
35291  SCIPerrorMessage("cannot start diving if LP has not been constructed\n");
35292  return SCIP_INVALIDCALL;
35293  }
35294  assert(SCIPtreeHasCurrentNodeLP(scip->tree));
35295 
35296  SCIP_CALL( SCIPlpStartDive(scip->lp, scip->mem->probmem, scip->set, scip->stat) );
35297 
35298  /* remember the relaxation solution to reset it later */
35299  if( SCIPisRelaxSolValid(scip) )
35300  {
35301  SCIP_CALL( SCIPtreeStoreRelaxSol(scip->tree, scip->set, scip->relaxation, scip->transprob) );
35302  }
35303 
35304  return SCIP_OKAY;
35305 }
35306 
35307 /** quits LP diving and resets bounds and objective values of columns to the current node's values
35308  *
35309  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35310  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35311  *
35312  * @pre This method can be called if @p scip is in one of the following stages:
35313  * - \ref SCIP_STAGE_SOLVING
35314  *
35315  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35316  */
35318  SCIP* scip /**< SCIP data structure */
35319  )
35320 {
35321  assert(scip != NULL);
35322 
35323  SCIP_CALL( checkStage(scip, "SCIPendDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35324 
35325  if( !SCIPlpDiving(scip->lp) )
35326  {
35327  SCIPerrorMessage("not in diving mode\n");
35328  return SCIP_INVALIDCALL;
35329  }
35330 
35331  /* unmark the diving flag in the LP and reset all variables' objective and bound values */
35332  SCIP_CALL( SCIPlpEndDive(scip->lp, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->eventqueue, scip->eventfilter,
35333  scip->transprob, scip->transprob->vars, scip->transprob->nvars) );
35334 
35335  /* the lower bound may have changed slightly due to LP resolve in SCIPlpEndDive() */
35336  if( !scip->lp->resolvelperror && scip->tree->focusnode != NULL && SCIPlpIsRelax(scip->lp) && SCIPlpIsSolved(scip->lp) )
35337  {
35338  assert(SCIPtreeIsFocusNodeLPConstructed(scip->tree));
35339  SCIP_CALL( SCIPnodeUpdateLowerboundLP(scip->tree->focusnode, scip->set, scip->stat, scip->tree, scip->transprob,
35340  scip->origprob, scip->lp) );
35341  }
35342  /* reset the probably changed LP's cutoff bound */
35343  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, scip->primal->cutoffbound) );
35344  assert(scip->lp->cutoffbound == scip->primal->cutoffbound); /*lint !e777*/
35345 
35346  /* if a new best solution was created, the cutoff of the tree was delayed due to diving;
35347  * the cutoff has to be done now.
35348  */
35349  if( scip->tree->cutoffdelayed )
35350  {
35351  SCIP_CALL( SCIPtreeCutoff(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
35352  scip->lp, scip->primal->cutoffbound) );
35353  }
35354 
35355  /* if a relaxation was stored before diving, restore it now */
35356  if( scip->tree->probdiverelaxstored )
35357  {
35358  SCIP_CALL( SCIPtreeRestoreRelaxSol(scip->tree, scip->set, scip->relaxation, scip->transprob) );
35359  }
35360 
35361  return SCIP_OKAY;
35362 }
35363 
35364 /** changes cutoffbound in current dive
35365  *
35366  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35367  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35368  *
35369  * @pre This method can be called if @p scip is in one of the following stages:
35370  * - \ref SCIP_STAGE_SOLVING
35371  *
35372  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35373  */
35375  SCIP* scip, /**< SCIP data structure */
35376  SCIP_Real newcutoffbound /**< new cutoffbound */
35377  )
35378 {
35379  assert(scip != NULL);
35380 
35381  SCIP_CALL( checkStage(scip, "SCIPchgCutoffboundDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35382 
35383  if( !SCIPlpDiving(scip->lp) )
35384  {
35385  SCIPerrorMessage("not in diving mode\n");
35386  return SCIP_INVALIDCALL;
35387  }
35388 
35389  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, newcutoffbound) );
35390 
35391  return SCIP_OKAY;
35392 }
35393 
35394 /** changes variable's objective value in current dive
35395  *
35396  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35397  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35398  *
35399  * @pre This method can be called if @p scip is in one of the following stages:
35400  * - \ref SCIP_STAGE_SOLVING
35401  *
35402  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35403  */
35405  SCIP* scip, /**< SCIP data structure */
35406  SCIP_VAR* var, /**< variable to change the objective value for */
35407  SCIP_Real newobj /**< new objective value */
35408  )
35409 {
35410  assert(scip != NULL);
35411  assert(var != NULL);
35412 
35413  SCIP_CALL( checkStage(scip, "SCIPchgVarObjDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35414 
35415  if( !SCIPlpDiving(scip->lp) )
35416  {
35417  SCIPerrorMessage("not in diving mode\n");
35418  return SCIP_INVALIDCALL;
35419  }
35420 
35421  /* invalidate the LP's cutoff bound, since this has nothing to do with the current objective value anymore;
35422  * the cutoff bound is reset in SCIPendDive()
35423  */
35424  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, SCIPsetInfinity(scip->set)) );
35425 
35426  /* mark the LP's objective function invalid */
35428 
35429  /* change the objective value of the variable in the diving LP */
35430  SCIP_CALL( SCIPvarChgObjDive(var, scip->set, scip->lp, newobj) );
35431 
35432  return SCIP_OKAY;
35433 }
35434 
35435 /** changes variable's lower bound in current dive
35436  *
35437  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35438  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35439  *
35440  * @pre This method can be called if @p scip is in one of the following stages:
35441  * - \ref SCIP_STAGE_SOLVING
35442  *
35443  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35444  */
35446  SCIP* scip, /**< SCIP data structure */
35447  SCIP_VAR* var, /**< variable to change the bound for */
35448  SCIP_Real newbound /**< new value for bound */
35449  )
35450 {
35451  assert(scip != NULL);
35452  assert(var != NULL);
35453 
35454  SCIP_CALL( checkStage(scip, "SCIPchgVarLbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35455 
35456  if( !SCIPlpDiving(scip->lp) )
35457  {
35458  SCIPerrorMessage("not in diving mode\n");
35459  return SCIP_INVALIDCALL;
35460  }
35461 
35462  SCIP_CALL( SCIPvarChgLbDive(var, scip->set, scip->lp, newbound) );
35463 
35464  return SCIP_OKAY;
35465 }
35466 
35467 /** changes variable's upper bound in current dive
35468  *
35469  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35470  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35471  *
35472  * @pre This method can be called if @p scip is in one of the following stages:
35473  * - \ref SCIP_STAGE_SOLVING
35474  *
35475  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35476  */
35478  SCIP* scip, /**< SCIP data structure */
35479  SCIP_VAR* var, /**< variable to change the bound for */
35480  SCIP_Real newbound /**< new value for bound */
35481  )
35482 {
35483  assert(scip != NULL);
35484  assert(var != NULL);
35485 
35486  SCIP_CALL( checkStage(scip, "SCIPchgVarUbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35487 
35488  if( !SCIPlpDiving(scip->lp) )
35489  {
35490  SCIPerrorMessage("not in diving mode\n");
35491  return SCIP_INVALIDCALL;
35492  }
35493 
35494  SCIP_CALL( SCIPvarChgUbDive(var, scip->set, scip->lp, newbound) );
35495 
35496  return SCIP_OKAY;
35497 }
35498 
35499 /** adds a row to the LP in current dive
35500  *
35501  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35502  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35503  *
35504  * @pre This method can be called if @p scip is in one of the following stages:
35505  * - \ref SCIP_STAGE_SOLVING
35506  *
35507  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35508  */
35510  SCIP* scip, /**< SCIP data structure */
35511  SCIP_ROW* row /**< row to be added */
35512  )
35513 {
35514  SCIP_NODE* node;
35515  int depth;
35516 
35517  assert(scip != NULL);
35518  assert(row != NULL);
35519 
35520  SCIP_CALL( checkStage(scip, "SCIPaddRowDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35521 
35522  if( !SCIPlpDiving(scip->lp) )
35523  {
35524  SCIPerrorMessage("not in diving mode\n");
35525  return SCIP_INVALIDCALL;
35526  }
35527 
35528  /* get depth of current node */
35529  node = SCIPtreeGetCurrentNode(scip->tree);
35530  assert(node != NULL);
35531  depth = SCIPnodeGetDepth(node);
35532 
35533  SCIP_CALL( SCIPlpAddRow(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter, row, depth) );
35534 
35535  return SCIP_OKAY;
35536 }
35537 
35538 /** changes row lhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowLhs()
35539  *
35540  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35541  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35542  *
35543  * @pre This method can be called if @p scip is in one of the following stages:
35544  * - \ref SCIP_STAGE_SOLVING
35545  *
35546  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35547  */
35549  SCIP* scip, /**< SCIP data structure */
35550  SCIP_ROW* row, /**< row to change the lhs for */
35551  SCIP_Real newlhs /**< new value for lhs */
35552  )
35553 {
35554  assert(scip != NULL);
35555  assert(row != NULL);
35556 
35557  SCIP_CALL( checkStage(scip, "SCIPchgRowLhsDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35558 
35559  if( !SCIPlpDiving(scip->lp) )
35560  {
35561  SCIPerrorMessage("not in diving mode\n");
35562  return SCIP_INVALIDCALL;
35563  }
35564 
35566  SCIP_CALL( SCIProwChgLhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, newlhs) );
35567 
35568  return SCIP_OKAY;
35569 }
35570 
35571 /** changes row rhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowRhs()
35572  *
35573  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35574  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35575  *
35576  * @pre This method can be called if @p scip is in one of the following stages:
35577  * - \ref SCIP_STAGE_SOLVING
35578  *
35579  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35580  */
35582  SCIP* scip, /**< SCIP data structure */
35583  SCIP_ROW* row, /**< row to change the lhs for */
35584  SCIP_Real newrhs /**< new value for rhs */
35585  )
35586 {
35587  assert(scip != NULL);
35588  assert(row != NULL);
35589 
35590  SCIP_CALL( checkStage(scip, "SCIPchgRowRhsDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35591 
35592  if( !SCIPlpDiving(scip->lp) )
35593  {
35594  SCIPerrorMessage("not in diving mode\n");
35595  return SCIP_INVALIDCALL;
35596  }
35597 
35599  SCIP_CALL( SCIProwChgRhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, newrhs) );
35600 
35601  return SCIP_OKAY;
35602 }
35603 
35604 /** gets variable's objective value in current dive
35605  *
35606  * @return the variable's objective value in current dive.
35607  *
35608  * @pre This method can be called if @p scip is in one of the following stages:
35609  * - \ref SCIP_STAGE_SOLVING
35610  *
35611  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35612  */
35614  SCIP* scip, /**< SCIP data structure */
35615  SCIP_VAR* var /**< variable to get the bound for */
35616  )
35617 {
35618  assert(scip != NULL);
35619  assert(var != NULL);
35620 
35621  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarObjDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35622 
35623  if( !SCIPlpDiving(scip->lp) )
35624  {
35625  SCIPerrorMessage("not in diving mode\n");
35626  SCIPABORT();
35627  return SCIP_INVALID; /*lint !e527*/
35628  }
35629 
35630  return SCIPvarGetObjLP(var);
35631 }
35632 
35633 /** gets variable's lower bound in current dive
35634  *
35635  * @return the variable's lower bound in current dive.
35636  *
35637  * @pre This method can be called if @p scip is in one of the following stages:
35638  * - \ref SCIP_STAGE_SOLVING
35639  *
35640  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35641  */
35643  SCIP* scip, /**< SCIP data structure */
35644  SCIP_VAR* var /**< variable to get the bound for */
35645  )
35646 {
35647  assert(scip != NULL);
35648  assert(var != NULL);
35649 
35650  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarLbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35651 
35652  if( !SCIPlpDiving(scip->lp) )
35653  {
35654  SCIPerrorMessage("not in diving mode\n");
35655  SCIPABORT();
35656  return SCIP_INVALID; /*lint !e527*/
35657  }
35658 
35659  return SCIPvarGetLbLP(var, scip->set);
35660 }
35661 
35662 /** gets variable's upper bound in current dive
35663  *
35664  * @return the variable's upper bound in current dive.
35665  *
35666  * @pre This method can be called if @p scip is in one of the following stages:
35667  * - \ref SCIP_STAGE_SOLVING
35668  *
35669  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35670  */
35672  SCIP* scip, /**< SCIP data structure */
35673  SCIP_VAR* var /**< variable to get the bound for */
35674  )
35675 {
35676  assert(scip != NULL);
35677  assert(var != NULL);
35678 
35679  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarUbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35680 
35681  if( !SCIPlpDiving(scip->lp) )
35682  {
35683  SCIPerrorMessage("not in diving mode\n");
35684  SCIPABORT();
35685  return SCIP_INVALID; /*lint !e527*/
35686  }
35687 
35688  return SCIPvarGetUbLP(var, scip->set);
35689 }
35690 
35691 /** solves the LP of the current dive; no separation or pricing is applied
35692  *
35693  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35694  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35695  *
35696  * @pre This method can be called if @p scip is in one of the following stages:
35697  * - \ref SCIP_STAGE_SOLVING
35698  *
35699  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35700  *
35701  * @note be aware that the LP solve may take longer than expected if SCIPgetLPSolstat(scip) != SCIP_LPSOLSTAT_OPTIMAL,
35702  * compare the explanation of SCIPstartDive()
35703  */
35705  SCIP* scip, /**< SCIP data structure */
35706  int itlim, /**< maximal number of LP iterations to perform, or -1 for no limit */
35707  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
35708  SCIP_Bool* cutoff /**< pointer to store whether the diving LP was infeasible or the objective
35709  * limit was reached (or NULL, if not needed) */
35710  )
35711 {
35712  assert(scip != NULL);
35713 
35714  SCIP_CALL( checkStage(scip, "SCIPsolveDiveLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35715 
35716  if( !SCIPlpDiving(scip->lp) )
35717  {
35718  SCIPerrorMessage("not in diving mode\n");
35719  return SCIP_INVALIDCALL;
35720  }
35721 
35722  if( cutoff != NULL )
35723  *cutoff = FALSE;
35724 
35725  /* solve diving LP */
35726  SCIP_CALL( SCIPlpSolveAndEval(scip->lp, scip->set, scip->messagehdlr, scip->mem->probmem, scip->stat,
35727  scip->eventqueue, scip->eventfilter, scip->transprob, (SCIP_Longint)itlim, FALSE, FALSE, FALSE, lperror) );
35728 
35729  /* the LP is infeasible or the objective limit was reached */
35731  || (SCIPlpGetSolstat(scip->lp) == SCIP_LPSOLSTAT_OPTIMAL &&
35732  SCIPisGE(scip, SCIPgetLPObjval(scip), SCIPgetCutoffbound(scip))) )
35733  {
35734  /* analyze the infeasible LP (only if the objective was not changed, all columns are in the LP, and no external
35735  * pricers exist)
35736  */
35737  if( !scip->set->misc_exactsolve && !(SCIPlpDivingObjChanged(scip->lp) || SCIPlpDivingRowsChanged(scip->lp))
35738  && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) )
35739  {
35740  SCIP_CALL( SCIPconflictAnalyzeLP(scip->conflict, scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
35741  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, NULL) );
35742  }
35743 
35744  if( cutoff != NULL )
35745  *cutoff = TRUE;
35746  }
35747 
35748  return SCIP_OKAY;
35749 }
35750 
35751 /** returns the number of the node in the current branch and bound run, where the last LP was solved in diving
35752  * or probing mode
35753  *
35754  * @return the number of the node in the current branch and bound run, where the last LP was solved in diving
35755  * or probing mode.
35756  *
35757  * @pre This method can be called if @p scip is in one of the following stages:
35758  * - \ref SCIP_STAGE_TRANSFORMING
35759  * - \ref SCIP_STAGE_TRANSFORMED
35760  * - \ref SCIP_STAGE_INITPRESOLVE
35761  * - \ref SCIP_STAGE_PRESOLVING
35762  * - \ref SCIP_STAGE_EXITPRESOLVE
35763  * - \ref SCIP_STAGE_PRESOLVED
35764  * - \ref SCIP_STAGE_INITSOLVE
35765  * - \ref SCIP_STAGE_SOLVING
35766  * - \ref SCIP_STAGE_SOLVED
35767  * - \ref SCIP_STAGE_EXITSOLVE
35768  * - \ref SCIP_STAGE_FREETRANS
35769  *
35770  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35771  */
35773  SCIP* scip /**< SCIP data structure */
35774  )
35775 {
35776  assert(scip != NULL);
35777 
35778  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLastDivenode", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
35779 
35780  return scip->stat->lastdivenode;
35781 }
35782 
35783 /** returns whether we are in diving mode
35784  *
35785  * @return whether we are in diving mode.
35786  *
35787  * @pre This method can be called if @p scip is in one of the following stages:
35788  * - \ref SCIP_STAGE_TRANSFORMING
35789  * - \ref SCIP_STAGE_TRANSFORMED
35790  * - \ref SCIP_STAGE_INITPRESOLVE
35791  * - \ref SCIP_STAGE_PRESOLVING
35792  * - \ref SCIP_STAGE_EXITPRESOLVE
35793  * - \ref SCIP_STAGE_PRESOLVED
35794  * - \ref SCIP_STAGE_INITSOLVE
35795  * - \ref SCIP_STAGE_SOLVING
35796  * - \ref SCIP_STAGE_SOLVED
35797  * - \ref SCIP_STAGE_EXITSOLVE
35798  * - \ref SCIP_STAGE_FREETRANS
35799  *
35800  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35801  */
35803  SCIP* scip /**< SCIP data structure */
35804  )
35805 {
35806  assert(scip != NULL);
35807 
35808  SCIP_CALL_ABORT( checkStage(scip, "SCIPinDive", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
35809 
35810  return SCIPlpDiving(scip->lp);
35811 }
35812 
35813 
35814 
35815 
35816 /*
35817  * probing methods
35818  */
35819 
35820 /** returns whether we are in probing mode; probing mode is activated via SCIPstartProbing() and stopped
35821  * via SCIPendProbing()
35822  *
35823  * @return TRUE, if SCIP is currently in probing mode, otherwise FALSE
35824  *
35825  * @pre This method can be called if @p scip is in one of the following stages:
35826  * - \ref SCIP_STAGE_TRANSFORMED
35827  * - \ref SCIP_STAGE_INITPRESOLVE
35828  * - \ref SCIP_STAGE_PRESOLVING
35829  * - \ref SCIP_STAGE_EXITPRESOLVE
35830  * - \ref SCIP_STAGE_PRESOLVED
35831  * - \ref SCIP_STAGE_INITSOLVE
35832  * - \ref SCIP_STAGE_SOLVING
35833  * - \ref SCIP_STAGE_SOLVED
35834  * - \ref SCIP_STAGE_EXITSOLVE
35835  */
35837  SCIP* scip /**< SCIP data structure */
35838  )
35839 {
35840  SCIP_CALL_ABORT( checkStage(scip, "SCIPinProbing", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
35841 
35842  return SCIPtreeProbing(scip->tree);
35843 }
35844 
35845 /** initiates probing, making methods SCIPnewProbingNode(), SCIPbacktrackProbing(), SCIPchgVarLbProbing(),
35846  * SCIPchgVarUbProbing(), SCIPfixVarProbing(), SCIPpropagateProbing(), and SCIPsolveProbingLP() available
35847  *
35848  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35849  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35850  *
35851  * @pre This method can be called if @p scip is in one of the following stages:
35852  * - \ref SCIP_STAGE_PRESOLVING
35853  * - \ref SCIP_STAGE_SOLVING
35854  *
35855  * @note The collection of variable statistics is turned off during probing. If these statistics should be collected
35856  * during probing use the method SCIPenableVarHistory() to turn the collection explicitly on.
35857  */
35859  SCIP* scip /**< SCIP data structure */
35860  )
35861 {
35862  SCIP_CALL( checkStage(scip, "SCIPstartProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35863 
35864  if( SCIPtreeProbing(scip->tree) )
35865  {
35866  SCIPerrorMessage("already in probing mode\n");
35867  return SCIP_INVALIDCALL;
35868  }
35869 
35870  if( scip->lp != NULL && SCIPlpDiving(scip->lp) )
35871  {
35872  SCIPerrorMessage("cannot start probing while in diving mode\n");
35873  return SCIP_INVALIDCALL;
35874  }
35875 
35876  /* use a different separation storage for probing mode; otherwise SCIP will remove the cuts that are currently in the
35877  * separation storage after solving an LP in probing mode
35878  */
35879  if( scip->sepastore != NULL )
35880  {
35881  assert(scip->sepastoreprobing != NULL);
35882  SCIPswapPointers((void**)&scip->sepastore, (void**)&scip->sepastoreprobing);
35883  }
35884 
35885  SCIP_CALL( SCIPtreeStartProbing(scip->tree, scip->mem->probmem, scip->set, scip->lp, scip->relaxation, scip->transprob, FALSE) );
35886 
35887  /* disables the collection of any statistic for a variable */
35889 
35890  return SCIP_OKAY;
35891 }
35892 
35893 /** creates a new probing sub node, whose changes can be undone by backtracking to a higher node in the probing path
35894  * with a call to SCIPbacktrackProbing();
35895  * using a sub node for each set of probing bound changes can improve conflict analysis
35896  *
35897  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35898  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35899  *
35900  * @pre This method can be called if @p scip is in one of the following stages:
35901  * - \ref SCIP_STAGE_PRESOLVING
35902  * - \ref SCIP_STAGE_SOLVING
35903  */
35905  SCIP* scip /**< SCIP data structure */
35906  )
35907 {
35908  SCIP_RETCODE retcode;
35909 
35910  SCIP_CALL( checkStage(scip, "SCIPnewProbingNode", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35911 
35912  if( !SCIPtreeProbing(scip->tree) )
35913  {
35914  SCIPerrorMessage("not in probing mode\n");
35915  return SCIP_INVALIDCALL;
35916  }
35917 
35918  retcode = SCIPtreeCreateProbingNode(scip->tree, scip->mem->probmem, scip->set, scip->lp);
35919 
35920  if( retcode == SCIP_MAXDEPTHLEVEL )
35921  {
35922  SCIPwarningMessage(scip, "probing reached maximal depth; it should be stopped\n");
35923  }
35924  SCIP_CALL( retcode );
35925 
35926  return SCIP_OKAY;
35927 }
35928 
35929 /** returns the current probing depth
35930  *
35931  * @return the probing depth, i.e. the number of probing sub nodes existing in the probing path
35932  *
35933  * @pre This method can be called if @p scip is in one of the following stages:
35934  * - \ref SCIP_STAGE_PRESOLVING
35935  * - \ref SCIP_STAGE_SOLVING
35936  */
35938  SCIP* scip /**< SCIP data structure */
35939  )
35940 {
35941  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetProbingDepth", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35942 
35943  if( !SCIPtreeProbing(scip->tree) )
35944  {
35945  SCIPerrorMessage("not in probing mode\n");
35946  SCIPABORT();
35947  return -1; /*lint !e527*/
35948  }
35949 
35950  return SCIPtreeGetProbingDepth(scip->tree);
35951 }
35952 
35953 /** undoes all changes to the problem applied in probing up to the given probing depth;
35954  * the changes of the probing node of the given probing depth are the last ones that remain active;
35955  * changes that were applied before calling SCIPnewProbingNode() cannot be undone
35956  *
35957  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35958  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35959  *
35960  * @pre This method can be called if @p scip is in one of the following stages:
35961  * - \ref SCIP_STAGE_PRESOLVING
35962  * - \ref SCIP_STAGE_SOLVING
35963  */
35965  SCIP* scip, /**< SCIP data structure */
35966  int probingdepth /**< probing depth of the node in the probing path that should be reactivated */
35967  )
35968 {
35969  SCIP_CALL( checkStage(scip, "SCIPbacktrackProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35970 
35971  if( !SCIPtreeProbing(scip->tree) )
35972  {
35973  SCIPerrorMessage("not in probing mode\n");
35974  return SCIP_INVALIDCALL;
35975  }
35976  if( probingdepth < 0 || probingdepth > SCIPtreeGetProbingDepth(scip->tree) )
35977  {
35978  SCIPerrorMessage("backtracking probing depth %d out of current probing range [0,%d]\n",
35979  probingdepth, SCIPtreeGetProbingDepth(scip->tree));
35980  return SCIP_INVALIDDATA;
35981  }
35982 
35983  SCIP_CALL( SCIPtreeBacktrackProbing(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
35984  scip->origprob, scip->lp, scip->primal, scip->branchcand, scip->eventqueue, scip->eventfilter,
35985  scip->cliquetable, probingdepth) );
35986 
35987  return SCIP_OKAY;
35988 }
35989 
35990 /** quits probing and resets bounds and constraints to the focus node's environment
35991  *
35992  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35993  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35994  *
35995  * @pre This method can be called if @p scip is in one of the following stages:
35996  * - \ref SCIP_STAGE_PRESOLVING
35997  * - \ref SCIP_STAGE_SOLVING
35998  */
36000  SCIP* scip /**< SCIP data structure */
36001  )
36002 {
36003  SCIP_CALL( checkStage(scip, "SCIPendProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36004 
36005  if( !SCIPtreeProbing(scip->tree) )
36006  {
36007  SCIPerrorMessage("not in probing mode\n");
36008  return SCIP_INVALIDCALL;
36009  }
36010 
36011  /* switch back from probing to normal operation mode and restore variables and constraints to focus node */
36012  SCIP_CALL( SCIPtreeEndProbing(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
36013  scip->transprob, scip->origprob, scip->lp, scip->relaxation, scip->primal,
36014  scip->branchcand, scip->eventqueue, scip->eventfilter, scip->cliquetable) );
36015 
36016  /* enables the collection of statistics for a variable */
36018 
36019  /* switch to the original separation storage */
36020  if( scip->sepastore != NULL )
36021  {
36022  assert(scip->sepastoreprobing != NULL);
36023  SCIPswapPointers((void**)&scip->sepastore, (void**)&scip->sepastoreprobing);
36024  assert(SCIPsepastoreGetNCuts(scip->sepastoreprobing) == 0);
36025  }
36026 
36027  return SCIP_OKAY;
36028 }
36029 
36030 /** injects a change of variable's lower bound into current probing node; the same can also be achieved with a call to
36031  * SCIPchgVarLb(), but in this case, the bound change would be treated like a deduction instead of a branching decision
36032  *
36033  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36034  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36035  *
36036  * @pre This method can be called if @p scip is in one of the following stages:
36037  * - \ref SCIP_STAGE_PRESOLVING
36038  * - \ref SCIP_STAGE_SOLVING
36039  */
36041  SCIP* scip, /**< SCIP data structure */
36042  SCIP_VAR* var, /**< variable to change the bound for */
36043  SCIP_Real newbound /**< new value for bound */
36044  )
36045 {
36046  SCIP_CALL( checkStage(scip, "SCIPchgVarLbProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36047 
36048  if( !SCIPtreeProbing(scip->tree) )
36049  {
36050  SCIPerrorMessage("not in probing mode\n");
36051  return SCIP_INVALIDCALL;
36052  }
36054 
36055  SCIPvarAdjustLb(var, scip->set, &newbound);
36056 
36057  /* ignore tightenings of lower bounds to +infinity during solving process */
36058  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
36059  {
36060 #ifndef NDEBUG
36061  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
36062  SCIPvarGetLbLocal(var));
36063 #endif
36064  return SCIP_OKAY;
36065  }
36066 
36068  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
36069  var, newbound, SCIP_BOUNDTYPE_LOWER, TRUE) );
36070 
36071  return SCIP_OKAY;
36072 }
36073 
36074 /** injects a change of variable's upper bound into current probing node; the same can also be achieved with a call to
36075  * SCIPchgVarUb(), but in this case, the bound change would be treated like a deduction instead of a branching decision
36076  *
36077  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36078  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36079  *
36080  * @pre This method can be called if @p scip is in one of the following stages:
36081  * - \ref SCIP_STAGE_PRESOLVING
36082  * - \ref SCIP_STAGE_SOLVING
36083  */
36085  SCIP* scip, /**< SCIP data structure */
36086  SCIP_VAR* var, /**< variable to change the bound for */
36087  SCIP_Real newbound /**< new value for bound */
36088  )
36089 {
36090  SCIP_CALL( checkStage(scip, "SCIPchgVarUbProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36091 
36092  if( !SCIPtreeProbing(scip->tree) )
36093  {
36094  SCIPerrorMessage("not in probing mode\n");
36095  return SCIP_INVALIDCALL;
36096  }
36098 
36099  SCIPvarAdjustUb(var, scip->set, &newbound);
36100 
36101  /* ignore tightenings of upper bounds to -infinity during solving process */
36102  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
36103  {
36104 #ifndef NDEBUG
36105  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
36106  SCIPvarGetUbLocal(var));
36107 #endif
36108  return SCIP_OKAY;
36109  }
36110 
36112  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
36113  var, newbound, SCIP_BOUNDTYPE_UPPER, TRUE) );
36114 
36115  return SCIP_OKAY;
36116 }
36117 
36118 /** gets variable's objective value in current probing
36119  *
36120  * @return the variable's objective value in current probing.
36121  *
36122  * @pre This method can be called if @p scip is in one of the following stages:
36123  * - \ref SCIP_STAGE_SOLVING
36124  *
36125  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36126  */
36128  SCIP* scip, /**< SCIP data structure */
36129  SCIP_VAR* var /**< variable to get the bound for */
36130  )
36131 {
36132  assert(scip != NULL);
36133  assert(var != NULL);
36134 
36135  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarObjProbing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36136 
36137  if( !SCIPtreeProbing(scip->tree) )
36138  {
36139  SCIPerrorMessage("not in probing mode\n");
36140  return SCIP_INVALID;
36141  }
36142 
36143  return SCIPvarGetObjLP(var);
36144 }
36145 
36146 /** injects a change of variable's bounds into current probing node to fix the variable to the specified value;
36147  * the same can also be achieved with a call to SCIPfixVar(), but in this case, the bound changes would be treated
36148  * like deductions instead of branching decisions
36149  *
36150  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36151  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36152  *
36153  * @pre This method can be called if @p scip is in one of the following stages:
36154  * - \ref SCIP_STAGE_PRESOLVING
36155  * - \ref SCIP_STAGE_SOLVING
36156  */
36158  SCIP* scip, /**< SCIP data structure */
36159  SCIP_VAR* var, /**< variable to change the bound for */
36160  SCIP_Real fixedval /**< value to fix variable to */
36161  )
36162 {
36163  SCIP_Real fixlb;
36164  SCIP_Real fixub;
36165 
36166  SCIP_CALL( checkStage(scip, "SCIPfixVarProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36167 
36168  if( !SCIPtreeProbing(scip->tree) )
36169  {
36170  SCIPerrorMessage("not in probing mode\n");
36171  return SCIP_INVALIDCALL;
36172  }
36174 
36175  /* we adjust the fixing value here and compare the old bound with the adjusted values because otherwise,
36176  * it might happen that the unadjusted value is better and we add the boundchange,
36177  * but within SCIPnodeAddBoundchg() the bounds are adjusted - using the feasibility epsilon for integer variables -
36178  * and it is asserted, that the bound is still better than the old one which might then be incorrect.
36179  */
36180  fixlb = fixedval;
36181  fixub = fixedval;
36182  SCIPvarAdjustLb(var, scip->set, &fixlb);
36183  SCIPvarAdjustUb(var, scip->set, &fixub);
36184  assert(SCIPsetIsEQ(scip->set, fixlb, fixub));
36185 
36186  if( SCIPsetIsGT(scip->set, fixlb, SCIPvarGetLbLocal(var)) )
36187  {
36189  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
36190  scip->cliquetable, var, fixlb, SCIP_BOUNDTYPE_LOWER, TRUE) );
36191  }
36192  if( SCIPsetIsLT(scip->set, fixub, SCIPvarGetUbLocal(var)) )
36193  {
36195  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
36196  var, fixub, SCIP_BOUNDTYPE_UPPER, TRUE) );
36197  }
36198 
36199  return SCIP_OKAY;
36200 }
36201 
36202 /** changes (column) variable's objective value during probing mode
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 @p scip is in one of the following stages:
36208  * - \ref SCIP_STAGE_PRESOLVING
36209  * - \ref SCIP_STAGE_SOLVING
36210  *
36211  * @pre The variable needs to be a column variable.
36212  */
36214  SCIP* scip, /**< SCIP data structure */
36215  SCIP_VAR* var, /**< variable to change the objective for */
36216  SCIP_Real newobj /**< new objective function value */
36217  )
36218 {
36219  SCIP_NODE* node;
36220  SCIP_Real oldobj;
36221 
36222  SCIP_CALL( checkStage(scip, "SCIPchgVarObjProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36223 
36224  if( !SCIPtreeProbing(scip->tree) )
36225  {
36226  SCIPerrorMessage("not in probing mode\n");
36227  return SCIP_INVALIDCALL;
36228  }
36229 
36230  /* get current probing node */
36231  node = SCIPtreeGetCurrentNode(scip->tree);
36232  assert(SCIPnodeGetType(node) == SCIP_NODETYPE_PROBINGNODE);
36233 
36234  /* get old objective function value */
36235  oldobj = SCIPvarGetObj(var);
36236 
36237  if( SCIPisEQ(scip, oldobj, newobj) )
36238  return SCIP_OKAY;
36239 
36240  if( node->data.probingnode->nchgdobjs == 0 )
36241  {
36242  SCIP_CALL( SCIPallocMemoryArray(scip, &node->data.probingnode->origobjvars, 1) ); /*lint !e506*/
36243  SCIP_CALL( SCIPallocMemoryArray(scip, &node->data.probingnode->origobjvals, 1) ); /*lint !e506*/
36244  }
36245  else
36246  {
36247  SCIP_CALL( SCIPreallocMemoryArray(scip, &node->data.probingnode->origobjvars, node->data.probingnode->nchgdobjs + 1) ); /*lint !e776*/
36248  SCIP_CALL( SCIPreallocMemoryArray(scip, &node->data.probingnode->origobjvals, node->data.probingnode->nchgdobjs + 1) ); /*lint !e776*/
36249  }
36250 
36251  node->data.probingnode->origobjvars[node->data.probingnode->nchgdobjs] = var;
36252  node->data.probingnode->origobjvals[node->data.probingnode->nchgdobjs] = oldobj;
36253  ++node->data.probingnode->nchgdobjs;
36254  ++scip->tree->probingsumchgdobjs;
36255 
36256  assert(SCIPtreeProbingObjChanged(scip->tree) == SCIPlpDivingObjChanged(scip->lp));
36257 
36258  /* inform tree and LP that the objective was changed and invalidate the LP's cutoff bound, since this has nothing to
36259  * do with the current objective value anymore; the cutoff bound is reset in SCIPendProbing()
36260  */
36261  if( !SCIPtreeProbingObjChanged(scip->tree) )
36262  {
36263  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, SCIPsetInfinity(scip->set)) );
36264 
36267  }
36268  assert(SCIPisInfinity(scip, scip->lp->cutoffbound));
36269 
36270  /* perform the objective change */
36271  SCIP_CALL( SCIPvarChgObj(var, scip->mem->probmem, scip->set, scip->transprob, scip->primal, scip->lp, scip->eventqueue, newobj) );
36272 
36273  return SCIP_OKAY;
36274 }
36275 
36276 /** returns whether the objective function has changed during probing mode
36277  *
36278  * @return \ref TRUE if objective has changed, \ref FALSE otherwise
36279  *
36280  * @pre This method can be called if @p scip is in one of the following stages:
36281  * - \ref SCIP_STAGE_TRANSFORMED
36282  * - \ref SCIP_STAGE_INITPRESOLVE
36283  * - \ref SCIP_STAGE_PRESOLVING
36284  * - \ref SCIP_STAGE_EXITPRESOLVE
36285  * - \ref SCIP_STAGE_PRESOLVED
36286  * - \ref SCIP_STAGE_INITSOLVE
36287  * - \ref SCIP_STAGE_SOLVING
36288  * - \ref SCIP_STAGE_SOLVED
36289  * - \ref SCIP_STAGE_EXITSOLVE
36290  */
36292  SCIP* scip /**< SCIP data structure */
36293  )
36294 {
36295  assert(scip != NULL);
36296 
36297  SCIP_CALL_ABORT( checkStage(scip, "SCIPisObjChangedProbing", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
36298 
36299  return scip->tree != NULL && SCIPinProbing(scip) && SCIPtreeProbingObjChanged(scip->tree);
36300 }
36301 
36302 /** applies domain propagation on the probing sub problem, that was changed after SCIPstartProbing() was called;
36303  * the propagated domains of the variables can be accessed with the usual bound accessing calls SCIPvarGetLbLocal()
36304  * and SCIPvarGetUbLocal(); the propagation is only valid locally, i.e. the local bounds as well as the changed
36305  * bounds due to SCIPchgVarLbProbing(), SCIPchgVarUbProbing(), and SCIPfixVarProbing() are used for propagation
36306  *
36307  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36308  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36309  *
36310  * @pre This method can be called if @p scip is in one of the following stages:
36311  * - \ref SCIP_STAGE_PRESOLVING
36312  * - \ref SCIP_STAGE_SOLVING
36313  */
36315  SCIP* scip, /**< SCIP data structure */
36316  int maxproprounds, /**< maximal number of propagation rounds (-1: no limit, 0: parameter settings) */
36317  SCIP_Bool* cutoff, /**< pointer to store whether the probing node can be cut off */
36318  SCIP_Longint* ndomredsfound /**< pointer to store the number of domain reductions found, or NULL */
36319  )
36320 {
36321  SCIP_VAR** objchgvars;
36322  SCIP_Real* objchgvals;
36323  SCIP_Bool changedobj;
36324  int nobjchg;
36325 
36326  SCIP_CALL( checkStage(scip, "SCIPpropagateProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36327 
36328  if( !SCIPtreeProbing(scip->tree) )
36329  {
36330  SCIPerrorMessage("not in probing mode\n");
36331  return SCIP_INVALIDCALL;
36332  }
36333 
36334  objchgvars = NULL;
36335  objchgvals = NULL;
36336  changedobj = FALSE;
36337  nobjchg = 0;
36338 
36339  /* undo objective changes if we want to propagate during probing */
36340  if( scip->tree->probingobjchanged )
36341  {
36342  SCIP_VAR** vars;
36343  int nvars;
36344  int i;
36345 
36346  vars = SCIPgetVars(scip);
36347  nvars = SCIPgetNVars(scip);
36348 
36349  SCIP_CALL( SCIPallocBufferArray(scip, &objchgvals, MIN(nvars, scip->tree->probingsumchgdobjs)) );
36350  SCIP_CALL( SCIPallocBufferArray(scip, &objchgvars, MIN(nvars, scip->tree->probingsumchgdobjs)) );
36351  nobjchg = 0;
36352 
36353  for( i = 0; i < nvars; ++i )
36354  {
36355  if( !SCIPisEQ(scip, vars[i]->unchangedobj, SCIPgetVarObjProbing(scip, vars[i])) )
36356  {
36357  objchgvars[nobjchg] = vars[i];
36358  objchgvals[nobjchg] = SCIPgetVarObjProbing(scip, vars[i]);
36359  ++nobjchg;
36360 
36361  SCIP_CALL( SCIPvarChgObj(vars[i], scip->mem->probmem, scip->set, scip->transprob, scip->primal, scip->lp,
36362  scip->eventqueue, vars[i]->unchangedobj) );
36363  }
36364  }
36365  assert(nobjchg <= scip->tree->probingsumchgdobjs);
36366 
36368  scip->tree->probingobjchanged = FALSE;
36369  changedobj = TRUE;
36370  }
36371 
36372  if( ndomredsfound != NULL )
36373  *ndomredsfound = -(scip->stat->nprobboundchgs + scip->stat->nprobholechgs);
36374 
36375  SCIP_CALL( SCIPpropagateDomains(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
36376  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->conflict, scip->cliquetable,
36377  SCIPgetDepth(scip), maxproprounds, SCIP_PROPTIMING_ALWAYS, cutoff) );
36378 
36379  if( ndomredsfound != NULL )
36380  *ndomredsfound += scip->stat->nprobboundchgs + scip->stat->nprobholechgs;
36381 
36382  /* restore old objective function */
36383  if( changedobj )
36384  {
36385  int i;
36386 
36387  assert(objchgvars != NULL);
36388  assert(objchgvals != NULL);
36389 
36391  scip->tree->probingobjchanged = TRUE;
36392 
36393  for( i = 0; i < nobjchg; ++i )
36394  {
36395  SCIP_CALL( SCIPvarChgObj(objchgvars[i], scip->mem->probmem, scip->set, scip->transprob, scip->primal,
36396  scip->lp, scip->eventqueue, objchgvals[i]) );
36397  }
36398 
36399  SCIPfreeBufferArray(scip, &objchgvars);
36400  SCIPfreeBufferArray(scip, &objchgvals);
36401  }
36402 
36403  return SCIP_OKAY;
36404 }
36405 
36406 /** applies domain propagation on the probing sub problem, that was changed after SCIPstartProbing() was called;
36407  * only propagations of the binary variables fixed at the current probing node that are triggered by the implication
36408  * graph and the clique table are applied;
36409  * the propagated domains of the variables can be accessed with the usual bound accessing calls SCIPvarGetLbLocal()
36410  * and SCIPvarGetUbLocal(); the propagation is only valid locally, i.e. the local bounds as well as the changed
36411  * bounds due to SCIPchgVarLbProbing(), SCIPchgVarUbProbing(), and SCIPfixVarProbing() are used for propagation
36412  *
36413  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36414  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36415  *
36416  * @pre This method can be called if @p scip is in one of the following stages:
36417  * - \ref SCIP_STAGE_PRESOLVING
36418  * - \ref SCIP_STAGE_SOLVING
36419  */
36421  SCIP* scip, /**< SCIP data structure */
36422  SCIP_Bool* cutoff /**< pointer to store whether the probing node can be cut off */
36423  )
36424 {
36425  SCIP_CALL( checkStage(scip, "SCIPpropagateProbingImplications", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36426 
36427  if( !SCIPtreeProbing(scip->tree) )
36428  {
36429  SCIPerrorMessage("not in probing mode\n");
36430  return SCIP_INVALIDCALL;
36431  }
36432 
36434  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, cutoff) );
36435 
36436  return SCIP_OKAY;
36437 }
36438 
36439 /** solves the LP at the current probing node (cannot be applied at preprocessing stage) with or without pricing */
36440 static
36442  SCIP* scip, /**< SCIP data structure */
36443  int itlim, /**< maximal number of LP iterations to perform, or -1 for no limit */
36444  SCIP_Bool pricing, /**< should pricing be applied? */
36445  SCIP_Bool pretendroot, /**< should the pricers be called as if we are at the root node? */
36446  SCIP_Bool displayinfo, /**< should info lines be displayed after each pricing round? */
36447  int maxpricerounds, /**< maximal number of pricing rounds (-1: no limit) */
36448  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
36449  SCIP_Bool* cutoff /**< pointer to store whether the probing LP was infeasible or the objective
36450  * limit was reached (or NULL, if not needed) */
36451  )
36452 {
36453  SCIP_Bool initcutoff;
36454 
36455  assert(lperror != NULL);
36456  assert(SCIPtreeIsFocusNodeLPConstructed(scip->tree));
36457 
36458  if( !SCIPtreeProbing(scip->tree) )
36459  {
36460  SCIPerrorMessage("not in probing mode\n");
36461  return SCIP_INVALIDCALL;
36462  }
36463  assert(SCIPtreeGetCurrentDepth(scip->tree) > 0);
36464 
36465  SCIP_CALL( SCIPinitConssLP(scip->mem->probmem, scip->set, scip->sepastore, scip->cutpool, scip->stat, scip->transprob,
36466  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->eventfilter,
36467  scip->cliquetable, FALSE, FALSE, &initcutoff) );
36468 
36469  if( initcutoff )
36470  {
36471  if( cutoff != NULL )
36472  *cutoff = TRUE;
36473 
36474  return SCIP_OKAY;
36475  }
36476  else if( cutoff != NULL )
36477  *cutoff = FALSE;
36478 
36479  /* load the LP state (if necessary) */
36480  SCIP_CALL( SCIPtreeLoadProbingLPState(scip->tree, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
36481 
36482  SCIPlpSetIsRelax(scip->lp, TRUE);
36483 
36484  /* solve probing LP */
36485  SCIP_CALL( SCIPlpSolveAndEval(scip->lp, scip->set, scip->messagehdlr, scip->mem->probmem, scip->stat,
36486  scip->eventqueue, scip->eventfilter, scip->transprob, (SCIP_Longint)itlim, FALSE, FALSE, FALSE, lperror) );
36487 
36488  assert((*lperror) || SCIPlpGetSolstat(scip->lp) != SCIP_LPSOLSTAT_NOTSOLVED);
36489 
36490  /* mark the probing node to have a solved LP */
36491  if( !(*lperror) )
36492  {
36493  SCIP_CALL( SCIPtreeMarkProbingNodeHasLP(scip->tree, scip->mem->probmem, scip->lp) );
36494 
36495  /* call pricing */
36496  if( pricing )
36497  {
36498  SCIP_Bool mustsepa;
36499  int npricedcolvars;
36500  SCIP_Bool result;
36501 
36502  mustsepa = FALSE;
36503  SCIP_CALL( SCIPpriceLoop(scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->transprob,
36504  scip->origprob, scip->primal, scip->tree, scip->reopt, scip->lp, scip->pricestore, scip->sepastore, scip->cutpool,
36505  scip->branchcand, scip->eventqueue, scip->eventfilter, scip->cliquetable, pretendroot, displayinfo,
36506  maxpricerounds, &npricedcolvars, &mustsepa, lperror, &result) );
36507 
36508  /* mark the probing node again to update the LP size in the node and the tree path */
36509  if( !(*lperror) )
36510  {
36511  SCIP_CALL( SCIPtreeMarkProbingNodeHasLP(scip->tree, scip->mem->probmem, scip->lp) );
36512  }
36513  }
36514  }
36515 
36516  /* remember that probing might have changed the LPi state; this holds even if solving returned with an LP error */
36517  scip->tree->probingsolvedlp = TRUE;
36518 
36519  /* the LP is infeasible or the objective limit was reached */
36520  if( !(*lperror) && (SCIPlpGetSolstat(scip->lp) == SCIP_LPSOLSTAT_INFEASIBLE
36523  && SCIPisGE(scip, SCIPgetLPObjval(scip), SCIPgetCutoffbound(scip)))) )
36524  {
36525  /* analyze the infeasible LP (only if all columns are in the LP and no external pricers exist) */
36526  if( !scip->set->misc_exactsolve && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->tree->probingobjchanged )
36527  {
36528  SCIP_CALL( SCIPconflictAnalyzeLP(scip->conflict, scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
36529  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, NULL) );
36530  }
36531 
36532  if( cutoff != NULL )
36533  *cutoff = TRUE;
36534  }
36535 
36536  return SCIP_OKAY;
36537 }
36538 
36539 /** solves the LP at the current probing node (cannot be applied at preprocessing stage);
36540  * no separation or pricing is applied
36541  *
36542  * The LP has to be constructed before (you can use SCIPisLPConstructed() or SCIPconstructLP()).
36543  *
36544  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36545  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36546  *
36547  * @pre This method can be called if @p scip is in one of the following stages:
36548  * - \ref SCIP_STAGE_SOLVING
36549  */
36551  SCIP* scip, /**< SCIP data structure */
36552  int itlim, /**< maximal number of LP iterations to perform, or -1 for no limit */
36553  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
36554  SCIP_Bool* cutoff /**< pointer to store whether the probing LP was infeasible or the objective
36555  * limit was reached (or NULL, if not needed) */
36556  )
36557 {
36558  SCIP_CALL( checkStage(scip, "SCIPsolveProbingLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36559 
36560  SCIP_CALL( solveProbingLP(scip, itlim, FALSE, FALSE, FALSE, -1, lperror, cutoff) );
36561 
36562  return SCIP_OKAY;
36563 }
36564 
36565 /** solves the LP at the current probing node (cannot be applied at preprocessing stage) and applies pricing
36566  * until the LP is solved to optimality; no separation is applied
36567  *
36568  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36569  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36570  *
36571  * @pre This method can be called if @p scip is in one of the following stages:
36572  * - \ref SCIP_STAGE_SOLVING
36573  */
36575  SCIP* scip, /**< SCIP data structure */
36576  SCIP_Bool pretendroot, /**< should the pricers be called as if we were at the root node? */
36577  SCIP_Bool displayinfo, /**< should info lines be displayed after each pricing round? */
36578  int maxpricerounds, /**< maximal number of pricing rounds (-1: no limit);
36579  * a finite limit means that the LP might not be solved to optimality! */
36580  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
36581  SCIP_Bool* cutoff /**< pointer to store whether the probing LP was infeasible or the objective
36582  * limit was reached (or NULL, if not needed) */
36583  )
36584 {
36585  SCIP_CALL( checkStage(scip, "SCIPsolveProbingLPWithPricing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36586 
36587  SCIP_CALL( solveProbingLP(scip, -1, TRUE, pretendroot, displayinfo, maxpricerounds, lperror, cutoff) );
36588 
36589  return SCIP_OKAY;
36590 }
36591 
36592 /** sets the LP state for the current probing node
36593  *
36594  * @note state and norms are stored at the node and later released by SCIP; therefore, the pointers are set
36595  * to NULL by the method
36596  *
36597  * @note the pointers to state and norms must not be NULL; however, they may point to a NULL pointer if the
36598  * respective information should not be set
36599  *
36600  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36601  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36602  *
36603  * @pre This method can be called if @p scip is in one of the following stages:
36604  * - \ref SCIP_STAGE_PRESOLVING
36605  * - \ref SCIP_STAGE_SOLVING
36606  */
36608  SCIP* scip, /**< SCIP data structure */
36609  SCIP_LPISTATE** lpistate, /**< pointer to LP state information (like basis information) */
36610  SCIP_LPINORMS** lpinorms, /**< pointer to LP pricing norms information */
36611  SCIP_Bool primalfeas, /**< primal feasibility when LP state information was stored */
36612  SCIP_Bool dualfeas /**< dual feasibility when LP state information was stored */
36613  )
36614 {
36615  SCIP_CALL( checkStage(scip, "SCIPsetProbingLPState", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36616 
36617  if( !SCIPtreeProbing(scip->tree) )
36618  {
36619  SCIPerrorMessage("not in probing mode\n");
36620  return SCIP_INVALIDCALL;
36621  }
36622 
36623  SCIP_CALL( SCIPtreeSetProbingLPState(scip->tree, scip->mem->probmem, scip->lp, lpistate, lpinorms, primalfeas, dualfeas) );
36624 
36625  return SCIP_OKAY;
36626 }
36627 
36628 /** adds a row to the LP in the current probing node
36629  *
36630  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36631  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36632  *
36633  * @pre This method can be called if @p scip is in one of the following stages:
36634  * - \ref SCIP_STAGE_SOLVING
36635  *
36636  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36637  */
36639  SCIP* scip, /**< SCIP data structure */
36640  SCIP_ROW* row /**< row to be added */
36641  )
36642 {
36643  SCIP_NODE* node;
36644  int depth;
36645 
36646  assert(scip != NULL);
36647  assert(row != NULL);
36648 
36649  SCIP_CALL( checkStage(scip, "SCIPaddRowProbing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36650 
36651  if( !SCIPtreeProbing(scip->tree) )
36652  {
36653  SCIPerrorMessage("not in probing mode\n");
36654  return SCIP_INVALIDCALL;
36655  }
36656 
36657  /* get depth of current node */
36658  node = SCIPtreeGetCurrentNode(scip->tree);
36659  assert(node != NULL);
36660  depth = SCIPnodeGetDepth(node);
36661 
36662  SCIP_CALL( SCIPlpAddRow(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter, row, depth) );
36663 
36664  return SCIP_OKAY;
36665 }
36666 
36667 
36668 /** applies the cuts in the separation storage to the LP and clears the storage afterwards;
36669  * this method can only be applied during probing; the user should resolve the probing LP afterwards
36670  * in order to get a new solution
36671  *
36672  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36673  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36674  *
36675  * @pre This method can be called if @p scip is in one of the following stages:
36676  * - \ref SCIP_STAGE_SOLVING
36677  */
36679  SCIP* scip, /**< SCIP data structure */
36680  SCIP_Bool* cutoff /**< pointer to store whether an empty domain was created */
36681  )
36682 {
36683  SCIP_CALL( checkStage(scip, "SCIPapplyCutsProbing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36684 
36685  if( !SCIPtreeProbing(scip->tree) )
36686  {
36687  SCIPerrorMessage("not in probing mode\n");
36688  return SCIP_INVALIDCALL;
36689  }
36690 
36691  SCIP_CALL( SCIPsepastoreApplyCuts(scip->sepastore, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
36692  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->eventfilter,
36693  scip->cliquetable, FALSE, SCIP_EFFICIACYCHOICE_LP, cutoff) );
36694 
36695  return SCIP_OKAY;
36696 }
36697 
36698 /** solves relaxation(s) at the current probing node (cannot be applied at preprocessing stage);
36699  * no separation or pricing is applied
36700  *
36701  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36702  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36703  *
36704  * @pre This method can be called if @p scip is in one of the following stages:
36705  * - \ref SCIP_STAGE_SOLVING
36706  */
36708  SCIP* scip, /**< SCIP data structure */
36709  SCIP_Bool* cutoff /**< pointer to store whether a relaxation was infeasible or the objective
36710  * limit was reached (or NULL, if not needed) */
36711  )
36712 {
36713  SCIP_SET* set;
36714  int r;
36715 
36716  SCIP_CALL( checkStage(scip, "SCIPsolveProbingRelax", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36717 
36718  if ( ! SCIPtreeProbing(scip->tree) )
36719  {
36720  SCIPerrorMessage("not in probing mode\n");
36721  return SCIP_INVALIDCALL;
36722  }
36723  assert( SCIPtreeGetCurrentDepth(scip->tree) > 0 );
36724 
36725  assert( cutoff != NULL );
36726  *cutoff = FALSE;
36727 
36728  set = scip->set;
36729 
36730  /* sort relaxators by priority */
36731  SCIPsetSortRelaxs(set);
36732 
36733  /* solve relaxations */
36734  for (r = 0; r < set->nrelaxs && !(*cutoff); ++r)
36735  {
36736  SCIP_RELAX* relax;
36737  SCIP_Real lowerbound;
36738  SCIP_RESULT result;
36739 
36740  lowerbound = -SCIPinfinity(scip);
36741 
36742  relax = set->relaxs[r];
36743  assert( relax != NULL );
36744 
36745  SCIP_CALL( SCIPrelaxExec(relax, set, scip->stat, SCIPtreeGetCurrentDepth(scip->tree), &lowerbound, &result) );
36746 
36747  switch( result )
36748  {
36749  case SCIP_CUTOFF:
36750  *cutoff = TRUE;
36751  SCIPdebugMsg(scip, " -> relaxator <%s> detected cutoff\n", SCIPrelaxGetName(relax));
36752  break;
36753 
36754  case SCIP_CONSADDED:
36755  case SCIP_REDUCEDDOM:
36756  case SCIP_SEPARATED:
36757  case SCIP_SUSPENDED:
36758  SCIPerrorMessage("The relaxator should not return <%d> within probing mode.\n", result);
36759  break;
36760 
36761  case SCIP_SUCCESS:
36762  case SCIP_DIDNOTRUN:
36763  break;
36764 
36765  default:
36766  SCIPerrorMessage("Invalid result code <%d> of relaxator <%s>\n", result, SCIPrelaxGetName(relax));
36767  return SCIP_INVALIDRESULT;
36768  } /*lint !e788*/
36769  }
36770 
36771  return SCIP_OKAY;
36772 }
36773 
36774 /** gets the candidate score and preferred rounding direction for a candidate variable */
36776  SCIP* scip, /**< SCIP data structure */
36777  SCIP_DIVESET* diveset, /**< general diving settings */
36778  SCIP_DIVETYPE divetype, /**< represents different methods for a dive set to explore the next children */
36779  SCIP_VAR* divecand, /**< the candidate for which the branching direction is requested */
36780  SCIP_Real divecandsol, /**< LP solution value of the candidate */
36781  SCIP_Real divecandfrac, /**< fractionality of the candidate */
36782  SCIP_Real* candscore, /**< pointer to store the candidate score */
36783  SCIP_Bool* roundup /**< pointer to store whether preferred direction for diving is upwards */
36784  )
36785 {
36786  assert(scip != NULL);
36787  assert(candscore != NULL);
36788  assert(roundup != NULL);
36789  assert(divecand != NULL);
36790 
36791  SCIP_CALL( checkStage(scip, "SCIPgetDivesetScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36792 
36793  SCIP_CALL( SCIPdivesetGetScore(diveset, scip->set, divetype, divecand, divecandsol, divecandfrac, candscore,
36794  roundup) );
36795 
36796  return SCIP_OKAY;
36797 }
36798 
36799 /** update diveset LP statistics, should be called after every LP solved by this diving heuristic */
36801  SCIP* scip, /**< SCIP data structure */
36802  SCIP_DIVESET* diveset, /**< diving settings */
36803  SCIP_Longint niterstoadd /**< additional number of LP iterations to be added */
36804  )
36805 {
36806  assert(scip != NULL);
36807  assert(diveset != NULL);
36808 
36809  SCIPdivesetUpdateLPStats(diveset, scip->stat, niterstoadd);
36810 }
36811 
36812 /** update diveset statistics and global diveset statistics */
36814  SCIP* scip, /**< SCIP data structure */
36815  SCIP_DIVESET* diveset, /**< diveset to be reset */
36816  int nprobingnodes, /**< the number of probing nodes explored this time */
36817  int nbacktracks, /**< the number of backtracks during probing this time */
36818  SCIP_Longint nsolsfound, /**< the number of solutions found */
36819  SCIP_Longint nbestsolsfound, /**< the number of best solutions found */
36820  SCIP_Bool leavewassol /**< was a solution found at the leaf? */
36821  )
36822 {
36823  assert(scip != NULL);
36824  assert(diveset != NULL);
36825  assert(SCIPinProbing(scip));
36826 
36827  SCIPdivesetUpdateStats(diveset, scip->stat, SCIPgetDepth(scip), nprobingnodes, nbacktracks, nsolsfound, nbestsolsfound, leavewassol);
36828 }
36829 
36830 /** enforces a probing/diving solution by suggesting bound changes that maximize the score w.r.t. the current diving settings
36831  *
36832  * the process is guided by the enforcement priorities of the constraint handlers and the scoring mechanism provided by
36833  * the dive set.
36834  * Constraint handlers may suggest diving bound changes in decreasing order of their enforcement priority, based on the
36835  * solution values in the solution @p sol and the current local bounds of the variables. A diving bound change
36836  * is a triple (variable,branching direction,value) and is used inside SCIPperformGenericDivingAlgorithm().
36837  *
36838  * After a successful call, SCIP holds two arrays of suggested dive bound changes, one for the preferred child
36839  * and one for the alternative.
36840  *
36841  * @see SCIPgetDiveBoundChangeData() for retrieving the dive bound change suggestions.
36842  *
36843  * The method stops after the first constraint handler was successful
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  *
36851  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36852  */
36854  SCIP* scip, /**< SCIP data structure */
36855  SCIP_DIVESET* diveset, /**< diving settings to control scoring */
36856  SCIP_SOL* sol, /**< current solution of diving mode */
36857  SCIP_Bool* success, /**< pointer to store whether constraint handler successfully found a variable */
36858  SCIP_Bool* infeasible /**< pointer to store whether the current node was detected to be infeasible */
36859  )
36860 {
36861  int i;
36862 
36863  assert(scip != NULL);
36864  assert(diveset != NULL);
36865  assert(SCIPinProbing(scip));
36866  assert(infeasible != NULL);
36867  assert(success != NULL);
36868 
36869  SCIP_CALL( checkStage(scip, "SCIPgetDiveBoundChanges", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36870 
36871  *success = FALSE;
36872  *infeasible = FALSE;
36873 
36874  /* we invalidate the previously stored bound changes */
36876 
36877  /* loop over constraint handlers until a constraint handler successfully found a variable/value assignment for proceeding
36878  * or a constraint handler detected the infeasibility of the local node
36879  */
36880  for( i = 0; i < scip->set->nconshdlrs && !(*success || *infeasible); ++i )
36881  {
36882  SCIP_CALL( SCIPconshdlrGetDiveBoundChanges(scip->set->conshdlrs_enfo[i], scip->set, diveset, sol,
36883  success, infeasible) );
36884 
36885  }
36886 #ifndef NDEBUG
36887  /* check if the constraint handler correctly assigned values to the dive set */
36888  if( *success )
36889  {
36890  SCIP_VAR** bdchgvars;
36891  SCIP_BRANCHDIR* bdchgdirs;
36892  SCIP_Real* values;
36893  int nbdchanges;
36894  SCIPtreeGetDiveBoundChangeData(scip->tree, &bdchgvars, &bdchgdirs, &values, &nbdchanges, TRUE);
36895  assert(nbdchanges > 0);
36896  SCIPtreeGetDiveBoundChangeData(scip->tree, &bdchgvars, &bdchgdirs, &values, &nbdchanges, FALSE);
36897  assert(nbdchanges > 0);
36898  }
36899 #endif
36900 
36901  return SCIP_OKAY;
36902 }
36903 
36904 /** adds a diving bound change to the diving bound change storage of SCIP together with the information if this is a
36905  * bound change for the preferred direction or not
36906  *
36907  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36908  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36909  *
36910  * @pre This method can be called if @p scip is in one of the following stages:
36911  * - \ref SCIP_STAGE_SOLVING
36912  *
36913  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36914  */
36916  SCIP* scip, /**< SCIP data structure */
36917  SCIP_VAR* var, /**< variable to apply the bound change to */
36918  SCIP_BRANCHDIR dir, /**< direction of the bound change */
36919  SCIP_Real value, /**< value to adjust this variable bound to */
36920  SCIP_Bool preferred /**< is this a bound change for the preferred child? */
36921  )
36922 {
36923  assert(scip->tree != NULL);
36924  assert(scip->mem->probmem != NULL);
36925  assert(SCIPinProbing(scip));
36926 
36927  SCIP_CALL( checkStage(scip, "SCIPaddDiveBoundChange", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36928 
36929  SCIP_CALL( SCIPtreeAddDiveBoundChange(scip->tree, scip->mem->probmem, var, dir, value, preferred) );
36930 
36931  return SCIP_OKAY;
36932 }
36933 
36934 /** get the dive bound change data for the preferred or the alternative direction
36935  *
36936  * @pre This method can be called if @p scip is in one of the following stages:
36937  * - \ref SCIP_STAGE_SOLVING
36938  *
36939  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36940  */
36942  SCIP* scip, /**< SCIP data structure */
36943  SCIP_VAR*** variables, /**< pointer to store variables for the specified direction */
36944  SCIP_BRANCHDIR** directions, /**< pointer to store the branching directions */
36945  SCIP_Real** values, /**< pointer to store bound change values */
36946  int* ndivebdchgs, /**< pointer to store the number of dive bound changes */
36947  SCIP_Bool preferred /**< should the dive bound changes for the preferred child be output? */
36948  )
36949 {
36950  assert(variables != NULL);
36951  assert(directions != NULL);
36952  assert(values != NULL);
36953  assert(ndivebdchgs != NULL);
36954  assert(SCIPinProbing(scip));
36955 
36956  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDiveBoundChangeData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36957 
36958  SCIPtreeGetDiveBoundChangeData(scip->tree, variables, directions, values, ndivebdchgs, preferred);
36959 }
36960 
36961 /** clear the dive bound change data structures
36962  *
36963  * @pre This method can be called if @p scip is in one of the following stages:
36964  * - \ref SCIP_STAGE_SOLVING
36965  *
36966  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36967  */
36969  SCIP* scip /**< SCIP data structure */
36970  )
36971 {
36972  assert(scip->tree != NULL);
36973 
36974  SCIP_CALL_ABORT( checkStage(scip, "SCIPclearDiveBoundChanges", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36975 
36977 }
36978 
36979 
36980 /*
36981  * branching methods
36982  */
36983 
36984 /** gets branching candidates for LP solution branching (fractional variables) along with solution values,
36985  * fractionalities, and number of branching candidates; The number of branching candidates does NOT
36986  * account for fractional implicit integer variables which should not be used for branching decisions.
36987  *
36988  * Fractional implicit integer variables are stored at the positions *nlpcands to *nlpcands + *nfracimplvars - 1
36989  *
36990  * branching rules should always select the branching candidate among the first npriolpcands of the candidate
36991  * list
36992  *
36993  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36994  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36995  *
36996  * @pre This method can be called if @p scip is in one of the following stages:
36997  * - \ref SCIP_STAGE_SOLVING
36998  *
36999  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37000  */
37002  SCIP* scip, /**< SCIP data structure */
37003  SCIP_VAR*** lpcands, /**< pointer to store the array of LP branching candidates, or NULL */
37004  SCIP_Real** lpcandssol, /**< pointer to store the array of LP candidate solution values, or NULL */
37005  SCIP_Real** lpcandsfrac, /**< pointer to store the array of LP candidate fractionalities, or NULL */
37006  int* nlpcands, /**< pointer to store the number of LP branching candidates, or NULL */
37007  int* npriolpcands, /**< pointer to store the number of candidates with maximal priority, or NULL */
37008  int* nfracimplvars /**< pointer to store the number of fractional implicit integer variables, or NULL */
37009  )
37010 {
37011  SCIP_CALL( checkStage(scip, "SCIPgetLPBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37012 
37014  {
37015  SCIPerrorMessage("LP not solved to optimality - solstat=%d\n", SCIPlpGetSolstat(scip->lp));
37016  return SCIP_INVALIDDATA;
37017  }
37018 
37019  SCIP_CALL( SCIPbranchcandGetLPCands(scip->branchcand, scip->set, scip->stat, scip->lp,
37020  lpcands, lpcandssol, lpcandsfrac, nlpcands, npriolpcands, nfracimplvars) );
37021 
37022  return SCIP_OKAY;
37023 }
37024 
37025 /** gets number of branching candidates for LP solution branching (number of fractional variables)
37026  *
37027  * @return the number of branching candidates for LP solution branching (number of fractional variables).
37028  *
37029  * @pre This method can be called if @p scip is in one of the following stages:
37030  * - \ref SCIP_STAGE_SOLVING
37031  *
37032  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37033  */
37035  SCIP* scip /**< SCIP data structure */
37036  )
37037 {
37038  SCIP_RETCODE retcode;
37039  int nlpcands;
37040 
37041  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37042 
37044  {
37045  SCIPerrorMessage("LP not solved to optimality\n");
37046  SCIPABORT();
37047  return 0; /*lint !e527*/
37048  }
37049 
37050  retcode = SCIPbranchcandGetLPCands(scip->branchcand, scip->set, scip->stat, scip->lp,
37051  NULL, NULL, NULL, &nlpcands, NULL, NULL);
37052 
37053  if( retcode != SCIP_OKAY )
37054  {
37055  SCIPerrorMessage("Error <%u> during computation of the number of LP branching candidates\n", retcode);
37056  SCIPABORT();
37057  return 0; /*lint !e527*/
37058  }
37059 
37060  return nlpcands;
37061 }
37062 
37063 /** gets number of branching candidates with maximal priority for LP solution branching
37064  *
37065  * @return the number of branching candidates with maximal priority for LP solution branching.
37066  *
37067  * @pre This method can be called if @p scip is in one of the following stages:
37068  * - \ref SCIP_STAGE_SOLVING
37069  *
37070  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37071  */
37073  SCIP* scip /**< SCIP data structure */
37074  )
37075 {
37076  SCIP_RETCODE retcode;
37077  int npriolpcands;
37078 
37079  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioLPBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37080 
37082  {
37083  SCIPerrorMessage("LP not solved to optimality\n");
37084  SCIPABORT();
37085  return 0; /*lint !e527*/
37086  }
37087 
37088  retcode = SCIPbranchcandGetLPCands(scip->branchcand, scip->set, scip->stat, scip->lp,
37089  NULL, NULL, NULL, NULL, &npriolpcands, NULL);
37090 
37091  if( retcode != SCIP_OKAY )
37092  {
37093  SCIPerrorMessage("Error <%u> during computation of the number of LP branching candidates with maximal priority\n", retcode);
37094  SCIPABORT();
37095  return 0; /*lint !e527*/
37096  }
37097 
37098  return npriolpcands;
37099 }
37100 
37101 /** gets external branching candidates along with solution values, scores, and number of branching candidates;
37102  * these branching candidates can be used by relaxations or nonlinear constraint handlers;
37103  * branching rules should always select the branching candidate among the first nprioexterncands of the candidate
37104  * list
37105  *
37106  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37107  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37108  *
37109  * @pre This method can be called if @p scip is in one of the following stages:
37110  * - \ref SCIP_STAGE_SOLVING
37111  *
37112  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37113  *
37114  * @note Candidate variables with maximal priority are ordered: binaries first, then integers, implicit integers and
37115  * continuous last.
37116  */
37118  SCIP* scip, /**< SCIP data structure */
37119  SCIP_VAR*** externcands, /**< pointer to store the array of extern branching candidates, or NULL */
37120  SCIP_Real** externcandssol, /**< pointer to store the array of extern candidate solution values, or NULL */
37121  SCIP_Real** externcandsscore, /**< pointer to store the array of extern candidate scores, or NULL */
37122  int* nexterncands, /**< pointer to store the number of extern branching candidates, or NULL */
37123  int* nprioexterncands, /**< pointer to store the number of candidates with maximal priority, or NULL */
37124  int* nprioexternbins, /**< pointer to store the number of binary candidates with maximal priority, or NULL */
37125  int* nprioexternints, /**< pointer to store the number of integer candidates with maximal priority, or NULL */
37126  int* nprioexternimpls /**< pointer to store the number of implicit integer candidates with maximal priority,
37127  * or NULL */
37128  )
37129 {
37130  assert(scip != NULL);
37131 
37132  SCIP_CALL( checkStage(scip, "SCIPgetExternBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37133 
37134  SCIP_CALL( SCIPbranchcandGetExternCands(scip->branchcand, externcands, externcandssol, externcandsscore, nexterncands,
37135  nprioexterncands, nprioexternbins, nprioexternints, nprioexternimpls) );
37136 
37137  return SCIP_OKAY;
37138 }
37139 
37140 /** gets number of external branching candidates
37141  *
37142  * @return the number of external branching candidates.
37143  *
37144  * @pre This method can be called if @p scip is in one of the following stages:
37145  * - \ref SCIP_STAGE_SOLVING
37146  *
37147  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37148  */
37150  SCIP* scip /**< SCIP data structure */
37151  )
37152 {
37153  assert(scip != NULL);
37154 
37155  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNExternBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37156 
37158 }
37159 
37160 /** gets number of external branching candidates with maximal branch priority
37161  *
37162  * @return the number of external branching candidates with maximal branch priority.
37163  *
37164  * @pre This method can be called if @p scip is in one of the following stages:
37165  * - \ref SCIP_STAGE_SOLVING
37166  *
37167  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37168  */
37170  SCIP* scip /**< SCIP data structure */
37171  )
37172 {
37173  assert(scip != NULL);
37174 
37175  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37176 
37178 }
37179 
37180 /** gets number of binary external branching candidates with maximal branch priority
37181  *
37182  * @return the number of binary external branching candidates with maximal branch priority.
37183  *
37184  * @pre This method can be called if @p scip is in one of the following stages:
37185  * - \ref SCIP_STAGE_SOLVING
37186  *
37187  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37188  */
37190  SCIP* scip /**< SCIP data structure */
37191  )
37192 {
37193  assert(scip != NULL);
37194 
37195  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchBins", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37196 
37198 }
37199 
37200 
37201 /** gets number of integer external branching candidates with maximal branch priority
37202  *
37203  * @return the number of integer external branching candidates with maximal branch priority.
37204  *
37205  * @pre This method can be called if @p scip is in one of the following stages:
37206  * - \ref SCIP_STAGE_SOLVING
37207  *
37208  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37209  */
37211  SCIP* scip /**< SCIP data structure */
37212  )
37213 {
37214  assert(scip != NULL);
37215 
37216  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchInts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37217 
37219 }
37220 
37221 /** gets number of implicit integer external branching candidates with maximal branch priority
37222  *
37223  * @return the number of implicit integer external branching candidates with maximal branch priority.
37224  *
37225  * @pre This method can be called if @p scip is in one of the following stages:
37226  * - \ref SCIP_STAGE_SOLVING
37227  *
37228  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37229  */
37231  SCIP* scip /**< SCIP data structure */
37232  )
37233 {
37234  assert(scip != NULL);
37235 
37236  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchImpls", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37237 
37239 }
37240 
37241 /** gets number of continuous external branching candidates with maximal branch priority
37242  *
37243  * @return the number of continuous external branching candidates with maximal branch priority.
37244  *
37245  * @pre This method can be called if @p scip is in one of the following stages:
37246  * - \ref SCIP_STAGE_SOLVING
37247  *
37248  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37249  */
37251  SCIP* scip /**< SCIP data structure */
37252  )
37253 {
37254  assert(scip != NULL);
37255 
37256  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchConts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37257 
37259 }
37260 
37261 /** insert variable, its score and its solution value into the external branching candidate storage
37262  * the relative difference of the current lower and upper bounds of a continuous variable must be at least epsilon
37263  *
37264  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37265  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37266  *
37267  * @pre This method can be called if @p scip is in one of the following stages:
37268  * - \ref SCIP_STAGE_SOLVING
37269  *
37270  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37271  */
37273  SCIP* scip, /**< SCIP data structure */
37274  SCIP_VAR* var, /**< variable to insert */
37275  SCIP_Real score, /**< score of external candidate, e.g. infeasibility */
37276  SCIP_Real solval /**< value of the variable in the current solution */
37277  )
37278 {
37279  assert(scip != NULL);
37280  assert(var->scip == scip);
37281 
37282  SCIP_CALL( checkStage(scip, "SCIPaddExternBranchCand", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37283 
37284  SCIP_CALL( SCIPbranchcandAddExternCand(scip->branchcand, scip->set, var, score, solval) );
37285 
37286  return SCIP_OKAY;
37287 }
37288 
37289 /** removes all external candidates from the storage for external branching
37290  *
37291  * @pre This method can be called if @p scip is in one of the following stages:
37292  * - \ref SCIP_STAGE_SOLVING
37293  *
37294  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37295  */
37297  SCIP* scip /**< SCIP data structure */
37298  )
37299 {
37300  assert(scip != NULL);
37301 
37302  SCIP_CALL_ABORT( checkStage(scip, "SCIPclearExternBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37303 
37305 }
37306 
37307 /** checks whether the given variable is contained in the candidate storage for external branching
37308  *
37309  * @return whether the given variable is contained in the candidate storage for external branching.
37310  *
37311  * @pre This method can be called if @p scip is in one of the following stages:
37312  * - \ref SCIP_STAGE_SOLVING
37313  *
37314  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37315  */
37317  SCIP* scip, /**< SCIP data structure */
37318  SCIP_VAR* var /**< variable to look for */
37319  )
37320 {
37321  assert(scip != NULL);
37322  assert(var->scip == scip);
37323 
37324  SCIP_CALL_ABORT( checkStage(scip, "SCIPcontainsExternBranchCand", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37325 
37326  return SCIPbranchcandContainsExternCand(scip->branchcand, var);
37327 }
37328 
37329 /** gets branching candidates for pseudo solution branching (non-fixed variables) along with the number of candidates
37330  *
37331  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37332  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37333  *
37334  * @pre This method can be called if @p scip is in one of the following stages:
37335  * - \ref SCIP_STAGE_PRESOLVING
37336  * - \ref SCIP_STAGE_SOLVING
37337  *
37338  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37339  */
37341  SCIP* scip, /**< SCIP data structure */
37342  SCIP_VAR*** pseudocands, /**< pointer to store the array of pseudo branching candidates, or NULL */
37343  int* npseudocands, /**< pointer to store the number of pseudo branching candidates, or NULL */
37344  int* npriopseudocands /**< pointer to store the number of candidates with maximal priority, or NULL */
37345  )
37346 {
37347  SCIP_CALL( checkStage(scip, "SCIPgetPseudoBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37348 
37350  pseudocands, npseudocands, npriopseudocands) );
37351 
37352  return SCIP_OKAY;
37353 }
37354 
37355 /** gets number of branching candidates for pseudo solution branching (non-fixed variables)
37356  *
37357  * @return the number branching candidates for pseudo solution branching (non-fixed variables).
37358  *
37359  * @pre This method can be called if @p scip is in one of the following stages:
37360  * - \ref SCIP_STAGE_PRESOLVING
37361  * - \ref SCIP_STAGE_SOLVING
37362  *
37363  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37364  */
37366  SCIP* scip /**< SCIP data structure */
37367  )
37368 {
37369  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPseudoBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37370 
37372 }
37373 
37374 /** gets number of branching candidates with maximal branch priority for pseudo solution branching
37375  *
37376  * @return the number of branching candidates with maximal branch priority for pseudo solution branching.
37377  *
37378  * @pre This method can be called if @p scip is in one of the following stages:
37379  * - \ref SCIP_STAGE_PRESOLVING
37380  * - \ref SCIP_STAGE_SOLVING
37381  *
37382  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37383  */
37385  SCIP* scip /**< SCIP data structure */
37386  )
37387 {
37388  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioPseudoBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37389 
37391 }
37392 
37393 /** gets number of binary branching candidates with maximal branch priority for pseudo solution branching
37394  *
37395  * @return the number of binary branching candidates with maximal branch priority for pseudo solution branching.
37396  *
37397  * @pre This method can be called if @p scip is in one of the following stages:
37398  * - \ref SCIP_STAGE_SOLVING
37399  *
37400  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37401  */
37403  SCIP* scip /**< SCIP data structure */
37404  )
37405 {
37406  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioPseudoBranchBins", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37407 
37409 }
37410 
37411 /** gets number of integer branching candidates with maximal branch priority for pseudo solution branching
37412  *
37413  * @return the number of integer branching candidates with maximal branch priority for pseudo solution branching.
37414  *
37415  * @pre This method can be called if @p scip is in one of the following stages:
37416  * - \ref SCIP_STAGE_SOLVING
37417  *
37418  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37419  */
37421  SCIP* scip /**< SCIP data structure */
37422  )
37423 {
37424  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioPseudoBranchInts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37425 
37427 }
37428 
37429 /** gets number of implicit integer branching candidates with maximal branch priority for pseudo solution branching
37430  *
37431  * @return the number of implicit integer branching candidates with maximal branch priority for pseudo solution branching.
37432  *
37433  * @pre This method can be called if @p scip is in one of the following stages:
37434  * - \ref SCIP_STAGE_SOLVING
37435  *
37436  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37437  */
37439  SCIP* scip /**< SCIP data structure */
37440  )
37441 {
37442  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioPseudoBranchImpls", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37443 
37445 }
37446 
37447 /** calculates the branching score out of the gain predictions for a binary branching
37448  *
37449  * @return the branching score out of the gain predictions for a binary branching.
37450  *
37451  * @pre This method can be called if @p scip is in one of the following stages:
37452  * - \ref SCIP_STAGE_SOLVING
37453  *
37454  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37455  */
37457  SCIP* scip, /**< SCIP data structure */
37458  SCIP_VAR* var, /**< variable, of which the branching factor should be applied, or NULL */
37459  SCIP_Real downgain, /**< prediction of objective gain for rounding downwards */
37460  SCIP_Real upgain /**< prediction of objective gain for rounding upwards */
37461  )
37462 {
37463  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBranchScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37464 
37465  assert( var == NULL || var->scip == scip );
37466 
37467  return SCIPbranchGetScore(scip->set, var, downgain, upgain);
37468 }
37469 
37470 /** calculates the branching score out of the gain predictions for a branching with arbitrary many children
37471  *
37472  * @return the branching score out of the gain predictions for a branching with arbitrary many children.
37473  *
37474  * @pre This method can be called if @p scip is in one of the following stages:
37475  * - \ref SCIP_STAGE_SOLVING
37476  *
37477  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37478  */
37480  SCIP* scip, /**< SCIP data structure */
37481  SCIP_VAR* var, /**< variable, of which the branching factor should be applied, or NULL */
37482  int nchildren, /**< number of children that the branching will create */
37483  SCIP_Real* gains /**< prediction of objective gain for each child */
37484  )
37485 {
37486  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBranchScoreMultiple", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37487 
37488  assert( var->scip == scip );
37489 
37490  return SCIPbranchGetScoreMultiple(scip->set, var, nchildren, gains);
37491 }
37492 
37493 /** computes a branching point for a continuous or discrete variable
37494  *
37495  * @see SCIPbranchGetBranchingPoint
37496  *
37497  * @return the branching point for a continuous or discrete variable.
37498  *
37499  * @pre This method can be called if @p scip is in one of the following stages:
37500  * - \ref SCIP_STAGE_SOLVING
37501  *
37502  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37503  */
37505  SCIP* scip, /**< SCIP data structure */
37506  SCIP_VAR* var, /**< variable, of which the branching point should be computed */
37507  SCIP_Real suggestion /**< suggestion for branching point, or SCIP_INVALID if no suggestion */
37508  )
37509 {
37510  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBranchingPoint", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37511 
37512  assert( var->scip == scip );
37513 
37514  return SCIPbranchGetBranchingPoint(scip->set, scip->tree, var, suggestion);
37515 }
37516 
37517 /** calculates the node selection priority for moving the given variable's LP value to the given target value;
37518  * this node selection priority can be given to the SCIPcreateChild() call
37519  *
37520  * @return the node selection priority for moving the given variable's LP value to the given target value.
37521  *
37522  * @pre This method can be called if @p scip is in one of the following stages:
37523  * - \ref SCIP_STAGE_SOLVING
37524  *
37525  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37526  */
37528  SCIP* scip, /**< SCIP data structure */
37529  SCIP_VAR* var, /**< variable on which the branching is applied */
37530  SCIP_BRANCHDIR branchdir, /**< type of branching that was performed: upwards, downwards, or fixed;
37531  * fixed should only be used, when both bounds changed
37532  */
37533  SCIP_Real targetvalue /**< new value of the variable in the child node */
37534  )
37535 {
37536  SCIP_CALL_ABORT( checkStage(scip, "SCIPcalcNodeselPriority", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37537 
37538  assert( var->scip == scip );
37539 
37540  return SCIPtreeCalcNodeselPriority(scip->tree, scip->set, scip->stat, var, branchdir, targetvalue);
37541 }
37542 
37543 /** calculates an estimate for the objective of the best feasible solution contained in the subtree after applying the given
37544  * branching; this estimate can be given to the SCIPcreateChild() call
37545  *
37546  * @return the estimate for the objective of the best feasible solution contained in the subtree after applying the given
37547  * branching.
37548  *
37549  * @pre This method can be called if @p scip is in one of the following stages:
37550  * - \ref SCIP_STAGE_SOLVING
37551  *
37552  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37553  */
37555  SCIP* scip, /**< SCIP data structure */
37556  SCIP_VAR* var, /**< variable on which the branching is applied */
37557  SCIP_Real targetvalue /**< new value of the variable in the child node */
37558  )
37559 {
37560  SCIP_CALL_ABORT( checkStage(scip, "SCIPcalcChildEstimate", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37561 
37562  assert( var->scip == scip );
37563 
37564  return SCIPtreeCalcChildEstimate(scip->tree, scip->set, scip->stat, var, targetvalue);
37565 }
37566 
37567 /** creates a child node of the focus node
37568  *
37569  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37570  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37571  *
37572  * @pre This method can be called if @p scip is in one of the following stages:
37573  * - \ref SCIP_STAGE_SOLVING
37574  *
37575  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37576  */
37578  SCIP* scip, /**< SCIP data structure */
37579  SCIP_NODE** node, /**< pointer to node data structure */
37580  SCIP_Real nodeselprio, /**< node selection priority of new node */
37581  SCIP_Real estimate /**< estimate for(transformed) objective value of best feasible solution in subtree */
37582  )
37583 {
37584  assert(node != NULL);
37585 
37586  SCIP_CALL( checkStage(scip, "SCIPcreateChild", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37587 
37588  SCIP_CALL( SCIPnodeCreateChild(node, scip->mem->probmem, scip->set, scip->stat, scip->tree, nodeselprio, estimate) );
37589 
37590  return SCIP_OKAY;
37591 }
37592 
37593 /** branches on a non-continuous variable v using the current LP or pseudo solution;
37594  * if solution value x' is fractional, two child nodes will be created
37595  * (x <= floor(x'), x >= ceil(x')),
37596  * if solution value is integral, the x' is equal to lower or upper bound of the branching
37597  * variable and the bounds of v are finite, then two child nodes will be created
37598  * (x <= x'', x >= x''+1 with x'' = floor((lb + ub)/2)),
37599  * otherwise (up to) three child nodes will be created
37600  * (x <= x'-1, x == x', x >= x'+1)
37601  *
37602  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37603  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37604  *
37605  * @pre This method can be called if @p scip is in one of the following stages:
37606  * - \ref SCIP_STAGE_SOLVING
37607  *
37608  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37609  */
37611  SCIP* scip, /**< SCIP data structure */
37612  SCIP_VAR* var, /**< variable to branch on */
37613  SCIP_NODE** downchild, /**< pointer to return the left child with variable rounded down, or NULL */
37614  SCIP_NODE** eqchild, /**< pointer to return the middle child with variable fixed, or NULL */
37615  SCIP_NODE** upchild /**< pointer to return the right child with variable rounded up, or NULL */
37616  )
37617 {
37618  SCIP_CALL( checkStage(scip, "SCIPbranchVar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37619 
37620  assert( var->scip == scip );
37621 
37623  {
37624  SCIPerrorMessage("cannot branch on continuous variable <%s>\n", SCIPvarGetName(var));
37625  return SCIP_INVALIDDATA;
37626  }
37627 
37628  if( SCIPsetIsEQ(scip->set, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) )
37629  {
37630  SCIPerrorMessage("cannot branch on variable <%s> with fixed domain [%.15g,%.15g]\n",
37632  return SCIP_INVALIDDATA;
37633  }
37634 
37635  SCIP_CALL( SCIPtreeBranchVar(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
37636  scip->lp, scip->branchcand, scip->eventqueue, var, SCIP_INVALID, downchild, eqchild, upchild) );
37637 
37638  return SCIP_OKAY;
37639 }
37640 
37641 /** branches a variable x using a given domain hole; two child nodes (x <= left, x >= right) are created
37642  *
37643  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37644  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37645  *
37646  * @pre This method can be called if @p scip is in one of the following stages:
37647  * - \ref SCIP_STAGE_SOLVING
37648  *
37649  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37650  */
37652  SCIP* scip, /**< SCIP data structure */
37653  SCIP_VAR* var, /**< variable to branch on */
37654  SCIP_Real left, /**< left side of the domain hole */
37655  SCIP_Real right, /**< right side of the domain hole */
37656  SCIP_NODE** downchild, /**< pointer to return the left child (x <= left), or NULL */
37657  SCIP_NODE** upchild /**< pointer to return the right child (x >= right), or NULL */
37658  )
37659 {
37660  SCIP_CALL( checkStage(scip, "SCIPbranchVarHole", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37661 
37662  assert( var->scip == scip );
37663 
37664  SCIP_CALL( SCIPtreeBranchVarHole(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
37665  scip->origprob, scip->lp, scip->branchcand, scip->eventqueue, var, left, right, downchild, upchild) );
37666 
37667  return SCIP_OKAY;
37668 }
37669 
37670 /** branches on a variable x using a given value x';
37671  * for continuous variables with relative domain width larger epsilon, x' must not be one of the bounds;
37672  * two child nodes (x <= x', x >= x') are created;
37673  * for integer variables, if solution value x' is fractional, two child nodes are created
37674  * (x <= floor(x'), x >= ceil(x')),
37675  * if x' is integral, three child nodes are created
37676  * (x <= x'-1, x == x', x >= x'+1)
37677  *
37678  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37679  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37680  *
37681  * @pre This method can be called if @p scip is in one of the following stages:
37682  * - \ref SCIP_STAGE_SOLVING
37683  *
37684  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37685  */
37687  SCIP* scip, /**< SCIP data structure */
37688  SCIP_VAR* var, /**< variable to branch on */
37689  SCIP_Real val, /**< value to branch on */
37690  SCIP_NODE** downchild, /**< pointer to return the left child with variable rounded down, or NULL */
37691  SCIP_NODE** eqchild, /**< pointer to return the middle child with variable fixed, or NULL */
37692  SCIP_NODE** upchild /**< pointer to return the right child with variable rounded up, or NULL */
37693  )
37694 {
37695  SCIP_CALL( checkStage(scip, "SCIPbranchVarVal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37696 
37697  assert( var->scip == scip );
37698 
37699  /* A continuous variable will be fixed if SCIPisRelEQ(lb,ub) is true. Otherwise, the given branching value should be
37700  * 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
37701  * 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
37702  * branching value that is at least eps away from both bounds. However, if the variable bounds are below/above
37703  * -/+infinity * 2.1, then SCIPisLT will give an assert, so we omit the check in this case.
37704  */
37705  assert(SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS ||
37706  SCIPisRelEQ(scip, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) ||
37707  SCIPisInfinity(scip, -2.1*SCIPvarGetLbLocal(var)) || SCIPisInfinity(scip, 2.1*SCIPvarGetUbLocal(var)) ||
37708  (SCIPisLT(scip, 2.1*SCIPvarGetLbLocal(var), 2.1*val) && SCIPisLT(scip, 2.1*val, 2.1*SCIPvarGetUbLocal(var)) ) );
37709 
37710  if( SCIPsetIsEQ(scip->set, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) )
37711  {
37712  SCIPerrorMessage("cannot branch on variable <%s> with fixed domain [%.15g,%.15g]\n",
37714  return SCIP_INVALIDDATA;
37715  }
37716 
37717  SCIP_CALL( SCIPtreeBranchVar(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
37718  scip->lp, scip->branchcand, scip->eventqueue, var, val, downchild, eqchild, upchild) );
37719 
37720  return SCIP_OKAY;
37721 }
37722 
37723 /** n-ary branching on a variable x using a given value
37724  *
37725  * Branches on variable x such that up to n/2 children are created on each side of the usual branching value.
37726  * The branching value is selected as in SCIPbranchVarVal().
37727  * The parameters minwidth and widthfactor determine the domain width of the branching variable in the child nodes.
37728  * If n is odd, one child with domain width 'width' and having the branching value in the middle is created.
37729  * Otherwise, two children with domain width 'width' and being left and right of the branching value are created.
37730  * Next further nodes to the left and right are created, where width is multiplied by widthfactor with increasing distance
37731  * from the first nodes.
37732  * The initial width is calculated such that n/2 nodes are created to the left and to the right of the branching value.
37733  * If this value is below minwidth, the initial width is set to minwidth, which may result in creating less than n nodes.
37734  *
37735  * Giving a large value for widthfactor results in creating children with small domain when close to the branching value
37736  * and large domain when closer to the current variable bounds. That is, setting widthfactor to a very large value and n to 3
37737  * results in a ternary branching where the branching variable is mostly fixed in the middle child.
37738  * Setting widthfactor to 1.0 results in children where the branching variable always has the same domain width
37739  * (except for one child if the branching value is not in the middle).
37740  *
37741  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37742  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37743  *
37744  * @pre This method can be called if @p scip is in one of the following stages:
37745  * - \ref SCIP_STAGE_SOLVING
37746  *
37747  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37748  */
37750  SCIP* scip, /**< SCIP data structure */
37751  SCIP_VAR* var, /**< variable to branch on */
37752  SCIP_Real val, /**< value to branch on */
37753  int n, /**< attempted number of children to be created, must be >= 2 */
37754  SCIP_Real minwidth, /**< minimal domain width in children */
37755  SCIP_Real widthfactor, /**< multiplier for children domain width with increasing distance from val, must be >= 1.0 */
37756  int* nchildren /**< pointer to store number of created children, or NULL */
37757  )
37758 {
37759  SCIP_CALL( checkStage(scip, "SCIPbranchVarValNary", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37760 
37761  assert( var->scip == scip );
37762 
37763  /* see comment in SCIPbranchVarVal */
37764  assert(SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS ||
37765  SCIPisRelEQ(scip, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) ||
37766  SCIPisInfinity(scip, -2.1*SCIPvarGetLbLocal(var)) || SCIPisInfinity(scip, 2.1*SCIPvarGetUbLocal(var)) ||
37767  (SCIPisLT(scip, 2.1*SCIPvarGetLbLocal(var), 2.1*val) && SCIPisLT(scip, 2.1*val, 2.1*SCIPvarGetUbLocal(var)) ) );
37768 
37769  if( SCIPsetIsEQ(scip->set, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) )
37770  {
37771  SCIPerrorMessage("cannot branch on variable <%s> with fixed domain [%.15g,%.15g]\n",
37773  return SCIP_INVALIDDATA;
37774  }
37775 
37776  SCIP_CALL( SCIPtreeBranchVarNary(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
37777  scip->origprob, scip->lp, scip->branchcand, scip->eventqueue, var, val, n, minwidth, widthfactor, nchildren) );
37778 
37779  return SCIP_OKAY;
37780 }
37781 
37782 /** calls branching rules to branch on an LP solution; if no fractional variables exist, the result is SCIP_DIDNOTRUN;
37783  * if the branch priority of an unfixed variable is larger than the maximal branch priority of the fractional
37784  * variables, pseudo solution branching is applied on the unfixed variables with maximal branch priority
37785  *
37786  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37787  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37788  *
37789  * @pre This method can be called if @p scip is in one of the following stages:
37790  * - \ref SCIP_STAGE_SOLVING
37791  *
37792  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37793  */
37795  SCIP* scip, /**< SCIP data structure */
37796  SCIP_RESULT* result /**< pointer to store the result of the branching (s. branch.h) */
37797  )
37798 {
37799  SCIP_CALL( checkStage(scip, "SCIPbranchLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37800 
37801  SCIP_CALL( SCIPbranchExecLP(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
37802  scip->tree, scip->reopt, scip->lp, scip->sepastore, scip->branchcand, scip->eventqueue, scip->primal->cutoffbound,
37803  TRUE, result) );
37804 
37805  return SCIP_OKAY;
37806 }
37807 
37808 /** calls branching rules to branch on a external candidates; if no such candidates exist, the result is SCIP_DIDNOTRUN
37809  *
37810  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37811  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37812  *
37813  * @pre This method can be called if @p scip is in one of the following stages:
37814  * - \ref SCIP_STAGE_SOLVING
37815  *
37816  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37817  */
37819  SCIP* scip, /**< SCIP data structure */
37820  SCIP_RESULT* result /**< pointer to store the result of the branching (s. branch.h) */
37821  )
37822 {
37823  SCIP_CALL( checkStage(scip, "SCIPbranchExtern", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37824 
37825  SCIP_CALL( SCIPbranchExecExtern(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
37826  scip->tree, scip->reopt, scip->lp, scip->sepastore, scip->branchcand, scip->eventqueue, scip->primal->cutoffbound,
37827  TRUE, result) );
37828 
37829  return SCIP_OKAY;
37830 }
37831 
37832 /** calls branching rules to branch on a pseudo solution; if no unfixed variables exist, the result is SCIP_DIDNOTRUN
37833  *
37834  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37835  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37836  *
37837  * @pre This method can be called if @p scip is in one of the following stages:
37838  * - \ref SCIP_STAGE_SOLVING
37839  *
37840  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37841  */
37843  SCIP* scip, /**< SCIP data structure */
37844  SCIP_RESULT* result /**< pointer to store the result of the branching (s. branch.h) */
37845  )
37846 {
37847  SCIP_CALL( checkStage(scip, "SCIPbranchPseudo", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37848 
37849  SCIP_CALL( SCIPbranchExecPseudo(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
37850  scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->primal->cutoffbound, TRUE, result) );
37851 
37852  return SCIP_OKAY;
37853 }
37854 
37855 
37856 
37857 
37858 /*
37859  * primal solutions
37860  */
37861 
37862 /** creates a primal solution, initialized to zero
37863  *
37864  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37865  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37866  *
37867  * @pre This method can be called if SCIP is in one of the following stages:
37868  * - \ref SCIP_STAGE_PROBLEM
37869  * - \ref SCIP_STAGE_TRANSFORMING
37870  * - \ref SCIP_STAGE_TRANSFORMED
37871  * - \ref SCIP_STAGE_INITPRESOLVE
37872  * - \ref SCIP_STAGE_PRESOLVING
37873  * - \ref SCIP_STAGE_EXITPRESOLVE
37874  * - \ref SCIP_STAGE_PRESOLVED
37875  * - \ref SCIP_STAGE_INITSOLVE
37876  * - \ref SCIP_STAGE_SOLVING
37877  */
37879  SCIP* scip, /**< SCIP data structure */
37880  SCIP_SOL** sol, /**< pointer to store the solution */
37881  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
37882  )
37883 {
37884  SCIP_CALL( checkStage(scip, "SCIPcreateSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37885 
37886  switch( scip->set->stage )
37887  {
37888  case SCIP_STAGE_PROBLEM:
37889  SCIP_CALL( SCIPsolCreateOriginal(sol, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->origprimal, NULL, heur) );
37890  return SCIP_OKAY;
37891 
37895  case SCIP_STAGE_PRESOLVING:
37897  case SCIP_STAGE_PRESOLVED:
37898  case SCIP_STAGE_INITSOLVE:
37899  case SCIP_STAGE_SOLVING:
37900  SCIP_CALL( SCIPsolCreate(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, heur) );
37901  return SCIP_OKAY;
37902 
37903  case SCIP_STAGE_SOLVED:
37904  case SCIP_STAGE_EXITSOLVE:
37905  case SCIP_STAGE_FREETRANS:
37906  default:
37907  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
37908  return SCIP_INVALIDDATA;
37909  } /*lint !e788*/
37910 }
37911 
37912 /** creates a primal solution, initialized to the current LP solution
37913  *
37914  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37915  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37916  *
37917  * @pre This method can be called if SCIP is in one of the following stages:
37918  * - \ref SCIP_STAGE_SOLVING
37919  */
37921  SCIP* scip, /**< SCIP data structure */
37922  SCIP_SOL** sol, /**< pointer to store the solution */
37923  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
37924  )
37925 {
37926  SCIP_CALL( checkStage(scip, "SCIPcreateLPSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37927 
37928  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
37929  {
37930  SCIPerrorMessage("LP solution does not exist\n");
37931  return SCIP_INVALIDCALL;
37932  }
37933 
37934  SCIP_CALL( SCIPsolCreateLPSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
37935  scip->tree, scip->lp, heur) );
37936 
37937  return SCIP_OKAY;
37938 }
37939 
37940 /** creates a primal solution, initialized to the current NLP solution
37941  *
37942  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37943  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37944  *
37945  * @pre This method can be called if SCIP is in one of the following stages:
37946  * - \ref SCIP_STAGE_SOLVING
37947  */
37949  SCIP* scip, /**< SCIP data structure */
37950  SCIP_SOL** sol, /**< pointer to store the solution */
37951  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
37952  )
37953 {
37954  SCIP_CALL( checkStage(scip, "SCIPcreateNLPSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37955 
37956  if( !SCIPisNLPConstructed(scip) )
37957  {
37958  SCIPerrorMessage("NLP does not exist\n");
37959  return SCIP_INVALIDCALL;
37960  }
37961  assert(scip->nlp != NULL);
37962 
37963  if( !SCIPnlpHasSolution(scip->nlp) )
37964  {
37965  SCIPerrorMessage("NLP solution does not exist\n");
37966  return SCIP_INVALIDCALL;
37967  }
37968 
37969  SCIP_CALL( SCIPsolCreateNLPSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, scip->nlp,
37970  heur) );
37971 
37972  return SCIP_OKAY;
37973 }
37974 
37975 /** creates a primal solution, initialized to the current relaxation solution
37976  *
37977  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37978  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37979  *
37980  * @pre This method can be called if SCIP is in one of the following stages:
37981  * - \ref SCIP_STAGE_SOLVING
37982  */
37984  SCIP* scip, /**< SCIP data structure */
37985  SCIP_SOL** sol, /**< pointer to store the solution */
37986  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
37987  )
37988 {
37989  SCIP_CALL( checkStage(scip, "SCIPcreateRelaxSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37990 
37991  if( !SCIPrelaxationIsSolValid(scip->relaxation) )
37992  {
37993  SCIPerrorMessage("relaxation solution is not valid\n");
37994  return SCIP_INVALIDCALL;
37995  }
37996 
37997  SCIP_CALL( SCIPsolCreateRelaxSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, scip->relaxation, heur) );
37998 
37999  return SCIP_OKAY;
38000 }
38001 
38002 /** creates a primal solution, initialized to the current pseudo solution
38003  *
38004  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38005  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38006  *
38007  * @pre This method can be called if SCIP is in one of the following stages:
38008  * - \ref SCIP_STAGE_SOLVING
38009  */
38011  SCIP* scip, /**< SCIP data structure */
38012  SCIP_SOL** sol, /**< pointer to store the solution */
38013  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
38014  )
38015 {
38016  SCIP_CALL( checkStage(scip, "SCIPcreatePseudoSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38017 
38018  SCIP_CALL( SCIPsolCreatePseudoSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
38019  scip->tree, scip->lp, heur) );
38020 
38021  return SCIP_OKAY;
38022 }
38023 
38024 /** creates a primal solution, initialized to the current LP or pseudo solution, depending on whether the LP was solved
38025  * at the current node
38026  *
38027  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38028  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38029  *
38030  * @pre This method can be called if SCIP is in one of the following stages:
38031  * - \ref SCIP_STAGE_SOLVING
38032  */
38034  SCIP* scip, /**< SCIP data structure */
38035  SCIP_SOL** sol, /**< pointer to store the solution */
38036  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
38037  )
38038 {
38039  SCIP_CALL( checkStage(scip, "SCIPcreateCurrentSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38040 
38041  SCIP_CALL( SCIPsolCreateCurrentSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
38042  scip->tree, scip->lp, heur) );
38043 
38044  return SCIP_OKAY;
38045 }
38046 
38047 /** creates a partial primal solution, initialized to unknown values
38048  *
38049  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38050  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38051  *
38052  * @pre This method can be called if SCIP is in one of the following stages:
38053  * - \ref SCIP_STAGE_PROBLEM
38054  */
38056  SCIP* scip, /**< SCIP data structure */
38057  SCIP_SOL** sol, /**< pointer to store the solution */
38058  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
38059  )
38060 {
38061  SCIP_CALL( checkStage(scip, "SCIPcreatePartialSol", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
38062 
38063  SCIP_CALL( SCIPsolCreatePartial(sol, scip->mem->probmem, scip->set, scip->stat, scip->origprimal, heur) );
38064 
38065  return SCIP_OKAY;
38066 }
38067 
38068 /** creates a primal solution, initialized to unknown values
38069  *
38070  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38071  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38072  *
38073  * @pre This method can be called if SCIP is in one of the following stages:
38074  * - \ref SCIP_STAGE_TRANSFORMING
38075  * - \ref SCIP_STAGE_TRANSFORMED
38076  * - \ref SCIP_STAGE_INITPRESOLVE
38077  * - \ref SCIP_STAGE_PRESOLVING
38078  * - \ref SCIP_STAGE_EXITPRESOLVE
38079  * - \ref SCIP_STAGE_PRESOLVED
38080  * - \ref SCIP_STAGE_INITSOLVE
38081  * - \ref SCIP_STAGE_SOLVING
38082  */
38084  SCIP* scip, /**< SCIP data structure */
38085  SCIP_SOL** sol, /**< pointer to store the solution */
38086  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
38087  )
38088 {
38089  SCIP_CALL( checkStage(scip, "SCIPcreateUnknownSol", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38090 
38091  SCIP_CALL( SCIPsolCreateUnknown(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, heur) );
38092 
38093  return SCIP_OKAY;
38094 }
38095 
38096 /** creates a primal solution living in the original problem space, initialized to zero;
38097  * a solution in original space allows to set original variables to values that would be invalid in the
38098  * transformed problem due to preprocessing fixings or aggregations
38099  *
38100  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38101  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38102  *
38103  * @pre This method can be called if SCIP is in one of the following stages:
38104  * - \ref SCIP_STAGE_PROBLEM
38105  * - \ref SCIP_STAGE_TRANSFORMING
38106  * - \ref SCIP_STAGE_TRANSFORMED
38107  * - \ref SCIP_STAGE_INITPRESOLVE
38108  * - \ref SCIP_STAGE_PRESOLVING
38109  * - \ref SCIP_STAGE_EXITPRESOLVE
38110  * - \ref SCIP_STAGE_PRESOLVED
38111  * - \ref SCIP_STAGE_INITSOLVE
38112  * - \ref SCIP_STAGE_SOLVING
38113  * - \ref SCIP_STAGE_SOLVED
38114  */
38116  SCIP* scip, /**< SCIP data structure */
38117  SCIP_SOL** sol, /**< pointer to store the solution */
38118  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
38119  )
38120 {
38121  SCIP_CALL( checkStage(scip, "SCIPcreateOrigSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38122 
38123  switch( scip->set->stage )
38124  {
38125  case SCIP_STAGE_PROBLEM:
38126  SCIP_CALL( SCIPsolCreateOriginal(sol, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->origprimal, NULL, heur) );
38127  return SCIP_OKAY;
38128 
38132  case SCIP_STAGE_PRESOLVING:
38134  case SCIP_STAGE_PRESOLVED:
38135  case SCIP_STAGE_INITSOLVE:
38136  case SCIP_STAGE_SOLVING:
38137  case SCIP_STAGE_SOLVED:
38138  SCIP_CALL( SCIPsolCreateOriginal(sol, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->primal, scip->tree, heur) );
38139  return SCIP_OKAY;
38140 
38141  case SCIP_STAGE_EXITSOLVE:
38142  case SCIP_STAGE_FREETRANS:
38143  default:
38144  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
38145  return SCIP_INVALIDCALL;
38146  } /*lint !e788*/
38147 }
38148 
38149 /** creates a copy of a primal solution; note that a copy of a linked solution is also linked and needs to be unlinked
38150  * if it should stay unaffected from changes in the LP or pseudo solution
38151  *
38152  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38153  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38154  *
38155  * @pre This method can be called if SCIP is in one of the following stages:
38156  * - \ref SCIP_STAGE_PROBLEM
38157  * - \ref SCIP_STAGE_FREETRANS
38158  * - \ref SCIP_STAGE_TRANSFORMING
38159  * - \ref SCIP_STAGE_TRANSFORMED
38160  * - \ref SCIP_STAGE_INITPRESOLVE
38161  * - \ref SCIP_STAGE_PRESOLVING
38162  * - \ref SCIP_STAGE_EXITPRESOLVE
38163  * - \ref SCIP_STAGE_PRESOLVED
38164  * - \ref SCIP_STAGE_INITSOLVE
38165  * - \ref SCIP_STAGE_SOLVING
38166  * - \ref SCIP_STAGE_SOLVED
38167  */
38169  SCIP* scip, /**< SCIP data structure */
38170  SCIP_SOL** sol, /**< pointer to store the solution */
38171  SCIP_SOL* sourcesol /**< primal CIP solution to copy */
38172  )
38173 {
38174  SCIP_CALL( checkStage(scip, "SCIPcreateSolCopy", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38175 
38176  /* check if we want to copy the current solution, which is the same as creating a current solution */
38177  if( sourcesol == NULL )
38178  {
38179  SCIP_CALL( SCIPcreateCurrentSol(scip, sol, NULL) );
38180  }
38181  else
38182  {
38183  SCIP_CALL( SCIPsolCopy(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, sourcesol) );
38184  }
38185 
38186  return SCIP_OKAY;
38187 }
38188 
38189 /** creates a copy of a solution in the original primal solution space
38190  *
38191  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38192  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38193  *
38194  * @pre This method can be called if SCIP is in one of the following stages:
38195  * - \ref SCIP_STAGE_PROBLEM
38196  * - \ref SCIP_STAGE_TRANSFORMING
38197  * - \ref SCIP_STAGE_TRANSFORMED
38198  * - \ref SCIP_STAGE_INITPRESOLVE
38199  * - \ref SCIP_STAGE_PRESOLVING
38200  * - \ref SCIP_STAGE_EXITPRESOLVE
38201  * - \ref SCIP_STAGE_PRESOLVED
38202  * - \ref SCIP_STAGE_INITSOLVE
38203  * - \ref SCIP_STAGE_SOLVING
38204  * - \ref SCIP_STAGE_SOLVED
38205  * - \ref SCIP_STAGE_EXITSOLVE
38206  * - \ref SCIP_STAGE_FREETRANS
38207  */
38209  SCIP* scip, /**< SCIP data structure */
38210  SCIP_SOL** sol, /**< pointer to store the solution */
38211  SCIP_SOL* sourcesol /**< primal CIP solution to copy */
38212  )
38213 {
38214  SCIP_CALL( checkStage(scip, "SCIPcreateSolCopyOrig", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38215 
38216  /* check if we want to copy the current solution, which is the same as creating a current solution */
38217  if( sourcesol == NULL )
38218  {
38219  SCIP_CALL( SCIPcreateCurrentSol(scip, sol, NULL) );
38220  }
38221  else
38222  {
38223  switch( scip->set->stage )
38224  {
38225  case SCIP_STAGE_PROBLEM:
38226  case SCIP_STAGE_FREETRANS:
38227  case SCIP_STAGE_SOLVED:
38231  case SCIP_STAGE_PRESOLVING:
38233  case SCIP_STAGE_PRESOLVED:
38234  case SCIP_STAGE_INITSOLVE:
38235  case SCIP_STAGE_SOLVING:
38236  SCIP_CALL( SCIPsolCopy(sol, scip->mem->probmem, scip->set, scip->stat, scip->origprimal, sourcesol) );
38237  break;
38238  default:
38239  assert(FALSE);
38240  } /*lint !e788*/
38241  }
38242 
38243  return SCIP_OKAY;
38244 }
38245 
38246 /** helper method that sets up and solves the sub-SCIP for removing infinite values from solutions */
38247 static
38249  SCIP* scip, /**< SCIP data structure */
38250  SCIP* subscip, /**< SCIP data structure of sub-SCIP*/
38251  SCIP_VAR** origvars, /**< original problem variables of main SCIP */
38252  int norigvars, /**< number of original problem variables of main SCIP */
38253  SCIP_Real* solvals, /**< array with solution values of variables; infinite ones are replaced */
38254  SCIP_Bool* success /**< pointer to store if removing infinite values was successful */
38255  )
38256 {
38257  SCIP_HASHMAP* varmap;
38258  SCIP_VAR* varcopy;
38259  SCIP_Real fixval;
38260  SCIP_Bool valid;
38261  SCIP_SOL* bestsol;
38262  int v;
38263 
38264  assert(scip != NULL);
38265  assert(subscip != NULL);
38266  assert(origvars != NULL);
38267  assert(solvals != NULL);
38268  assert(success != NULL);
38269 
38270  /* copy the original problem to the sub-SCIP */
38271  SCIP_CALL( SCIPhashmapCreate(&varmap, SCIPblkmem(scip), norigvars) );
38272  SCIP_CALL( SCIPcopyOrig(scip, subscip, varmap, NULL, "removeinffixings", TRUE, TRUE, &valid) );
38273 
38274  SCIP_CALL( SCIPsetIntParam(subscip, "display/verblevel", (int)SCIP_VERBLEVEL_NONE) );
38275 
38276  /* in the sub-SCIP, we try to minimize the absolute values of all variables with infinite values in the solution
38277  * and fix all other variables to the value they have in the solution
38278  */
38279  for( v = 0; v < norigvars; ++v )
38280  {
38281  varcopy = (SCIP_VAR*) SCIPhashmapGetImage(varmap, (void*)origvars[v]);
38282  assert(varcopy != NULL);
38283 
38284  fixval = solvals[v];
38285 
38286  if( SCIPisInfinity(scip, fixval) || SCIPisInfinity(scip, -fixval) )
38287  {
38288  /* If a variable with a finite finite lower bound was set to +infinity, we just change its objective to 1.0
38289  * to minimize its value; if a variable with a finite finite upper bound was set to -infinity, we just
38290  * change its objective to -1.0 to maximize its value; if a variable is free, we split the variable into
38291  * positive and negative part by creating two new non-negative variables and one constraint linking those
38292  * variables.
38293  */
38294  if( SCIPisInfinity(scip, fixval) && !SCIPisInfinity(scip, -SCIPvarGetLbLocal(varcopy)) )
38295  {
38296  SCIP_CALL( SCIPchgVarObj(subscip, varcopy, 1.0) );
38297  }
38298  else if( SCIPisInfinity(scip, -fixval) && !SCIPisInfinity(scip, SCIPvarGetUbLocal(varcopy)) )
38299  {
38300  SCIP_CALL( SCIPchgVarObj(subscip, varcopy, -1.0) );
38301  }
38302  else
38303  {
38304  char name[SCIP_MAXSTRLEN];
38305  SCIP_VAR* posvar;
38306  SCIP_VAR* negvar;
38307  SCIP_CONS* linkcons;
38308 
38309  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%s", SCIPvarGetName(varcopy), "run");
38310  SCIP_CALL( SCIPcreateVar(subscip, &posvar, name, 0.0, SCIPinfinity(scip), 1.0,
38311  SCIP_VARTYPE_CONTINUOUS, TRUE, FALSE, NULL, NULL, NULL, NULL, NULL) );
38312  SCIP_CALL( SCIPaddVar(subscip, posvar) );
38313 
38314  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%s", SCIPvarGetName(varcopy), "neg");
38315  SCIP_CALL( SCIPcreateVar(subscip, &negvar, name, 0.0, SCIPinfinity(scip), 1.0,
38316  SCIP_VARTYPE_CONTINUOUS, TRUE, FALSE, NULL, NULL, NULL, NULL, NULL) );
38317  SCIP_CALL( SCIPaddVar(subscip, negvar) );
38318 
38319  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%s", SCIPvarGetName(varcopy), "linkcons");
38320  SCIP_CALL( SCIPcreateConsBasicLinear(subscip, &linkcons, name, 0, NULL, NULL, 0.0, 0.0 ) );
38321  SCIP_CALL( SCIPaddCoefLinear(subscip, linkcons, varcopy, 1.0) );
38322  SCIP_CALL( SCIPaddCoefLinear(subscip, linkcons, posvar, -1.0) );
38323  SCIP_CALL( SCIPaddCoefLinear(subscip, linkcons, negvar, 1.0) );
38324  SCIP_CALL( SCIPaddCons(subscip, linkcons) );
38325 
38326  SCIP_CALL( SCIPreleaseCons(subscip, &linkcons) );
38327  SCIP_CALL( SCIPreleaseVar(subscip, &posvar) );
38328  SCIP_CALL( SCIPreleaseVar(subscip, &negvar) );
38329 
38330  SCIP_CALL( SCIPchgVarObj(subscip, varcopy, 0.0) );
38331  }
38332  }
38333  else
38334  {
38335  SCIP_Bool infeasible;
38336  SCIP_Bool fixed;
38337 
38338  if( SCIPisFeasLT(scip, solvals[v], SCIPvarGetLbLocal(varcopy)) || SCIPisFeasGT(scip, solvals[v], SCIPvarGetUbLocal(varcopy)) )
38339  {
38340  SCIP_CALL( SCIPchgVarType(subscip, varcopy, SCIP_VARTYPE_CONTINUOUS, &infeasible) );
38341  assert(!infeasible);
38342  }
38343 
38344  /* fix variable to its value in the solution */
38345  SCIP_CALL( SCIPfixVar(subscip, varcopy, fixval, &infeasible, &fixed) );
38346  assert(!infeasible);
38347  }
38348  }
38349 
38350  SCIP_CALL( SCIPsolve(subscip) );
38351 
38352  bestsol = SCIPgetBestSol(subscip);
38353 
38354  if( bestsol != NULL )
38355  {
38356  /* change the stored solution values for variables fixed to infinite values */
38357  for( v = 0; v < norigvars; ++v )
38358  {
38359  varcopy = (SCIP_VAR*) SCIPhashmapGetImage(varmap, (void*)origvars[v]);
38360  assert(varcopy != NULL);
38361 
38362  if( (SCIPisInfinity(scip, solvals[v]) || SCIPisInfinity(scip, -solvals[v])) )
38363  {
38364  solvals[v] = SCIPgetSolVal(subscip, bestsol, varcopy);
38365  }
38366  }
38367  }
38368  else
38369  {
38370  *success = FALSE;
38371  }
38372 
38373  SCIPhashmapFree(&varmap);
38374 
38375  return SCIP_OKAY;
38376 }
38377 
38378 
38379 /** creates a copy of a primal solution, thereby replacing infinite fixings of variables by finite values;
38380  * the copy is always defined in the original variable space;
38381  * success indicates whether the objective value of the solution was changed by removing infinite values
38382  *
38383  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38384  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38385  *
38386  * @pre This method can be called if SCIP is in one of the following stages:
38387  * - \ref SCIP_STAGE_PROBLEM
38388  * - \ref SCIP_STAGE_TRANSFORMING
38389  * - \ref SCIP_STAGE_TRANSFORMED
38390  * - \ref SCIP_STAGE_INITPRESOLVE
38391  * - \ref SCIP_STAGE_PRESOLVING
38392  * - \ref SCIP_STAGE_EXITPRESOLVE
38393  * - \ref SCIP_STAGE_PRESOLVED
38394  * - \ref SCIP_STAGE_INITSOLVE
38395  * - \ref SCIP_STAGE_SOLVING
38396  * - \ref SCIP_STAGE_SOLVED
38397  * - \ref SCIP_STAGE_EXITSOLVE
38398  */
38400  SCIP* scip, /**< SCIP data structure */
38401  SCIP_SOL** sol, /**< pointer to store the solution */
38402  SCIP_SOL* sourcesol, /**< primal CIP solution to copy */
38403  SCIP_Bool* success /**< does the finite solution have the same objective value? */
38404  )
38405 {
38406  SCIP_VAR** fixedvars;
38407  SCIP_VAR** origvars;
38408  SCIP_Real* solvals;
38409  SCIP_VAR* var;
38410  int nfixedvars;
38411  int norigvars;
38412  int v;
38413 
38414  SCIP_CALL( checkStage(scip, "SCIPcreateFiniteSolCopy", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38415 
38416  assert(scip != NULL);
38417  assert(sol != NULL);
38418  assert(sourcesol != NULL);
38419  assert(success != NULL);
38420 
38421  *success = TRUE;
38422  *sol = NULL;
38423 
38424  fixedvars = SCIPgetFixedVars(scip);
38425  nfixedvars = SCIPgetNFixedVars(scip);
38426  assert(fixedvars != NULL || nfixedvars == 0);
38427 
38428  /* get original variables and their values in the optimal solution */
38429  SCIP_CALL( SCIPgetOrigVarsData(scip, &origvars, &norigvars, NULL, NULL, NULL, NULL) );
38430  SCIP_CALL( SCIPallocBufferArray(scip, &solvals, norigvars) );
38431  SCIP_CALL( SCIPgetSolVals(scip, sourcesol, norigvars, origvars, solvals) );
38432 
38433  /* check whether there are variables fixed to an infinite value */
38434  for( v = 0; v < nfixedvars; ++v )
38435  {
38436  var = fixedvars[v]; /*lint !e613*/
38437 
38438  /* skip (multi-)aggregated variables */
38440  continue;
38441 
38442  assert(SCIPisEQ(scip, SCIPvarGetLbGlobal(var), SCIPvarGetUbGlobal(var)));
38443 
38444  if( (SCIPisInfinity(scip, SCIPvarGetLbGlobal(var)) || SCIPisInfinity(scip, -SCIPvarGetLbGlobal(var))) )
38445  {
38446  SCIPdebugMsg(scip, "var <%s> is fixed to infinite value %g\n", SCIPvarGetName(var), SCIPvarGetLbGlobal(var));
38447  break;
38448  }
38449  }
38450 
38451  /* there were variables fixed to infinite values */
38452  if( v < nfixedvars )
38453  {
38454  SCIP* subscip;
38455  SCIP_RETCODE retcode;
38456 
38457  /* if one of the variables was fixed to infinity in the original problem, we stop here */
38458  for( v = 0; v < norigvars; ++v )
38459  {
38460  var = origvars[v];
38461 
38463  {
38464  assert(SCIPisEQ(scip, SCIPvarGetLbOriginal(var), SCIPvarGetUbOriginal(var)));
38465 
38466  SCIPdebugMsg(scip, "--> var <%s> is fixed to infinite value %g in the original problem, stop making solution finite\n",
38468 
38469  *success = FALSE;
38470 
38471  goto TERMINATE;
38472  }
38473  }
38474 
38475  /* create sub-SCIP */
38476  SCIP_CALL( SCIPcreate(&subscip) );
38477 
38478  retcode = setupAndSolveFiniteSolSubscip(scip, subscip, origvars, norigvars, solvals, success);
38479 
38480  /* free sub-SCIP */
38481  SCIP_CALL( SCIPfree(&subscip) );
38482 
38483  SCIP_CALL( retcode );
38484  }
38485 
38486  /* create original solution and set the solution values */
38487  if( *success )
38488  {
38489  SCIP_CALL( SCIPcreateOrigSol(scip, sol, NULL) );
38490  for( v = 0; v < norigvars; ++v )
38491  {
38492  SCIP_CALL( SCIPsetSolVal(scip, *sol, origvars[v], solvals[v]) );
38493  }
38494  }
38495 
38496 #ifdef SCIP_DEBUG
38497  SCIPdebugMsg(scip, "created finites solution copy:\n");
38498  SCIP_CALL( SCIPprintSol(scip, *sol, NULL, FALSE) );
38499 #endif
38500 
38501  /* the solution of the sub-SCIP should have the same objective value */
38502  if( *success && !SCIPisEQ(scip, SCIPgetSolOrigObj(scip, *sol), SCIPgetSolOrigObj(scip, sourcesol)) )
38503  {
38504  /* @todo how should we avoid numerical trobles here for large objective values? */
38505  if( (SCIPgetSolOrigObj(scip, *sol) / SCIPepsilon(scip)) < 1e+15 ||
38506  REALABS(SCIPgetSolOrigObj(scip, *sol) - SCIPgetSolOrigObj(scip, sourcesol)) > 1e-12 * SCIPgetSolOrigObj(scip, *sol) )
38507  *success = FALSE;
38508  }
38509 
38510  TERMINATE:
38511  SCIPfreeBufferArray(scip, &solvals);
38512 
38513  return SCIP_OKAY;
38514 }
38515 
38516 /** frees primal CIP solution
38517  *
38518  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38519  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38520  *
38521  * @pre This method can be called if SCIP is in one of the following stages:
38522  * - \ref SCIP_STAGE_PROBLEM
38523  * - \ref SCIP_STAGE_TRANSFORMING
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  * - \ref SCIP_STAGE_FREETRANS
38534  */
38536  SCIP* scip, /**< SCIP data structure */
38537  SCIP_SOL** sol /**< pointer to the solution */
38538  )
38539 {
38540  SCIP_CALL( checkStage(scip, "SCIPfreeSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38541 
38542  switch( scip->set->stage )
38543  {
38544  case SCIP_STAGE_PROBLEM:
38545  SCIP_CALL( SCIPsolFree(sol, scip->mem->probmem, scip->origprimal) );
38546  break;
38547  case SCIP_STAGE_FREETRANS:
38550  case SCIP_STAGE_PRESOLVING:
38552  case SCIP_STAGE_PRESOLVED:
38553  case SCIP_STAGE_SOLVING:
38555  case SCIP_STAGE_INITSOLVE:
38556  case SCIP_STAGE_SOLVED:
38557  case SCIP_STAGE_EXITSOLVE:
38558  SCIP_CALL( SCIPsolFree(sol, scip->mem->probmem, scip->primal) );
38559  break;
38560  default:
38561  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
38562  return SCIP_INVALIDCALL;
38563  } /*lint !e788*/
38564 
38565  return SCIP_OKAY;
38566 }
38567 
38568 /** links a primal solution to the current LP solution
38569  *
38570  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38571  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38572  *
38573  * @pre This method can be called if SCIP is in one of the following stages:
38574  * - \ref SCIP_STAGE_SOLVING
38575  */
38577  SCIP* scip, /**< SCIP data structure */
38578  SCIP_SOL* sol /**< primal solution */
38579  )
38580 {
38581  SCIP_CALL( checkStage(scip, "SCIPlinkLPSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38582 
38583  if( !SCIPlpIsSolved(scip->lp) )
38584  {
38585  SCIPerrorMessage("LP solution does not exist\n");
38586  return SCIP_INVALIDCALL;
38587  }
38588 
38589  SCIP_CALL( SCIPsolLinkLPSol(sol, scip->set, scip->stat, scip->transprob, scip->tree, scip->lp) );
38590 
38591  return SCIP_OKAY;
38592 }
38593 
38594 /** links a primal solution to the current NLP solution
38595  *
38596  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38597  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38598  *
38599  * @pre This method can be called if SCIP is in one of the following stages:
38600  * - \ref SCIP_STAGE_SOLVING
38601  */
38603  SCIP* scip, /**< SCIP data structure */
38604  SCIP_SOL* sol /**< primal solution */
38605  )
38606 {
38607  SCIP_CALL( checkStage(scip, "SCIPlinkNLPSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38608 
38609  if( scip->nlp == NULL )
38610  {
38611  SCIPerrorMessage("NLP does not exist\n");
38612  return SCIP_INVALIDCALL;
38613  }
38614 
38616  {
38617  SCIPerrorMessage("NLP solution does not exist\n");
38618  return SCIP_INVALIDCALL;
38619  }
38620 
38621  SCIP_CALL( SCIPsolLinkNLPSol(sol, scip->stat, scip->tree, scip->nlp) );
38622 
38623  return SCIP_OKAY;
38624 }
38625 
38626 /** links a primal solution to the current relaxation solution
38627  *
38628  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38629  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38630  *
38631  * @pre This method can be called if SCIP is in one of the following stages:
38632  * - \ref SCIP_STAGE_SOLVING
38633  */
38635  SCIP* scip, /**< SCIP data structure */
38636  SCIP_SOL* sol /**< primal solution */
38637  )
38638 {
38639  SCIP_CALL( checkStage(scip, "SCIPlinkRelaxSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38640 
38641  if( !SCIPrelaxationIsSolValid(scip->relaxation) )
38642  {
38643  SCIPerrorMessage("relaxation solution is not valid\n");
38644  return SCIP_INVALIDCALL;
38645  }
38646 
38647  SCIP_CALL( SCIPsolLinkRelaxSol(sol, scip->set, scip->stat, scip->tree, scip->relaxation) );
38648 
38649  return SCIP_OKAY;
38650 }
38651 
38652 /** links a primal solution to the current pseudo solution
38653  *
38654  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38655  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38656  *
38657  * @pre This method can be called if SCIP is in one of the following stages:
38658  * - \ref SCIP_STAGE_PRESOLVING
38659  * - \ref SCIP_STAGE_SOLVING
38660  */
38662  SCIP* scip, /**< SCIP data structure */
38663  SCIP_SOL* sol /**< primal solution */
38664  )
38665 {
38666  SCIP_CALL( checkStage(scip, "SCIPlinkPseudoSol", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38667 
38668  SCIP_CALL( SCIPsolLinkPseudoSol(sol, scip->set, scip->stat, scip->transprob, scip->tree, scip->lp) );
38669 
38670  return SCIP_OKAY;
38671 }
38672 
38673 /** links a primal solution to the current LP or pseudo solution
38674  *
38675  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38676  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38677  *
38678  * @pre This method can be called if SCIP is in one of the following stages:
38679  * - \ref SCIP_STAGE_SOLVING
38680  */
38682  SCIP* scip, /**< SCIP data structure */
38683  SCIP_SOL* sol /**< primal solution */
38684  )
38685 {
38686  SCIP_CALL( checkStage(scip, "SCIPlinkCurrentSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38687 
38688  SCIP_CALL( SCIPsolLinkCurrentSol(sol, scip->set, scip->stat, scip->transprob, scip->tree, scip->lp) );
38689 
38690  return SCIP_OKAY;
38691 }
38692 
38693 /** clears a primal solution
38694  *
38695  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38696  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38697  *
38698  * @pre This method can be called if SCIP is in one of the following stages:
38699  * - \ref SCIP_STAGE_PROBLEM
38700  * - \ref SCIP_STAGE_TRANSFORMING
38701  * - \ref SCIP_STAGE_TRANSFORMED
38702  * - \ref SCIP_STAGE_INITPRESOLVE
38703  * - \ref SCIP_STAGE_PRESOLVING
38704  * - \ref SCIP_STAGE_EXITPRESOLVE
38705  * - \ref SCIP_STAGE_PRESOLVED
38706  * - \ref SCIP_STAGE_INITSOLVE
38707  * - \ref SCIP_STAGE_SOLVING
38708  * - \ref SCIP_STAGE_SOLVED
38709  * - \ref SCIP_STAGE_EXITSOLVE
38710  * - \ref SCIP_STAGE_FREETRANS
38711  */
38713  SCIP* scip, /**< SCIP data structure */
38714  SCIP_SOL* sol /**< primal solution */
38715  )
38716 {
38717  SCIP_CALL( checkStage(scip, "SCIPclearSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38718 
38719  SCIP_CALL( SCIPsolClear(sol, scip->stat, scip->tree) );
38720 
38721  return SCIP_OKAY;
38722 }
38723 
38724 /** stores solution values of variables in solution's own array
38725  *
38726  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38727  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38728  *
38729  * @pre This method can be called if SCIP is in one of the following stages:
38730  * - \ref SCIP_STAGE_TRANSFORMING
38731  * - \ref SCIP_STAGE_TRANSFORMED
38732  * - \ref SCIP_STAGE_PRESOLVING
38733  * - \ref SCIP_STAGE_PRESOLVED
38734  * - \ref SCIP_STAGE_INITSOLVE
38735  * - \ref SCIP_STAGE_SOLVING
38736  * - \ref SCIP_STAGE_SOLVED
38737  * - \ref SCIP_STAGE_EXITSOLVE
38738  * - \ref SCIP_STAGE_FREETRANS
38739  */
38741  SCIP* scip, /**< SCIP data structure */
38742  SCIP_SOL* sol /**< primal solution */
38743  )
38744 {
38745  SCIP_CALL( checkStage(scip, "SCIPunlinkSol", FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38746 
38747  SCIP_CALL( SCIPsolUnlink(sol, scip->set, scip->transprob) );
38748 
38749  return SCIP_OKAY;
38750 }
38751 
38752 /** sets value of variable in primal CIP solution
38753  *
38754  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38755  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38756  *
38757  * @pre This method can be called if SCIP is in one of the following stages:
38758  * - \ref SCIP_STAGE_PROBLEM
38759  * - \ref SCIP_STAGE_TRANSFORMING
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  * - \ref SCIP_STAGE_FREETRANS
38770  */
38772  SCIP* scip, /**< SCIP data structure */
38773  SCIP_SOL* sol, /**< primal solution */
38774  SCIP_VAR* var, /**< variable to add to solution */
38775  SCIP_Real val /**< solution value of variable */
38776  )
38777 {
38778  SCIP_CALL( checkStage(scip, "SCIPsetSolVal", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38779 
38780  assert( var->scip == scip );
38781 
38782  if( SCIPsolIsOriginal(sol) && SCIPvarIsTransformed(var) )
38783  {
38784  SCIPerrorMessage("cannot set value of transformed variable <%s> in original space solution\n",
38785  SCIPvarGetName(var));
38786  return SCIP_INVALIDCALL;
38787  }
38788 
38789  SCIP_CALL( SCIPsolSetVal(sol, scip->set, scip->stat, scip->tree, var, val) );
38790 
38791  return SCIP_OKAY;
38792 }
38793 
38794 /** sets values of multiple variables in primal CIP solution
38795  *
38796  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38797  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38798  *
38799  * @pre This method can be called if SCIP is in one of the following stages:
38800  * - \ref SCIP_STAGE_PROBLEM
38801  * - \ref SCIP_STAGE_TRANSFORMING
38802  * - \ref SCIP_STAGE_TRANSFORMED
38803  * - \ref SCIP_STAGE_INITPRESOLVE
38804  * - \ref SCIP_STAGE_PRESOLVING
38805  * - \ref SCIP_STAGE_EXITPRESOLVE
38806  * - \ref SCIP_STAGE_PRESOLVED
38807  * - \ref SCIP_STAGE_INITSOLVE
38808  * - \ref SCIP_STAGE_SOLVING
38809  * - \ref SCIP_STAGE_SOLVED
38810  * - \ref SCIP_STAGE_EXITSOLVE
38811  * - \ref SCIP_STAGE_FREETRANS
38812  */
38814  SCIP* scip, /**< SCIP data structure */
38815  SCIP_SOL* sol, /**< primal solution */
38816  int nvars, /**< number of variables to set solution value for */
38817  SCIP_VAR** vars, /**< array with variables to add to solution */
38818  SCIP_Real* vals /**< array with solution values of variables */
38819  )
38820 {
38821  int v;
38822 
38823  assert(nvars == 0 || vars != NULL);
38824  assert(nvars == 0 || vals != NULL);
38825 
38826  SCIP_CALL( checkStage(scip, "SCIPsetSolVals", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38827 
38828  if( SCIPsolIsOriginal(sol) )
38829  {
38830  for( v = 0; v < nvars; ++v )
38831  {
38832  if( SCIPvarIsTransformed(vars[v]) )
38833  {
38834  SCIPerrorMessage("cannot set value of transformed variable <%s> in original space solution\n",
38835  SCIPvarGetName(vars[v]));
38836  return SCIP_INVALIDCALL;
38837  }
38838  }
38839  }
38840 
38841  for( v = 0; v < nvars; ++v )
38842  {
38843  SCIP_CALL( SCIPsolSetVal(sol, scip->set, scip->stat, scip->tree, vars[v], vals[v]) );
38844  }
38845 
38846  return SCIP_OKAY;
38847 }
38848 
38849 /** increases value of variable in primal CIP solution
38850  *
38851  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38852  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38853  *
38854  * @pre This method can be called if SCIP is in one of the following stages:
38855  * - \ref SCIP_STAGE_PROBLEM
38856  * - \ref SCIP_STAGE_TRANSFORMING
38857  * - \ref SCIP_STAGE_TRANSFORMED
38858  * - \ref SCIP_STAGE_INITPRESOLVE
38859  * - \ref SCIP_STAGE_PRESOLVING
38860  * - \ref SCIP_STAGE_EXITPRESOLVE
38861  * - \ref SCIP_STAGE_PRESOLVED
38862  * - \ref SCIP_STAGE_INITSOLVE
38863  * - \ref SCIP_STAGE_SOLVING
38864  * - \ref SCIP_STAGE_SOLVED
38865  * - \ref SCIP_STAGE_EXITSOLVE
38866  * - \ref SCIP_STAGE_FREETRANS
38867  */
38869  SCIP* scip, /**< SCIP data structure */
38870  SCIP_SOL* sol, /**< primal solution */
38871  SCIP_VAR* var, /**< variable to increase solution value for */
38872  SCIP_Real incval /**< increment for solution value of variable */
38873  )
38874 {
38875  SCIP_CALL( checkStage(scip, "SCIPincSolVal", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38876 
38877  assert( var->scip == scip );
38878 
38879  if( SCIPsolIsOriginal(sol) && SCIPvarIsTransformed(var) )
38880  {
38881  SCIPerrorMessage("cannot increase value of transformed variable <%s> in original space solution\n",
38882  SCIPvarGetName(var));
38883  return SCIP_INVALIDCALL;
38884  }
38885 
38886  SCIP_CALL( SCIPsolIncVal(sol, scip->set, scip->stat, scip->tree, var, incval) );
38887 
38888  return SCIP_OKAY;
38889 }
38890 
38891 /** returns value of variable in primal CIP solution, or in current LP/pseudo solution
38892  *
38893  * @return value of variable in primal CIP solution, or in current LP/pseudo solution
38894  *
38895  * @pre In case the solution pointer @p sol is @b NULL, that means it is asked for the LP or pseudo solution, this method
38896  * can only be called if @p scip is in the solving stage \ref SCIP_STAGE_SOLVING. In any other case, this method
38897  * can be called if @p scip is in one of the following stages:
38898  * - \ref SCIP_STAGE_PROBLEM
38899  * - \ref SCIP_STAGE_TRANSFORMING
38900  * - \ref SCIP_STAGE_TRANSFORMED
38901  * - \ref SCIP_STAGE_INITPRESOLVE
38902  * - \ref SCIP_STAGE_PRESOLVING
38903  * - \ref SCIP_STAGE_EXITPRESOLVE
38904  * - \ref SCIP_STAGE_PRESOLVED
38905  * - \ref SCIP_STAGE_INITSOLVE
38906  * - \ref SCIP_STAGE_SOLVING
38907  * - \ref SCIP_STAGE_SOLVED
38908  * - \ref SCIP_STAGE_EXITSOLVE
38909  * - \ref SCIP_STAGE_FREETRANS
38910  */
38912  SCIP* scip, /**< SCIP data structure */
38913  SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
38914  SCIP_VAR* var /**< variable to get value for */
38915  )
38916 {
38917  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolVal", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38918 
38919  assert( var->scip == scip );
38920 
38921  if( sol != NULL )
38922  return SCIPsolGetVal(sol, scip->set, scip->stat, var);
38923 
38924  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolVal(sol==NULL)", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38925 
38926  return SCIPvarGetSol(var, SCIPtreeHasCurrentNodeLP(scip->tree));
38927 }
38928 
38929 /** gets values of multiple variables in primal CIP solution
38930  *
38931  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38932  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38933  *
38934  * @pre This method can be called if SCIP is in one of the following stages:
38935  * - \ref SCIP_STAGE_PROBLEM
38936  * - \ref SCIP_STAGE_TRANSFORMING
38937  * - \ref SCIP_STAGE_TRANSFORMED
38938  * - \ref SCIP_STAGE_INITPRESOLVE
38939  * - \ref SCIP_STAGE_PRESOLVING
38940  * - \ref SCIP_STAGE_EXITPRESOLVE
38941  * - \ref SCIP_STAGE_PRESOLVED
38942  * - \ref SCIP_STAGE_INITSOLVE
38943  * - \ref SCIP_STAGE_SOLVING
38944  * - \ref SCIP_STAGE_SOLVED
38945  * - \ref SCIP_STAGE_EXITSOLVE
38946  * - \ref SCIP_STAGE_FREETRANS
38947  */
38949  SCIP* scip, /**< SCIP data structure */
38950  SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
38951  int nvars, /**< number of variables to get solution value for */
38952  SCIP_VAR** vars, /**< array with variables to get value for */
38953  SCIP_Real* vals /**< array to store solution values of variables */
38954  )
38955 {
38956  assert(nvars == 0 || vars != NULL);
38957  assert(nvars == 0 || vals != NULL);
38958 
38959  SCIP_CALL( checkStage(scip, "SCIPgetSolVals", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38960 
38961  if( sol != NULL )
38962  {
38963  int v;
38964 
38965  for( v = 0; v < nvars; ++v )
38966  vals[v] = SCIPsolGetVal(sol, scip->set, scip->stat, vars[v]);
38967  }
38968  else
38969  {
38970  SCIP_CALL( SCIPgetVarSols(scip, nvars, vars, vals) );
38971  }
38972 
38973  return SCIP_OKAY;
38974 }
38975 
38976 /** returns objective value of primal CIP solution w.r.t. original problem, or current LP/pseudo objective value
38977  *
38978  * @return objective value of primal CIP solution w.r.t. original problem, or current LP/pseudo objective value
38979  *
38980  * @pre This method can be called if SCIP is in one of the following stages:
38981  * - \ref SCIP_STAGE_PROBLEM
38982  * - \ref SCIP_STAGE_TRANSFORMING
38983  * - \ref SCIP_STAGE_TRANSFORMED
38984  * - \ref SCIP_STAGE_INITPRESOLVE
38985  * - \ref SCIP_STAGE_PRESOLVING
38986  * - \ref SCIP_STAGE_EXITPRESOLVE
38987  * - \ref SCIP_STAGE_PRESOLVED
38988  * - \ref SCIP_STAGE_INITSOLVE
38989  * - \ref SCIP_STAGE_SOLVING
38990  * - \ref SCIP_STAGE_SOLVED
38991  * - \ref SCIP_STAGE_EXITSOLVE
38992  * - \ref SCIP_STAGE_FREETRANS
38993  */
38995  SCIP* scip, /**< SCIP data structure */
38996  SCIP_SOL* sol /**< primal solution, or NULL for current LP/pseudo objective value */
38997  )
38998 {
38999  /* for original solutions, an original objective value is already available in SCIP_STAGE_PROBLEM
39000  * for all other solutions, we should be at least in SCIP_STAGE_TRANSFORMING
39001  */
39002  if( sol != NULL && SCIPsolIsOriginal(sol) )
39003  {
39004  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolOrigObj", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
39005 
39006  return SCIPsolGetOrigObj(sol);
39007  }
39008 
39009  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolOrigObj", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
39010 
39011  if( sol != NULL )
39012  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
39013  else
39014  {
39015  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolOrigObj(sol==NULL)", \
39017  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
39018  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPlpGetObjval(scip->lp, scip->set, scip->transprob));
39019  else
39020  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPlpGetPseudoObjval(scip->lp, scip->set, scip->transprob));
39021  }
39022 }
39023 
39024 /** returns transformed objective value of primal CIP solution, or transformed current LP/pseudo objective value
39025  *
39026  * @return transformed objective value of primal CIP solution, or transformed current LP/pseudo objective value
39027  *
39028  * @pre This method can be called if SCIP is in one of the following stages:
39029  * - \ref SCIP_STAGE_TRANSFORMING
39030  * - \ref SCIP_STAGE_TRANSFORMED
39031  * - \ref SCIP_STAGE_INITPRESOLVE
39032  * - \ref SCIP_STAGE_PRESOLVING
39033  * - \ref SCIP_STAGE_EXITPRESOLVE
39034  * - \ref SCIP_STAGE_PRESOLVED
39035  * - \ref SCIP_STAGE_INITSOLVE
39036  * - \ref SCIP_STAGE_SOLVING
39037  * - \ref SCIP_STAGE_SOLVED
39038  * - \ref SCIP_STAGE_EXITSOLVE
39039  * - \ref SCIP_STAGE_FREETRANS
39040  */
39042  SCIP* scip, /**< SCIP data structure */
39043  SCIP_SOL* sol /**< primal solution, or NULL for current LP/pseudo objective value */
39044  )
39045 {
39046  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolTransObj", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
39047 
39048  if( sol != NULL )
39049  return SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob);
39050  else
39051  {
39052  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolTransObj(sol==NULL)", \
39054  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
39055  return SCIPlpGetObjval(scip->lp, scip->set, scip->transprob);
39056  else
39057  return SCIPlpGetPseudoObjval(scip->lp, scip->set, scip->transprob);
39058  }
39059 }
39060 
39061 /** recomputes the objective value of an original solution, e.g., when transferring solutions
39062  * from the solution pool (objective coefficients might have changed in the meantime)
39063  *
39064  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39065  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39066  *
39067  * @pre This method can be called if SCIP is in one of the following stages:
39068  * - \ref SCIP_STAGE_PRESOLVING
39069  * - \ref SCIP_STAGE_SOLVING
39070  *
39071  */
39073  SCIP* scip,
39074  SCIP_SOL* sol
39075  )
39076 {
39077  assert(scip != NULL);
39078 
39079  SCIP_CALL( checkStage(scip, "SCIPrecomputeSolObj", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
39080 
39081  SCIPsolRecomputeObj(sol, scip->set, scip->stat, scip->origprob);
39082 
39083  return SCIP_OKAY;
39084 }
39085 
39086 /** maps original space objective value into transformed objective value
39087  *
39088  * @return transformed objective value
39089  *
39090  * @pre This method can be called if SCIP is in one of the following stages:
39091  * - \ref SCIP_STAGE_TRANSFORMING
39092  * - \ref SCIP_STAGE_TRANSFORMED
39093  * - \ref SCIP_STAGE_INITPRESOLVE
39094  * - \ref SCIP_STAGE_PRESOLVING
39095  * - \ref SCIP_STAGE_EXITPRESOLVE
39096  * - \ref SCIP_STAGE_PRESOLVED
39097  * - \ref SCIP_STAGE_INITSOLVE
39098  * - \ref SCIP_STAGE_SOLVING
39099  * - \ref SCIP_STAGE_SOLVED
39100  */
39102  SCIP* scip, /**< SCIP data structure */
39103  SCIP_Real obj /**< original space objective value to transform */
39104  )
39105 {
39106  SCIP_CALL_ABORT( checkStage(scip, "SCIPtransformObj", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
39107 
39108  return SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, obj);
39109 }
39110 
39111 /** maps transformed objective value into original space
39112  *
39113  * @return objective value into original space
39114  *
39115  * @pre This method can be called if SCIP is in one of the following stages:
39116  * - \ref SCIP_STAGE_TRANSFORMING
39117  * - \ref SCIP_STAGE_TRANSFORMED
39118  * - \ref SCIP_STAGE_INITPRESOLVE
39119  * - \ref SCIP_STAGE_PRESOLVING
39120  * - \ref SCIP_STAGE_EXITPRESOLVE
39121  * - \ref SCIP_STAGE_PRESOLVED
39122  * - \ref SCIP_STAGE_INITSOLVE
39123  * - \ref SCIP_STAGE_SOLVING
39124  * - \ref SCIP_STAGE_SOLVED
39125  */
39127  SCIP* scip, /**< SCIP data structure */
39128  SCIP_Real obj /**< transformed objective value to retransform in original space */
39129  )
39130 {
39131  SCIP_CALL_ABORT( checkStage(scip, "SCIPretransformObj", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
39132 
39133  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, obj);
39134 }
39135 
39136 /** gets clock time, when this solution was found
39137  *
39138  * @return clock time, when this solution was found
39139  *
39140  * @pre This method can be called if SCIP is in one of the following stages:
39141  * - \ref SCIP_STAGE_TRANSFORMING
39142  * - \ref SCIP_STAGE_TRANSFORMED
39143  * - \ref SCIP_STAGE_INITPRESOLVE
39144  * - \ref SCIP_STAGE_PRESOLVING
39145  * - \ref SCIP_STAGE_EXITPRESOLVE
39146  * - \ref SCIP_STAGE_PRESOLVED
39147  * - \ref SCIP_STAGE_INITSOLVE
39148  * - \ref SCIP_STAGE_SOLVING
39149  * - \ref SCIP_STAGE_SOLVED
39150  * - \ref SCIP_STAGE_EXITSOLVE
39151  * - \ref SCIP_STAGE_FREETRANS
39152  */
39154  SCIP* scip, /**< SCIP data structure */
39155  SCIP_SOL* sol /**< primal solution */
39156  )
39157 {
39158  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolTime", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
39159 
39160  return SCIPsolGetTime(sol);
39161 }
39162 
39163 /** gets branch and bound run number, where this solution was found
39164  *
39165  * @return branch and bound run number, where this solution was found
39166  *
39167  * @pre This method can be called if SCIP is in one of the following stages:
39168  * - \ref SCIP_STAGE_TRANSFORMING
39169  * - \ref SCIP_STAGE_TRANSFORMED
39170  * - \ref SCIP_STAGE_INITPRESOLVE
39171  * - \ref SCIP_STAGE_PRESOLVING
39172  * - \ref SCIP_STAGE_EXITPRESOLVE
39173  * - \ref SCIP_STAGE_PRESOLVED
39174  * - \ref SCIP_STAGE_INITSOLVE
39175  * - \ref SCIP_STAGE_SOLVING
39176  * - \ref SCIP_STAGE_SOLVED
39177  * - \ref SCIP_STAGE_EXITSOLVE
39178  * - \ref SCIP_STAGE_FREETRANS
39179  */
39181  SCIP* scip, /**< SCIP data structure */
39182  SCIP_SOL* sol /**< primal solution */
39183  )
39184 {
39185  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolRunnum", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
39186 
39187  return SCIPsolGetRunnum(sol);
39188 }
39189 
39190 /** gets node number of the specific branch and bound run, where this solution was found
39191  *
39192  * @return node number of the specific branch and bound run, where this solution was found
39193  *
39194  * @pre This method can be called if SCIP is in one of the following stages:
39195  * - \ref SCIP_STAGE_TRANSFORMING
39196  * - \ref SCIP_STAGE_TRANSFORMED
39197  * - \ref SCIP_STAGE_INITPRESOLVE
39198  * - \ref SCIP_STAGE_PRESOLVING
39199  * - \ref SCIP_STAGE_EXITPRESOLVE
39200  * - \ref SCIP_STAGE_PRESOLVED
39201  * - \ref SCIP_STAGE_INITSOLVE
39202  * - \ref SCIP_STAGE_SOLVING
39203  * - \ref SCIP_STAGE_SOLVED
39204  * - \ref SCIP_STAGE_EXITSOLVE
39205  * - \ref SCIP_STAGE_FREETRANS
39206  */
39208  SCIP* scip, /**< SCIP data structure */
39209  SCIP_SOL* sol /**< primal solution */
39210  )
39211 {
39212  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolNodenum", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
39213 
39214  return SCIPsolGetNodenum(sol);
39215 }
39216 
39217 /** gets heuristic, that found this solution (or NULL if it's from the tree)
39218  *
39219  * @return heuristic, that found this solution (or NULL if it's from the tree)
39220  *
39221  * @pre This method can be called if SCIP is in one of the following stages:
39222  * - \ref SCIP_STAGE_TRANSFORMING
39223  * - \ref SCIP_STAGE_TRANSFORMED
39224  * - \ref SCIP_STAGE_INITPRESOLVE
39225  * - \ref SCIP_STAGE_PRESOLVING
39226  * - \ref SCIP_STAGE_EXITPRESOLVE
39227  * - \ref SCIP_STAGE_PRESOLVED
39228  * - \ref SCIP_STAGE_INITSOLVE
39229  * - \ref SCIP_STAGE_SOLVING
39230  * - \ref SCIP_STAGE_SOLVED
39231  * - \ref SCIP_STAGE_EXITSOLVE
39232  * - \ref SCIP_STAGE_FREETRANS
39233  */
39235  SCIP* scip, /**< SCIP data structure */
39236  SCIP_SOL* sol /**< primal solution */
39237  )
39238 {
39239  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolHeur", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
39240 
39241  return SCIPsolGetHeur(sol);
39242 }
39243 
39244 /** returns whether two given solutions are exactly equal
39245  *
39246  * @return returns whether two given solutions are exactly equal
39247  *
39248  * @pre This method can be called if SCIP is in one of the following stages:
39249  * - \ref SCIP_STAGE_PROBLEM
39250  * - \ref SCIP_STAGE_TRANSFORMING
39251  * - \ref SCIP_STAGE_TRANSFORMED
39252  * - \ref SCIP_STAGE_INITPRESOLVE
39253  * - \ref SCIP_STAGE_PRESOLVING
39254  * - \ref SCIP_STAGE_EXITPRESOLVE
39255  * - \ref SCIP_STAGE_PRESOLVED
39256  * - \ref SCIP_STAGE_INITSOLVE
39257  * - \ref SCIP_STAGE_SOLVING
39258  * - \ref SCIP_STAGE_SOLVED
39259  * - \ref SCIP_STAGE_EXITSOLVE
39260  * - \ref SCIP_STAGE_FREETRANS
39261  */
39263  SCIP* scip, /**< SCIP data structure */
39264  SCIP_SOL* sol1, /**< first primal CIP solution */
39265  SCIP_SOL* sol2 /**< second primal CIP solution */
39266  )
39267 {
39268  SCIP_CALL_ABORT( checkStage(scip, "SCIPareSolsEqual", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
39269 
39270  return SCIPsolsAreEqual(sol1, sol2, scip->set, scip->stat, scip->origprob, scip->transprob);
39271 }
39272 
39273 /** adjusts solution values of implicit integer variables in handed solution. Solution objective value is not
39274  * deteriorated by this method.
39275  *
39276  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39277  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39278  *
39279  * @pre This method can be called if SCIP is in one of the following stages:
39280  * - \ref SCIP_STAGE_SOLVING
39281  */
39283  SCIP* scip, /**< SCIP data structure */
39284  SCIP_SOL* sol, /**< primal CIP solution */
39285  SCIP_Bool uselprows /**< should LP row information be considered for none-objective variables */
39286  )
39287 {
39288  assert(scip != NULL);
39289  SCIP_CALL( checkStage(scip, "SCIPadjustImplicitSolVals", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
39290 
39291  assert(sol != NULL);
39292  SCIP_CALL( SCIPsolAdjustImplicitSolVals(sol, scip->set, scip->stat, scip->transprob, scip->tree, uselprows) );
39293 
39294  return SCIP_OKAY;
39295 }
39296 
39297 /** outputs non-zero variables of solution in original problem space to the given file stream
39298  *
39299  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39300  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39301  *
39302  * @pre In case the solution pointer @p sol is NULL (asking for the current LP/pseudo solution), this method can be
39303  * called if @p scip is in one of the following stages:
39304  * - \ref SCIP_STAGE_PRESOLVING
39305  * - \ref SCIP_STAGE_EXITPRESOLVE
39306  * - \ref SCIP_STAGE_PRESOLVED
39307  * - \ref SCIP_STAGE_INITSOLVE
39308  * - \ref SCIP_STAGE_SOLVING
39309  * - \ref SCIP_STAGE_SOLVED
39310  * - \ref SCIP_STAGE_EXITSOLVE
39311  *
39312  * @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
39313  * following stages:
39314  * - \ref SCIP_STAGE_PROBLEM
39315  * - \ref SCIP_STAGE_TRANSFORMED
39316  * - \ref SCIP_STAGE_INITPRESOLVE
39317  * - \ref SCIP_STAGE_PRESOLVING
39318  * - \ref SCIP_STAGE_EXITPRESOLVE
39319  * - \ref SCIP_STAGE_PRESOLVED
39320  * - \ref SCIP_STAGE_INITSOLVE
39321  * - \ref SCIP_STAGE_SOLVING
39322  * - \ref SCIP_STAGE_SOLVED
39323  * - \ref SCIP_STAGE_EXITSOLVE
39324  */
39326  SCIP* scip, /**< SCIP data structure */
39327  SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
39328  FILE* file, /**< output file (or NULL for standard output) */
39329  SCIP_Bool printzeros /**< should variables set to zero be printed? */
39330  )
39331 {
39332  SCIP_Real objvalue;
39333  SCIP_Bool currentsol;
39334  SCIP_Bool oldquiet = FALSE;
39335 
39336  assert(SCIPisTransformed(scip) || sol != NULL);
39337 
39338  SCIP_CALL( checkStage(scip, "SCIPprintSol", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39339 
39340  currentsol = (sol == NULL);
39341  if( currentsol )
39342  {
39343  SCIP_CALL( checkStage(scip, "SCIPprintSol(sol==NULL)", \
39345 
39346  /* create a temporary solution that is linked to the current solution */
39347  SCIP_CALL( SCIPsolCreateCurrentSol(&sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
39348  scip->tree, scip->lp, NULL) );
39349  }
39350 
39351  if( file != NULL && scip->messagehdlr != NULL )
39352  {
39353  oldquiet = SCIPmessagehdlrIsQuiet(scip->messagehdlr);
39355  }
39356 
39357  SCIPmessageFPrintInfo(scip->messagehdlr, file, "objective value: ");
39358 
39359  if( SCIPsolIsPartial(sol) )
39360  {
39361  SCIPmessageFPrintInfo(scip->messagehdlr, file, "unknown\n");
39362  }
39363  else
39364  {
39365  if( SCIPsolIsOriginal(sol) )
39366  objvalue = SCIPsolGetOrigObj(sol);
39367  else
39368  objvalue = SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
39369 
39370  SCIPprintReal(scip, file, objvalue, 20, 15);
39371  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
39372  }
39373 
39374  SCIP_CALL( SCIPsolPrint(sol, scip->set, scip->messagehdlr, scip->stat, scip->origprob, scip->transprob, file, FALSE,
39375  printzeros) );
39376 
39377  if( file != NULL && scip->messagehdlr != NULL )
39378  {
39379  SCIPmessagehdlrSetQuiet(scip->messagehdlr, oldquiet);
39380  }
39381 
39382  if( currentsol )
39383  {
39384  /* free temporary solution */
39385  SCIP_CALL( SCIPsolFree(&sol, scip->mem->probmem, scip->primal) );
39386  }
39387 
39388  return SCIP_OKAY;
39389 }
39390 
39391 /** outputs non-zero variables of solution in transformed problem space to file stream
39392  *
39393  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39394  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39395  *
39396  * @pre This method can be called if SCIP is in one of the following stages:
39397  * - \ref SCIP_STAGE_TRANSFORMED
39398  * - \ref SCIP_STAGE_INITPRESOLVE
39399  * - \ref SCIP_STAGE_PRESOLVING
39400  * - \ref SCIP_STAGE_EXITPRESOLVE
39401  * - \ref SCIP_STAGE_PRESOLVED
39402  * - \ref SCIP_STAGE_INITSOLVE
39403  * - \ref SCIP_STAGE_SOLVING
39404  * - \ref SCIP_STAGE_SOLVED
39405  * - \ref SCIP_STAGE_EXITSOLVE
39406  */
39408  SCIP* scip, /**< SCIP data structure */
39409  SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
39410  FILE* file, /**< output file (or NULL for standard output) */
39411  SCIP_Bool printzeros /**< should variables set to zero be printed? */
39412  )
39413 {
39414  SCIP_Bool currentsol;
39415 
39416  SCIP_CALL( checkStage(scip, "SCIPprintTransSol", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39417 
39418  currentsol = (sol == NULL);
39419  if( currentsol )
39420  {
39421  /* create a temporary solution that is linked to the current solution */
39422  SCIP_CALL( SCIPsolCreateCurrentSol(&sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
39423  scip->tree, scip->lp, NULL) );
39424  }
39425 
39426  if( SCIPsolIsOriginal(sol) )
39427  {
39428  SCIPerrorMessage("cannot print original space solution as transformed solution\n");
39429  return SCIP_INVALIDCALL;
39430  }
39431 
39432  SCIPmessageFPrintInfo(scip->messagehdlr, file, "objective value: ");
39433  SCIPprintReal(scip, file, SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob), 20, 9);
39434  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
39435 
39436  SCIP_CALL( SCIPsolPrint(sol, scip->set, scip->messagehdlr, scip->stat, scip->transprob, NULL, file, FALSE, printzeros) );
39437 
39438  if( currentsol )
39439  {
39440  /* free temporary solution */
39441  SCIP_CALL( SCIPsolFree(&sol, scip->mem->probmem, scip->primal) );
39442  }
39443 
39444  return SCIP_OKAY;
39445 }
39446 
39447 /** outputs discrete variables of solution in original problem space to the given file stream
39448  *
39449  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39450  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39451  *
39452  * @pre This method can be called if @p scip is in one of the following stages:
39453  * - \ref SCIP_STAGE_PROBLEM
39454  * - \ref SCIP_STAGE_TRANSFORMED
39455  * - \ref SCIP_STAGE_INITPRESOLVE
39456  * - \ref SCIP_STAGE_PRESOLVING
39457  * - \ref SCIP_STAGE_EXITPRESOLVE
39458  * - \ref SCIP_STAGE_PRESOLVED
39459  * - \ref SCIP_STAGE_INITSOLVE
39460  * - \ref SCIP_STAGE_SOLVING
39461  * - \ref SCIP_STAGE_SOLVED
39462  * - \ref SCIP_STAGE_EXITSOLVE
39463  */
39465  SCIP* scip, /**< SCIP data structure */
39466  SCIP_SOL* sol, /**< primal solution */
39467  FILE* file /**< output file (or NULL for standard output) */
39468  )
39469 {
39470  SCIP_Real objvalue;
39471  SCIP_Bool oldquiet = FALSE;
39472 
39473  assert(SCIPisTransformed(scip) || sol != NULL);
39474  assert(sol != NULL);
39475  assert(!SCIPsolIsPartial(sol));
39476 
39477  SCIP_CALL( checkStage(scip, "SCIPprintMIPStart", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39478 
39479  if( file != NULL && scip->messagehdlr != NULL )
39480  {
39481  oldquiet = SCIPmessagehdlrIsQuiet(scip->messagehdlr);
39483  }
39484 
39485  SCIPmessageFPrintInfo(scip->messagehdlr, file, "objective value: ");
39486 
39487  if( SCIPsolIsOriginal(sol) )
39488  objvalue = SCIPsolGetOrigObj(sol);
39489  else
39490  objvalue = SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
39491 
39492  SCIPprintReal(scip, file, objvalue, 20, 15);
39493  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
39494 
39495  SCIP_CALL( SCIPsolPrint(sol, scip->set, scip->messagehdlr, scip->stat, scip->origprob, scip->transprob, file, TRUE,
39496  TRUE) );
39497 
39498  if( file != NULL && scip->messagehdlr != NULL )
39499  {
39500  SCIPmessagehdlrSetQuiet(scip->messagehdlr, oldquiet);
39501  }
39502 
39503  return SCIP_OKAY;
39504 }
39505 
39506 /** returns dual solution value of a constraint */
39508  SCIP* scip, /**< SCIP data structure */
39509  SCIP_CONS* cons, /**< constraint for which the dual solution should be returned */
39510  SCIP_Real* dualsolval, /**< pointer to store the dual solution value */
39511  SCIP_Bool* boundconstraint /**< pointer to store whether the constraint is a bound constraint (or NULL) */
39512  )
39513 {
39514  SCIP_CONS* transcons;
39515  int nvars;
39516  SCIP_Bool success;
39517 #ifndef NDEBUG
39518  SCIP_CONSHDLR* conshdlr;
39519 #endif
39520 
39521  assert(scip != NULL);
39522  assert(cons != NULL);
39523  assert(dualsolval != NULL);
39524 
39525 #ifndef NDEBUG
39526  conshdlr = SCIPconsGetHdlr(cons);
39527  assert(conshdlr != NULL);
39528  assert(strcmp(SCIPconshdlrGetName(conshdlr), "linear" ) == 0);
39529 #endif
39530 
39531  SCIP_CALL( SCIPconsGetNVars(cons, scip->set, &nvars, &success) );
39532 
39533  if( boundconstraint != NULL )
39534  *boundconstraint = (nvars == 1);
39535 
39536  if( SCIPconsIsTransformed(cons) )
39537  transcons = cons;
39538  else
39539  transcons = SCIPconsGetTransformed(cons);
39540 
39541  /* it can happen that a transformed constraints gets deleted due to redundancy. by complementary slackness the
39542  * corresponding dual solution value would be zero. however, if the constraint contains exactly one variable we need
39543  * to check the reduced costs of the variable.
39544  */
39545  if( nvars > 1 && transcons == NULL )
39546  (*dualsolval) = 0.0;
39547  else
39548  {
39549  if( !success )
39550  {
39551  SCIPABORT();
39552  return SCIP_INVALIDCALL;
39553  }
39554 
39555  if( nvars > 1 )
39556  (*dualsolval) = SCIPgetDualsolLinear(scip, transcons);
39557 
39558  /* the constraint is a bound constraint */
39559  else
39560  {
39561  SCIP_VAR** vars;
39562  SCIP_Real varsolval;
39563 
39564  /* allocate buffer memory */
39565  SCIP_CALL( SCIPallocBufferArray(scip, &vars, 1) );
39566 
39567  assert(vars != NULL);
39568  SCIP_CALL( SCIPconsGetVars(cons, scip->set, vars, 1, &success) );
39569 
39570  varsolval = SCIPvarGetLPSol(vars[0]);
39571 
39572  /* return the reduced cost of the variable if the constraint would be tight */
39573  if( SCIPsetIsEQ(scip->set, varsolval, SCIPgetRhsLinear(scip, cons))
39574  || SCIPsetIsEQ(scip->set, varsolval, SCIPgetLhsLinear(scip, cons)) )
39575  (*dualsolval) = SCIPgetVarRedcost(scip, vars[0]);
39576  else
39577  (*dualsolval) = 0.0;
39578 
39579  /* free buffer memory */
39580  SCIPfreeBufferArray(scip, &vars);
39581  }
39582  }
39583  assert(*dualsolval != SCIP_INVALID); /*lint !e777*/
39584 
39585  /* dual values are coming from the LP solver that is always solving a minimization problem */
39587  (*dualsolval) *= -1.0;
39588 
39589  return SCIP_OKAY;
39590 }
39591 
39592 /** outputs dual solution from LP solver to file stream */
39593 static
39595  SCIP* scip, /**< SCIP data structure */
39596  FILE* file, /**< output file (or NULL for standard output) */
39597  SCIP_Bool printzeros /**< should variables set to zero be printed? */
39598  )
39599 {
39600  SCIP_Bool boundconstraint;
39601  int c;
39602 
39603  assert(scip->lp != NULL);
39604  assert(scip->lp->solved);
39605  assert(scip->lp->dualfeasible);
39606 
39607  /* print dual solution values of all constraints */
39608  for( c = 0; c < scip->origprob->nconss; ++c )
39609  {
39610  SCIP_CONS* cons;
39611  SCIP_Real solval;
39612 
39613  cons = scip->origprob->conss[c];
39614  assert(cons != NULL);
39615 
39616  SCIP_CALL( SCIPgetDualSolVal(scip, cons, &solval, &boundconstraint) );
39617 
39618  if( printzeros || !SCIPisZero(scip, solval) )
39619  {
39620  SCIP_MESSAGEHDLR* messagehdlr = scip->messagehdlr;
39621 
39622  SCIPmessageFPrintInfo(messagehdlr, file, "%-32s", SCIPconsGetName(cons));
39623 
39624  if( SCIPisInfinity(scip, solval) )
39625  SCIPmessageFPrintInfo(messagehdlr, file, " +infinity\n");
39626  else if( SCIPisInfinity(scip, -solval) )
39627  SCIPmessageFPrintInfo(messagehdlr, file, " -infinity\n");
39628  else
39629  {
39630  if( boundconstraint )
39631  SCIPmessageFPrintInfo(messagehdlr, file, " %20.15g*\n", solval);
39632  else
39633  SCIPmessageFPrintInfo(messagehdlr, file, " %20.15g\n", solval);
39634  }
39635  }
39636 
39637  }
39638 
39639  return SCIP_OKAY;
39640 }
39641 
39642 /** check whether the dual solution is available
39643  *
39644  * @note This is used when calling \ref SCIPprintDualSol()
39645  *
39646  * @return is dual solution available?
39647  *
39648  * @pre This method can be called if SCIP is in one of the following stages:
39649  * - \ref SCIP_STAGE_SOLVED
39650  */
39652  SCIP* scip, /**< SCIP data structure */
39653  SCIP_Bool printreason /**< print warning message if dualsol is not available? */
39654  )
39655 {
39656  int c;
39657 
39658  assert(scip != NULL);
39659 
39660  SCIP_CALL_ABORT( checkStage(scip, "SCIPisDualSolAvailable", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
39661 
39662  if( SCIPgetStage(scip) != SCIP_STAGE_SOLVED )
39663  {
39664  if( printreason )
39665  SCIPmessageFPrintInfo(scip->messagehdlr, NULL, "No dual solution available.\n");
39666  return FALSE;
39667  }
39668 
39669  assert(scip->stat != NULL);
39670  assert(scip->transprob != NULL);
39671 
39672  /* dual solution only useful when no presolving was performed */
39673  if( scip->stat->performpresol )
39674  {
39675  if( printreason )
39676  SCIPwarningMessage(scip, "No dual information available when presolving was performed.\n");
39677  return FALSE;
39678  }
39679 
39680  /* dual solution is created by LP solver and therefore only available for pure LPs */
39681  if( scip->transprob->nvars != scip->transprob->ncontvars )
39682  {
39683  if( printreason )
39684  SCIPwarningMessage(scip, "Dual information only available for pure LPs (only continuous variables).\n");
39685  return FALSE;
39686  }
39687 
39688  /* dual solution is created by LP solver and therefore only available for linear constraints */
39689  for( c = scip->transprob->nconss - 1; c >= 0; --c )
39690  {
39691  SCIP_CONSHDLR* conshdlr;
39692 
39693  conshdlr = SCIPconsGetHdlr(scip->transprob->conss[c]);
39694  assert(conshdlr != NULL);
39695 
39696  if( strcmp(SCIPconshdlrGetName(conshdlr), "linear" ) != 0 )
39697  {
39698  if( printreason )
39699  SCIPwarningMessage(scip, "Dual information only available for pure LPs (only linear constraints).\n");
39700  return FALSE;
39701  }
39702  }
39703 
39704  return TRUE;
39705 }
39706 
39707 /** outputs dual solution from LP solver to file stream
39708  *
39709  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39710  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39711  *
39712  * @pre This method can be called in all stages but only prints dual information when called in \ref SCIP_STAGE_SOLVED
39713  */
39715  SCIP* scip, /**< SCIP data structure */
39716  FILE* file, /**< output file (or NULL for standard output) */
39717  SCIP_Bool printzeros /**< should variables set to zero be printed? */
39718  )
39719 {
39720  if( SCIPisDualSolAvailable(scip, TRUE) )
39721  {
39722  /* print dual solution */
39723  SCIP_CALL( printDualSol(scip, file, printzeros) );
39724  }
39725 
39726  return SCIP_OKAY;
39727 }
39728 
39729 
39730 /** outputs non-zero variables of solution representing a ray in original problem space to file stream
39731  *
39732  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39733  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39734  *
39735  * @pre This method can be called if SCIP is in one of the following stages:
39736  * - \ref SCIP_STAGE_PROBLEM
39737  * - \ref SCIP_STAGE_TRANSFORMED
39738  * - \ref SCIP_STAGE_INITPRESOLVE
39739  * - \ref SCIP_STAGE_PRESOLVING
39740  * - \ref SCIP_STAGE_EXITPRESOLVE
39741  * - \ref SCIP_STAGE_PRESOLVED
39742  * - \ref SCIP_STAGE_INITSOLVE
39743  * - \ref SCIP_STAGE_SOLVING
39744  * - \ref SCIP_STAGE_SOLVED
39745  * - \ref SCIP_STAGE_EXITSOLVE
39746  */
39748  SCIP* scip, /**< SCIP data structure */
39749  SCIP_SOL* sol, /**< primal solution representing ray */
39750  FILE* file, /**< output file (or NULL for standard output) */
39751  SCIP_Bool printzeros /**< should variables set to zero be printed? */
39752  )
39753 {
39754  assert(scip != NULL);
39755  assert(sol != NULL);
39756 
39757  SCIP_CALL( checkStage(scip, "SCIPprintRay", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39758 
39759  SCIP_CALL( SCIPsolPrintRay(sol, scip->set, scip->messagehdlr, scip->stat, scip->origprob, scip->transprob, file, printzeros) );
39760 
39761  return SCIP_OKAY;
39762 }
39763 
39764 /** gets number of feasible primal solutions stored in the solution storage in case the problem is transformed;
39765  * in case the problem stage is SCIP_STAGE_PROBLEM, the number of solution in the original solution candidate
39766  * storage is returned
39767  *
39768  * @return number of feasible primal solutions stored in the solution storage in case the problem is transformed; or
39769  * number of solution in the original solution candidate storage if the problem stage is SCIP_STAGE_PROBLEM
39770  *
39771  * @pre This method can be called if SCIP is in one of the following stages:
39772  * - \ref SCIP_STAGE_PROBLEM
39773  * - \ref SCIP_STAGE_TRANSFORMED
39774  * - \ref SCIP_STAGE_INITPRESOLVE
39775  * - \ref SCIP_STAGE_PRESOLVING
39776  * - \ref SCIP_STAGE_EXITPRESOLVE
39777  * - \ref SCIP_STAGE_PRESOLVED
39778  * - \ref SCIP_STAGE_INITSOLVE
39779  * - \ref SCIP_STAGE_SOLVING
39780  * - \ref SCIP_STAGE_SOLVED
39781  * - \ref SCIP_STAGE_EXITSOLVE
39782  */
39784  SCIP* scip /**< SCIP data structure */
39785  )
39786 {
39787  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNSols", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39788 
39789  switch( scip->set->stage )
39790  {
39791  case SCIP_STAGE_PROBLEM:
39792  return scip->origprimal->nsols;
39793 
39796  case SCIP_STAGE_PRESOLVING:
39798  case SCIP_STAGE_PRESOLVED:
39799  case SCIP_STAGE_INITSOLVE:
39800  case SCIP_STAGE_SOLVING:
39801  case SCIP_STAGE_SOLVED:
39802  case SCIP_STAGE_EXITSOLVE:
39803  return scip->primal->nsols;
39804 
39805  case SCIP_STAGE_INIT:
39807  case SCIP_STAGE_FREETRANS:
39808  default:
39809  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
39810  SCIPABORT();
39811  return -1; /*lint !e527*/
39812  } /*lint !e788*/
39813 }
39814 
39815 /** gets array of feasible primal solutions stored in the solution storage in case the problem is transformed; in case
39816  * if the problem stage is in SCIP_STAGE_PROBLEM, it returns the number array of solution candidate stored
39817  *
39818  * @return array of feasible primal solutions
39819  *
39820  * @pre This method can be called if SCIP is in one of the following stages:
39821  * - \ref SCIP_STAGE_PROBLEM
39822  * - \ref SCIP_STAGE_TRANSFORMED
39823  * - \ref SCIP_STAGE_INITPRESOLVE
39824  * - \ref SCIP_STAGE_PRESOLVING
39825  * - \ref SCIP_STAGE_EXITPRESOLVE
39826  * - \ref SCIP_STAGE_PRESOLVED
39827  * - \ref SCIP_STAGE_INITSOLVE
39828  * - \ref SCIP_STAGE_SOLVING
39829  * - \ref SCIP_STAGE_SOLVED
39830  * - \ref SCIP_STAGE_EXITSOLVE
39831  */
39833  SCIP* scip /**< SCIP data structure */
39834  )
39835 {
39836  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSols", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39837 
39838  switch( scip->set->stage )
39839  {
39840  case SCIP_STAGE_PROBLEM:
39841  return scip->origprimal->sols;
39842 
39845  case SCIP_STAGE_PRESOLVING:
39847  case SCIP_STAGE_PRESOLVED:
39848  case SCIP_STAGE_INITSOLVE:
39849  case SCIP_STAGE_SOLVING:
39850  case SCIP_STAGE_SOLVED:
39851  case SCIP_STAGE_EXITSOLVE:
39852  return scip->primal->sols;
39853 
39854  case SCIP_STAGE_INIT:
39856  case SCIP_STAGE_FREETRANS:
39857  case SCIP_STAGE_FREE:
39858  default:
39859  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
39860  return NULL;
39861  } /*lint !e788*/
39862 }
39863 
39864 /** gets best feasible primal solution found so far if the problem is transformed; in case the problem is in
39865  * SCIP_STAGE_PROBLEM it returns the best solution candidate, or NULL if no solution has been found or the candidate
39866  * store is empty;
39867  *
39868  * @return best feasible primal solution so far
39869  *
39870  * @pre This method can be called if SCIP is in one of the following stages:
39871  * - \ref SCIP_STAGE_PROBLEM
39872  * - \ref SCIP_STAGE_TRANSFORMED
39873  * - \ref SCIP_STAGE_INITPRESOLVE
39874  * - \ref SCIP_STAGE_PRESOLVING
39875  * - \ref SCIP_STAGE_EXITPRESOLVE
39876  * - \ref SCIP_STAGE_PRESOLVED
39877  * - \ref SCIP_STAGE_INITSOLVE
39878  * - \ref SCIP_STAGE_SOLVING
39879  * - \ref SCIP_STAGE_SOLVED
39880  * - \ref SCIP_STAGE_EXITSOLVE
39881  */
39883  SCIP* scip /**< SCIP data structure */
39884  )
39885 {
39886  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestSol", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39887  switch( scip->set->stage )
39888  {
39889  case SCIP_STAGE_INIT:
39890  return NULL;
39891  case SCIP_STAGE_PROBLEM:
39892  assert(scip->origprimal != NULL);
39893  if( scip->origprimal->nsols > 0 )
39894  {
39895  assert(scip->origprimal->sols != NULL);
39896  assert(scip->origprimal->sols[0] != NULL);
39897  return scip->origprimal->sols[0];
39898  }
39899  break;
39900 
39903  case SCIP_STAGE_PRESOLVING:
39905  case SCIP_STAGE_PRESOLVED:
39906  case SCIP_STAGE_INITSOLVE:
39907  case SCIP_STAGE_SOLVING:
39908  case SCIP_STAGE_SOLVED:
39909  case SCIP_STAGE_EXITSOLVE:
39910  assert(scip->primal != NULL);
39911  if( scip->primal->nsols > 0 )
39912  {
39913  assert(scip->primal->sols != NULL);
39914  assert(scip->primal->sols[0] != NULL);
39915  return scip->primal->sols[0];
39916  }
39917  break;
39918 
39920  case SCIP_STAGE_FREETRANS:
39921  case SCIP_STAGE_FREE:
39922  default:
39923  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
39924  return NULL;
39925  }
39926 
39927  return NULL;
39928 }
39929 
39930 /** outputs best feasible primal solution found so far to file stream
39931  *
39932  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39933  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39934  *
39935  * @pre This method can be called if SCIP is in one of the following stages:
39936  * - \ref SCIP_STAGE_INIT
39937  * - \ref SCIP_STAGE_PROBLEM
39938  * - \ref SCIP_STAGE_TRANSFORMED
39939  * - \ref SCIP_STAGE_INITPRESOLVE
39940  * - \ref SCIP_STAGE_PRESOLVING
39941  * - \ref SCIP_STAGE_EXITPRESOLVE
39942  * - \ref SCIP_STAGE_PRESOLVED
39943  * - \ref SCIP_STAGE_INITSOLVE
39944  * - \ref SCIP_STAGE_SOLVING
39945  * - \ref SCIP_STAGE_SOLVED
39946  * - \ref SCIP_STAGE_EXITSOLVE
39947  */
39949  SCIP* scip, /**< SCIP data structure */
39950  FILE* file, /**< output file (or NULL for standard output) */
39951  SCIP_Bool printzeros /**< should variables set to zero be printed? */
39952  )
39953 {
39954  SCIP_SOL* sol;
39955 
39956  SCIP_CALL( checkStage(scip, "SCIPprintBestSol", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39957 
39958  sol = SCIPgetBestSol(scip);
39959 
39960  if( sol == NULL )
39961  SCIPmessageFPrintInfo(scip->messagehdlr, file, "no solution available\n");
39962  else
39963  {
39964  SCIP_CALL( SCIPprintSol(scip, sol, file, printzeros) );
39965  }
39966 
39967  return SCIP_OKAY;
39968 }
39969 
39970 /** outputs best feasible primal solution found so far in transformed variables to file stream
39971  *
39972  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39973  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39974  *
39975  * @pre This method can be called if SCIP is in one of the following stages:
39976  * - \ref SCIP_STAGE_INIT
39977  * - \ref SCIP_STAGE_PROBLEM
39978  * - \ref SCIP_STAGE_TRANSFORMED
39979  * - \ref SCIP_STAGE_INITPRESOLVE
39980  * - \ref SCIP_STAGE_PRESOLVING
39981  * - \ref SCIP_STAGE_EXITPRESOLVE
39982  * - \ref SCIP_STAGE_PRESOLVED
39983  * - \ref SCIP_STAGE_INITSOLVE
39984  * - \ref SCIP_STAGE_SOLVING
39985  * - \ref SCIP_STAGE_SOLVED
39986  * - \ref SCIP_STAGE_EXITSOLVE
39987  */
39989  SCIP* scip, /**< SCIP data structure */
39990  FILE* file, /**< output file (or NULL for standard output) */
39991  SCIP_Bool printzeros /**< should variables set to zero be printed? */
39992  )
39993 {
39994  SCIP_SOL* sol;
39995 
39996  SCIP_CALL( checkStage(scip, "SCIPprintBestTransSol", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39997 
39998  sol = SCIPgetBestSol(scip);
39999 
40000  if( sol != NULL && SCIPsolIsOriginal(sol) )
40001  {
40002  SCIPerrorMessage("best solution is defined in original space - cannot print it as transformed solution\n");
40003  return SCIP_INVALIDCALL;
40004  }
40005 
40006  if( sol == NULL )
40007  SCIPmessageFPrintInfo(scip->messagehdlr, file, "no solution available\n");
40008  else
40009  {
40010  SCIP_CALL( SCIPprintTransSol(scip, sol, file, printzeros) );
40011  }
40012 
40013  return SCIP_OKAY;
40014 }
40015 
40016 /** try to round given solution
40017  *
40018  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40019  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40020  *
40021  * @pre This method can be called if SCIP is in one of the following stages:
40022  * - \ref SCIP_STAGE_SOLVING
40023  */
40025  SCIP* scip, /**< SCIP data structure */
40026  SCIP_SOL* sol, /**< primal solution */
40027  SCIP_Bool* success /**< pointer to store whether rounding was successful */
40028  )
40029 {
40030  SCIP_CALL( checkStage(scip, "SCIProundSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40031 
40032  if( SCIPsolIsOriginal(sol) )
40033  {
40034  SCIPerrorMessage("cannot round original space solution\n");
40035  return SCIP_INVALIDCALL;
40036  }
40037 
40038  SCIP_CALL( SCIPsolRound(sol, scip->set, scip->stat, scip->transprob, scip->tree, success) );
40039 
40040  return SCIP_OKAY;
40041 }
40042 
40043 /** retransforms solution to original problem space
40044  *
40045  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40046  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40047  *
40048  * @pre This method can be called if SCIP is in one of the following stages:
40049  * - \ref SCIP_STAGE_TRANSFORMED
40050  * - \ref SCIP_STAGE_INITPRESOLVE
40051  * - \ref SCIP_STAGE_PRESOLVING
40052  * - \ref SCIP_STAGE_EXITPRESOLVE
40053  * - \ref SCIP_STAGE_PRESOLVED
40054  * - \ref SCIP_STAGE_INITSOLVE
40055  * - \ref SCIP_STAGE_SOLVING
40056  * - \ref SCIP_STAGE_SOLVED
40057  * - \ref SCIP_STAGE_EXITSOLVE
40058  * - \ref SCIP_STAGE_FREETRANS
40059  */
40061  SCIP* scip, /**< SCIP data structure */
40062  SCIP_SOL* sol /**< primal CIP solution */
40063  )
40064 {
40065  SCIP_CALL( checkStage(scip, "SCIPretransformSol", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
40066 
40067  switch ( SCIPsolGetOrigin(sol) )
40068  {
40070  /* nothing to do */
40071  return SCIP_OKAY;
40072 
40073  case SCIP_SOLORIGIN_LPSOL:
40074  case SCIP_SOLORIGIN_NLPSOL:
40077 
40078  /* first unlink solution */
40079  SCIP_CALL( SCIPunlinkSol(scip, sol) );
40080 
40081  /*lint -fallthrough*/
40082  case SCIP_SOLORIGIN_ZERO:
40083  {
40084  SCIP_Bool hasinfval;
40085 
40086  SCIP_CALL( SCIPsolRetransform(sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
40087  break;
40088  }
40091  SCIPerrorMessage("unknown solution origin.\n");
40092  return SCIP_INVALIDCALL;
40093 
40094  default:
40095  /* note that this is in an internal SCIP error since all solution origins are covert in the switch above */
40096  SCIPerrorMessage("invalid solution origin <%d>\n", SCIPsolGetOrigin(sol));
40097  return SCIP_ERROR;
40098  }
40099 
40100  return SCIP_OKAY;
40101 }
40102 
40103 /** reads a given solution file, problem has to be transformed in advance
40104  *
40105  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40106  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40107  *
40108  * @pre This method can be called if SCIP is in one of the following stages:
40109  * - \ref SCIP_STAGE_PROBLEM
40110  * - \ref SCIP_STAGE_TRANSFORMED
40111  * - \ref SCIP_STAGE_INITPRESOLVE
40112  * - \ref SCIP_STAGE_PRESOLVING
40113  * - \ref SCIP_STAGE_EXITPRESOLVE
40114  * - \ref SCIP_STAGE_PRESOLVED
40115  * - \ref SCIP_STAGE_INITSOLVE
40116  * - \ref SCIP_STAGE_SOLVING
40117  */
40119  SCIP* scip, /**< SCIP data structure */
40120  const char* filename /**< name of the input file */
40121  )
40122 {
40123  SCIP_CALL( checkStage(scip, "SCIPreadSol", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40124 
40125  /* we pass the reading of the solution file on to reader_sol via the following call */
40126  SCIP_CALL( SCIPreadProb(scip, filename, "sol") );
40127 
40128  return SCIP_OKAY;
40129 }
40130 
40131 /** reads a given solution file and store the solution values in the given solution pointer */
40132 static
40134  SCIP* scip, /**< SCIP data structure */
40135  const char* filename, /**< name of the input file */
40136  SCIP_SOL* sol, /**< solution pointer */
40137  SCIP_Bool* partial, /**< pointer to store if the solution is partial (or NULL, if not needed) */
40138  SCIP_Bool* error /**< pointer store if an error occured */
40139  )
40140 {
40141  SCIP_FILE* file;
40142  SCIP_Bool unknownvariablemessage;
40143  SCIP_Bool localpartial;
40144  int lineno;
40145 
40146  assert(scip != NULL);
40147  assert(sol != NULL);
40148  assert(error != NULL);
40149 
40150  /* open input file */
40151  file = SCIPfopen(filename, "r");
40152  if( file == NULL )
40153  {
40154  SCIPerrorMessage("cannot open file <%s> for reading\n", filename);
40155  SCIPprintSysError(filename);
40156  return SCIP_NOFILE;
40157  }
40158 
40159  *error = FALSE;
40160  localpartial = SCIPsolIsPartial(sol);
40161 
40162  unknownvariablemessage = FALSE;
40163  lineno = 0;
40164 
40165  /* read the file */
40166  while( !SCIPfeof(file) && !(*error) )
40167  {
40168  char buffer[SCIP_MAXSTRLEN];
40169  char varname[SCIP_MAXSTRLEN];
40170  char valuestring[SCIP_MAXSTRLEN];
40171  char objstring[SCIP_MAXSTRLEN];
40172  SCIP_VAR* var;
40173  SCIP_Real value;
40174  int nread;
40175 
40176  /* get next line */
40177  if( SCIPfgets(buffer, (int) sizeof(buffer), file) == NULL )
40178  break;
40179  lineno++;
40180 
40181  /* there are some lines which may preceed the solution information */
40182  if( strncasecmp(buffer, "solution status:", 16) == 0 || strncasecmp(buffer, "objective value:", 16) == 0 ||
40183  strncasecmp(buffer, "Log started", 11) == 0 || strncasecmp(buffer, "Variable Name", 13) == 0 ||
40184  strncasecmp(buffer, "All other variables", 19) == 0 || strncasecmp(buffer, "\n", 1) == 0 ||
40185  strncasecmp(buffer, "NAME", 4) == 0 || strncasecmp(buffer, "ENDATA", 6) == 0 ) /* allow parsing of SOL-format on the MIPLIB 2003 pages */
40186  continue;
40187 
40188  /* parse the line */
40189  /* cppcheck-suppress invalidscanf */
40190  nread = sscanf(buffer, "%s %s %s\n", varname, valuestring, objstring);
40191  if( nread < 2 )
40192  {
40193  SCIPerrorMessage("Invalid input line %d in solution file <%s>: <%s>.\n", lineno, filename, buffer);
40194  *error = TRUE;
40195  break;
40196  }
40197 
40198  /* find the variable */
40199  var = SCIPfindVar(scip, varname);
40200  if( var == NULL )
40201  {
40202  if( !unknownvariablemessage )
40203  {
40204  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "unknown variable <%s> in line %d of solution file <%s>\n",
40205  varname, lineno, filename);
40206  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, " (further unknown variables are ignored)\n");
40207  unknownvariablemessage = TRUE;
40208  }
40209  continue;
40210  }
40211 
40212  /* cast the value */
40213  if( strncasecmp(valuestring, "inv", 3) == 0 )
40214  continue;
40215  else if( strncasecmp(valuestring, "+inf", 4) == 0 || strncasecmp(valuestring, "inf", 3) == 0 )
40216  value = SCIPinfinity(scip);
40217  else if( strncasecmp(valuestring, "-inf", 4) == 0 )
40218  value = -SCIPinfinity(scip);
40219  else if( strncasecmp(valuestring, "unknown", 7) == 0 )
40220  {
40221  value = SCIP_UNKNOWN;
40222  localpartial = TRUE;
40223  }
40224  else
40225  {
40226  nread = sscanf(valuestring, "%lf", &value);
40227  if( nread != 1 )
40228  {
40229  SCIPerrorMessage("Invalid solution value <%s> for variable <%s> in line %d of solution file <%s>.\n",
40230  valuestring, varname, lineno, filename);
40231  *error = TRUE;
40232  break;
40233  }
40234  }
40235 
40236  /* set the solution value of the variable, if not multiaggregated */
40238  {
40239  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "ignored solution value for multiaggregated variable <%s>\n", SCIPvarGetName(var));
40240  }
40241  else
40242  {
40243  SCIP_RETCODE retcode;
40244 
40245  retcode = SCIPsetSolVal(scip, sol, var, value);
40246 
40247  if( retcode == SCIP_INVALIDDATA )
40248  {
40250  {
40251  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "ignored conflicting solution value for fixed variable <%s>\n",
40252  SCIPvarGetName(var));
40253  }
40254  else
40255  {
40256  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "ignored solution value for multiaggregated variable <%s>\n",
40257  SCIPvarGetName(var));
40258  }
40259  }
40260  else
40261  {
40262  SCIP_CALL_FINALLY( retcode, SCIPfclose(file) );
40263  }
40264  }
40265  }
40266 
40267  /* close input file */
40268  SCIPfclose(file);
40269 
40270  if( localpartial && !SCIPsolIsPartial(sol) )
40271  {
40272  if( SCIPgetStage(scip) == SCIP_STAGE_PROBLEM )
40273  {
40274  SCIP_CALL( SCIPsolMarkPartial(sol, scip->set, scip->stat, scip->origprob->vars, scip->origprob->nvars) );
40275  }
40276  else
40277  *error = TRUE;
40278  }
40279 
40280  if( partial != NULL )
40281  *partial = localpartial;
40282 
40283  return SCIP_OKAY;
40284 }
40285 
40286 /** reads a given xml solution file and store the solution values in the given solution pointer */
40287 static
40289  SCIP* scip, /**< SCIP data structure */
40290  const char* filename, /**< name of the input file */
40291  SCIP_SOL* sol, /**< solution pointer */
40292  SCIP_Bool* partial, /**< pointer to store if the solution is partial (or NULL if not needed) */
40293  SCIP_Bool* error /**< pointer store if an error occured */
40294  )
40295 {
40296  SCIP_Bool unknownvariablemessage;
40297  SCIP_Bool localpartial;
40298  XML_NODE* start;
40299  const XML_NODE* varsnode;
40300  const XML_NODE* varnode;
40301  const char* tag;
40302 
40303  assert(scip != NULL);
40304  assert(sol != NULL);
40305  assert(error != NULL);
40306 
40307  /* read xml file */
40308  start = xmlProcess(filename);
40309 
40310  if( start == NULL )
40311  {
40312  SCIPerrorMessage("Some error occured during parsing the XML solution file.\n");
40313  return SCIP_READERROR;
40314  }
40315 
40316  *error = FALSE;
40317  localpartial = SCIPsolIsPartial(sol);
40318 
40319  /* find variable sections */
40320  tag = "variables";
40321  varsnode = xmlFindNodeMaxdepth(start, tag, 0, 3);
40322  if( varsnode == NULL )
40323  {
40324  /* free xml data */
40325  xmlFreeNode(start);
40326 
40327  SCIPerrorMessage("Variable section not found.\n");
40328  return SCIP_READERROR;
40329  }
40330 
40331  /* loop through all variables */
40332  unknownvariablemessage = FALSE;
40333  for( varnode = xmlFirstChild(varsnode); varnode != NULL; varnode = xmlNextSibl(varnode) )
40334  {
40335  SCIP_VAR* var;
40336  const char* varname;
40337  const char* valuestring;
40338  SCIP_Real value;
40339  int nread;
40340 
40341  /* find variable name */
40342  varname = xmlGetAttrval(varnode, "name");
40343  if( varname == NULL )
40344  {
40345  SCIPerrorMessage("Attribute \"name\" of variable not found.\n");
40346  *error = TRUE;
40347  break;
40348  }
40349 
40350  /* find the variable */
40351  var = SCIPfindVar(scip, varname);
40352  if( var == NULL )
40353  {
40354  if( !unknownvariablemessage )
40355  {
40356  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "unknown variable <%s> of solution file <%s>\n",
40357  varname, filename);
40358  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, " (further unknown variables are ignored)\n");
40359  unknownvariablemessage = TRUE;
40360  }
40361  continue;
40362  }
40363 
40364  /* find value of variable */
40365  valuestring = xmlGetAttrval(varnode, "value");
40366  if( valuestring == NULL )
40367  {
40368  SCIPerrorMessage("Attribute \"value\" of variable not found.\n");
40369  *error = TRUE;
40370  break;
40371  }
40372 
40373  /* cast the value */
40374  if( strncasecmp(valuestring, "inv", 3) == 0 )
40375  continue;
40376  else if( strncasecmp(valuestring, "+inf", 4) == 0 || strncasecmp(valuestring, "inf", 3) == 0 )
40377  value = SCIPinfinity(scip);
40378  else if( strncasecmp(valuestring, "-inf", 4) == 0 )
40379  value = -SCIPinfinity(scip);
40380  else if( strncasecmp(valuestring, "unknown", 7) == 0 )
40381  {
40382  value = SCIP_UNKNOWN;
40383  localpartial = TRUE;
40384  }
40385  else
40386  {
40387  nread = sscanf(valuestring, "%lf", &value);
40388  if( nread != 1 )
40389  {
40390  SCIPwarningMessage(scip, "invalid solution value <%s> for variable <%s> in XML solution file <%s>\n", valuestring, varname, filename);
40391  *error = TRUE;
40392  break;
40393  }
40394  }
40395 
40396  /* set the solution value of the variable, if not multiaggregated */
40398  {
40399  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "ignored solution value for multiaggregated variable <%s>\n", SCIPvarGetName(var));
40400  }
40401  else
40402  {
40403  SCIP_RETCODE retcode;
40404  retcode = SCIPsetSolVal(scip, sol, var, value);
40405 
40406  if( retcode == SCIP_INVALIDDATA )
40407  {
40409  {
40410  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "ignored conflicting solution value for fixed variable <%s>\n",
40411  SCIPvarGetName(var));
40412  }
40413  else
40414  {
40415  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "ignored solution value for multiaggregated variable <%s>\n",
40416  SCIPvarGetName(var));
40417  }
40418  }
40419  else
40420  {
40421  SCIP_CALL( retcode );
40422  }
40423  }
40424  }
40425 
40426  /* free xml data */
40427  xmlFreeNode(start);
40428 
40429  if( localpartial && !SCIPsolIsPartial(sol) )
40430  {
40431  if( SCIPgetStage(scip) == SCIP_STAGE_PROBLEM )
40432  {
40433  SCIP_CALL( SCIPsolMarkPartial(sol, scip->set, scip->stat, scip->origprob->vars, scip->origprob->nvars) );
40434  }
40435  else
40436  *error = TRUE;
40437  }
40438 
40439  if( partial != NULL )
40440  *partial = localpartial;
40441 
40442  return SCIP_OKAY;
40443 }
40444 
40445 /** reads a given solution file and store the solution values in the given solution pointer
40446  *
40447  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40448  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40449  *
40450  * @pre This method can be called if SCIP is in one of the following stages:
40451  * - \ref SCIP_STAGE_PROBLEM
40452  * - \ref SCIP_STAGE_TRANSFORMED
40453  * - \ref SCIP_STAGE_INITPRESOLVE
40454  * - \ref SCIP_STAGE_PRESOLVING
40455  * - \ref SCIP_STAGE_EXITPRESOLVE
40456  * - \ref SCIP_STAGE_PRESOLVED
40457  * - \ref SCIP_STAGE_INITSOLVE
40458  * - \ref SCIP_STAGE_SOLVING
40459  */
40461  SCIP* scip, /**< SCIP data structure */
40462  const char* filename, /**< name of the input file */
40463  SCIP_SOL* sol, /**< solution pointer */
40464  SCIP_Bool xml, /**< true, iff the given solution in written in XML */
40465  SCIP_Bool* partial, /**< pointer to store if the solution is partial */
40466  SCIP_Bool* error /**< pointer store if an error occured */
40467  )
40468 {
40469  SCIP_CALL( checkStage(scip, "SCIPreadSolFile", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40470 
40471  if( xml )
40472  {
40473  SCIP_CALL( readXmlSolFile(scip, filename, sol, partial, error) );
40474  }
40475  else
40476  {
40477  SCIP_CALL( readSolFile(scip, filename, sol, partial, error) );
40478  }
40479 
40480  return SCIP_OKAY;
40481 }
40482 
40483 /** adds feasible primal solution to solution storage by copying it
40484  *
40485  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40486  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40487  *
40488  * @pre This method can be called if SCIP is in one of the following stages:
40489  * - \ref SCIP_STAGE_PROBLEM
40490  * - \ref SCIP_STAGE_TRANSFORMED
40491  * - \ref SCIP_STAGE_INITPRESOLVE
40492  * - \ref SCIP_STAGE_PRESOLVING
40493  * - \ref SCIP_STAGE_EXITPRESOLVE
40494  * - \ref SCIP_STAGE_PRESOLVED
40495  * - \ref SCIP_STAGE_SOLVING
40496  * - \ref SCIP_STAGE_FREETRANS
40497  *
40498  * @note Do not call during propagation, use heur_trysol instead.
40499  */
40501  SCIP* scip, /**< SCIP data structure */
40502  SCIP_SOL* sol, /**< primal CIP solution */
40503  SCIP_Bool* stored /**< stores whether given solution was good enough to keep */
40504  )
40505 {
40506  SCIP_CALL( checkStage(scip, "SCIPaddSol", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE) );
40507 
40508  switch( scip->set->stage )
40509  {
40510  case SCIP_STAGE_PROBLEM:
40511  case SCIP_STAGE_FREETRANS:
40512  assert(SCIPsolIsOriginal(sol));
40513  SCIP_CALL( SCIPprimalAddOrigSol(scip->origprimal, scip->mem->probmem, scip->set, scip->stat, scip->origprob, sol, stored) );
40514  return SCIP_OKAY;
40515 
40518  case SCIP_STAGE_PRESOLVING:
40520  /* if the solution is added during presolving and it is not defined on original variables,
40521  * presolving operations will destroy its validity, so we retransform it to the original space
40522  */
40523  if( !SCIPsolIsOriginal(sol) )
40524  {
40525  SCIP_SOL* bestsol = SCIPgetBestSol(scip);
40526  SCIP_SOL* tmpsol = sol;
40527  SCIP_Bool hasinfval;
40528 
40529  SCIP_CALL( SCIPcreateSolCopy(scip, &tmpsol, sol) );
40530 
40531  SCIP_CALL( SCIPsolUnlink(tmpsol, scip->set, scip->transprob) );
40532  SCIP_CALL( SCIPsolRetransform(tmpsol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
40533 
40534  SCIP_CALL( SCIPprimalAddSolFree(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
40535  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter,
40536  &tmpsol, stored) );
40537 
40538  if( *stored && (bestsol != SCIPgetBestSol(scip)) )
40539  {
40540  SCIPstoreSolutionGap(scip);
40541  }
40542 
40543  return SCIP_OKAY;
40544  }
40545  /*lint -fallthrough*/
40546  case SCIP_STAGE_PRESOLVED:
40547  case SCIP_STAGE_SOLVING:
40548  {
40549  SCIP_SOL* bestsol = SCIPgetBestSol(scip);
40550 
40551  SCIP_CALL( SCIPprimalAddSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
40552  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, sol,
40553  stored) );
40554 
40555  /* @todo use solution index rather than pointer */
40556  if( *stored && (bestsol != SCIPgetBestSol(scip)) )
40557  {
40558  SCIPstoreSolutionGap(scip);
40559  }
40560 
40561  return SCIP_OKAY;
40562  }
40564  case SCIP_STAGE_INITSOLVE:
40565  case SCIP_STAGE_SOLVED:
40566  case SCIP_STAGE_EXITSOLVE:
40567  default:
40568  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
40569  return SCIP_INVALIDCALL;
40570  } /*lint !e788*/
40571 }
40572 
40573 /** adds primal solution to solution storage, frees the solution afterwards
40574  *
40575  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40576  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40577  *
40578  * @pre This method can be called if SCIP is in one of the following stages:
40579  * - \ref SCIP_STAGE_PROBLEM
40580  * - \ref SCIP_STAGE_TRANSFORMED
40581  * - \ref SCIP_STAGE_INITPRESOLVE
40582  * - \ref SCIP_STAGE_PRESOLVING
40583  * - \ref SCIP_STAGE_EXITPRESOLVE
40584  * - \ref SCIP_STAGE_PRESOLVED
40585  * - \ref SCIP_STAGE_SOLVING
40586  * - \ref SCIP_STAGE_FREETRANS
40587  *
40588  * @note Do not call during propagation, use heur_trysol instead.
40589  */
40591  SCIP* scip, /**< SCIP data structure */
40592  SCIP_SOL** sol, /**< pointer to primal CIP solution; is cleared in function call */
40593  SCIP_Bool* stored /**< stores whether given solution was good enough to keep */
40594  )
40595 {
40596  SCIP_CALL( checkStage(scip, "SCIPaddSolFree", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE) );
40597 
40598  switch( scip->set->stage )
40599  {
40600  case SCIP_STAGE_PROBLEM:
40601  case SCIP_STAGE_FREETRANS:
40602  assert(SCIPsolIsOriginal(*sol));
40603  SCIP_CALL( SCIPprimalAddOrigSolFree(scip->origprimal, scip->mem->probmem, scip->set, scip->stat, scip->origprob, sol, stored) );
40604  return SCIP_OKAY;
40605 
40608  case SCIP_STAGE_PRESOLVING:
40610  /* if the solution is added during presolving and it is not defined on original variables,
40611  * presolving operations will destroy its validity, so we retransform it to the original space
40612  */
40613  if( !SCIPsolIsOriginal(*sol) )
40614  {
40615  SCIP_Bool hasinfval;
40616 
40617  SCIP_CALL( SCIPsolUnlink(*sol, scip->set, scip->transprob) );
40618  SCIP_CALL( SCIPsolRetransform(*sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
40619  }
40620  /*lint -fallthrough*/
40621  case SCIP_STAGE_PRESOLVED:
40622  case SCIP_STAGE_SOLVING:
40623  {
40624  SCIP_SOL* bestsol = SCIPgetBestSol(scip);
40625 
40626  SCIP_CALL( SCIPprimalAddSolFree(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
40627  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter,
40628  sol, stored) );
40629 
40630  if( *stored )
40631  {
40632  if( bestsol != SCIPgetBestSol(scip) )
40633  {
40634  assert(SCIPgetBestSol(scip) != NULL);
40635  SCIPstoreSolutionGap(scip);
40636  }
40637  }
40638 
40639  return SCIP_OKAY;
40640  }
40642  case SCIP_STAGE_INITSOLVE:
40643  case SCIP_STAGE_SOLVED:
40644  case SCIP_STAGE_EXITSOLVE:
40645  default:
40646  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
40647  return SCIP_INVALIDCALL;
40648  } /*lint !e788*/
40649 }
40650 
40651 /** adds current LP/pseudo solution to solution storage
40652  *
40653  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40654  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40655  *
40656  * @pre This method can be called if SCIP is in one of the following stages:
40657  * - \ref SCIP_STAGE_PRESOLVED
40658  * - \ref SCIP_STAGE_SOLVING
40659  */
40661  SCIP* scip, /**< SCIP data structure */
40662  SCIP_HEUR* heur, /**< heuristic that found the solution */
40663  SCIP_Bool* stored /**< stores whether given solution was good enough to keep */
40664  )
40665 {
40666  SCIP_SOL* bestsol;
40667 
40668  SCIP_CALL( checkStage(scip, "SCIPaddCurrentSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40669 
40670  bestsol = SCIPgetBestSol(scip);
40671 
40672  SCIP_CALL( SCIPprimalAddCurrentSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
40673  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, heur,
40674  stored) );
40675 
40676  if( *stored )
40677  {
40678  if( bestsol != SCIPgetBestSol(scip) )
40679  SCIPstoreSolutionGap(scip);
40680  }
40681 
40682  return SCIP_OKAY;
40683 }
40684 
40685 /** checks solution for feasibility; if possible, adds it to storage by copying
40686  *
40687  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40688  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40689  *
40690  * @pre This method can be called if SCIP is in one of the following stages:
40691  * - \ref SCIP_STAGE_TRANSFORMED
40692  * - \ref SCIP_STAGE_INITPRESOLVE
40693  * - \ref SCIP_STAGE_PRESOLVING
40694  * - \ref SCIP_STAGE_EXITPRESOLVE
40695  * - \ref SCIP_STAGE_PRESOLVED
40696  * - \ref SCIP_STAGE_SOLVING
40697  *
40698  * @note Do not call during propagation, use heur_trysol instead.
40699  */
40701  SCIP* scip, /**< SCIP data structure */
40702  SCIP_SOL* sol, /**< primal CIP solution */
40703  SCIP_Bool printreason, /**< Should all reasons of violation be printed? */
40704  SCIP_Bool completely, /**< Should all violations be checked? */
40705  SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
40706  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
40707  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
40708  SCIP_Bool* stored /**< stores whether given solution was feasible and good enough to keep */
40709  )
40710 {
40711  SCIP_SOL* bestsol;
40712 
40713  assert(sol != NULL);
40714  assert(stored != NULL);
40715 
40716  SCIP_CALL( checkStage(scip, "SCIPtrySol", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40717 
40718  bestsol = SCIPgetBestSol(scip);
40719 
40720  if( !printreason )
40721  completely = FALSE;
40722 
40723  /* we cannot check partial solutions */
40724  if( SCIPsolIsPartial(sol) )
40725  {
40726  SCIPerrorMessage("Cannot check feasibility of partial solutions.\n");
40727  return SCIP_INVALIDDATA;
40728  }
40729 
40730  /* if the solution is added during presolving and it is not defined on original variables,
40731  * presolving operations will destroy its validity, so we retransform it to the original space
40732  */
40733  if( scip->set->stage == SCIP_STAGE_PRESOLVING && !SCIPsolIsOriginal(sol) )
40734  {
40735  SCIP_Bool hasinfval;
40736 
40737  SCIP_CALL( SCIPsolUnlink(sol, scip->set, scip->transprob) );
40738  SCIP_CALL( SCIPsolRetransform(sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
40739  }
40740 
40741  if( SCIPsolIsOriginal(sol) )
40742  {
40743  SCIP_Bool feasible;
40744 
40745  /* SCIPprimalTrySol() can only be called on transformed solutions; therefore check solutions in original problem
40746  * including modifiable constraints */
40747  SCIP_CALL( checkSolOrig(scip, sol, &feasible, printreason, completely, checkbounds, checkintegrality, checklprows, TRUE) );
40748  if( feasible )
40749  {
40750  SCIP_CALL( SCIPprimalAddSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
40751  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter,
40752  sol, stored) );
40753 
40754  if( *stored )
40755  {
40756  if( bestsol != SCIPgetBestSol(scip) )
40757  SCIPstoreSolutionGap(scip);
40758  }
40759  }
40760  else
40761  *stored = FALSE;
40762  }
40763  else
40764  {
40765  SCIP_CALL( SCIPprimalTrySol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->origprob,
40766  scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, sol, printreason,
40767  completely, checkbounds, checkintegrality, checklprows, stored) );
40768 
40769  if( *stored )
40770  {
40771  if( bestsol != SCIPgetBestSol(scip) )
40772  SCIPstoreSolutionGap(scip);
40773  }
40774  }
40775 
40776  return SCIP_OKAY;
40777 }
40778 
40779 /** checks primal solution; if feasible, adds it to storage; solution is freed afterwards
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  *
40784  * @pre This method can be called if SCIP is in one of the following stages:
40785  * - \ref SCIP_STAGE_TRANSFORMED
40786  * - \ref SCIP_STAGE_INITPRESOLVE
40787  * - \ref SCIP_STAGE_PRESOLVING
40788  * - \ref SCIP_STAGE_EXITPRESOLVE
40789  * - \ref SCIP_STAGE_PRESOLVED
40790  * - \ref SCIP_STAGE_SOLVING
40791  *
40792  * @note Do not call during propagation, use heur_trysol instead.
40793  */
40795  SCIP* scip, /**< SCIP data structure */
40796  SCIP_SOL** sol, /**< pointer to primal CIP solution; is cleared in function call */
40797  SCIP_Bool printreason, /**< Should all reasons of violations be printed */
40798  SCIP_Bool completely, /**< Should all violation be checked? */
40799  SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
40800  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
40801  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
40802  SCIP_Bool* stored /**< stores whether solution was feasible and good enough to keep */
40803  )
40804 {
40805  SCIP_SOL* bestsol;
40806 
40807  assert(stored != NULL);
40808  assert(sol != NULL);
40809 
40810  SCIP_CALL( checkStage(scip, "SCIPtrySolFree", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40811 
40812  bestsol = SCIPgetBestSol(scip);
40813 
40814  if( !printreason )
40815  completely = FALSE;
40816 
40817  /* we cannot check partial solutions */
40818  if( SCIPsolIsPartial(*sol) )
40819  {
40820  SCIPerrorMessage("Cannot check feasibility of partial solutions.\n");
40821  return SCIP_INVALIDDATA;
40822  }
40823 
40824  /* if the solution is added during presolving and it is not defined on original variables,
40825  * presolving operations will destroy its validity, so we retransform it to the original space
40826  */
40827  if( scip->set->stage == SCIP_STAGE_PRESOLVING && !SCIPsolIsOriginal(*sol) )
40828  {
40829  SCIP_Bool hasinfval;
40830 
40831  SCIP_CALL( SCIPsolUnlink(*sol, scip->set, scip->transprob) );
40832  SCIP_CALL( SCIPsolRetransform(*sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
40833  }
40834 
40835  if( SCIPsolIsOriginal(*sol) )
40836  {
40837  SCIP_Bool feasible;
40838 
40839  /* SCIPprimalTrySol() can only be called on transformed solutions; therefore check solutions in original problem
40840  * including modifiable constraints
40841  */
40842  SCIP_CALL( checkSolOrig(scip, *sol, &feasible, printreason, completely, checkbounds, checkintegrality, checklprows, TRUE) );
40843 
40844  if( feasible )
40845  {
40846  SCIP_CALL( SCIPprimalAddSolFree(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
40847  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter,
40848  sol, stored) );
40849 
40850  if( *stored )
40851  {
40852  if( bestsol != SCIPgetBestSol(scip) )
40853  SCIPstoreSolutionGap(scip);
40854  }
40855  }
40856  else
40857  {
40858  SCIP_CALL( SCIPsolFree(sol, scip->mem->probmem, scip->primal) );
40859  *stored = FALSE;
40860  }
40861  }
40862  else
40863  {
40864  SCIP_CALL( SCIPprimalTrySolFree(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
40865  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter,
40866  sol, printreason, completely, checkbounds, checkintegrality, checklprows, stored) );
40867 
40868  if( *stored )
40869  {
40870  if( bestsol != SCIPgetBestSol(scip) )
40871  SCIPstoreSolutionGap(scip);
40872  }
40873  }
40874 
40875  return SCIP_OKAY;
40876 }
40877 
40878 /** checks current LP/pseudo solution for feasibility; if possible, adds it to storage
40879  *
40880  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40881  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40882  *
40883  * @pre This method can be called if SCIP is in one of the following stages:
40884  * - \ref SCIP_STAGE_PRESOLVED
40885  * - \ref SCIP_STAGE_SOLVING
40886  */
40888  SCIP* scip, /**< SCIP data structure */
40889  SCIP_HEUR* heur, /**< heuristic that found the solution */
40890  SCIP_Bool printreason, /**< Should all reasons of violations be printed? */
40891  SCIP_Bool completely, /**< Should all violation be checked? */
40892  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
40893  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
40894  SCIP_Bool* stored /**< stores whether given solution was feasible and good enough to keep */
40895  )
40896 {
40897  SCIP_SOL* bestsol;
40898 
40899  SCIP_CALL( checkStage(scip, "SCIPtryCurrentSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40900 
40901  bestsol = SCIPgetBestSol(scip);
40902 
40903  if( !printreason )
40904  completely = FALSE;
40905 
40906  SCIP_CALL( SCIPprimalTryCurrentSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
40907  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, heur,
40908  printreason, completely, checkintegrality, checklprows, stored) );
40909 
40910  if( *stored )
40911  {
40912  if( bestsol != SCIPgetBestSol(scip) )
40913  SCIPstoreSolutionGap(scip);
40914  }
40915 
40916  return SCIP_OKAY;
40917 }
40918 
40919 /** returns all partial solutions
40920  *
40921  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40922  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40923  *
40924  * @pre This method can be called if SCIP is in one of the following stages:
40925  * - \ref SCIP_STAGE_PROBLEM
40926  * - \ref SCIP_STAGE_PRESOLVING
40927  * - \ref SCIP_STAGE_SOLVING
40928  * - \ref SCIP_STAGE_SOLVED
40929  */
40931  SCIP* scip /**< SCIP data structure */
40932  )
40933 {
40934  assert(scip != NULL);
40935 
40936  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPartialSols", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40937 
40938  return scip->origprimal->partialsols;
40939 
40940 }
40941 
40942 /** returns number of partial solutions
40943  *
40944  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40945  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40946  *
40947  * @pre This method can be called if SCIP is in one of the following stages:
40948  * - \ref SCIP_STAGE_PROBLEM
40949  * - \ref SCIP_STAGE_PRESOLVING
40950  * - \ref SCIP_STAGE_SOLVING
40951  * - \ref SCIP_STAGE_SOLVED
40952  */
40954  SCIP* scip /**< SCIP data structure */
40955  )
40956 {
40957  assert(scip != NULL);
40958 
40959  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPartialSols", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40960 
40961  return scip->origprimal->npartialsols;
40962 }
40963 
40964 /** checks solution for feasibility without adding it to the solution store
40965  *
40966  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40967  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40968  *
40969  * @pre This method can be called if SCIP is in one of the following stages:
40970  * - \ref SCIP_STAGE_PROBLEM
40971  * - \ref SCIP_STAGE_TRANSFORMED
40972  * - \ref SCIP_STAGE_INITPRESOLVE
40973  * - \ref SCIP_STAGE_PRESOLVING
40974  * - \ref SCIP_STAGE_EXITPRESOLVE
40975  * - \ref SCIP_STAGE_PRESOLVED
40976  * - \ref SCIP_STAGE_INITSOLVE
40977  * - \ref SCIP_STAGE_SOLVING
40978  * - \ref SCIP_STAGE_SOLVED
40979  */
40981  SCIP* scip, /**< SCIP data structure */
40982  SCIP_SOL* sol, /**< primal CIP solution */
40983  SCIP_Bool printreason, /**< Should all reasons of violations be printed? */
40984  SCIP_Bool completely, /**< Should all violation be checked? */
40985  SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
40986  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
40987  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
40988  SCIP_Bool* feasible /**< stores whether given solution is feasible */
40989  )
40990 {
40991  SCIP_CALL( checkStage(scip, "SCIPcheckSol", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40992 
40993  /* return immediately if the solution is of type partial */
40994  if( SCIPsolIsPartial(sol) )
40995  {
40996  SCIPerrorMessage("Cannot check feasibility of partial solutions.");
40997  return SCIP_INVALIDDATA;
40998  }
40999 
41000  /* if we want to solve exactly, the constraint handlers cannot rely on the LP's feasibility */
41001  checklprows = checklprows || scip->set->misc_exactsolve;
41002 
41003  if( !printreason )
41004  completely = FALSE;
41005 
41006  if( SCIPsolIsOriginal(sol) )
41007  {
41008  /* SCIPsolCheck() can only be called on transformed solutions */
41009  SCIP_CALL( checkSolOrig(scip, sol, feasible, printreason, completely, checkbounds, checkintegrality, checklprows, FALSE) );
41010  }
41011  else
41012  {
41013  SCIP_CALL( SCIPsolCheck(sol, scip->set, scip->messagehdlr, scip->mem->probmem, scip->stat, scip->transprob,
41014  printreason, completely, checkbounds, checkintegrality, checklprows, feasible) );
41015  }
41016 
41017  return SCIP_OKAY;
41018 }
41019 
41020 /** checks solution for feasibility in original problem without adding it to the solution store;
41021  * this method is used to double check a solution in order to validate the presolving process
41022  *
41023  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41024  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41025  *
41026  * @pre This method can be called if SCIP is in one of the following stages:
41027  * - \ref SCIP_STAGE_PROBLEM
41028  * - \ref SCIP_STAGE_TRANSFORMED
41029  * - \ref SCIP_STAGE_INITPRESOLVE
41030  * - \ref SCIP_STAGE_PRESOLVING
41031  * - \ref SCIP_STAGE_EXITPRESOLVE
41032  * - \ref SCIP_STAGE_PRESOLVED
41033  * - \ref SCIP_STAGE_INITSOLVE
41034  * - \ref SCIP_STAGE_SOLVING
41035  * - \ref SCIP_STAGE_SOLVED
41036  */
41038  SCIP* scip, /**< SCIP data structure */
41039  SCIP_SOL* sol, /**< primal CIP solution */
41040  SCIP_Bool* feasible, /**< stores whether given solution is feasible */
41041  SCIP_Bool printreason, /**< should the reason for the violation be printed? */
41042  SCIP_Bool completely /**< should all violation be checked? */
41043  )
41044 {
41045  assert(scip != NULL);
41046  assert(sol != NULL);
41047  assert(feasible != NULL);
41048 
41049  SCIP_CALL( checkStage(scip, "SCIPcheckSolOrig", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41050 
41051  /* return immediately if the solution is of type partial */
41052  if( SCIPsolIsPartial(sol) )
41053  {
41054  SCIPerrorMessage("Cannot check feasibility of partial solutions.");
41055  return SCIP_INVALIDDATA;
41056  }
41057 
41058  if( !printreason )
41059  completely = FALSE;
41060 
41061  /* check solution in original problem; that includes bounds, integrality, and non modifiable constraints */
41062  SCIP_CALL( checkSolOrig(scip, sol, feasible, printreason, completely, TRUE, TRUE, TRUE, FALSE) );
41063 
41064  return SCIP_OKAY;
41065 }
41066 
41067 /** return whether a primal ray is stored that proves unboundedness of the LP relaxation
41068  *
41069  * @return return whether a primal ray is stored that proves unboundedness of the LP relaxation
41070  *
41071  * @pre This method can be called if SCIP is in one of the following stages:
41072  * - \ref SCIP_STAGE_SOLVING
41073  * - \ref SCIP_STAGE_SOLVED
41074  */
41076  SCIP* scip /**< SCIP data structure */
41077  )
41078 {
41079  SCIP_CALL_ABORT( checkStage(scip, "SCIPhasPrimalRay", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41080 
41081  return scip->primal->primalray != NULL;
41082 }
41083 
41084 /** gets value of given variable in primal ray causing unboundedness of the LP relaxation;
41085  * should only be called if such a ray is stored (check with SCIPhasPrimalRay())
41086  *
41087  * @return value of given variable in primal ray causing unboundedness of the LP relaxation
41088  *
41089  * @pre This method can be called if SCIP is in one of the following stages:
41090  * - \ref SCIP_STAGE_SOLVING
41091  * - \ref SCIP_STAGE_SOLVED
41092  */
41094  SCIP* scip, /**< SCIP data structure */
41095  SCIP_VAR* var /**< variable to get value for */
41096  )
41097 {
41098  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPrimalRayVal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41099 
41100  assert(var != NULL);
41101  assert(scip->primal->primalray != NULL);
41102  assert(var->scip == scip);
41103 
41104  return SCIPsolGetRayVal(scip->primal->primalray, scip->set, scip->stat, var);
41105 }
41106 
41107 /** updates the primal ray thats proves unboundedness
41108  *
41109  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41110  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41111  *
41112  * @pre This method can be called if @p scip is in one of the following stages:
41113  * - \ref SCIP_STAGE_PRESOLVING
41114  * - \ref SCIP_STAGE_PRESOLVED
41115  * - \ref SCIP_STAGE_SOLVING
41116  * - \ref SCIP_STAGE_SOLVED
41117  *
41118  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
41119  */
41121  SCIP* scip, /**< SCIP data structure */
41122  SCIP_SOL* primalray /**< the new primal ray */
41123  )
41124 {
41125  assert(scip != NULL);
41126  assert(primalray != NULL);
41127 
41128  SCIP_CALL( checkStage(scip, "SCIPupdatePrimalRay", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41129 
41130  SCIP_CALL( SCIPprimalUpdateRay(scip->primal, scip->set, scip->stat, primalray, scip->mem->probmem) );
41131 
41132  return SCIP_OKAY;
41133 }
41134 
41135 
41136 /*
41137  * event methods
41138  */
41139 
41140 /** catches a global (not variable or row dependent) event
41141  *
41142  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41143  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41144  *
41145  * @pre This method can be called if @p scip is in one of the following stages:
41146  * - \ref SCIP_STAGE_TRANSFORMING
41147  * - \ref SCIP_STAGE_TRANSFORMED
41148  * - \ref SCIP_STAGE_INITPRESOLVE
41149  * - \ref SCIP_STAGE_PRESOLVING
41150  * - \ref SCIP_STAGE_EXITPRESOLVE
41151  * - \ref SCIP_STAGE_PRESOLVED
41152  * - \ref SCIP_STAGE_INITSOLVE
41153  * - \ref SCIP_STAGE_SOLVING
41154  * - \ref SCIP_STAGE_SOLVED
41155  * - \ref SCIP_STAGE_EXITSOLVE
41156  * - \ref SCIP_STAGE_FREETRANS
41157  */
41159  SCIP* scip, /**< SCIP data structure */
41160  SCIP_EVENTTYPE eventtype, /**< event type mask to select events to catch */
41161  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
41162  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
41163  int* filterpos /**< pointer to store position of event filter entry, or NULL */
41164  )
41165 {
41166  SCIP_CALL( checkStage(scip, "SCIPcatchEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41167 
41168  SCIP_CALL( SCIPeventfilterAdd(scip->eventfilter, scip->mem->probmem, scip->set,
41169  eventtype, eventhdlr, eventdata, filterpos) );
41170 
41171  return SCIP_OKAY;
41172 }
41173 
41174 /** drops a global event (stops to track event)
41175  *
41176  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41177  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41178  *
41179  * @pre This method can be called if @p scip is in one of the following stages:
41180  * - \ref SCIP_STAGE_TRANSFORMING
41181  * - \ref SCIP_STAGE_TRANSFORMED
41182  * - \ref SCIP_STAGE_INITPRESOLVE
41183  * - \ref SCIP_STAGE_PRESOLVING
41184  * - \ref SCIP_STAGE_EXITPRESOLVE
41185  * - \ref SCIP_STAGE_PRESOLVED
41186  * - \ref SCIP_STAGE_INITSOLVE
41187  * - \ref SCIP_STAGE_SOLVING
41188  * - \ref SCIP_STAGE_SOLVED
41189  * - \ref SCIP_STAGE_EXITSOLVE
41190  * - \ref SCIP_STAGE_FREETRANS
41191  */
41193  SCIP* scip, /**< SCIP data structure */
41194  SCIP_EVENTTYPE eventtype, /**< event type mask of dropped event */
41195  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
41196  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
41197  int filterpos /**< position of event filter entry returned by SCIPcatchEvent(), or -1 */
41198  )
41199 {
41200  SCIP_CALL( checkStage(scip, "SCIPdropEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41201 
41202  SCIP_CALL( SCIPeventfilterDel(scip->eventfilter, scip->mem->probmem, scip->set,
41203  eventtype, eventhdlr, eventdata, filterpos) );
41204 
41205  return SCIP_OKAY;
41206 }
41207 
41208 /** catches an objective value or domain change event on the given transformed variable
41209  *
41210  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41211  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41212  *
41213  * @pre This method can be called if @p scip is in one of the following stages:
41214  * - \ref SCIP_STAGE_TRANSFORMING
41215  * - \ref SCIP_STAGE_TRANSFORMED
41216  * - \ref SCIP_STAGE_INITPRESOLVE
41217  * - \ref SCIP_STAGE_PRESOLVING
41218  * - \ref SCIP_STAGE_EXITPRESOLVE
41219  * - \ref SCIP_STAGE_PRESOLVED
41220  * - \ref SCIP_STAGE_INITSOLVE
41221  * - \ref SCIP_STAGE_SOLVING
41222  * - \ref SCIP_STAGE_SOLVED
41223  * - \ref SCIP_STAGE_EXITSOLVE
41224  * - \ref SCIP_STAGE_FREETRANS
41225  */
41227  SCIP* scip, /**< SCIP data structure */
41228  SCIP_VAR* var, /**< transformed variable to catch event for */
41229  SCIP_EVENTTYPE eventtype, /**< event type mask to select events to catch */
41230  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
41231  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
41232  int* filterpos /**< pointer to store position of event filter entry, or NULL */
41233  )
41234 {
41235  SCIP_CALL( checkStage(scip, "SCIPcatchVarEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41236 
41237  if( (eventtype & SCIP_EVENTTYPE_VARCHANGED) == 0 )
41238  {
41239  SCIPerrorMessage("event does not operate on a single variable\n");
41240  return SCIP_INVALIDDATA;
41241  }
41242 
41243  if( SCIPvarIsOriginal(var) )
41244  {
41245  SCIPerrorMessage("cannot catch events on original variable <%s>\n", SCIPvarGetName(var));
41246  return SCIP_INVALIDDATA;
41247  }
41248 
41249  SCIP_CALL( SCIPvarCatchEvent(var, scip->mem->probmem, scip->set, eventtype, eventhdlr, eventdata, filterpos) );
41250 
41251  return SCIP_OKAY;
41252 }
41253 
41254 /** drops an objective value or domain change event (stops to track event) on the given transformed variable
41255  *
41256  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41257  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41258  *
41259  * @pre This method can be called if @p scip is in one of the following stages:
41260  * - \ref SCIP_STAGE_TRANSFORMING
41261  * - \ref SCIP_STAGE_TRANSFORMED
41262  * - \ref SCIP_STAGE_INITPRESOLVE
41263  * - \ref SCIP_STAGE_PRESOLVING
41264  * - \ref SCIP_STAGE_EXITPRESOLVE
41265  * - \ref SCIP_STAGE_PRESOLVED
41266  * - \ref SCIP_STAGE_INITSOLVE
41267  * - \ref SCIP_STAGE_SOLVING
41268  * - \ref SCIP_STAGE_SOLVED
41269  * - \ref SCIP_STAGE_EXITSOLVE
41270  * - \ref SCIP_STAGE_FREETRANS
41271  */
41273  SCIP* scip, /**< SCIP data structure */
41274  SCIP_VAR* var, /**< transformed variable to drop event for */
41275  SCIP_EVENTTYPE eventtype, /**< event type mask of dropped event */
41276  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
41277  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
41278  int filterpos /**< position of event filter entry returned by SCIPcatchVarEvent(), or -1 */
41279  )
41280 {
41281  SCIP_CALL( checkStage(scip, "SCIPdropVarEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41282 
41283  if( SCIPvarIsOriginal(var) )
41284  {
41285  SCIPerrorMessage("cannot drop events on original variable <%s>\n", SCIPvarGetName(var));
41286  return SCIP_INVALIDDATA;
41287  }
41288 
41289  SCIP_CALL( SCIPvarDropEvent(var, scip->mem->probmem, scip->set, eventtype, eventhdlr, eventdata, filterpos) );
41290 
41291  return SCIP_OKAY;
41292 }
41293 
41294 /** catches a row coefficient, constant, or side change event on the given row
41295  *
41296  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41297  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41298  *
41299  * @pre This method can be called if @p scip is in one of the following stages:
41300  * - \ref SCIP_STAGE_TRANSFORMING
41301  * - \ref SCIP_STAGE_TRANSFORMED
41302  * - \ref SCIP_STAGE_INITPRESOLVE
41303  * - \ref SCIP_STAGE_PRESOLVING
41304  * - \ref SCIP_STAGE_EXITPRESOLVE
41305  * - \ref SCIP_STAGE_PRESOLVED
41306  * - \ref SCIP_STAGE_INITSOLVE
41307  * - \ref SCIP_STAGE_SOLVING
41308  * - \ref SCIP_STAGE_SOLVED
41309  * - \ref SCIP_STAGE_EXITSOLVE
41310  * - \ref SCIP_STAGE_FREETRANS
41311  */
41313  SCIP* scip, /**< SCIP data structure */
41314  SCIP_ROW* row, /**< linear row to catch event for */
41315  SCIP_EVENTTYPE eventtype, /**< event type mask to select events to catch */
41316  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
41317  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
41318  int* filterpos /**< pointer to store position of event filter entry, or NULL */
41319  )
41320 {
41321  SCIP_CALL( checkStage(scip, "SCIPcatchRowEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41322 
41323  if( (eventtype & SCIP_EVENTTYPE_ROWCHANGED) == 0 )
41324  {
41325  SCIPerrorMessage("event does not operate on a single row\n");
41326  return SCIP_INVALIDDATA;
41327  }
41328 
41329  SCIP_CALL( SCIProwCatchEvent(row, scip->mem->probmem, scip->set, eventtype, eventhdlr, eventdata, filterpos) );
41330 
41331  return SCIP_OKAY;
41332 }
41333 
41334 /** drops a row coefficient, constant, or side change event (stops to track event) on the given row
41335  *
41336  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41337  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41338  *
41339  * @pre This method can be called if @p scip is in one of the following stages:
41340  * - \ref SCIP_STAGE_TRANSFORMING
41341  * - \ref SCIP_STAGE_TRANSFORMED
41342  * - \ref SCIP_STAGE_INITPRESOLVE
41343  * - \ref SCIP_STAGE_PRESOLVING
41344  * - \ref SCIP_STAGE_EXITPRESOLVE
41345  * - \ref SCIP_STAGE_PRESOLVED
41346  * - \ref SCIP_STAGE_INITSOLVE
41347  * - \ref SCIP_STAGE_SOLVING
41348  * - \ref SCIP_STAGE_SOLVED
41349  * - \ref SCIP_STAGE_EXITSOLVE
41350  * - \ref SCIP_STAGE_FREETRANS
41351  */
41353  SCIP* scip, /**< SCIP data structure */
41354  SCIP_ROW* row, /**< linear row to drop event for */
41355  SCIP_EVENTTYPE eventtype, /**< event type mask of dropped event */
41356  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
41357  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
41358  int filterpos /**< position of event filter entry returned by SCIPcatchVarEvent(), or -1 */
41359  )
41360 {
41361  SCIP_CALL( checkStage(scip, "SCIPdropRowEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41362 
41363  SCIP_CALL( SCIProwDropEvent(row, scip->mem->probmem, scip->set, eventtype, eventhdlr, eventdata, filterpos) );
41364 
41365  return SCIP_OKAY;
41366 }
41367 
41368 
41369 /*
41370  * tree methods
41371  */
41372 
41373 /** gets focus node in the tree
41374  *
41375  * if we are in probing/diving mode this method returns the node in the tree where the probing/diving mode was started.
41376  *
41377  * @return the current node of the search tree
41378  *
41379  * @pre This method can be called if @p scip is in one of the following stages:
41380  * - \ref SCIP_STAGE_INITPRESOLVE
41381  * - \ref SCIP_STAGE_PRESOLVING
41382  * - \ref SCIP_STAGE_EXITPRESOLVE
41383  * - \ref SCIP_STAGE_SOLVING
41384  */
41386  SCIP* scip /**< SCIP data structure */
41387  )
41388 {
41389  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFocusNode", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41390 
41391  return SCIPtreeGetFocusNode(scip->tree);
41392 }
41393 
41394 /** gets current node in the tree
41395  *
41396  * @return the current node of the search tree
41397  *
41398  * @pre This method can be called if @p scip is in one of the following stages:
41399  * - \ref SCIP_STAGE_INITPRESOLVE
41400  * - \ref SCIP_STAGE_PRESOLVING
41401  * - \ref SCIP_STAGE_EXITPRESOLVE
41402  * - \ref SCIP_STAGE_SOLVING
41403  */
41405  SCIP* scip /**< SCIP data structure */
41406  )
41407 {
41408  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCurrentNode", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41409 
41410  return SCIPtreeGetCurrentNode(scip->tree);
41411 }
41412 
41413 /** gets the root node of the tree
41414  *
41415  * @return the root node of the search tree
41416  *
41417  * @pre This method can be called if @p scip is in one of the following stages:
41418  * - \ref SCIP_STAGE_INITPRESOLVE
41419  * - \ref SCIP_STAGE_PRESOLVING
41420  * - \ref SCIP_STAGE_EXITPRESOLVE
41421  * - \ref SCIP_STAGE_SOLVING
41422  */
41424  SCIP* scip /**< SCIP data structure */
41425  )
41426 {
41427  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRootNode", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41428 
41429  return SCIPtreeGetRootNode(scip->tree);
41430 }
41431 
41432 /** gets the effective root depth, i.e., the depth of the deepest node which is part of all paths from the root node
41433  * to the unprocessed nodes.
41434  *
41435  * @return effective root depth
41436  *
41437  * @pre This method can be called if @p scip is in one of the following stages:
41438  * - \ref SCIP_STAGE_SOLVING
41439  */
41441  SCIP* scip /**< SCIP data structure */
41442  )
41443 {
41444  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetEffectiveRootDepth", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41445 
41446  return SCIPtreeGetEffectiveRootDepth(scip->tree);
41447 }
41448 
41449 /** returns whether the current node is already solved and only propagated again
41450  *
41451  * @return TRUE is returned if \SCIP performance repropagation, otherwise FALSE.
41452  *
41453  * @pre This method can be called if @p scip is in one of the following stages:
41454  * - \ref SCIP_STAGE_INITPRESOLVE
41455  * - \ref SCIP_STAGE_PRESOLVING
41456  * - \ref SCIP_STAGE_EXITPRESOLVE
41457  * - \ref SCIP_STAGE_SOLVING
41458  */
41460  SCIP* scip /**< SCIP data structure */
41461  )
41462 {
41463  SCIP_CALL_ABORT( checkStage(scip, "SCIPinRepropagation", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41464 
41465  return SCIPtreeInRepropagation(scip->tree);
41466 }
41467 
41468 /** gets children of focus node along with the number of children
41469  *
41470  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41471  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41472  *
41473  * @pre This method can be called if @p scip is in one of the following stages:
41474  * - \ref SCIP_STAGE_SOLVING
41475  * - \ref SCIP_STAGE_SOLVED
41476  */
41478  SCIP* scip, /**< SCIP data structure */
41479  SCIP_NODE*** children, /**< pointer to store children array, or NULL if not needed */
41480  int* nchildren /**< pointer to store number of children, or NULL if not needed */
41481  )
41482 {
41483  SCIP_CALL( checkStage(scip, "SCIPgetChildren", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41484 
41485  if( children != NULL )
41486  *children = scip->tree->children;
41487  if( nchildren != NULL )
41488  *nchildren = scip->tree->nchildren;
41489 
41490  return SCIP_OKAY;
41491 }
41492 
41493 /** gets number of children of focus node
41494  *
41495  * @return number of children of the focus node
41496  *
41497  * @pre This method can be called if @p scip is in one of the following stages:
41498  * - \ref SCIP_STAGE_SOLVING
41499  * - \ref SCIP_STAGE_SOLVED
41500  */
41502  SCIP* scip /**< SCIP data structure */
41503  )
41504 {
41505  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNChildren", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41506 
41507  return scip->tree->nchildren;
41508 }
41509 
41510 /** gets siblings of focus node along with the number of siblings
41511  *
41512  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41513  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41514  *
41515  * @pre This method can be called if @p scip is in one of the following stages:
41516  * - \ref SCIP_STAGE_SOLVING
41517  * - \ref SCIP_STAGE_SOLVED
41518  */
41520  SCIP* scip, /**< SCIP data structure */
41521  SCIP_NODE*** siblings, /**< pointer to store siblings array, or NULL if not needed */
41522  int* nsiblings /**< pointer to store number of siblings, or NULL if not needed */
41523  )
41524 {
41525  SCIP_CALL( checkStage(scip, "SCIPgetSiblings", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41526 
41527  if( siblings != NULL )
41528  *siblings = scip->tree->siblings;
41529  if( nsiblings != NULL )
41530  *nsiblings = scip->tree->nsiblings;
41531 
41532  return SCIP_OKAY;
41533 }
41534 
41535 /** gets number of siblings of focus node
41536  *
41537  * @return the number of siblings of focus node
41538  *
41539  * @pre This method can be called if @p scip is in one of the following stages:
41540  * - \ref SCIP_STAGE_SOLVING
41541  * - \ref SCIP_STAGE_SOLVED
41542  */
41544  SCIP* scip /**< SCIP data structure */
41545  )
41546 {
41547  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNSiblings", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41548 
41549  return scip->tree->nsiblings;
41550 }
41551 
41552 /** gets leaves of the tree along with the number of leaves
41553  *
41554  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41555  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41556  *
41557  * @pre This method can be called if @p scip is in one of the following stages:
41558  * - \ref SCIP_STAGE_SOLVING
41559  * - \ref SCIP_STAGE_SOLVED
41560  */
41562  SCIP* scip, /**< SCIP data structure */
41563  SCIP_NODE*** leaves, /**< pointer to store leaves array, or NULL if not needed */
41564  int* nleaves /**< pointer to store number of leaves, or NULL if not needed */
41565  )
41566 {
41567  SCIP_CALL( checkStage(scip, "SCIPgetLeaves", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41568 
41569  if( leaves != NULL )
41570  *leaves = SCIPnodepqNodes(scip->tree->leaves);
41571  if( nleaves != NULL )
41572  *nleaves = SCIPnodepqLen(scip->tree->leaves);
41573 
41574  return SCIP_OKAY;
41575 }
41576 
41577 /** gets number of leaves in the tree
41578  *
41579  * @return the number of leaves in the tree
41580  *
41581  * @pre This method can be called if @p scip is in one of the following stages:
41582  * - \ref SCIP_STAGE_SOLVING
41583  * - \ref SCIP_STAGE_SOLVED
41584  */
41586  SCIP* scip /**< SCIP data structure */
41587  )
41588 {
41589  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLeaves", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41590 
41591  return SCIPnodepqLen(scip->tree->leaves);
41592 }
41593 
41594 /** gets the best child of the focus node w.r.t. the node selection priority assigned by the branching rule
41595  *
41596  * @return the best child of the focus node w.r.t. the node selection priority assigned by the branching rule
41597  *
41598  * @pre This method can be called if @p scip is in one of the following stages:
41599  * - \ref SCIP_STAGE_SOLVING
41600  */
41602  SCIP* scip /**< SCIP data structure */
41603  )
41604 {
41605  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPrioChild", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41606 
41607  return SCIPtreeGetPrioChild(scip->tree);
41608 }
41609 
41610 /** gets the best sibling of the focus node w.r.t. the node selection priority assigned by the branching rule
41611  *
41612  * @return the best sibling of the focus node w.r.t. the node selection priority assigned by the branching rule
41613  *
41614  * @pre This method can be called if @p scip is in one of the following stages:
41615  * - \ref SCIP_STAGE_SOLVING
41616  */
41618  SCIP* scip /**< SCIP data structure */
41619  )
41620 {
41621  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPrioSibling", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41622 
41623  return SCIPtreeGetPrioSibling(scip->tree);
41624 }
41625 
41626 /** gets the best child of the focus node w.r.t. the node selection strategy
41627  *
41628  * @return the best child of the focus node w.r.t. the node selection strategy
41629  *
41630  * @pre This method can be called if @p scip is in one of the following stages:
41631  * - \ref SCIP_STAGE_SOLVING
41632  */
41634  SCIP* scip /**< SCIP data structure */
41635  )
41636 {
41637  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestChild", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41638 
41639  return SCIPtreeGetBestChild(scip->tree, scip->set);
41640 }
41641 
41642 /** gets the best sibling of the focus node w.r.t. the node selection strategy
41643  *
41644  * @return the best sibling of the focus node w.r.t. the node selection strategy
41645  *
41646  * @pre This method can be called if @p scip is in one of the following stages:
41647  * - \ref SCIP_STAGE_SOLVING
41648  */
41650  SCIP* scip /**< SCIP data structure */
41651  )
41652 {
41653  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestSibling", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41654 
41655  return SCIPtreeGetBestSibling(scip->tree, scip->set);
41656 }
41657 
41658 /** gets the best leaf from the node queue w.r.t. the node selection strategy
41659  *
41660  * @return the best leaf from the node queue w.r.t. the node selection strategy
41661  *
41662  * @pre This method can be called if @p scip is in one of the following stages:
41663  * - \ref SCIP_STAGE_SOLVING
41664  */
41666  SCIP* scip /**< SCIP data structure */
41667  )
41668 {
41669  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestLeaf", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41670 
41671  return SCIPtreeGetBestLeaf(scip->tree);
41672 }
41673 
41674 /** gets the best node from the tree (child, sibling, or leaf) w.r.t. the node selection strategy
41675  *
41676  * @return the best node from the tree (child, sibling, or leaf) w.r.t. the node selection strategy
41677  *
41678  * @pre This method can be called if @p scip is in one of the following stages:
41679  * - \ref SCIP_STAGE_SOLVING
41680  */
41682  SCIP* scip /**< SCIP data structure */
41683  )
41684 {
41685  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41686 
41687  return SCIPtreeGetBestNode(scip->tree, scip->set);
41688 }
41689 
41690 /** gets the node with smallest lower bound from the tree (child, sibling, or leaf)
41691  *
41692  * @return the node with smallest lower bound from the tree (child, sibling, or leaf)
41693  *
41694  * @pre This method can be called if @p scip is in one of the following stages:
41695  * - \ref SCIP_STAGE_SOLVING
41696  */
41698  SCIP* scip /**< SCIP data structure */
41699  )
41700 {
41701  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestboundNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41702 
41703  return SCIPtreeGetLowerboundNode(scip->tree, scip->set);
41704 }
41705 
41706 /** access to all data of open nodes (leaves, children, and siblings)
41707  *
41708  * @pre This method can be called if @p scip is in one of the following stages:
41709  * - \ref SCIP_STAGE_SOLVING
41710  */
41712  SCIP* scip, /**< SCIP data structure */
41713  SCIP_NODE*** leaves, /**< pointer to store the leaves, or NULL if not needed */
41714  SCIP_NODE*** children, /**< pointer to store the children, or NULL if not needed */
41715  SCIP_NODE*** siblings, /**< pointer to store the siblings, or NULL if not needed */
41716  int* nleaves, /**< pointer to store the number of leaves, or NULL */
41717  int* nchildren, /**< pointer to store the number of children, or NULL */
41718  int* nsiblings /**< pointer to store the number of siblings, or NULL */
41719  )
41720 {
41721  SCIP_CALL( checkStage(scip, "SCIPgetOpenNodesData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41722 
41723  if( leaves != NULL )
41724  *leaves = SCIPnodepqNodes(scip->tree->leaves);
41725  if( children != NULL )
41726  *children = scip->tree->children;
41727  if( siblings != NULL )
41728  *siblings = scip->tree->siblings;
41729  if( nleaves != NULL )
41730  *nleaves = SCIPnodepqLen(scip->tree->leaves);
41731  if( nchildren != NULL )
41732  *nchildren = SCIPtreeGetNChildren(scip->tree);
41733  if( nsiblings != NULL )
41734  *nsiblings = SCIPtreeGetNSiblings(scip->tree);
41735 
41736  return SCIP_OKAY;
41737 }
41738 
41739 /** cuts off node and whole sub tree from branch and bound tree
41740  *
41741  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41742  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41743  *
41744  * @pre This method can be called if @p scip is in one of the following stages:
41745  * - \ref SCIP_STAGE_SOLVING
41746  */
41748  SCIP* scip, /**< SCIP data structure */
41749  SCIP_NODE* node /**< node that should be cut off */
41750  )
41751 {
41752  SCIP_CALL( checkStage(scip, "SCIPcutoffNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41753 
41754  SCIP_CALL( SCIPnodeCutoff(node, scip->set, scip->stat, scip->tree, scip->transprob, scip->origprob, scip->reopt,
41755  scip->lp, scip->mem->probmem) );
41756 
41757  return SCIP_OKAY;
41758 }
41759 
41760 /** marks the given node to be propagated again the next time a node of its subtree is processed
41761  *
41762  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41763  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41764  *
41765  * @pre This method can be called if @p scip is in one of the following stages:
41766  * - \ref SCIP_STAGE_SOLVING
41767  */
41769  SCIP* scip, /**< SCIP data structure */
41770  SCIP_NODE* node /**< node that should be propagated again */
41771  )
41772 {
41773  SCIP_CALL( checkStage(scip, "SCIPrepropagateNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41774 
41775  SCIPnodePropagateAgain(node, scip->set, scip->stat, scip->tree);
41776 
41777  return SCIP_OKAY;
41778 }
41779 
41780 /** returns depth of first node in active path that is marked being cutoff
41781  *
41782  * @return depth of first node in active path that is marked being cutoff
41783  *
41784  * @pre This method can be called if @p scip is in one of the following stages:
41785  * - \ref SCIP_STAGE_SOLVING
41786  */
41788  SCIP* scip /**< SCIP data structure */
41789  )
41790 {
41791  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCutoffdepth", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41792 
41793  return scip->tree->cutoffdepth;
41794 }
41795 
41796 /** returns depth of first node in active path that has to be propagated again
41797  *
41798  * @return depth of first node in active path that has to be propagated again
41799  *
41800  * @pre This method can be called if @p scip is in one of the following stages:
41801  * - \ref SCIP_STAGE_SOLVING
41802  */
41804  SCIP* scip /**< SCIP data structure */
41805  )
41806 {
41807  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRepropdepth", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41808 
41809  return scip->tree->repropdepth;
41810 }
41811 
41812 /** prints all branching decisions on variables from the root to the given node
41813  *
41814  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41815  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41816  *
41817  * @pre This method can be called if @p scip is in one of the following stages:
41818  * - \ref SCIP_STAGE_SOLVING
41819  */
41821  SCIP* scip, /**< SCIP data structure */
41822  SCIP_NODE* node, /**< node data */
41823  FILE* file /**< output file (or NULL for standard output) */
41824  )
41825 {
41826  SCIP_VAR** branchvars; /* array of variables on which the branchings has been performed in all ancestors */
41827  SCIP_Real* branchbounds; /* array of bounds which the branchings in all ancestors set */
41828  SCIP_BOUNDTYPE* boundtypes; /* array of boundtypes which the branchings in all ancestors set */
41829  int* nodeswitches; /* marks, where in the arrays the branching decisions of the next node on the path start
41830  * branchings performed at the parent of node always start at position 0. For single variable branching,
41831  * nodeswitches[i] = i holds */
41832  int nbranchvars; /* number of variables on which branchings have been performed in all ancestors
41833  * if this is larger than the array size, arrays should be reallocated and method should be called again */
41834  int branchvarssize; /* available slots in arrays */
41835  int nnodes; /* number of nodes in the nodeswitch array */
41836  int nodeswitchsize; /* available slots in node switch array */
41837 
41838  branchvarssize = SCIPnodeGetDepth(node);
41839  nodeswitchsize = branchvarssize;
41840 
41841  /* memory allocation */
41842  SCIP_CALL( SCIPallocBufferArray(scip, &branchvars, branchvarssize) );
41843  SCIP_CALL( SCIPallocBufferArray(scip, &branchbounds, branchvarssize) );
41844  SCIP_CALL( SCIPallocBufferArray(scip, &boundtypes, branchvarssize) );
41845  SCIP_CALL( SCIPallocBufferArray(scip, &nodeswitches, nodeswitchsize) );
41846 
41847  SCIPnodeGetAncestorBranchingPath(node, branchvars, branchbounds, boundtypes, &nbranchvars, branchvarssize, nodeswitches, &nnodes, nodeswitchsize );
41848 
41849  /* if the arrays were to small, we have to reallocate them and recall SCIPnodeGetAncestorBranchingPath */
41850  if( nbranchvars > branchvarssize || nnodes > nodeswitchsize )
41851  {
41852  branchvarssize = nbranchvars;
41853  nodeswitchsize = nnodes;
41854 
41855  /* memory reallocation */
41856  SCIP_CALL( SCIPreallocBufferArray(scip, &branchvars, branchvarssize) );
41857  SCIP_CALL( SCIPreallocBufferArray(scip, &branchbounds, branchvarssize) );
41858  SCIP_CALL( SCIPreallocBufferArray(scip, &boundtypes, branchvarssize) );
41859  SCIP_CALL( SCIPreallocBufferArray(scip, &nodeswitches, nodeswitchsize) );
41860 
41861  SCIPnodeGetAncestorBranchingPath(node, branchvars, branchbounds, boundtypes, &nbranchvars, branchvarssize, nodeswitches, &nnodes, nodeswitchsize);
41862  assert(nbranchvars == branchvarssize);
41863  }
41864 
41865  /* we only want to create output, if branchings were performed */
41866  if( nbranchvars >= 1 )
41867  {
41868  int i;
41869  int j;
41870 
41871  /* print all nodes, starting from the root, which is last in the arrays */
41872  for( j = nnodes-1; j >= 0; --j)
41873  {
41874  int end;
41875  if(j == nnodes-1)
41876  end = nbranchvars;
41877  else
41878  end = nodeswitches[j+1];
41879 
41880  for( i = nodeswitches[j]; i < end; ++i )
41881  {
41882  if( i > nodeswitches[j] )
41883  SCIPmessageFPrintInfo(scip->messagehdlr, file, " AND ");
41884  SCIPmessageFPrintInfo(scip->messagehdlr, file, "<%s> %s %.1f",SCIPvarGetName(branchvars[i]), boundtypes[i] == SCIP_BOUNDTYPE_LOWER ? ">=" : "<=", branchbounds[i]);
41885  }
41886  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
41887  if( j > 0 )
41888  {
41889  if( nodeswitches[j]-nodeswitches[j-1] != 1 )
41890  SCIPmessageFPrintInfo(scip->messagehdlr, file, " |\n |\n");
41891  else if( boundtypes[i-1] == SCIP_BOUNDTYPE_LOWER )
41892  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\\ \n \\\n");
41893  else
41894  SCIPmessageFPrintInfo(scip->messagehdlr, file, " /\n/ \n");
41895  }
41896  }
41897  }
41898 
41899  /* free all local memory */
41900  SCIPfreeBufferArray(scip, &nodeswitches);
41901  SCIPfreeBufferArray(scip, &boundtypes);
41902  SCIPfreeBufferArray(scip, &branchbounds);
41903  SCIPfreeBufferArray(scip, &branchvars);
41904 
41905  return SCIP_OKAY;
41906 }
41907 
41908 /** sets whether the LP should be solved at the focus node
41909  *
41910  * @note In order to have an effect, this method needs to be called after a node is focused but before the LP is
41911  * solved.
41912  *
41913  * @pre This method can be called if @p scip is in one of the following stages:
41914  * - \ref SCIP_STAGE_SOLVING
41915  */
41917  SCIP* scip, /**< SCIP data structure */
41918  SCIP_Bool solvelp /**< should the LP be solved? */
41919  )
41920 {
41921  SCIP_CALL_ABORT( checkStage(scip, "SCIPsetFocusnodeLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41922 
41923  SCIPtreeSetFocusNodeLP(scip->tree, solvelp);
41924 }
41925 
41926 
41927 /*
41928  * parallel interface methods
41929  */
41930 
41931 /** Constructs the parallel interface to execute processes concurrently.
41932  *
41933  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41934  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41935  *
41936  * @pre This method can be called if @p scip is in one of the following stages:
41937  * - \ref SCIP_STAGE_PROBLEM
41938  * - \ref SCIP_STAGE_TRANSFORMING
41939  * - \ref SCIP_STAGE_TRANSFORMED
41940  * - \ref SCIP_STAGE_INITPRESOLVE
41941  * - \ref SCIP_STAGE_PRESOLVING
41942  * - \ref SCIP_STAGE_EXITPRESOLVE
41943  * - \ref SCIP_STAGE_PRESOLVED
41944  * - \ref SCIP_STAGE_INITSOLVE
41945  * - \ref SCIP_STAGE_SOLVING
41946  * - \ref SCIP_STAGE_SOLVED
41947  * - \ref SCIP_STAGE_EXITSOLVE
41948  * - \ref SCIP_STAGE_FREETRANS
41949  *
41950  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
41951  */
41953  SCIP* scip /**< SCIP data structure */
41954  )
41955 {
41956  SCIP_CALL( checkStage(scip, "SCIPconstructSyncstore", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41957 
41959 
41960  return SCIP_OKAY;
41961 }
41962 
41963 /** releases the current parallel interface
41964  *
41965  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41966  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41967  *
41968  * @pre This method can be called if @p scip is in one of the following stages:
41969  * - \ref SCIP_STAGE_PROBLEM
41970  * - \ref SCIP_STAGE_TRANSFORMING
41971  * - \ref SCIP_STAGE_TRANSFORMED
41972  * - \ref SCIP_STAGE_INITPRESOLVE
41973  * - \ref SCIP_STAGE_PRESOLVING
41974  * - \ref SCIP_STAGE_EXITPRESOLVE
41975  * - \ref SCIP_STAGE_PRESOLVED
41976  * - \ref SCIP_STAGE_INITSOLVE
41977  * - \ref SCIP_STAGE_SOLVING
41978  * - \ref SCIP_STAGE_SOLVED
41979  * - \ref SCIP_STAGE_EXITSOLVE
41980  * - \ref SCIP_STAGE_FREETRANS
41981  * - \ref SCIP_STAGE_FREE
41982  *
41983  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
41984  */
41986  SCIP* scip /**< SCIP data structure */
41987  )
41988 {
41989  SCIP_CALL( checkStage(scip, "SCIPfreeSyncstore", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
41990 
41992 
41993  return SCIP_OKAY;
41994 }
41995 
41996 /** Gets the parallel interface to execute processes concurrently.
41997  *
41998  * @return the \ref SCIP_SYNCSTORE parallel interface pointer to submit jobs for concurrent processing.
41999  *
42000  * @pre This method can be called if @p scip is in one of the following stages:
42001  * - \ref SCIP_STAGE_INIT
42002  * - \ref SCIP_STAGE_PROBLEM
42003  * - \ref SCIP_STAGE_TRANSFORMING
42004  * - \ref SCIP_STAGE_TRANSFORMED
42005  * - \ref SCIP_STAGE_INITPRESOLVE
42006  * - \ref SCIP_STAGE_PRESOLVING
42007  * - \ref SCIP_STAGE_EXITPRESOLVE
42008  * - \ref SCIP_STAGE_PRESOLVED
42009  * - \ref SCIP_STAGE_INITSOLVE
42010  * - \ref SCIP_STAGE_SOLVING
42011  * - \ref SCIP_STAGE_SOLVED
42012  * - \ref SCIP_STAGE_EXITSOLVE
42013  * - \ref SCIP_STAGE_FREETRANS
42014  *
42015  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
42016  */
42018  SCIP* scip /**< SCIP data structure */
42019  )
42020 {
42021  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSyncstore", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42022 
42023  return scip->syncstore;
42024 }
42025 
42026 
42027 
42028 /*
42029  * statistic methods
42030  */
42031 
42032 /** gets number of branch and bound runs performed, including the current run
42033  *
42034  * @return the number of branch and bound runs performed, including the current run
42035  *
42036  * @pre This method can be called if SCIP is in one of the following stages:
42037  * - \ref SCIP_STAGE_PROBLEM
42038  * - \ref SCIP_STAGE_TRANSFORMING
42039  * - \ref SCIP_STAGE_TRANSFORMED
42040  * - \ref SCIP_STAGE_INITPRESOLVE
42041  * - \ref SCIP_STAGE_PRESOLVING
42042  * - \ref SCIP_STAGE_EXITPRESOLVE
42043  * - \ref SCIP_STAGE_PRESOLVED
42044  * - \ref SCIP_STAGE_INITSOLVE
42045  * - \ref SCIP_STAGE_SOLVING
42046  * - \ref SCIP_STAGE_SOLVED
42047  * - \ref SCIP_STAGE_EXITSOLVE
42048  * - \ref SCIP_STAGE_FREETRANS
42049  */
42051  SCIP* scip /**< SCIP data structure */
42052  )
42053 {
42054  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRuns", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42055 
42056  return scip->stat->nruns;
42057 }
42058 
42059 /** gets number of reoptimization runs performed, including the current run
42060  *
42061  * @return the number of reoptimization runs performed, including the current run
42062  *
42063  * @pre This method can be called if SCIP is in one of the following stages:
42064  * - \ref SCIP_STAGE_PROBLEM
42065  * - \ref SCIP_STAGE_TRANSFORMING
42066  * - \ref SCIP_STAGE_TRANSFORMED
42067  * - \ref SCIP_STAGE_INITPRESOLVE
42068  * - \ref SCIP_STAGE_PRESOLVING
42069  * - \ref SCIP_STAGE_EXITPRESOLVE
42070  * - \ref SCIP_STAGE_PRESOLVED
42071  * - \ref SCIP_STAGE_INITSOLVE
42072  * - \ref SCIP_STAGE_SOLVING
42073  * - \ref SCIP_STAGE_SOLVED
42074  * - \ref SCIP_STAGE_EXITSOLVE
42075  * - \ref SCIP_STAGE_FREETRANS
42076  */
42078  SCIP* scip /**< SCIP data structure */
42079  )
42080 {
42081  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNReoptRuns", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42082 
42083  return scip->stat->nreoptruns;
42084 }
42085 
42086 /** add given number to the number of processed nodes in current run and in all runs, including the focus node
42087  *
42088  * @return the number of processed nodes in current run, including the focus node
42089  *
42090  * @pre This method can be called if SCIP is in one of the following stages:
42091  * - \ref SCIP_STAGE_PROBLEM
42092  * - \ref SCIP_STAGE_TRANSFORMING
42093  * - \ref SCIP_STAGE_TRANSFORMED
42094  * - \ref SCIP_STAGE_INITPRESOLVE
42095  * - \ref SCIP_STAGE_PRESOLVING
42096  * - \ref SCIP_STAGE_EXITPRESOLVE
42097  * - \ref SCIP_STAGE_PRESOLVED
42098  * - \ref SCIP_STAGE_INITSOLVE
42099  * - \ref SCIP_STAGE_SOLVING
42100  * - \ref SCIP_STAGE_SOLVED
42101  * - \ref SCIP_STAGE_EXITSOLVE
42102  * - \ref SCIP_STAGE_FREETRANS
42103  */
42105  SCIP* scip, /**< SCIP data structure */
42106  SCIP_Longint nnodes /**< number of processed nodes to add to the statistics */
42107  )
42108 {
42109  SCIP_CALL_ABORT( checkStage(scip, "SCIPaddNNodes", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42110 
42111  scip->stat->nnodes += nnodes;
42112  scip->stat->ntotalnodes += nnodes;
42113 }
42114 
42115 /** gets number of processed nodes in current run, including the focus node
42116  *
42117  * @return the number of processed nodes in current run, including the focus node
42118  *
42119  * @pre This method can be called if SCIP is in one of the following stages:
42120  * - \ref SCIP_STAGE_PROBLEM
42121  * - \ref SCIP_STAGE_TRANSFORMING
42122  * - \ref SCIP_STAGE_TRANSFORMED
42123  * - \ref SCIP_STAGE_INITPRESOLVE
42124  * - \ref SCIP_STAGE_PRESOLVING
42125  * - \ref SCIP_STAGE_EXITPRESOLVE
42126  * - \ref SCIP_STAGE_PRESOLVED
42127  * - \ref SCIP_STAGE_INITSOLVE
42128  * - \ref SCIP_STAGE_SOLVING
42129  * - \ref SCIP_STAGE_SOLVED
42130  * - \ref SCIP_STAGE_EXITSOLVE
42131  * - \ref SCIP_STAGE_FREETRANS
42132  */
42134  SCIP* scip /**< SCIP data structure */
42135  )
42136 {
42137  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodes", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42138 
42139  return scip->stat->nnodes;
42140 }
42141 
42142 /** gets total number of processed nodes in all runs, including the focus node
42143  *
42144  * @return the total number of processed nodes in all runs, including the focus node
42145  *
42146  * @pre This method can be called if SCIP is in one of the following stages:
42147  * - \ref SCIP_STAGE_PROBLEM
42148  * - \ref SCIP_STAGE_TRANSFORMING
42149  * - \ref SCIP_STAGE_TRANSFORMED
42150  * - \ref SCIP_STAGE_INITPRESOLVE
42151  * - \ref SCIP_STAGE_PRESOLVING
42152  * - \ref SCIP_STAGE_EXITPRESOLVE
42153  * - \ref SCIP_STAGE_PRESOLVED
42154  * - \ref SCIP_STAGE_INITSOLVE
42155  * - \ref SCIP_STAGE_SOLVING
42156  * - \ref SCIP_STAGE_SOLVED
42157  * - \ref SCIP_STAGE_EXITSOLVE
42158  * - \ref SCIP_STAGE_FREETRANS
42159  */
42161  SCIP* scip /**< SCIP data structure */
42162  )
42163 {
42164  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNTotalNodes", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42165 
42166  return scip->stat->ntotalnodes;
42167 }
42168 
42169 /** gets number of nodes left in the tree (children + siblings + leaves)
42170  *
42171  * @return the number of nodes left in the tree (children + siblings + leaves)
42172  *
42173  * @pre This method can be called if SCIP is in one of the following stages:
42174  * - \ref SCIP_STAGE_PRESOLVED
42175  * - \ref SCIP_STAGE_SOLVING
42176  * - \ref SCIP_STAGE_SOLVED
42177  */
42179  SCIP* scip /**< SCIP data structure */
42180  )
42181 {
42182  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodesLeft", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42183 
42184  return SCIPtreeGetNNodes(scip->tree);
42185 }
42186 
42187 /** gets number of leaf nodes processed with feasible relaxation solution
42188  *
42189  * @return number of leaf nodes processed with feasible relaxation solution
42190  *
42191  * @pre This method can be called if SCIP is in one of the following stages:
42192  * - \ref SCIP_STAGE_PROBLEM
42193  * - \ref SCIP_STAGE_TRANSFORMING
42194  * - \ref SCIP_STAGE_TRANSFORMED
42195  * - \ref SCIP_STAGE_INITPRESOLVE
42196  * - \ref SCIP_STAGE_PRESOLVING
42197  * - \ref SCIP_STAGE_EXITPRESOLVE
42198  * - \ref SCIP_STAGE_PRESOLVED
42199  * - \ref SCIP_STAGE_INITSOLVE
42200  * - \ref SCIP_STAGE_SOLVING
42201  * - \ref SCIP_STAGE_SOLVED
42202  * - \ref SCIP_STAGE_EXITSOLVE
42203  * - \ref SCIP_STAGE_FREETRANS
42204  */
42206  SCIP* scip /**< SCIP data structure */
42207  )
42208 {
42209  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNFeasibleLeaves", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42210 
42211  return scip->stat->nfeasleaves;
42212 }
42213 
42214 /** gets number of infeasible leaf nodes processed
42215  *
42216  * @return number of infeasible leaf nodes processed
42217  *
42218  * @pre This method can be called if SCIP is in one of the following stages:
42219  * - \ref SCIP_STAGE_PROBLEM
42220  * - \ref SCIP_STAGE_TRANSFORMING
42221  * - \ref SCIP_STAGE_TRANSFORMED
42222  * - \ref SCIP_STAGE_INITPRESOLVE
42223  * - \ref SCIP_STAGE_PRESOLVING
42224  * - \ref SCIP_STAGE_EXITPRESOLVE
42225  * - \ref SCIP_STAGE_PRESOLVED
42226  * - \ref SCIP_STAGE_INITSOLVE
42227  * - \ref SCIP_STAGE_SOLVING
42228  * - \ref SCIP_STAGE_SOLVED
42229  * - \ref SCIP_STAGE_EXITSOLVE
42230  * - \ref SCIP_STAGE_FREETRANS
42231  */
42233  SCIP* scip /**< SCIP data structure */
42234  )
42235 {
42236  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNInfeasibleLeaves", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42237 
42238  return scip->stat->ninfeasleaves;
42239 }
42240 
42241 /** gets number of processed leaf nodes that hit LP objective limit
42242  *
42243  * @return number of processed leaf nodes that hit LP objective limit
42244  *
42245  * @pre This method can be called if SCIP is in one of the following stages:
42246  * - \ref SCIP_STAGE_PROBLEM
42247  * - \ref SCIP_STAGE_TRANSFORMING
42248  * - \ref SCIP_STAGE_TRANSFORMED
42249  * - \ref SCIP_STAGE_INITPRESOLVE
42250  * - \ref SCIP_STAGE_PRESOLVING
42251  * - \ref SCIP_STAGE_EXITPRESOLVE
42252  * - \ref SCIP_STAGE_PRESOLVED
42253  * - \ref SCIP_STAGE_INITSOLVE
42254  * - \ref SCIP_STAGE_SOLVING
42255  * - \ref SCIP_STAGE_SOLVED
42256  * - \ref SCIP_STAGE_EXITSOLVE
42257  * - \ref SCIP_STAGE_FREETRANS
42258  */
42260  SCIP* scip /**< Scip data structure */
42261  )
42262 {
42263  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNObjlimLeaves", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42264 
42265  return scip->stat->nobjleaves;
42266 }
42267 
42268 
42269 /** gets number of times a selected node was from a cut off subtree
42270  *
42271  * @return number of times a selected node was from a cut off subtree
42272  *
42273  * @pre This method can be called if SCIP is in one of the following stages:
42274  * - \ref SCIP_STAGE_PROBLEM
42275  * - \ref SCIP_STAGE_TRANSFORMING
42276  * - \ref SCIP_STAGE_TRANSFORMED
42277  * - \ref SCIP_STAGE_INITPRESOLVE
42278  * - \ref SCIP_STAGE_PRESOLVING
42279  * - \ref SCIP_STAGE_EXITPRESOLVE
42280  * - \ref SCIP_STAGE_PRESOLVED
42281  * - \ref SCIP_STAGE_INITSOLVE
42282  * - \ref SCIP_STAGE_SOLVING
42283  * - \ref SCIP_STAGE_SOLVED
42284  * - \ref SCIP_STAGE_EXITSOLVE
42285  * - \ref SCIP_STAGE_FREETRANS
42286  */
42288  SCIP* scip /**< SCIP data structure */
42289  )
42290 {
42291  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDelayedCutoffs", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42292 
42293  return scip->stat->ndelayedcutoffs;
42294 }
42295 
42296 /** gets total number of LPs solved so far
42297  *
42298  * @return the total number of LPs solved so far
42299  *
42300  * @pre This method can be called if SCIP is in one of the following stages:
42301  * - \ref SCIP_STAGE_PROBLEM
42302  * - \ref SCIP_STAGE_TRANSFORMING
42303  * - \ref SCIP_STAGE_TRANSFORMED
42304  * - \ref SCIP_STAGE_INITPRESOLVE
42305  * - \ref SCIP_STAGE_PRESOLVING
42306  * - \ref SCIP_STAGE_EXITPRESOLVE
42307  * - \ref SCIP_STAGE_PRESOLVED
42308  * - \ref SCIP_STAGE_INITSOLVE
42309  * - \ref SCIP_STAGE_SOLVING
42310  * - \ref SCIP_STAGE_SOLVED
42311  * - \ref SCIP_STAGE_EXITSOLVE
42312  * - \ref SCIP_STAGE_FREETRANS
42313  */
42315  SCIP* scip /**< SCIP data structure */
42316  )
42317 {
42318  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPs", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42319 
42320  return scip->stat->nlps;
42321 }
42322 
42323 /** gets total number of iterations used so far in primal and dual simplex and barrier algorithm
42324  *
42325  * @return the total number of iterations used so far in primal and dual simplex and barrier algorithm
42326  *
42327  * @pre This method can be called if SCIP is in one of the following stages:
42328  * - \ref SCIP_STAGE_PRESOLVING
42329  * - \ref SCIP_STAGE_PRESOLVED
42330  * - \ref SCIP_STAGE_SOLVING
42331  * - \ref SCIP_STAGE_SOLVED
42332  */
42334  SCIP* scip /**< SCIP data structure */
42335  )
42336 {
42337  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42338 
42339  return scip->stat->nlpiterations;
42340 }
42341 
42342 /** gets number of active non-zeros in the current transformed problem
42343  *
42344  * @return the number of active non-zeros in the current transformed problem
42345  *
42346  * @pre This method can be called if SCIP is in one of the following stages:
42347  * - \ref SCIP_STAGE_PROBLEM
42348  * - \ref SCIP_STAGE_TRANSFORMING
42349  * - \ref SCIP_STAGE_TRANSFORMED
42350  * - \ref SCIP_STAGE_INITPRESOLVE
42351  * - \ref SCIP_STAGE_PRESOLVING
42352  * - \ref SCIP_STAGE_EXITPRESOLVE
42353  * - \ref SCIP_STAGE_PRESOLVED
42354  * - \ref SCIP_STAGE_INITSOLVE
42355  * - \ref SCIP_STAGE_SOLVING
42356  * - \ref SCIP_STAGE_SOLVED
42357  * - \ref SCIP_STAGE_EXITSOLVE
42358  */
42360  SCIP* scip /**< SCIP data structure */
42361  )
42362 {
42363  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNZs", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42364 
42365  return scip->stat->nnz;
42366 }
42367 
42368 /** gets total number of iterations used so far in primal and dual simplex and barrier algorithm for the root node
42369  *
42370  * @return the total number of iterations used so far in primal and dual simplex and barrier algorithm for the root node
42371  *
42372  * @pre This method can be called if SCIP is in one of the following stages:
42373  * - \ref SCIP_STAGE_PRESOLVED
42374  * - \ref SCIP_STAGE_SOLVING
42375  * - \ref SCIP_STAGE_SOLVED
42376  */
42378  SCIP* scip /**< SCIP data structure */
42379  )
42380 {
42381  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRootLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42382 
42383  return scip->stat->nrootlpiterations;
42384 }
42385 
42386 /** gets total number of iterations used in primal and dual simplex and barrier algorithm for the first LP at the root
42387  * node
42388  *
42389  * @return the total number of iterations used in primal and dual simplex and barrier algorithm for the first root LP
42390  *
42391  * @pre This method can be called if SCIP is in one of the following stages:
42392  * - \ref SCIP_STAGE_PRESOLVED
42393  * - \ref SCIP_STAGE_SOLVING
42394  * - \ref SCIP_STAGE_SOLVED
42395  */
42397  SCIP* scip /**< SCIP data structure */
42398  )
42399 {
42400  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRootFirstLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42401 
42402  return scip->stat->nrootfirstlpiterations;
42403 }
42404 
42405 /** gets total number of primal LPs solved so far
42406  *
42407  * @return the total number of primal LPs solved so far
42408  *
42409  * @pre This method can be called if SCIP is in one of the following stages:
42410  * - \ref SCIP_STAGE_PRESOLVED
42411  * - \ref SCIP_STAGE_SOLVING
42412  * - \ref SCIP_STAGE_SOLVED
42413  */
42415  SCIP* scip /**< SCIP data structure */
42416  )
42417 {
42418  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrimalLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42419 
42420  return scip->stat->nprimallps;
42421 }
42422 
42423 /** gets total number of iterations used so far in primal simplex
42424  *
42425  * @return total number of iterations used so far in primal simplex
42426  *
42427  * @pre This method can be called if SCIP is in one of the following stages:
42428  * - \ref SCIP_STAGE_PRESOLVED
42429  * - \ref SCIP_STAGE_SOLVING
42430  * - \ref SCIP_STAGE_SOLVED
42431  */
42433  SCIP* scip /**< SCIP data structure */
42434  )
42435 {
42436  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrimalLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42437 
42438  return scip->stat->nprimallpiterations;
42439 }
42440 
42441 /** gets total number of dual LPs solved so far
42442  *
42443  * @return the total number of dual LPs solved so far
42444  *
42445  * @pre This method can be called if SCIP is in one of the following stages:
42446  * - \ref SCIP_STAGE_PRESOLVED
42447  * - \ref SCIP_STAGE_SOLVING
42448  * - \ref SCIP_STAGE_SOLVED
42449  */
42451  SCIP* scip /**< SCIP data structure */
42452  )
42453 {
42454  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDualLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42455 
42456  return scip->stat->nduallps;
42457 }
42458 
42459 /** gets total number of iterations used so far in dual simplex
42460  *
42461  * @return the total number of iterations used so far in dual simplex
42462  *
42463  * @pre This method can be called if SCIP is in one of the following stages:
42464  * - \ref SCIP_STAGE_PRESOLVED
42465  * - \ref SCIP_STAGE_SOLVING
42466  * - \ref SCIP_STAGE_SOLVED
42467  */
42469  SCIP* scip /**< SCIP data structure */
42470  )
42471 {
42472  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDualLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42473 
42474  return scip->stat->nduallpiterations;
42475 }
42476 
42477 /** gets total number of barrier LPs solved so far
42478  *
42479  * @return the total number of barrier LPs solved so far
42480  *
42481  * @pre This method can be called if SCIP is in one of the following stages:
42482  * - \ref SCIP_STAGE_PRESOLVED
42483  * - \ref SCIP_STAGE_SOLVING
42484  * - \ref SCIP_STAGE_SOLVED
42485  */
42487  SCIP* scip /**< SCIP data structure */
42488  )
42489 {
42490  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBarrierLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42491 
42492  return scip->stat->nbarrierlps;
42493 }
42494 
42495 /** gets total number of iterations used so far in barrier algorithm
42496  *
42497  * @return the total number of iterations used so far in barrier algorithm
42498  *
42499  * @pre This method can be called if SCIP is in one of the following stages:
42500  * - \ref SCIP_STAGE_PRESOLVED
42501  * - \ref SCIP_STAGE_SOLVING
42502  * - \ref SCIP_STAGE_SOLVED
42503  */
42505  SCIP* scip /**< SCIP data structure */
42506  )
42507 {
42508  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBarrierLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42509 
42510  return scip->stat->nbarrierlpiterations;
42511 }
42512 
42513 /** gets total number of LPs solved so far that were resolved from an advanced start basis
42514  *
42515  * @return the total number of LPs solved so far that were resolved from an advanced start basis
42516  *
42517  * @pre This method can be called if SCIP is in one of the following stages:
42518  * - \ref SCIP_STAGE_PRESOLVED
42519  * - \ref SCIP_STAGE_SOLVING
42520  * - \ref SCIP_STAGE_SOLVED
42521  */
42523  SCIP* scip /**< SCIP data structure */
42524  )
42525 {
42526  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNResolveLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42527 
42528  return scip->stat->nprimalresolvelps + scip->stat->ndualresolvelps;
42529 }
42530 
42531 /** gets total number of simplex iterations used so far in primal and dual simplex calls where an advanced start basis
42532  * was available
42533  *
42534  * @return the total number of simplex iterations used so far in primal and dual simplex calls where an advanced start
42535  * basis was available
42536  *
42537  * @pre This method can be called if SCIP is in one of the following stages:
42538  * - \ref SCIP_STAGE_PRESOLVED
42539  * - \ref SCIP_STAGE_SOLVING
42540  * - \ref SCIP_STAGE_SOLVED
42541  */
42543  SCIP* scip /**< SCIP data structure */
42544  )
42545 {
42546  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNResolveLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42547 
42549 }
42550 
42551 /** gets total number of primal LPs solved so far that were resolved from an advanced start basis
42552  *
42553  * @return the total number of primal LPs solved so far that were resolved from an advanced start basis
42554  *
42555  * @pre This method can be called if SCIP is in one of the following stages:
42556  * - \ref SCIP_STAGE_PRESOLVED
42557  * - \ref SCIP_STAGE_SOLVING
42558  * - \ref SCIP_STAGE_SOLVED
42559  */
42561  SCIP* scip /**< SCIP data structure */
42562  )
42563 {
42564  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrimalResolveLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42565 
42566  return scip->stat->nprimalresolvelps;
42567 }
42568 
42569 /** gets total number of simplex iterations used so far in primal simplex calls where an advanced start basis
42570  * was available
42571  *
42572  * @return the total number of simplex iterations used so far in primal simplex calls where an advanced start
42573  * basis was available
42574  *
42575  * @pre This method can be called if SCIP is in one of the following stages:
42576  * - \ref SCIP_STAGE_PRESOLVED
42577  * - \ref SCIP_STAGE_SOLVING
42578  * - \ref SCIP_STAGE_SOLVED
42579  */
42581  SCIP* scip /**< SCIP data structure */
42582  )
42583 {
42584  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrimalResolveLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42585 
42586  return scip->stat->nprimalresolvelpiterations;
42587 }
42588 
42589 /** gets total number of dual LPs solved so far that were resolved from an advanced start basis
42590  *
42591  * @return the total number of dual LPs solved so far that were resolved from an advanced start basis
42592  *
42593  * @pre This method can be called if SCIP is in one of the following stages:
42594  * - \ref SCIP_STAGE_PRESOLVED
42595  * - \ref SCIP_STAGE_SOLVING
42596  * - \ref SCIP_STAGE_SOLVED
42597  */
42599  SCIP* scip /**< SCIP data structure */
42600  )
42601 {
42602  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDualResolveLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42603 
42604  return scip->stat->ndualresolvelps;
42605 }
42606 
42607 /** gets total number of simplex iterations used so far in dual simplex calls where an advanced start basis
42608  * was available
42609  *
42610  * @return the total number of simplex iterations used so far in dual simplex calls where an advanced start
42611  * basis was available
42612  *
42613  * @pre This method can be called if SCIP is in one of the following stages:
42614  * - \ref SCIP_STAGE_PRESOLVED
42615  * - \ref SCIP_STAGE_SOLVING
42616  * - \ref SCIP_STAGE_SOLVED
42617  */
42619  SCIP* scip /**< SCIP data structure */
42620  )
42621 {
42622  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDualResolveLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42623 
42624  return scip->stat->ndualresolvelpiterations;
42625 }
42626 
42627 /** gets total number of LPs solved so far for node relaxations
42628  *
42629  * @return the total number of LPs solved so far for node relaxations
42630  *
42631  * @pre This method can be called if SCIP is in one of the following stages:
42632  * - \ref SCIP_STAGE_PRESOLVED
42633  * - \ref SCIP_STAGE_SOLVING
42634  * - \ref SCIP_STAGE_SOLVED
42635  */
42637  SCIP* scip /**< SCIP data structure */
42638  )
42639 {
42640  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodeLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42641 
42642  return scip->stat->nnodelps;
42643 }
42644 
42645 /** gets total number of simplex iterations used so far for node relaxations
42646  *
42647  * @return the total number of simplex iterations used so far for node relaxations
42648  *
42649  * @pre This method can be called if SCIP is in one of the following stages:
42650  * - \ref SCIP_STAGE_PRESOLVED
42651  * - \ref SCIP_STAGE_SOLVING
42652  * - \ref SCIP_STAGE_SOLVED
42653  */
42655  SCIP* scip /**< SCIP data structure */
42656  )
42657 {
42658  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodeLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42659 
42660  return scip->stat->nnodelpiterations;
42661 }
42662 
42663 /** gets total number of LPs solved so far for initial LP in node relaxations
42664  *
42665  * @return the total number of LPs solved so far for initial LP in node relaxations
42666  *
42667  * @pre This method can be called if SCIP is in one of the following stages:
42668  * - \ref SCIP_STAGE_PRESOLVED
42669  * - \ref SCIP_STAGE_SOLVING
42670  * - \ref SCIP_STAGE_SOLVED
42671  */
42673  SCIP* scip /**< SCIP data structure */
42674  )
42675 {
42676  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodeInitLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42677 
42678  return scip->stat->ninitlps;
42679 }
42680 
42681 /** gets total number of simplex iterations used so far for initial LP in node relaxations
42682  *
42683  * @return the total number of simplex iterations used so far for initial LP in node relaxations
42684  *
42685  * @pre This method can be called if SCIP is in one of the following stages:
42686  * - \ref SCIP_STAGE_PRESOLVED
42687  * - \ref SCIP_STAGE_SOLVING
42688  * - \ref SCIP_STAGE_SOLVED
42689  */
42691  SCIP* scip /**< SCIP data structure */
42692  )
42693 {
42694  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodeInitLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42695 
42696  return scip->stat->ninitlpiterations;
42697 }
42698 
42699 /** gets total number of LPs solved so far during diving and probing
42700  *
42701  * @return total number of LPs solved so far during diving and probing
42702  *
42703  * @pre This method can be called if SCIP is in one of the following stages:
42704  * - \ref SCIP_STAGE_PRESOLVED
42705  * - \ref SCIP_STAGE_SOLVING
42706  * - \ref SCIP_STAGE_SOLVED
42707  */
42709  SCIP* scip /**< SCIP data structure */
42710  )
42711 {
42712  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDivingLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42713 
42714  return scip->stat->ndivinglps;
42715 }
42716 
42717 /** gets total number of simplex iterations used so far during diving and probing
42718  *
42719  * @return the total number of simplex iterations used so far during diving and probing
42720  *
42721  * @pre This method can be called if SCIP is in one of the following stages:
42722  * - \ref SCIP_STAGE_PRESOLVED
42723  * - \ref SCIP_STAGE_SOLVING
42724  * - \ref SCIP_STAGE_SOLVED
42725  */
42727  SCIP* scip /**< SCIP data structure */
42728  )
42729 {
42730  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDivingLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42731 
42732  return scip->stat->ndivinglpiterations;
42733 }
42734 
42735 /** gets total number of times, strong branching was called (each call represents solving two LPs)
42736  *
42737  * @return the total number of times, strong branching was called (each call represents solving two LPs)
42738  *
42739  * @pre This method can be called if SCIP is in one of the following stages:
42740  * - \ref SCIP_STAGE_PRESOLVED
42741  * - \ref SCIP_STAGE_SOLVING
42742  * - \ref SCIP_STAGE_SOLVED
42743  */
42745  SCIP* scip /**< SCIP data structure */
42746  )
42747 {
42748  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNStrongbranchs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42749 
42750  return scip->stat->nstrongbranchs;
42751 }
42752 
42753 /** gets total number of simplex iterations used so far in strong branching
42754  *
42755  * @return the total number of simplex iterations used so far in strong branching
42756  *
42757  * @pre This method can be called if SCIP is in one of the following stages:
42758  * - \ref SCIP_STAGE_PRESOLVED
42759  * - \ref SCIP_STAGE_SOLVING
42760  * - \ref SCIP_STAGE_SOLVED
42761  */
42763  SCIP* scip /**< SCIP data structure */
42764  )
42765 {
42766  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNStrongbranchLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42767 
42768  return scip->stat->nsblpiterations;
42769 }
42770 
42771 /** gets total number of times, strong branching was called at the root node (each call represents solving two LPs)
42772  *
42773  * @return the total number of times, strong branching was called at the root node (each call represents solving two LPs)
42774  *
42775  * @pre This method can be called if SCIP is in one of the following stages:
42776  * - \ref SCIP_STAGE_PRESOLVED
42777  * - \ref SCIP_STAGE_SOLVING
42778  * - \ref SCIP_STAGE_SOLVED
42779  */
42781  SCIP* scip /**< SCIP data structure */
42782  )
42783 {
42784  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRootStrongbranchs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42785 
42786  return scip->stat->nrootstrongbranchs;
42787 }
42788 
42789 /** gets total number of simplex iterations used so far in strong branching at the root node
42790  *
42791  * @return the total number of simplex iterations used so far in strong branching at the root node
42792  *
42793  * @pre This method can be called if SCIP is in one of the following stages:
42794  * - \ref SCIP_STAGE_PRESOLVED
42795  * - \ref SCIP_STAGE_SOLVING
42796  * - \ref SCIP_STAGE_SOLVED
42797  */
42799  SCIP* scip /**< SCIP data structure */
42800  )
42801 {
42802  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRootStrongbranchLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42803 
42804  return scip->stat->nrootsblpiterations;
42805 }
42806 
42807 /** gets number of pricing rounds performed so far at the current node
42808  *
42809  * @return the number of pricing rounds performed so far at the current node
42810  *
42811  * @pre This method can be called if SCIP is in one of the following stages:
42812  * - \ref SCIP_STAGE_SOLVING
42813  */
42815  SCIP* scip /**< SCIP data structure */
42816  )
42817 {
42818  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPriceRounds", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
42819 
42820  return scip->stat->npricerounds;
42821 }
42822 
42823 /** get current number of variables in the pricing store
42824  *
42825  * @return the current number of variables in the pricing store
42826  *
42827  * @pre This method can be called if SCIP is in one of the following stages:
42828  * - \ref SCIP_STAGE_PRESOLVED
42829  * - \ref SCIP_STAGE_SOLVING
42830  * - \ref SCIP_STAGE_SOLVED
42831  */
42833  SCIP* scip /**< SCIP data structure */
42834  )
42835 {
42836  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPricevars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42837 
42838  return SCIPpricestoreGetNVars(scip->pricestore);
42839 }
42840 
42841 /** get total number of pricing variables found so far
42842  *
42843  * @return the total number of pricing variables found so far
42844  *
42845  * @pre This method can be called if SCIP is in one of the following stages:
42846  * - \ref SCIP_STAGE_PRESOLVED
42847  * - \ref SCIP_STAGE_SOLVING
42848  * - \ref SCIP_STAGE_SOLVED
42849  */
42851  SCIP* scip /**< SCIP data structure */
42852  )
42853 {
42854  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPricevarsFound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42855 
42857 }
42858 
42859 /** get total number of pricing variables applied to the LPs
42860  *
42861  * @return the total number of pricing variables applied to the LPs
42862  *
42863  * @pre This method can be called if SCIP is in one of the following stages:
42864  * - \ref SCIP_STAGE_PRESOLVED
42865  * - \ref SCIP_STAGE_SOLVING
42866  * - \ref SCIP_STAGE_SOLVED
42867  */
42869  SCIP* scip /**< SCIP data structure */
42870  )
42871 {
42872  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPricevarsApplied", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42873 
42875 }
42876 
42877 /** gets number of separation rounds performed so far at the current node
42878  *
42879  * @return the number of separation rounds performed so far at the current node
42880  *
42881  * @pre This method can be called if SCIP is in one of the following stages:
42882  * - \ref SCIP_STAGE_SOLVING
42883  */
42885  SCIP* scip /**< SCIP data structure */
42886  )
42887 {
42888  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNSepaRounds", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
42889 
42890  return scip->stat->nseparounds;
42891 }
42892 
42893 /** get total number of cuts found so far
42894  *
42895  * @return the total number of cuts found so far
42896  *
42897  * @pre This method can be called if SCIP is in one of the following stages:
42898  * - \ref SCIP_STAGE_PRESOLVED
42899  * - \ref SCIP_STAGE_SOLVING
42900  * - \ref SCIP_STAGE_SOLVED
42901  */
42903  SCIP* scip /**< SCIP data structure */
42904  )
42905 {
42906  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCutsFound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42907 
42908  return SCIPsepastoreGetNCutsFound(scip->sepastore);
42909 }
42910 
42911 /** get number of cuts found so far in current separation round
42912  *
42913  * @return the number of cuts found so far in current separation round
42914  *
42915  * @pre This method can be called if SCIP is in one of the following stages:
42916  * - \ref SCIP_STAGE_PRESOLVED
42917  * - \ref SCIP_STAGE_SOLVING
42918  * - \ref SCIP_STAGE_SOLVED
42919  */
42921  SCIP* scip /**< SCIP data structure */
42922  )
42923 {
42924  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCutsFoundRound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42925 
42927 }
42928 
42929 /** get total number of cuts applied to the LPs
42930  *
42931  * @return the total number of cuts applied to the LPs
42932  *
42933  * @pre This method can be called if SCIP is in one of the following stages:
42934  * - \ref SCIP_STAGE_PRESOLVED
42935  * - \ref SCIP_STAGE_SOLVING
42936  * - \ref SCIP_STAGE_SOLVED
42937  */
42939  SCIP* scip /**< SCIP data structure */
42940  )
42941 {
42942  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCutsApplied", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42943 
42945 }
42946 
42947 /** get total number of constraints found in conflict analysis (conflict and reconvergence constraints)
42948  *
42949  * @return the total number of constraints found in conflict analysis (conflict and reconvergence constraints)
42950  *
42951  * @pre This method can be called if SCIP is in one of the following stages:
42952  * - \ref SCIP_STAGE_TRANSFORMED
42953  * - \ref SCIP_STAGE_INITPRESOLVE
42954  * - \ref SCIP_STAGE_PRESOLVING
42955  * - \ref SCIP_STAGE_EXITPRESOLVE
42956  * - \ref SCIP_STAGE_PRESOLVED
42957  * - \ref SCIP_STAGE_INITSOLVE
42958  * - \ref SCIP_STAGE_SOLVING
42959  * - \ref SCIP_STAGE_SOLVED
42960  * - \ref SCIP_STAGE_EXITSOLVE
42961  */
42963  SCIP* scip /**< SCIP data structure */
42964  )
42965 {
42966  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNConflictConssFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42967 
42978 }
42979 
42980 /** get number of conflict constraints found so far at the current node
42981  *
42982  * @return the number of conflict constraints found so far at the current node
42983  *
42984  * @pre This method can be called if SCIP is in one of the following stages:
42985  * - \ref SCIP_STAGE_TRANSFORMED
42986  * - \ref SCIP_STAGE_INITPRESOLVE
42987  * - \ref SCIP_STAGE_PRESOLVING
42988  * - \ref SCIP_STAGE_EXITPRESOLVE
42989  * - \ref SCIP_STAGE_PRESOLVED
42990  * - \ref SCIP_STAGE_INITSOLVE
42991  * - \ref SCIP_STAGE_SOLVING
42992  * - \ref SCIP_STAGE_SOLVED
42993  * - \ref SCIP_STAGE_EXITSOLVE
42994  */
42996  SCIP* scip /**< SCIP data structure */
42997  )
42998 {
42999  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNConflictConssFoundNode", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43000 
43001  return SCIPconflictGetNConflicts(scip->conflict);
43002 }
43003 
43004 /** get total number of conflict constraints added to the problem
43005  *
43006  * @return the total number of conflict constraints added to the problem
43007  *
43008  * @pre This method can be called if SCIP is in one of the following stages:
43009  * - \ref SCIP_STAGE_TRANSFORMED
43010  * - \ref SCIP_STAGE_INITPRESOLVE
43011  * - \ref SCIP_STAGE_PRESOLVING
43012  * - \ref SCIP_STAGE_EXITPRESOLVE
43013  * - \ref SCIP_STAGE_PRESOLVED
43014  * - \ref SCIP_STAGE_INITSOLVE
43015  * - \ref SCIP_STAGE_SOLVING
43016  * - \ref SCIP_STAGE_SOLVED
43017  * - \ref SCIP_STAGE_EXITSOLVE
43018  */
43020  SCIP* scip /**< SCIP data structure */
43021  )
43022 {
43023  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNConflictConssApplied", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43024 
43025  return SCIPconflictGetNAppliedConss(scip->conflict);
43026 }
43027 
43028 /** gets depth of current node, or -1 if no current node exists; in probing, the current node is the last probing node,
43029  * such that the depth includes the probing path
43030  *
43031  * @return the depth of current node, or -1 if no current node exists; in probing, the current node is the last probing node,
43032  * such that the depth includes the probing path
43033  *
43034  * @pre This method can be called if SCIP is in one of the following stages:
43035  * - \ref SCIP_STAGE_TRANSFORMED
43036  * - \ref SCIP_STAGE_INITPRESOLVE
43037  * - \ref SCIP_STAGE_PRESOLVING
43038  * - \ref SCIP_STAGE_EXITPRESOLVE
43039  * - \ref SCIP_STAGE_PRESOLVED
43040  * - \ref SCIP_STAGE_INITSOLVE
43041  * - \ref SCIP_STAGE_SOLVING
43042  * - \ref SCIP_STAGE_SOLVED
43043  * - \ref SCIP_STAGE_EXITSOLVE
43044  */
43046  SCIP* scip /**< SCIP data structure */
43047  )
43048 {
43049  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDepth", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43050 
43051  return SCIPtreeGetCurrentDepth(scip->tree);
43052 }
43053 
43054 /** gets depth of the focus node, or -1 if no focus node exists; the focus node is the currently processed node in the
43055  * branching tree, excluding the nodes of the probing path
43056  *
43057  * @return the depth of the focus node, or -1 if no focus node exists; the focus node is the currently processed node in the
43058  * branching tree, excluding the nodes of the probing path
43059  *
43060  * @pre This method can be called if SCIP is in one of the following stages:
43061  * - \ref SCIP_STAGE_TRANSFORMED
43062  * - \ref SCIP_STAGE_INITPRESOLVE
43063  * - \ref SCIP_STAGE_PRESOLVING
43064  * - \ref SCIP_STAGE_EXITPRESOLVE
43065  * - \ref SCIP_STAGE_PRESOLVED
43066  * - \ref SCIP_STAGE_INITSOLVE
43067  * - \ref SCIP_STAGE_SOLVING
43068  * - \ref SCIP_STAGE_SOLVED
43069  * - \ref SCIP_STAGE_EXITSOLVE
43070  */
43072  SCIP* scip /**< SCIP data structure */
43073  )
43074 {
43075  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFocusDepth", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43076 
43077  return SCIPtreeGetFocusDepth(scip->tree);
43078 }
43079 
43080 /** gets maximal depth of all processed nodes in current branch and bound run (excluding probing nodes)
43081  *
43082  * @return the maximal depth of all processed nodes in current branch and bound run (excluding probing nodes)
43083  *
43084  * @pre This method can be called if SCIP is in one of the following stages:
43085  * - \ref SCIP_STAGE_TRANSFORMED
43086  * - \ref SCIP_STAGE_INITPRESOLVE
43087  * - \ref SCIP_STAGE_PRESOLVING
43088  * - \ref SCIP_STAGE_EXITPRESOLVE
43089  * - \ref SCIP_STAGE_PRESOLVED
43090  * - \ref SCIP_STAGE_INITSOLVE
43091  * - \ref SCIP_STAGE_SOLVING
43092  * - \ref SCIP_STAGE_SOLVED
43093  * - \ref SCIP_STAGE_EXITSOLVE
43094  */
43096  SCIP* scip /**< SCIP data structure */
43097  )
43098 {
43099  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetMaxDepth", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43100 
43101  return scip->stat->maxdepth;
43102 }
43103 
43104 /** gets maximal depth of all processed nodes over all branch and bound runs
43105  *
43106  * @return the maximal depth of all processed nodes over all branch and bound runs
43107  *
43108  * @pre This method can be called if SCIP is in one of the following stages:
43109  * - \ref SCIP_STAGE_TRANSFORMED
43110  * - \ref SCIP_STAGE_INITPRESOLVE
43111  * - \ref SCIP_STAGE_PRESOLVING
43112  * - \ref SCIP_STAGE_EXITPRESOLVE
43113  * - \ref SCIP_STAGE_PRESOLVED
43114  * - \ref SCIP_STAGE_INITSOLVE
43115  * - \ref SCIP_STAGE_SOLVING
43116  * - \ref SCIP_STAGE_SOLVED
43117  * - \ref SCIP_STAGE_EXITSOLVE
43118  */
43120  SCIP* scip /**< SCIP data structure */
43121  )
43122 {
43123  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetMaxTotalDepth", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43124 
43125  return scip->stat->maxtotaldepth;
43126 }
43127 
43128 /** gets total number of backtracks, i.e. number of times, the new node was selected from the leaves queue
43129  *
43130  * @return the total number of backtracks, i.e. number of times, the new node was selected from the leaves queue
43131  *
43132  * @pre This method can be called if SCIP is in one of the following stages:
43133  * - \ref SCIP_STAGE_TRANSFORMED
43134  * - \ref SCIP_STAGE_INITPRESOLVE
43135  * - \ref SCIP_STAGE_PRESOLVING
43136  * - \ref SCIP_STAGE_EXITPRESOLVE
43137  * - \ref SCIP_STAGE_PRESOLVED
43138  * - \ref SCIP_STAGE_INITSOLVE
43139  * - \ref SCIP_STAGE_SOLVING
43140  * - \ref SCIP_STAGE_SOLVED
43141  * - \ref SCIP_STAGE_EXITSOLVE
43142  */
43144  SCIP* scip /**< SCIP data structure */
43145  )
43146 {
43147  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBacktracks", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43148 
43149  return scip->stat->nbacktracks;
43150 }
43151 
43152 /** gets current plunging depth (successive times, a child was selected as next node)
43153  *
43154  * @return the current plunging depth (successive times, a child was selected as next node)
43155  *
43156  * @pre This method can be called if SCIP is in one of the following stages:
43157  * - \ref SCIP_STAGE_PRESOLVED
43158  * - \ref SCIP_STAGE_SOLVING
43159  */
43161  SCIP* scip /**< SCIP data structure */
43162  )
43163 {
43164  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPlungeDepth", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
43165 
43166  return scip->stat->plungedepth;
43167 }
43168 
43169 /** gets total number of active constraints at the current node
43170  *
43171  * @return the total number of active constraints at the current node
43172  *
43173  * @pre This method can be called if SCIP is in one of the following stages:
43174  * - \ref SCIP_STAGE_INITPRESOLVE
43175  * - \ref SCIP_STAGE_PRESOLVING
43176  * - \ref SCIP_STAGE_EXITPRESOLVE
43177  * - \ref SCIP_STAGE_PRESOLVED
43178  * - \ref SCIP_STAGE_SOLVING
43179  */
43181  SCIP* scip /**< SCIP data structure */
43182  )
43183 {
43184  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNActiveConss", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
43185 
43186  return scip->stat->nactiveconss;
43187 }
43188 
43189 /** gets total number of enabled constraints at the current node
43190  *
43191  * @return the total number of enabled constraints at the current node
43192  *
43193  * @pre This method can be called if SCIP is in one of the following stages:
43194  * - \ref SCIP_STAGE_PRESOLVED
43195  * - \ref SCIP_STAGE_SOLVING
43196  */
43198  SCIP* scip /**< SCIP data structure */
43199  )
43200 {
43201  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNEnabledConss", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
43202 
43203  return scip->stat->nenabledconss;
43204 }
43205 
43206 /** gets average dual bound of all unprocessed nodes for original problem
43207  *
43208  * @return the average dual bound of all unprocessed nodes for original problem
43209  *
43210  * @pre This method can be called if SCIP is in one of the following stages:
43211  * - \ref SCIP_STAGE_PRESOLVED
43212  * - \ref SCIP_STAGE_SOLVING
43213  * - \ref SCIP_STAGE_SOLVED
43214  */
43216  SCIP* scip /**< SCIP data structure */
43217  )
43218 {
43219  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43220 
43221  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set,
43223 }
43224 
43225 /** gets average lower (dual) bound of all unprocessed nodes in transformed problem
43226  *
43227  * @return the average lower (dual) bound of all unprocessed nodes in transformed problem
43228  *
43229  * @pre This method can be called if SCIP is in one of the following stages:
43230  * - \ref SCIP_STAGE_PRESOLVED
43231  * - \ref SCIP_STAGE_SOLVING
43232  * - \ref SCIP_STAGE_SOLVED
43233  */
43235  SCIP* scip /**< SCIP data structure */
43236  )
43237 {
43238  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43239 
43240  return SCIPtreeGetAvgLowerbound(scip->tree, scip->primal->cutoffbound);
43241 }
43242 
43243 /** gets global dual bound
43244  *
43245  * @return the global dual bound
43246  *
43247  * @pre This method can be called if SCIP is in one of the following stages:
43248  * - \ref SCIP_STAGE_PRESOLVING
43249  * - \ref SCIP_STAGE_EXITPRESOLVE
43250  * - \ref SCIP_STAGE_PRESOLVED
43251  * - \ref SCIP_STAGE_INITSOLVE
43252  * - \ref SCIP_STAGE_SOLVING
43253  * - \ref SCIP_STAGE_SOLVED
43254  * - \ref SCIP_STAGE_EXITSOLVE
43255  */
43257  SCIP* scip /**< SCIP data structure */
43258  )
43259 {
43260  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43261 
43262  return getDualbound(scip);
43263 }
43264 
43265 /** gets global lower (dual) bound in transformed problem
43266  *
43267  * @return the global lower (dual) bound in transformed problem
43268  *
43269  * @pre This method can be called if SCIP is in one of the following stages:
43270  * - \ref SCIP_STAGE_PRESOLVING
43271  * - \ref SCIP_STAGE_EXITPRESOLVE
43272  * - \ref SCIP_STAGE_PRESOLVED
43273  * - \ref SCIP_STAGE_INITSOLVE
43274  * - \ref SCIP_STAGE_SOLVING
43275  * - \ref SCIP_STAGE_SOLVED
43276  */
43278  SCIP* scip /**< SCIP data structure */
43279  )
43280 {
43281  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43282 
43283  return getLowerbound(scip);
43284 }
43285 
43286 /** gets dual bound of the root node for the original problem
43287  *
43288  * @return the dual bound of the root node for the original problem
43289  *
43290  * @pre This method can be called if SCIP is in one of the following stages:
43291  * - \ref SCIP_STAGE_PRESOLVING
43292  * - \ref SCIP_STAGE_EXITPRESOLVE
43293  * - \ref SCIP_STAGE_PRESOLVED
43294  * - \ref SCIP_STAGE_INITSOLVE
43295  * - \ref SCIP_STAGE_SOLVING
43296  * - \ref SCIP_STAGE_SOLVED
43297  */
43299  SCIP* scip /**< SCIP data structure */
43300  )
43301 {
43302  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDualboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43303 
43304  if( SCIPsetIsInfinity(scip->set, scip->stat->rootlowerbound) )
43305  return getPrimalbound(scip);
43306  else
43307  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, scip->stat->rootlowerbound);
43308 }
43309 
43310 /** gets lower (dual) bound in transformed problem of the root node
43311  *
43312  * @return the lower (dual) bound in transformed problem of the root node
43313  *
43314  * @pre This method can be called if SCIP is in one of the following stages:
43315  * - \ref SCIP_STAGE_PRESOLVING
43316  * - \ref SCIP_STAGE_EXITPRESOLVE
43317  * - \ref SCIP_STAGE_PRESOLVED
43318  * - \ref SCIP_STAGE_INITSOLVE
43319  * - \ref SCIP_STAGE_SOLVING
43320  * - \ref SCIP_STAGE_SOLVED
43321  */
43323  SCIP* scip /**< SCIP data structure */
43324  )
43325 {
43326  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLowerboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43327 
43328  if( SCIPsetIsInfinity(scip->set, scip->stat->rootlowerbound) )
43329  return getUpperbound(scip);
43330  else
43331  return scip->stat->rootlowerbound;
43332 }
43333 
43334 /** gets dual bound for the original problem obtained by the first LP solve at the root node
43335  *
43336  * @return the dual bound for the original problem of the first LP solve at the root node
43337  *
43338  * @pre This method can be called if SCIP is in one of the following stages:
43339  * - \ref SCIP_STAGE_PRESOLVING
43340  * - \ref SCIP_STAGE_EXITPRESOLVE
43341  * - \ref SCIP_STAGE_PRESOLVED
43342  * - \ref SCIP_STAGE_INITSOLVE
43343  * - \ref SCIP_STAGE_SOLVING
43344  * - \ref SCIP_STAGE_SOLVED
43345  */
43347  SCIP* scip /**< SCIP data structure */
43348  )
43349 {
43350  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFirstLPDualboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43351 
43352  return scip->stat->firstlpdualbound;
43353 }
43354 
43355 /** gets lower (dual) bound in transformed problem obtained by the first LP solve at the root node
43356  *
43357  * @return the lower (dual) bound in transformed problem obtained by first LP solve at the root node
43358  *
43359  * @pre This method can be called if SCIP is in one of the following stages:
43360  * - \ref SCIP_STAGE_PRESOLVING
43361  * - \ref SCIP_STAGE_EXITPRESOLVE
43362  * - \ref SCIP_STAGE_PRESOLVED
43363  * - \ref SCIP_STAGE_INITSOLVE
43364  * - \ref SCIP_STAGE_SOLVING
43365  * - \ref SCIP_STAGE_SOLVED
43366  */
43368  SCIP* scip /**< SCIP data structure */
43369  )
43370 {
43371  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFirstLPLowerboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43372 
43373  if( scip->stat->firstlpdualbound == SCIP_INVALID ) /*lint !e777*/
43374  return -SCIPinfinity(scip);
43375  else
43376  return SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, scip->stat->firstlpdualbound);
43377 }
43378 
43379 /** the primal bound of the very first solution */
43381  SCIP* scip /**< SCIP data structure */
43382  )
43383 {
43384  return scip->stat->firstprimalbound;
43385 }
43386 
43387 /** gets global primal bound (objective value of best solution or user objective limit) for the original problem
43388  *
43389  * @return the global primal bound (objective value of best solution or user objective limit) for the original problem
43390  *
43391  * @pre This method can be called if SCIP is in one of the following stages:
43392  * - \ref SCIP_STAGE_TRANSFORMED
43393  * - \ref SCIP_STAGE_INITPRESOLVE
43394  * - \ref SCIP_STAGE_PRESOLVING
43395  * - \ref SCIP_STAGE_EXITPRESOLVE
43396  * - \ref SCIP_STAGE_PRESOLVED
43397  * - \ref SCIP_STAGE_INITSOLVE
43398  * - \ref SCIP_STAGE_SOLVING
43399  * - \ref SCIP_STAGE_SOLVED
43400  * - \ref SCIP_STAGE_EXITSOLVE
43401  */
43403  SCIP* scip /**< SCIP data structure */
43404  )
43405 {
43406  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPrimalbound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43407 
43408  return getPrimalbound(scip);
43409 }
43410 
43411 /** gets global upper (primal) bound in transformed problem (objective value of best solution or user objective limit)
43412  *
43413  * @return the global upper (primal) bound in transformed problem (objective value of best solution or user objective limit)
43414  *
43415  * @pre This method can be called if SCIP is in one of the following stages:
43416  * - \ref SCIP_STAGE_TRANSFORMED
43417  * - \ref SCIP_STAGE_INITPRESOLVE
43418  * - \ref SCIP_STAGE_PRESOLVING
43419  * - \ref SCIP_STAGE_EXITPRESOLVE
43420  * - \ref SCIP_STAGE_PRESOLVED
43421  * - \ref SCIP_STAGE_INITSOLVE
43422  * - \ref SCIP_STAGE_SOLVING
43423  * - \ref SCIP_STAGE_SOLVED
43424  * - \ref SCIP_STAGE_EXITSOLVE
43425  */
43427  SCIP* scip /**< SCIP data structure */
43428  )
43429 {
43430  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetUpperbound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43431 
43432  return getUpperbound(scip);
43433 }
43434 
43435 /** gets global cutoff bound in transformed problem: a sub problem with lower bound larger than the cutoff
43436  * cannot contain a better feasible solution; usually, this bound is equal to the upper bound, but if the
43437  * objective value is always integral, the cutoff bound is (nearly) one less than the upper bound;
43438  * additionally, due to objective function domain propagation, the cutoff bound can be further reduced
43439  *
43440  * @return global cutoff bound in transformed problem
43441  *
43442  * @pre This method can be called if SCIP is in one of the following stages:
43443  * - \ref SCIP_STAGE_TRANSFORMED
43444  * - \ref SCIP_STAGE_INITPRESOLVE
43445  * - \ref SCIP_STAGE_PRESOLVING
43446  * - \ref SCIP_STAGE_EXITPRESOLVE
43447  * - \ref SCIP_STAGE_PRESOLVED
43448  * - \ref SCIP_STAGE_INITSOLVE
43449  * - \ref SCIP_STAGE_SOLVING
43450  * - \ref SCIP_STAGE_SOLVED
43451  * - \ref SCIP_STAGE_EXITSOLVE
43452  */
43454  SCIP* scip /**< SCIP data structure */
43455  )
43456 {
43457  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCutoffbound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43458 
43459  return scip->primal->cutoffbound;
43460 }
43461 
43462 /** updates the cutoff bound
43463  *
43464  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
43465  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
43466  *
43467  * @note using this method in the solving stage can lead to an erroneous SCIP solving status; in particular,
43468  * if a solution not respecting the cutoff bound was found before installing a cutoff bound which
43469  * renders the remaining problem infeasible, this solution may be reported as optimal
43470  *
43471  * @pre This method can be called if SCIP is in one of the following stages:
43472  * - \ref SCIP_STAGE_TRANSFORMED
43473  * - \ref SCIP_STAGE_PRESOLVING
43474  * - \ref SCIP_STAGE_PRESOLVED
43475  * - \ref SCIP_STAGE_INITSOLVE
43476  * - \ref SCIP_STAGE_SOLVING
43477  *
43478  * @note the given cutoff bound has to better or equal to known one (SCIPgetCutoffbound())
43479  * @note a given cutoff bound is also used for updating the objective limit, if possible
43480  */
43482  SCIP* scip, /**< SCIP data structure */
43483  SCIP_Real cutoffbound /**< new cutoff bound */
43484  )
43485 {
43486  SCIP_CALL( checkStage(scip, "SCIPupdateCutoffbound", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
43487 
43488  assert(cutoffbound <= SCIPgetCutoffbound(scip));
43489 
43490  SCIP_CALL( SCIPprimalSetCutoffbound(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
43491  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, cutoffbound, FALSE) );
43492 
43493  return SCIP_OKAY;
43494 }
43495 
43496 
43497 /** returns whether the current primal bound is justified with a feasible primal solution; if not, the primal bound
43498  * was set from the user as objective limit
43499  *
43500  * @return TRUE if the current primal bound is justified with a feasible primal solution, otherwise FALSE
43501  *
43502  * @pre This method can be called if SCIP is in one of the following stages:
43503  * - \ref SCIP_STAGE_TRANSFORMED
43504  * - \ref SCIP_STAGE_INITPRESOLVE
43505  * - \ref SCIP_STAGE_PRESOLVING
43506  * - \ref SCIP_STAGE_EXITPRESOLVE
43507  * - \ref SCIP_STAGE_PRESOLVED
43508  * - \ref SCIP_STAGE_INITSOLVE
43509  * - \ref SCIP_STAGE_SOLVING
43510  * - \ref SCIP_STAGE_SOLVED
43511  * - \ref SCIP_STAGE_EXITSOLVE
43512  */
43514  SCIP* scip /**< SCIP data structure */
43515  )
43516 {
43517  SCIP_CALL_ABORT( checkStage(scip, "SCIPisPrimalboundSol", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43518 
43519  return SCIPprimalUpperboundIsSol(scip->primal, scip->set, scip->transprob, scip->origprob);
43520 }
43521 
43522 /** gets current gap |(primalbound - dualbound)/min(|primalbound|,|dualbound|)| if both bounds have same sign,
43523  * or infinity, if they have opposite sign
43524  *
43525  * @return the current gap |(primalbound - dualbound)/min(|primalbound|,|dualbound|)| if both bounds have same sign,
43526  * or infinity, if they have opposite sign
43527  *
43528  * @pre This method can be called if SCIP is in one of the following stages:
43529  * - \ref SCIP_STAGE_PRESOLVING
43530  * - \ref SCIP_STAGE_EXITPRESOLVE
43531  * - \ref SCIP_STAGE_PRESOLVED
43532  * - \ref SCIP_STAGE_INITSOLVE
43533  * - \ref SCIP_STAGE_SOLVING
43534  * - \ref SCIP_STAGE_SOLVED
43535  */
43537  SCIP* scip /**< SCIP data structure */
43538  )
43539 {
43540  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetGap", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43541 
43542  if( SCIPsetIsInfinity(scip->set, getLowerbound(scip)) )
43543  {
43544  /* in case we could not prove whether the problem is unbounded or infeasible, we want to terminate with
43545  * gap = +inf instead of gap = 0
43546  */
43547  if( SCIPgetStatus(scip) == SCIP_STATUS_INFORUNBD )
43548  return SCIPsetInfinity(scip->set);
43549  else
43550  return 0.0;
43551  }
43552 
43553  return SCIPcomputeGap(SCIPsetEpsilon(scip->set), SCIPsetInfinity(scip->set), getPrimalbound(scip), getDualbound(scip));
43554 }
43555 
43556 /** gets current gap |(upperbound - lowerbound)/min(|upperbound|,|lowerbound|)| in transformed problem if both bounds
43557  * have same sign, or infinity, if they have opposite sign
43558  *
43559  * @return current gap |(upperbound - lowerbound)/min(|upperbound|,|lowerbound|)| in transformed problem if both bounds
43560  * have same sign, or infinity, if they have opposite sign
43561  *
43562  * @pre This method can be called if SCIP is in one of the following stages:
43563  * - \ref SCIP_STAGE_PRESOLVED
43564  * - \ref SCIP_STAGE_SOLVING
43565  * - \ref SCIP_STAGE_SOLVED
43566  */
43568  SCIP* scip /**< SCIP data structure */
43569  )
43570 {
43571  SCIP_Real upperbound;
43572  SCIP_Real lowerbound;
43573 
43574  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetTransGap", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43575 
43576  upperbound = getUpperbound(scip);
43577  lowerbound = getLowerbound(scip);
43578 
43579  if( SCIPsetIsInfinity(scip->set, lowerbound) )
43580  /* in case we could not prove whether the problem is unbounded or infeasible, we want to terminate with
43581  * gap = +inf instead of gap = 0
43582  */
43583  if( SCIPgetStatus(scip) == SCIP_STATUS_INFORUNBD )
43584  return SCIPsetInfinity(scip->set);
43585  else
43586  return 0.0;
43587  else if( SCIPsetIsEQ(scip->set, upperbound, lowerbound) )
43588  return 0.0;
43589  else if( SCIPsetIsZero(scip->set, lowerbound)
43590  || SCIPsetIsZero(scip->set, upperbound)
43591  || SCIPsetIsInfinity(scip->set, upperbound)
43592  || SCIPsetIsInfinity(scip->set, -lowerbound)
43593  || lowerbound * upperbound < 0.0 )
43594  return SCIPsetInfinity(scip->set);
43595  else
43596  {
43597  SCIP_Real abslower = REALABS(lowerbound);
43598  SCIP_Real absupper = REALABS(upperbound);
43599 
43600  return REALABS((upperbound - lowerbound)/MIN(abslower, absupper));
43601  }
43602 }
43603 
43604 /** gets number of feasible primal solutions found so far
43605  *
43606  * @return the number of feasible primal solutions found so far
43607  *
43608  * @pre This method can be called if SCIP is in one of the following stages:
43609  * - \ref SCIP_STAGE_TRANSFORMED
43610  * - \ref SCIP_STAGE_INITPRESOLVE
43611  * - \ref SCIP_STAGE_PRESOLVING
43612  * - \ref SCIP_STAGE_EXITPRESOLVE
43613  * - \ref SCIP_STAGE_PRESOLVED
43614  * - \ref SCIP_STAGE_INITSOLVE
43615  * - \ref SCIP_STAGE_SOLVING
43616  * - \ref SCIP_STAGE_SOLVED
43617  * - \ref SCIP_STAGE_EXITSOLVE
43618  */
43620  SCIP* scip /**< SCIP data structure */
43621  )
43622 {
43623  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNSolsFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43624 
43625  return scip->primal->nsolsfound;
43626 }
43627 
43628 /** gets number of feasible primal solutions respecting the objective limit found so far
43629  *
43630  * @return the number of feasible primal solutions respecting the objective limit found so far
43631  *
43632  * @pre This method can be called if SCIP is in one of the following stages:
43633  * - \ref SCIP_STAGE_INIT
43634  * - \ref SCIP_STAGE_PROBLEM
43635  * - \ref SCIP_STAGE_TRANSFORMING
43636  * - \ref SCIP_STAGE_TRANSFORMED
43637  * - \ref SCIP_STAGE_INITPRESOLVE
43638  * - \ref SCIP_STAGE_PRESOLVING
43639  * - \ref SCIP_STAGE_EXITPRESOLVE
43640  * - \ref SCIP_STAGE_PRESOLVED
43641  * - \ref SCIP_STAGE_INITSOLVE
43642  * - \ref SCIP_STAGE_SOLVING
43643  * - \ref SCIP_STAGE_SOLVED
43644  * - \ref SCIP_STAGE_EXITSOLVE
43645  */
43647  SCIP* scip /**< SCIP data structure */
43648  )
43649 {
43651  return 0;
43652 
43653  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLimSolsFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43654 
43655  return scip->primal->nlimsolsfound;
43656 }
43657 
43658 /** gets number of feasible primal solutions found so far, that improved the primal bound at the time they were found
43659  *
43660  * @return the number of feasible primal solutions found so far, that improved the primal bound at the time they were found
43661  *
43662  * @pre This method can be called if SCIP is in one of the following stages:
43663  * - \ref SCIP_STAGE_TRANSFORMED
43664  * - \ref SCIP_STAGE_INITPRESOLVE
43665  * - \ref SCIP_STAGE_PRESOLVING
43666  * - \ref SCIP_STAGE_EXITPRESOLVE
43667  * - \ref SCIP_STAGE_PRESOLVED
43668  * - \ref SCIP_STAGE_INITSOLVE
43669  * - \ref SCIP_STAGE_SOLVING
43670  * - \ref SCIP_STAGE_SOLVED
43671  * - \ref SCIP_STAGE_EXITSOLVE
43672  */
43674  SCIP* scip /**< SCIP data structure */
43675  )
43676 {
43677  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBestSolsFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43678 
43679  return scip->primal->nbestsolsfound;
43680 }
43681 
43682 /** gets the average pseudo cost value for the given direction over all variables
43683  *
43684  * @return the average pseudo cost value for the given direction over all variables
43685  *
43686  * @pre This method can be called if SCIP is in one of the following stages:
43687  * - \ref SCIP_STAGE_SOLVING
43688  * - \ref SCIP_STAGE_SOLVED
43689  */
43691  SCIP* scip, /**< SCIP data structure */
43692  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
43693  )
43694 {
43695  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocost", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43696 
43697  return SCIPhistoryGetPseudocost(scip->stat->glbhistory, solvaldelta);
43698 }
43699 
43700 /** gets the average pseudo cost value for the given direction over all variables,
43701  * only using the pseudo cost information of the current run
43702  *
43703  * @return the average pseudo cost value for the given direction over all variables,
43704  * only using the pseudo cost information of the current run
43705  *
43706  * @pre This method can be called if SCIP is in one of the following stages:
43707  * - \ref SCIP_STAGE_SOLVING
43708  * - \ref SCIP_STAGE_SOLVED
43709  */
43711  SCIP* scip, /**< SCIP data structure */
43712  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
43713  )
43714 {
43715  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43716 
43717  return SCIPhistoryGetPseudocost(scip->stat->glbhistorycrun, solvaldelta);
43718 }
43719 
43720 /** gets the average number of pseudo cost updates for the given direction over all variables
43721  *
43722  * @return the average number of pseudo cost updates for the given direction over all variables
43723  *
43724  * @pre This method can be called if SCIP is in one of the following stages:
43725  * - \ref SCIP_STAGE_SOLVING
43726  * - \ref SCIP_STAGE_SOLVED
43727  */
43729  SCIP* scip, /**< SCIP data structure */
43730  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
43731  )
43732 {
43733  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostCount", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43734 
43735  return SCIPhistoryGetPseudocostCount(scip->stat->glbhistory, dir)
43736  / MAX(scip->transprob->nbinvars + scip->transprob->nintvars, 1);
43737 }
43738 
43739 /** gets the average number of pseudo cost updates for the given direction over all variables,
43740  * only using the pseudo cost information of the current run
43741  *
43742  * @return the average number of pseudo cost updates for the given direction over all variables,
43743  * only using the pseudo cost information of the current run
43744  *
43745  * @pre This method can be called if SCIP is in one of the following stages:
43746  * - \ref SCIP_STAGE_SOLVING
43747  * - \ref SCIP_STAGE_SOLVED
43748  */
43750  SCIP* scip, /**< SCIP data structure */
43751  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
43752  )
43753 {
43754  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostCountCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43755 
43757  / MAX(scip->transprob->nbinvars + scip->transprob->nintvars, 1);
43758 }
43759 
43760 /** gets the average pseudo cost score value over all variables, assuming a fractionality of 0.5
43761  *
43762  * @return the average pseudo cost score value over all variables, assuming a fractionality of 0.5
43763  *
43764  * @pre This method can be called if SCIP is in one of the following stages:
43765  * - \ref SCIP_STAGE_SOLVING
43766  * - \ref SCIP_STAGE_SOLVED
43767  */
43769  SCIP* scip /**< SCIP data structure */
43770  )
43771 {
43772  SCIP_Real pscostdown;
43773  SCIP_Real pscostup;
43774 
43775  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43776 
43777  pscostdown = SCIPhistoryGetPseudocost(scip->stat->glbhistory, -0.5);
43778  pscostup = SCIPhistoryGetPseudocost(scip->stat->glbhistory, +0.5);
43779 
43780  return SCIPbranchGetScore(scip->set, NULL, pscostdown, pscostup);
43781 }
43782 
43783 /** returns the variance of pseudo costs for all variables in the requested direction
43784  *
43785  * @return the variance of pseudo costs for all variables in the requested direction
43786  *
43787  * @pre This method can be called if SCIP is in one of the following stages:
43788  * - \ref SCIP_STAGE_SOLVING
43789  * - \ref SCIP_STAGE_SOLVED
43790  */
43792  SCIP* scip, /**< SCIP data structure */
43793  SCIP_BRANCHDIR branchdir, /**< the branching direction, up or down */
43794  SCIP_Bool onlycurrentrun /**< use only history of current run? */
43795  )
43796 {
43797  SCIP_HISTORY* history;
43798 
43799  assert(scip != NULL);
43800  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPseudocostVariance", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43801 
43802  history = (onlycurrentrun ? scip->stat->glbhistorycrun : scip->stat->glbhistory);
43803  assert(history != NULL);
43804 
43805  return SCIPhistoryGetPseudocostVariance(history, branchdir);
43806 }
43807 
43808 /** gets the number of pseudo cost updates for the given direction over all variables
43809  *
43810  * @return the number of pseudo cost updates for the given direction over all variables
43811  *
43812  * @pre This method can be called if SCIP is in one of the following stages:
43813  * - \ref SCIP_STAGE_SOLVING
43814  * - \ref SCIP_STAGE_SOLVED
43815  */
43817  SCIP* scip, /**< SCIP data structure */
43818  SCIP_BRANCHDIR dir, /**< branching direction (downwards, or upwards) */
43819  SCIP_Bool onlycurrentrun /**< use only history of current run? */
43820  )
43821 {
43822  SCIP_HISTORY* history;
43823 
43824  assert(scip != NULL);
43825  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPseudocostCount", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43826 
43827  history = (onlycurrentrun ? scip->stat->glbhistorycrun : scip->stat->glbhistory);
43828 
43829  return SCIPhistoryGetPseudocostCount(history, dir);
43830 }
43831 
43832 /** gets the average pseudo cost score value over all variables, assuming a fractionality of 0.5,
43833  * only using the pseudo cost information of the current run
43834  *
43835  * @return the average pseudo cost score value over all variables, assuming a fractionality of 0.5,
43836  * only using the pseudo cost information of the current run
43837  *
43838  * @pre This method can be called if SCIP is in one of the following stages:
43839  * - \ref SCIP_STAGE_SOLVING
43840  * - \ref SCIP_STAGE_SOLVED
43841  */
43843  SCIP* scip /**< SCIP data structure */
43844  )
43845 {
43846  SCIP_Real pscostdown;
43847  SCIP_Real pscostup;
43848 
43849  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43850 
43851  pscostdown = SCIPhistoryGetPseudocost(scip->stat->glbhistorycrun, -0.5);
43852  pscostup = SCIPhistoryGetPseudocost(scip->stat->glbhistorycrun, +0.5);
43853 
43854  return SCIPbranchGetScore(scip->set, NULL, pscostdown, pscostup);
43855 }
43856 
43857 /** gets the average conflict score value over all variables
43858  *
43859  * @return the average conflict score value over all variables
43860  *
43861  * @pre This method can be called if SCIP is in one of the following stages:
43862  * - \ref SCIP_STAGE_SOLVING
43863  * - \ref SCIP_STAGE_SOLVED
43864  */
43866  SCIP* scip /**< SCIP data structure */
43867  )
43868 {
43869  SCIP_Real conflictscoredown;
43870  SCIP_Real conflictscoreup;
43871  SCIP_Real scale;
43872 
43873  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgConflictScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43874 
43875  scale = scip->transprob->nvars * scip->stat->vsidsweight;
43876  conflictscoredown = SCIPhistoryGetVSIDS(scip->stat->glbhistory, SCIP_BRANCHDIR_DOWNWARDS) / scale;
43877  conflictscoreup = SCIPhistoryGetVSIDS(scip->stat->glbhistory, SCIP_BRANCHDIR_UPWARDS) / scale;
43878 
43879  return SCIPbranchGetScore(scip->set, NULL, conflictscoredown, conflictscoreup);
43880 }
43881 
43882 /** gets the average conflict score value over all variables, only using the conflict score information of the current run
43883  *
43884  * @return the average conflict score value over all variables, only using the conflict score information of the current run
43885  *
43886  * @pre This method can be called if SCIP is in one of the following stages:
43887  * - \ref SCIP_STAGE_SOLVING
43888  * - \ref SCIP_STAGE_SOLVED
43889  */
43891  SCIP* scip /**< SCIP data structure */
43892  )
43893 {
43894  SCIP_Real conflictscoredown;
43895  SCIP_Real conflictscoreup;
43896  SCIP_Real scale;
43897 
43898  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgConflictScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43899 
43900  scale = scip->transprob->nvars * scip->stat->vsidsweight;
43901  conflictscoredown = SCIPhistoryGetVSIDS(scip->stat->glbhistorycrun, SCIP_BRANCHDIR_DOWNWARDS) / scale;
43902  conflictscoreup = SCIPhistoryGetVSIDS(scip->stat->glbhistorycrun, SCIP_BRANCHDIR_UPWARDS) / scale;
43903 
43904  return SCIPbranchGetScore(scip->set, NULL, conflictscoredown, conflictscoreup);
43905 }
43906 
43907 /** gets the average inference score value over all variables
43908  *
43909  * @return the average inference score value over all variables
43910  *
43911  * @pre This method can be called if SCIP is in one of the following stages:
43912  * - \ref SCIP_STAGE_SOLVING
43913  * - \ref SCIP_STAGE_SOLVED
43914  */
43916  SCIP* scip /**< SCIP data structure */
43917  )
43918 {
43919  SCIP_Real conflictlengthdown;
43920  SCIP_Real conflictlengthup;
43921 
43922  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgConflictlengthScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43923 
43926 
43927  return SCIPbranchGetScore(scip->set, NULL, conflictlengthdown, conflictlengthup);
43928 }
43929 
43930 /** gets the average conflictlength score value over all variables, only using the conflictlength information of the
43931  * current run
43932  *
43933  * @return the average conflictlength score value over all variables, only using the conflictlength information of the
43934  * current run
43935  *
43936  * @pre This method can be called if SCIP is in one of the following stages:
43937  * - \ref SCIP_STAGE_SOLVING
43938  * - \ref SCIP_STAGE_SOLVED
43939  */
43941  SCIP* scip /**< SCIP data structure */
43942  )
43943 {
43944  SCIP_Real conflictlengthdown;
43945  SCIP_Real conflictlengthup;
43946 
43947  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgConflictlengthScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43948 
43951 
43952  return SCIPbranchGetScore(scip->set, NULL, conflictlengthdown, conflictlengthup);
43953 }
43954 
43955 /** returns the average number of inferences found after branching in given direction over all variables
43956  *
43957  * @return the average number of inferences found after branching in given direction over all variables
43958  *
43959  * @pre This method can be called if SCIP is in one of the following stages:
43960  * - \ref SCIP_STAGE_SOLVING
43961  * - \ref SCIP_STAGE_SOLVED
43962  */
43964  SCIP* scip, /**< SCIP data structure */
43965  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
43966  )
43967 {
43968  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgInferences", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43969 
43970  return SCIPhistoryGetAvgInferences(scip->stat->glbhistory, dir);
43971 }
43972 
43973 /** returns the average number of inferences found after branching in given direction over all variables,
43974  * only using the inference information of the current run
43975  *
43976  * @return the average number of inferences found after branching in given direction over all variables,
43977  * only using the inference information of the current run
43978  *
43979  * @pre This method can be called if SCIP is in one of the following stages:
43980  * - \ref SCIP_STAGE_SOLVING
43981  * - \ref SCIP_STAGE_SOLVED
43982  */
43984  SCIP* scip, /**< SCIP data structure */
43985  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
43986  )
43987 {
43988  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgInferencesCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43989 
43990  return SCIPhistoryGetAvgInferences(scip->stat->glbhistorycrun, dir);
43991 }
43992 
43993 /** gets the average inference score value over all variables
43994  *
43995  * @return the average inference score value over all variables
43996  *
43997  * @pre This method can be called if SCIP is in one of the following stages:
43998  * - \ref SCIP_STAGE_SOLVING
43999  * - \ref SCIP_STAGE_SOLVED
44000  */
44002  SCIP* scip /**< SCIP data structure */
44003  )
44004 {
44005  SCIP_Real inferencesdown;
44006  SCIP_Real inferencesup;
44007 
44008  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgInferenceScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44009 
44012 
44013  return SCIPbranchGetScore(scip->set, NULL, inferencesdown, inferencesup);
44014 }
44015 
44016 /** gets the average inference score value over all variables, only using the inference information of the
44017  * current run
44018  *
44019  * @return the average inference score value over all variables, only using the inference information of the
44020  * current run
44021  *
44022  * @pre This method can be called if SCIP is in one of the following stages:
44023  * - \ref SCIP_STAGE_SOLVING
44024  * - \ref SCIP_STAGE_SOLVED
44025  */
44027  SCIP* scip /**< SCIP data structure */
44028  )
44029 {
44030  SCIP_Real inferencesdown;
44031  SCIP_Real inferencesup;
44032 
44033  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgInferenceScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44034 
44037 
44038  return SCIPbranchGetScore(scip->set, NULL, inferencesdown, inferencesup);
44039 }
44040 
44041 /** returns the average number of cutoffs found after branching in given direction over all variables
44042  *
44043  * @return the average number of cutoffs found after branching in given direction over all variables
44044  *
44045  * @pre This method can be called if SCIP is in one of the following stages:
44046  * - \ref SCIP_STAGE_SOLVING
44047  * - \ref SCIP_STAGE_SOLVED
44048  */
44050  SCIP* scip, /**< SCIP data structure */
44051  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
44052  )
44053 {
44054  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgCutoffs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44055 
44056  return SCIPhistoryGetAvgCutoffs(scip->stat->glbhistory, dir);
44057 }
44058 
44059 /** returns the average number of cutoffs found after branching in given direction over all variables,
44060  * only using the cutoff information of the current run
44061  *
44062  * @return the average number of cutoffs found after branching in given direction over all variables,
44063  * only using the cutoff information of the current run
44064  *
44065  * @pre This method can be called if SCIP is in one of the following stages:
44066  * - \ref SCIP_STAGE_SOLVING
44067  * - \ref SCIP_STAGE_SOLVED
44068  */
44070  SCIP* scip, /**< SCIP data structure */
44071  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
44072  )
44073 {
44074  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgCutoffsCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44075 
44076  return SCIPhistoryGetAvgCutoffs(scip->stat->glbhistorycrun, dir);
44077 }
44078 
44079 /** gets the average cutoff score value over all variables
44080  *
44081  * @return the average cutoff score value over all variables
44082  *
44083  * @pre This method can be called if SCIP is in one of the following stages:
44084  * - \ref SCIP_STAGE_SOLVING
44085  * - \ref SCIP_STAGE_SOLVED
44086  */
44088  SCIP* scip /**< SCIP data structure */
44089  )
44090 {
44091  SCIP_Real cutoffsdown;
44092  SCIP_Real cutoffsup;
44093 
44094  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgCutoffScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44095 
44098 
44099  return SCIPbranchGetScore(scip->set, NULL, cutoffsdown, cutoffsup);
44100 }
44101 
44102 /** gets the average cutoff score value over all variables, only using the cutoff score information of the current run
44103  *
44104  * @return the average cutoff score value over all variables, only using the cutoff score information of the current run
44105  *
44106  * @pre This method can be called if SCIP is in one of the following stages:
44107  * - \ref SCIP_STAGE_SOLVING
44108  * - \ref SCIP_STAGE_SOLVED
44109  */
44111  SCIP* scip /**< SCIP data structure */
44112  )
44113 {
44114  SCIP_Real cutoffsdown;
44115  SCIP_Real cutoffsup;
44116 
44117  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgCutoffScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44118 
44121 
44122  return SCIPbranchGetScore(scip->set, NULL, cutoffsdown, cutoffsup);
44123 }
44124 
44125 /** computes a deterministic measure of time from statistics
44126  *
44127  * @return the deterministic time
44128  *
44129  * @pre This method can be called if SCIP is in one of the following stages:
44130  * - \ref SCIP_STAGE_PRESOLVING
44131  * - \ref SCIP_STAGE_PRESOLVED
44132  * - \ref SCIP_STAGE_SOLVING
44133  * - \ref SCIP_STAGE_SOLVED
44134  */
44136  SCIP* scip /**< SCIP data structure */
44137  )
44138 {
44139 /* TODO: SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDeterministicTime", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) ); */
44140  if(scip->stat == NULL)
44141  return 0.0;
44142 
44143  return 1e-6 * scip->stat->nnz * (
44144  0.00328285264101 * scip->stat->nprimalresolvelpiterations +
44145  0.00531625104146 * scip->stat->ndualresolvelpiterations +
44146  0.000738719124051 * scip->stat->nprobboundchgs +
44147  0.0011123144764 * scip->stat->nisstoppedcalls );
44148 }
44149 
44150 /** outputs problem to file stream */
44151 static
44153  SCIP* scip, /**< SCIP data structure */
44154  SCIP_PROB* prob, /**< problem data */
44155  FILE* file, /**< output file (or NULL for standard output) */
44156  const char* extension, /**< file format (or NULL for default CIP format) */
44157  SCIP_Bool genericnames /**< using generic variable and constraint names? */
44158  )
44159 {
44160  SCIP_RESULT result;
44161  int i;
44162  assert(scip != NULL);
44163  assert(prob != NULL);
44164 
44165  /* try all readers until one could read the file */
44166  result = SCIP_DIDNOTRUN;
44167  for( i = 0; i < scip->set->nreaders && result == SCIP_DIDNOTRUN; ++i )
44168  {
44169  SCIP_RETCODE retcode;
44170 
44171  if( extension != NULL )
44172  retcode = SCIPreaderWrite(scip->set->readers[i], prob, scip->set, file, extension, genericnames, &result);
44173  else
44174  retcode = SCIPreaderWrite(scip->set->readers[i], prob, scip->set, file, "cip", genericnames, &result);
44175 
44176  /* check for reader errors */
44177  if( retcode == SCIP_WRITEERROR )
44178  return retcode;
44179 
44180  SCIP_CALL( retcode );
44181  }
44182 
44183  switch( result )
44184  {
44185  case SCIP_DIDNOTRUN:
44186  return SCIP_PLUGINNOTFOUND;
44187 
44188  case SCIP_SUCCESS:
44189  return SCIP_OKAY;
44190 
44191  default:
44192  assert(i < scip->set->nreaders);
44193  SCIPerrorMessage("invalid result code <%d> from reader <%s> writing <%s> format\n",
44194  result, SCIPreaderGetName(scip->set->readers[i]), extension);
44195  return SCIP_READERROR;
44196  } /*lint !e788*/
44197 }
44198 
44199 /** outputs original problem to file stream
44200  *
44201  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
44202  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
44203  *
44204  * @pre This method can be called if SCIP is in one of the following stages:
44205  * - \ref SCIP_STAGE_PROBLEM
44206  * - \ref SCIP_STAGE_TRANSFORMING
44207  * - \ref SCIP_STAGE_TRANSFORMED
44208  * - \ref SCIP_STAGE_INITPRESOLVE
44209  * - \ref SCIP_STAGE_PRESOLVING
44210  * - \ref SCIP_STAGE_EXITPRESOLVE
44211  * - \ref SCIP_STAGE_PRESOLVED
44212  * - \ref SCIP_STAGE_INITSOLVE
44213  * - \ref SCIP_STAGE_SOLVING
44214  * - \ref SCIP_STAGE_SOLVED
44215  * - \ref SCIP_STAGE_EXITSOLVE
44216  * - \ref SCIP_STAGE_FREETRANS
44217  */
44219  SCIP* scip, /**< SCIP data structure */
44220  FILE* file, /**< output file (or NULL for standard output) */
44221  const char* extension, /**< file format (or NULL for default CIP format)*/
44222  SCIP_Bool genericnames /**< using generic variable and constraint names? */
44223  )
44224 {
44225  SCIP_RETCODE retcode;
44226 
44227  SCIP_CALL( checkStage(scip, "SCIPprintOrigProblem", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
44228 
44229  assert(scip != NULL);
44230  assert( scip->origprob != NULL );
44231 
44232  retcode = printProblem(scip, scip->origprob, file, extension, genericnames);
44233 
44234  /* check for write errors */
44235  if( retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
44236  return retcode;
44237  else
44238  {
44239  SCIP_CALL( retcode );
44240  }
44241 
44242  return SCIP_OKAY;
44243 }
44244 
44245 /** outputs transformed problem of the current node to file stream
44246  *
44247  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
44248  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
44249  *
44250  * @pre This method can be called if SCIP is in one of the following stages:
44251  * - \ref SCIP_STAGE_TRANSFORMED
44252  * - \ref SCIP_STAGE_INITPRESOLVE
44253  * - \ref SCIP_STAGE_PRESOLVING
44254  * - \ref SCIP_STAGE_EXITPRESOLVE
44255  * - \ref SCIP_STAGE_PRESOLVED
44256  * - \ref SCIP_STAGE_INITSOLVE
44257  * - \ref SCIP_STAGE_SOLVING
44258  * - \ref SCIP_STAGE_SOLVED
44259  * - \ref SCIP_STAGE_EXITSOLVE
44260  * - \ref SCIP_STAGE_FREETRANS
44261  */
44263  SCIP* scip, /**< SCIP data structure */
44264  FILE* file, /**< output file (or NULL for standard output) */
44265  const char* extension, /**< file format (or NULL for default CIP format)*/
44266  SCIP_Bool genericnames /**< using generic variable and constraint names? */
44267  )
44268 {
44269  SCIP_RETCODE retcode;
44270 
44271  SCIP_CALL( checkStage(scip, "SCIPprintTransProblem", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
44272 
44273  assert(scip != NULL);
44274  assert(scip->transprob != NULL );
44275 
44276  retcode = printProblem(scip, scip->transprob, file, extension, genericnames);
44277 
44278  /* check for write errors */
44279  if( retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
44280  return retcode;
44281  else
44282  {
44283  SCIP_CALL( retcode );
44284  }
44285 
44286  return SCIP_OKAY;
44287 }
44288 
44289 /** outputs status statistics
44290  *
44291  * @note If limits have been changed between the solution and the call to this function, the status is recomputed and
44292  * thus may to correspond to the original status.
44293  *
44294  * @pre This method can be called if SCIP is in one of the following stages:
44295  * - \ref SCIP_STAGE_INIT
44296  * - \ref SCIP_STAGE_PROBLEM
44297  * - \ref SCIP_STAGE_TRANSFORMED
44298  * - \ref SCIP_STAGE_INITPRESOLVE
44299  * - \ref SCIP_STAGE_PRESOLVING
44300  * - \ref SCIP_STAGE_EXITPRESOLVE
44301  * - \ref SCIP_STAGE_PRESOLVED
44302  * - \ref SCIP_STAGE_SOLVING
44303  * - \ref SCIP_STAGE_SOLVED
44304  */
44306  SCIP* scip, /**< SCIP data structure */
44307  FILE* file /**< output file */
44308  )
44309 {
44310  assert(scip != NULL);
44311  assert(scip->set != NULL);
44312 
44313  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintStatusStatistics", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44314 
44315  SCIPmessageFPrintInfo(scip->messagehdlr, file, "SCIP Status : ");
44316  SCIP_CALL_ABORT( SCIPprintStage(scip, file) );
44317  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
44318 }
44319 
44320 /** outputs statistics for original problem
44321  *
44322  * @pre This method can be called if SCIP is in one of the following stages:
44323  * - \ref SCIP_STAGE_PROBLEM
44324  * - \ref SCIP_STAGE_TRANSFORMED
44325  * - \ref SCIP_STAGE_INITPRESOLVE
44326  * - \ref SCIP_STAGE_PRESOLVING
44327  * - \ref SCIP_STAGE_EXITPRESOLVE
44328  * - \ref SCIP_STAGE_PRESOLVED
44329  * - \ref SCIP_STAGE_SOLVING
44330  * - \ref SCIP_STAGE_SOLVED
44331  */
44333  SCIP* scip, /**< SCIP data structure */
44334  FILE* file /**< output file */
44335  )
44336 {
44337  assert(scip != NULL);
44338  assert(scip->set != NULL);
44339 
44340  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintOrigProblemStatistics", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44341 
44342  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Original Problem :\n");
44343  SCIPprobPrintStatistics(scip->origprob, scip->set, scip->messagehdlr, file);
44344 }
44345 
44346 /** outputs statistics for transformed problem
44347  *
44348  * @pre This method can be called if SCIP is in one of the following stages:
44349  * - \ref SCIP_STAGE_PROBLEM
44350  * - \ref SCIP_STAGE_TRANSFORMED
44351  * - \ref SCIP_STAGE_INITPRESOLVE
44352  * - \ref SCIP_STAGE_PRESOLVING
44353  * - \ref SCIP_STAGE_EXITPRESOLVE
44354  * - \ref SCIP_STAGE_PRESOLVED
44355  * - \ref SCIP_STAGE_SOLVING
44356  * - \ref SCIP_STAGE_SOLVED
44357  */
44359  SCIP* scip, /**< SCIP data structure */
44360  FILE* file /**< output file */
44361  )
44362 {
44363  assert(scip != NULL);
44364  assert(scip->set != NULL);
44365 
44366  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintTransProblemStatistics", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44367 
44368  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Presolved Problem :\n");
44369  SCIPprobPrintStatistics(scip->transprob, scip->set, scip->messagehdlr, file);
44370 }
44371 
44372 /** outputs presolver statistics
44373  *
44374  * @pre This method can be called if SCIP is in one of the following stages:
44375  * - \ref SCIP_STAGE_TRANSFORMED
44376  * - \ref SCIP_STAGE_INITPRESOLVE
44377  * - \ref SCIP_STAGE_PRESOLVING
44378  * - \ref SCIP_STAGE_EXITPRESOLVE
44379  * - \ref SCIP_STAGE_PRESOLVED
44380  * - \ref SCIP_STAGE_SOLVING
44381  * - \ref SCIP_STAGE_SOLVED
44382  */
44384  SCIP* scip, /**< SCIP data structure */
44385  FILE* file /**< output file */
44386  )
44387 {
44388  int i;
44389 
44390  assert(scip != NULL);
44391  assert(scip->set != NULL);
44392 
44393  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintPresolverStatistics", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44394 
44395  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Presolvers : ExecTime SetupTime Calls FixedVars AggrVars ChgTypes ChgBounds AddHoles DelCons AddCons ChgSides ChgCoefs\n");
44396 
44397  /* sort presolvers w.r.t. their name */
44398  SCIPsetSortPresolsName(scip->set);
44399 
44400  /* presolver statistics */
44401  for( i = 0; i < scip->set->npresols; ++i )
44402  {
44403  SCIP_PRESOL* presol;
44404  presol = scip->set->presols[i];
44405  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPpresolGetName(presol));
44406  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %6d %10d %10d %10d %10d %10d %10d %10d %10d %10d\n",
44407  SCIPpresolGetTime(presol),
44408  SCIPpresolGetSetupTime(presol),
44409  SCIPpresolGetNCalls(presol),
44410  SCIPpresolGetNFixedVars(presol),
44411  SCIPpresolGetNAggrVars(presol),
44412  SCIPpresolGetNChgVarTypes(presol),
44413  SCIPpresolGetNChgBds(presol),
44414  SCIPpresolGetNAddHoles(presol),
44415  SCIPpresolGetNDelConss(presol),
44416  SCIPpresolGetNAddConss(presol),
44417  SCIPpresolGetNChgSides(presol),
44418  SCIPpresolGetNChgCoefs(presol));
44419  }
44420 
44421  /* sort propagators w.r.t. their name */
44422  SCIPsetSortPropsName(scip->set);
44423 
44424  for( i = 0; i < scip->set->nprops; ++i )
44425  {
44426  SCIP_PROP* prop;
44427  prop = scip->set->props[i];
44428  if( SCIPpropDoesPresolve(prop) )
44429  {
44430  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPpropGetName(prop));
44431  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %6d %10d %10d %10d %10d %10d %10d %10d %10d %10d\n",
44432  SCIPpropGetPresolTime(prop),
44433  SCIPpropGetSetupTime(prop),
44435  SCIPpropGetNFixedVars(prop),
44436  SCIPpropGetNAggrVars(prop),
44438  SCIPpropGetNChgBds(prop),
44439  SCIPpropGetNAddHoles(prop),
44440  SCIPpropGetNDelConss(prop),
44441  SCIPpropGetNAddConss(prop),
44442  SCIPpropGetNChgSides(prop),
44443  SCIPpropGetNChgCoefs(prop));
44444  }
44445  }
44446 
44447  /* constraint handler presolving methods statistics */
44448  for( i = 0; i < scip->set->nconshdlrs; ++i )
44449  {
44450  SCIP_CONSHDLR* conshdlr;
44451  int maxnactiveconss;
44452 
44453  conshdlr = scip->set->conshdlrs[i];
44454  maxnactiveconss = SCIPconshdlrGetMaxNActiveConss(conshdlr);
44455  if( SCIPconshdlrDoesPresolve(conshdlr)
44456  && (maxnactiveconss > 0 || !SCIPconshdlrNeedsCons(conshdlr)
44457  || SCIPconshdlrGetNFixedVars(conshdlr) > 0
44458  || SCIPconshdlrGetNAggrVars(conshdlr) > 0
44459  || SCIPconshdlrGetNChgVarTypes(conshdlr) > 0
44460  || SCIPconshdlrGetNChgBds(conshdlr) > 0
44461  || SCIPconshdlrGetNAddHoles(conshdlr) > 0
44462  || SCIPconshdlrGetNDelConss(conshdlr) > 0
44463  || SCIPconshdlrGetNAddConss(conshdlr) > 0
44464  || SCIPconshdlrGetNChgSides(conshdlr) > 0
44465  || SCIPconshdlrGetNChgCoefs(conshdlr) > 0
44466  || SCIPconshdlrGetNUpgdConss(conshdlr) > 0) )
44467  {
44468  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPconshdlrGetName(conshdlr));
44469  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %6d %10d %10d %10d %10d %10d %10d %10d %10d %10d\n",
44470  SCIPconshdlrGetPresolTime(conshdlr),
44471  SCIPconshdlrGetSetupTime(conshdlr),
44472  SCIPconshdlrGetNPresolCalls(conshdlr),
44473  SCIPconshdlrGetNFixedVars(conshdlr),
44474  SCIPconshdlrGetNAggrVars(conshdlr),
44475  SCIPconshdlrGetNChgVarTypes(conshdlr),
44476  SCIPconshdlrGetNChgBds(conshdlr),
44477  SCIPconshdlrGetNAddHoles(conshdlr),
44478  SCIPconshdlrGetNDelConss(conshdlr),
44479  SCIPconshdlrGetNAddConss(conshdlr),
44480  SCIPconshdlrGetNChgSides(conshdlr),
44481  SCIPconshdlrGetNChgCoefs(conshdlr));
44482  }
44483  }
44484 
44485  /* root node bound changes */
44486  SCIPmessageFPrintInfo(scip->messagehdlr, file, " root node : - - - %10d - - %10d - - - - -\n",
44487  scip->stat->nrootintfixings, scip->stat->nrootboundchgs);
44488 }
44489 
44490 /** outputs constraint statistics
44491  *
44492  * @pre This method can be called if SCIP is in one of the following stages:
44493  * - \ref SCIP_STAGE_TRANSFORMED
44494  * - \ref SCIP_STAGE_INITPRESOLVE
44495  * - \ref SCIP_STAGE_PRESOLVING
44496  * - \ref SCIP_STAGE_EXITPRESOLVE
44497  * - \ref SCIP_STAGE_PRESOLVED
44498  * - \ref SCIP_STAGE_SOLVING
44499  * - \ref SCIP_STAGE_SOLVED
44500  */
44502  SCIP* scip, /**< SCIP data structure */
44503  FILE* file /**< output file */
44504  )
44505 {
44506  int i;
44507 
44508  assert(scip != NULL);
44509  assert(scip->set != NULL);
44510 
44511  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintConstraintStatistics", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44512 
44513  /* Add maximal number of constraints of the same type? So far this information is not added because of lack of space. */
44514  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Constraints : Number MaxNumber #Separate #Propagate #EnfoLP #EnfoRelax #EnfoPS #Check #ResProp Cutoffs DomReds Cuts Applied Conss Children\n");
44515 
44516  for( i = 0; i < scip->set->nconshdlrs; ++i )
44517  {
44518  SCIP_CONSHDLR* conshdlr;
44519  int startnactiveconss;
44520  int maxnactiveconss;
44521 
44522  conshdlr = scip->set->conshdlrs[i];
44523  startnactiveconss = SCIPconshdlrGetStartNActiveConss(conshdlr);
44524  maxnactiveconss = SCIPconshdlrGetMaxNActiveConss(conshdlr);
44525  if( maxnactiveconss > 0 || !SCIPconshdlrNeedsCons(conshdlr) )
44526  {
44527  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPconshdlrGetName(conshdlr));
44528  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 " %10" SCIP_LONGINT_FORMAT "\n",
44529  startnactiveconss,
44530  maxnactiveconss > startnactiveconss ? '+' : ' ',
44531  maxnactiveconss,
44532  SCIPconshdlrGetNSepaCalls(conshdlr),
44533  SCIPconshdlrGetNPropCalls(conshdlr),
44534  SCIPconshdlrGetNEnfoLPCalls(conshdlr),
44536  SCIPconshdlrGetNEnfoPSCalls(conshdlr),
44537  SCIPconshdlrGetNCheckCalls(conshdlr),
44538  SCIPconshdlrGetNRespropCalls(conshdlr),
44539  SCIPconshdlrGetNCutoffs(conshdlr),
44540  SCIPconshdlrGetNDomredsFound(conshdlr),
44541  SCIPconshdlrGetNCutsFound(conshdlr),
44542  SCIPconshdlrGetNCutsApplied(conshdlr),
44543  SCIPconshdlrGetNConssFound(conshdlr),
44544  SCIPconshdlrGetNChildren(conshdlr));
44545  }
44546  }
44547 }
44548 
44549 /** outputs constraint timing statistics
44550  *
44551  * @pre This method can be called if SCIP is in one of the following stages:
44552  * - \ref SCIP_STAGE_TRANSFORMED
44553  * - \ref SCIP_STAGE_INITPRESOLVE
44554  * - \ref SCIP_STAGE_PRESOLVING
44555  * - \ref SCIP_STAGE_EXITPRESOLVE
44556  * - \ref SCIP_STAGE_PRESOLVED
44557  * - \ref SCIP_STAGE_SOLVING
44558  * - \ref SCIP_STAGE_SOLVED
44559  */
44561  SCIP* scip, /**< SCIP data structure */
44562  FILE* file /**< output file */
44563  )
44564 {
44565  int i;
44566 
44567  assert(scip != NULL);
44568  assert(scip->set != NULL);
44569 
44570  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintConstraintTimingStatistics", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44571 
44572  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Constraint Timings : TotalTime SetupTime Separate Propagate EnfoLP EnfoPS EnfoRelax Check ResProp SB-Prop\n");
44573 
44574  for( i = 0; i < scip->set->nconshdlrs; ++i )
44575  {
44576  SCIP_CONSHDLR* conshdlr;
44577  int maxnactiveconss;
44578 
44579  conshdlr = scip->set->conshdlrs[i];
44580  maxnactiveconss = SCIPconshdlrGetMaxNActiveConss(conshdlr);
44581  if( maxnactiveconss > 0 || !SCIPconshdlrNeedsCons(conshdlr) )
44582  {
44583  SCIP_Real totaltime;
44584 
44585  totaltime = SCIPconshdlrGetSepaTime(conshdlr) + SCIPconshdlrGetPropTime(conshdlr)
44587  + SCIPconshdlrGetEnfoLPTime(conshdlr)
44588  + SCIPconshdlrGetEnfoPSTime(conshdlr)
44589  + SCIPconshdlrGetEnfoRelaxTime(conshdlr)
44590  + SCIPconshdlrGetCheckTime(conshdlr)
44591  + SCIPconshdlrGetRespropTime(conshdlr)
44592  + SCIPconshdlrGetSetupTime(conshdlr);
44593 
44594  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPconshdlrGetName(conshdlr));
44595  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f\n",
44596  totaltime,
44597  SCIPconshdlrGetSetupTime(conshdlr),
44598  SCIPconshdlrGetSepaTime(conshdlr),
44599  SCIPconshdlrGetPropTime(conshdlr),
44600  SCIPconshdlrGetEnfoLPTime(conshdlr),
44601  SCIPconshdlrGetEnfoPSTime(conshdlr),
44602  SCIPconshdlrGetEnfoRelaxTime(conshdlr),
44603  SCIPconshdlrGetCheckTime(conshdlr),
44604  SCIPconshdlrGetRespropTime(conshdlr),
44606  }
44607  }
44608 }
44609 
44610 /** outputs propagator statistics
44611  *
44612  * @pre This method can be called if SCIP is in one of the following stages:
44613  * - \ref SCIP_STAGE_TRANSFORMED
44614  * - \ref SCIP_STAGE_INITPRESOLVE
44615  * - \ref SCIP_STAGE_PRESOLVING
44616  * - \ref SCIP_STAGE_EXITPRESOLVE
44617  * - \ref SCIP_STAGE_PRESOLVED
44618  * - \ref SCIP_STAGE_SOLVING
44619  * - \ref SCIP_STAGE_SOLVED
44620  */
44622  SCIP* scip, /**< SCIP data structure */
44623  FILE* file /**< output file */
44624  )
44625 {
44626  int i;
44627 
44628  assert(scip != NULL);
44629  assert(scip->set != NULL);
44630 
44631  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintPropagatorStatistics", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44632 
44633  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Propagators : #Propagate #ResProp Cutoffs DomReds\n");
44634 
44635  /* sort propagaters w.r.t. their name */
44636  SCIPsetSortPropsName(scip->set);
44637 
44638  for( i = 0; i < scip->set->nprops; ++i )
44639  {
44640  SCIP_PROP* prop;
44641  prop = scip->set->props[i];
44642 
44643  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
44644  SCIPpropGetName(prop),
44645  SCIPpropGetNCalls(prop),
44647  SCIPpropGetNCutoffs(prop),
44648  SCIPpropGetNDomredsFound(prop));
44649  }
44650 
44651  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Propagator Timings : TotalTime SetupTime Presolve Propagate ResProp SB-Prop\n");
44652 
44653  for( i = 0; i < scip->set->nprops; ++i )
44654  {
44655  SCIP_PROP* prop;
44656  SCIP_Real totaltime;
44657 
44658  prop = scip->set->props[i];
44659  totaltime = SCIPpropGetPresolTime(prop) + SCIPpropGetTime(prop) + SCIPpropGetRespropTime(prop)
44661 
44662  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPpropGetName(prop));
44663  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f\n",
44664  totaltime,
44665  SCIPpropGetSetupTime(prop),
44666  SCIPpropGetPresolTime(prop),
44667  SCIPpropGetTime(prop),
44668  SCIPpropGetRespropTime(prop),
44670  }
44671 }
44672 
44673 /** outputs conflict statistics
44674  *
44675  * @pre This method can be called if SCIP is in one of the following stages:
44676  * - \ref SCIP_STAGE_TRANSFORMED
44677  * - \ref SCIP_STAGE_INITPRESOLVE
44678  * - \ref SCIP_STAGE_PRESOLVING
44679  * - \ref SCIP_STAGE_EXITPRESOLVE
44680  * - \ref SCIP_STAGE_PRESOLVED
44681  * - \ref SCIP_STAGE_SOLVING
44682  * - \ref SCIP_STAGE_SOLVED
44683  */
44685  SCIP* scip, /**< SCIP data structure */
44686  FILE* file /**< output file */
44687  )
44688 {
44689  char initstoresize[SCIP_MAXSTRLEN];
44690  char maxstoresize[SCIP_MAXSTRLEN];
44691 
44692  assert(scip != NULL);
44693  assert(scip->set != NULL);
44694 
44695  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintConflictStatistics", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44696 
44697  if( scip->set->conf_maxstoresize == 0 )
44698  {
44699  (void)SCIPsnprintf(initstoresize, SCIP_MAXSTRLEN, "inf");
44700  (void)SCIPsnprintf(maxstoresize, SCIP_MAXSTRLEN, "inf");
44701  }
44702  else
44703  {
44704  int initsize = SCIPconflictstoreGetInitPoolSize(scip->conflictstore);
44705  int maxsize = SCIPconflictstoreGetMaxPoolSize(scip->conflictstore);
44706 
44707  if( maxsize == -1 )
44708  {
44709  (void)SCIPsnprintf(initstoresize, SCIP_MAXSTRLEN, "--");
44710  (void)SCIPsnprintf(maxstoresize, SCIP_MAXSTRLEN, "--");
44711  }
44712  else
44713  {
44714  assert(initsize >= 0);
44715  assert(maxsize >= 0);
44716 
44717  (void)SCIPsnprintf(initstoresize, SCIP_MAXSTRLEN, "%d", initsize);
44718  (void)SCIPsnprintf(maxstoresize, SCIP_MAXSTRLEN, "%d", maxsize);
44719  }
44720  }
44721  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Conflict Analysis : Time Calls Success DomReds Conflicts Literals Reconvs ReconvLits Dualrays Nonzeros LP Iters (pool size: [%s,%s])\n", initstoresize, maxstoresize);
44722  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",
44734  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 " %10.1f %10" SCIP_LONGINT_FORMAT "\n",
44751  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 " %10.1f %10" SCIP_LONGINT_FORMAT "\n",
44768  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",
44781  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",
44793  SCIPmessageFPrintInfo(scip->messagehdlr, file, " applied globally : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.1f - - %10" SCIP_LONGINT_FORMAT " - -\n",
44801  SCIPmessageFPrintInfo(scip->messagehdlr, file, " applied locally : - - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.1f - - %10" SCIP_LONGINT_FORMAT " - -\n",
44809 }
44810 
44811 /** outputs separator statistics
44812  *
44813  * @pre This method can be called if SCIP is in one of the following stages:
44814  * - \ref SCIP_STAGE_SOLVING
44815  * - \ref SCIP_STAGE_SOLVED
44816  */
44818  SCIP* scip, /**< SCIP data structure */
44819  FILE* file /**< output file */
44820  )
44821 {
44822  int i;
44823 
44824  assert(scip != NULL);
44825  assert(scip->set != NULL);
44826 
44827  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintSeparatorStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44828 
44829  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Separators : ExecTime SetupTime Calls Cutoffs DomReds Cuts Applied Conss\n");
44830  SCIPmessageFPrintInfo(scip->messagehdlr, file, " cut pool : %10.2f %10" SCIP_LONGINT_FORMAT " - - %10" SCIP_LONGINT_FORMAT " - - (maximal pool size: %d)\n",
44831  SCIPcutpoolGetTime(scip->cutpool),
44835 
44836  /* sort separators w.r.t. their name */
44837  SCIPsetSortSepasName(scip->set);
44838 
44839  for( i = 0; i < scip->set->nsepas; ++i )
44840  {
44841  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",
44842  SCIPsepaGetName(scip->set->sepas[i]),
44843  SCIPsepaGetTime(scip->set->sepas[i]),
44844  SCIPsepaGetSetupTime(scip->set->sepas[i]),
44845  SCIPsepaGetNCalls(scip->set->sepas[i]),
44846  SCIPsepaGetNCutoffs(scip->set->sepas[i]),
44847  SCIPsepaGetNDomredsFound(scip->set->sepas[i]),
44848  SCIPsepaGetNCutsFound(scip->set->sepas[i]),
44849  SCIPsepaGetNCutsApplied(scip->set->sepas[i]),
44850  SCIPsepaGetNConssFound(scip->set->sepas[i]));
44851  }
44852 }
44853 
44854 /** outputs pricer statistics
44855  *
44856  * @pre This method can be called if SCIP is in one of the following stages:
44857  * - \ref SCIP_STAGE_SOLVING
44858  * - \ref SCIP_STAGE_SOLVED
44859  */
44861  SCIP* scip, /**< SCIP data structure */
44862  FILE* file /**< output file */
44863  )
44864 {
44865  int i;
44866 
44867  assert(scip != NULL);
44868  assert(scip->set != NULL);
44869 
44870  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintPricerStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44871 
44872  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Pricers : ExecTime SetupTime Calls Vars\n");
44873  SCIPmessageFPrintInfo(scip->messagehdlr, file, " problem variables: %10.2f - %10d %10d\n",
44877 
44878  /* sort pricers w.r.t. their name */
44879  SCIPsetSortPricersName(scip->set);
44880 
44881  for( i = 0; i < scip->set->nactivepricers; ++i )
44882  {
44883  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10.2f %10d %10d\n",
44884  SCIPpricerGetName(scip->set->pricers[i]),
44885  SCIPpricerGetTime(scip->set->pricers[i]),
44886  SCIPpricerGetSetupTime(scip->set->pricers[i]),
44887  SCIPpricerGetNCalls(scip->set->pricers[i]),
44888  SCIPpricerGetNVarsFound(scip->set->pricers[i]));
44889  }
44890 }
44891 
44892 /** outputs branching rule statistics
44893  *
44894  * @pre This method can be called if SCIP is in one of the following stages:
44895  * - \ref SCIP_STAGE_SOLVING
44896  * - \ref SCIP_STAGE_SOLVED
44897  */
44899  SCIP* scip, /**< SCIP data structure */
44900  FILE* file /**< output file */
44901  )
44902 {
44903  int i;
44904 
44905  assert(scip != NULL);
44906  assert(scip->set != NULL);
44907 
44908  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintBranchruleStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44909 
44910  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Branching Rules : ExecTime SetupTime BranchLP BranchExt BranchPS Cutoffs DomReds Cuts Conss Children\n");
44911 
44912  /* sort branching rules w.r.t. their name */
44914 
44915  for( i = 0; i < scip->set->nbranchrules; ++i )
44916  {
44917  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",
44929  }
44930 }
44931 
44932 /** outputs heuristics statistics
44933  *
44934  * @pre This method can be called if SCIP is in one of the following stages:
44935  * - \ref SCIP_STAGE_PRESOLVING
44936  * - \ref SCIP_STAGE_EXITPRESOLVE
44937  * - \ref SCIP_STAGE_PRESOLVED
44938  * - \ref SCIP_STAGE_SOLVING
44939  * - \ref SCIP_STAGE_SOLVED
44940  */
44942  SCIP* scip, /**< SCIP data structure */
44943  FILE* file /**< output file */
44944  )
44945 {
44946  int ndivesets = 0;
44947  int i;
44948 
44949  assert(scip != NULL);
44950  assert(scip->set != NULL);
44951  assert(scip->tree != NULL);
44952 
44953  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintHeuristicStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44954 
44955  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Primal Heuristics : ExecTime SetupTime Calls Found Best\n");
44956  SCIPmessageFPrintInfo(scip->messagehdlr, file, " LP solutions : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
44958  scip->stat->nlpsolsfound, scip->stat->nlpbestsolsfound);
44959  SCIPmessageFPrintInfo(scip->messagehdlr, file, " relax solutions : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
44961  scip->stat->nrelaxsolsfound, scip->stat->nrelaxbestsolsfound);
44962  SCIPmessageFPrintInfo(scip->messagehdlr, file, " pseudo solutions : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
44964  scip->stat->npssolsfound, scip->stat->npsbestsolsfound);
44965  SCIPmessageFPrintInfo(scip->messagehdlr, file, " strong branching : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
44967  scip->stat->nsbsolsfound, scip->stat->nsbbestsolsfound);
44968 
44969  /* sort heuristics w.r.t. their names */
44970  SCIPsetSortHeursName(scip->set);
44971 
44972  for( i = 0; i < scip->set->nheurs; ++i )
44973  {
44974  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
44975  SCIPheurGetName(scip->set->heurs[i]),
44976  SCIPheurGetTime(scip->set->heurs[i]),
44977  SCIPheurGetSetupTime(scip->set->heurs[i]),
44978  SCIPheurGetNCalls(scip->set->heurs[i]),
44979  SCIPheurGetNSolsFound(scip->set->heurs[i]),
44980  SCIPheurGetNBestSolsFound(scip->set->heurs[i]));
44981 
44982  /* count heuristics that use diving; needed to determine output later */
44983  ndivesets += SCIPheurGetNDivesets(scip->set->heurs[i]);
44984  }
44985 
44986  SCIPmessageFPrintInfo(scip->messagehdlr, file, " other solutions : - - - %10" SCIP_LONGINT_FORMAT " -\n",
44987  scip->stat->nexternalsolsfound);
44988 
44989  if ( ndivesets > 0 )
44990  {
44991  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Diving Statistics : Calls Nodes LP Iters Backtracks MinDepth MaxDepth AvgDepth RoundSols NLeafSols MinSolDpt MaxSolDpt AvgSolDpt\n");
44992  for( i = 0; i < scip->set->nheurs; ++i )
44993  {
44994  int s;
44995  for( s = 0; s < SCIPheurGetNDivesets(scip->set->heurs[i]); ++s )
44996  {
44997  SCIP_DIVESET* diveset = SCIPheurGetDivesets(scip->set->heurs[i])[s];
44998  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10d", SCIPdivesetGetName(diveset), SCIPdivesetGetNCalls(diveset));
44999  if( SCIPdivesetGetNCalls(diveset) > 0 )
45000  {
45001  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10d %10d %10.1f %10" SCIP_LONGINT_FORMAT,
45002  SCIPdivesetGetNProbingNodes(diveset),
45003  SCIPdivesetGetNLPIterations(diveset),
45004  SCIPdivesetGetNBacktracks(diveset),
45005  SCIPdivesetGetMinDepth(diveset),
45006  SCIPdivesetGetMaxDepth(diveset),
45007  SCIPdivesetGetAvgDepth(diveset),
45009 
45010  if( SCIPdivesetGetNSolutionCalls(diveset) > 0 )
45011  {
45012  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10d %10d %10d %10.1f\n",
45017  }
45018  else
45019  SCIPmessageFPrintInfo(scip->messagehdlr, file, " - - - -\n");
45020  }
45021  else
45022  SCIPmessageFPrintInfo(scip->messagehdlr, file, " - - - - - - - - - - -\n");
45023  }
45024  }
45025  }
45026 }
45027 
45028 /** outputs compression statistics
45029  *
45030  * @pre This method can be called if SCIP is in one of the following stages:
45031  * - \ref SCIP_STAGE_PRESOLVING
45032  * - \ref SCIP_STAGE_EXITPRESOLVE
45033  * - \ref SCIP_STAGE_PRESOLVED
45034  * - \ref SCIP_STAGE_SOLVING
45035  * - \ref SCIP_STAGE_SOLVED
45036  */
45038  SCIP* scip, /**< SCIP data structure */
45039  FILE* file /**< output file */
45040  )
45041 {
45042  int i;
45043 
45044  assert(scip != NULL);
45045 
45046  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintCompressionStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45047 
45048  /* only print compression statistics if tree reoptimization is enabled */
45049  if( !scip->set->reopt_enable )
45050  return;
45051 
45052  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Tree Compressions : ExecTime SetupTime Calls Found\n");
45053 
45054  /* sort compressions w.r.t. their names */
45055  SCIPsetSortComprsName(scip->set);
45056 
45057  for( i = 0; i < scip->set->ncomprs; ++i )
45058  {
45059  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
45060  SCIPcomprGetName(scip->set->comprs[i]),
45061  SCIPcomprGetTime(scip->set->comprs[i]),
45062  SCIPcomprGetSetupTime(scip->set->comprs[i]),
45063  SCIPcomprGetNCalls(scip->set->comprs[i]),
45064  SCIPcomprGetNFound(scip->set->comprs[i]));
45065  }
45066 }
45067 
45068 /** outputs LP statistics
45069  *
45070  * @pre This method can be called if SCIP is in one of the following stages:
45071  * - \ref SCIP_STAGE_SOLVING
45072  * - \ref SCIP_STAGE_SOLVED
45073  */
45075  SCIP* scip, /**< SCIP data structure */
45076  FILE* file /**< output file */
45077  )
45078 {
45079  assert(scip != NULL);
45080  assert(scip->stat != NULL);
45081  assert(scip->lp != NULL);
45082 
45083  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintLPStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45084 
45085  SCIPmessageFPrintInfo(scip->messagehdlr, file, "LP : Time Calls Iterations Iter/call Iter/sec Time-0-It Calls-0-It ItLimit\n");
45086 
45087  SCIPmessageFPrintInfo(scip->messagehdlr, file, " primal LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
45089  scip->stat->nprimallps + scip->stat->nprimalzeroitlps,
45090  scip->stat->nprimallpiterations,
45091  scip->stat->nprimallps > 0 ? (SCIP_Real)scip->stat->nprimallpiterations/(SCIP_Real)scip->stat->nprimallps : 0.0);
45092  if( SCIPclockGetTime(scip->stat->primallptime) >= 0.01 )
45094  else
45095  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -");
45096  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10" SCIP_LONGINT_FORMAT "\n",
45097  scip->stat->primalzeroittime,
45098  scip->stat->nprimalzeroitlps);
45099 
45100  SCIPmessageFPrintInfo(scip->messagehdlr, file, " dual LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
45102  scip->stat->nduallps + scip->stat->ndualzeroitlps,
45103  scip->stat->nduallpiterations,
45104  scip->stat->nduallps > 0 ? (SCIP_Real)scip->stat->nduallpiterations/(SCIP_Real)scip->stat->nduallps : 0.0);
45105  if( SCIPclockGetTime(scip->stat->duallptime) >= 0.01 )
45107  else
45108  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -");
45109  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10" SCIP_LONGINT_FORMAT "\n",
45110  scip->stat->dualzeroittime,
45111  scip->stat->ndualzeroitlps);
45112 
45113  SCIPmessageFPrintInfo(scip->messagehdlr, file, " lex dual LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
45115  scip->stat->nlexduallps,
45116  scip->stat->nlexduallpiterations,
45117  scip->stat->nlexduallps > 0 ? (SCIP_Real)scip->stat->nlexduallpiterations/(SCIP_Real)scip->stat->nlexduallps : 0.0);
45118  if( SCIPclockGetTime(scip->stat->lexduallptime) >= 0.01 )
45120  else
45121  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -\n");
45122 
45123  SCIPmessageFPrintInfo(scip->messagehdlr, file, " barrier LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
45125  scip->stat->nbarrierlps,
45126  scip->stat->nbarrierlpiterations,
45127  scip->stat->nbarrierlps > 0 ? (SCIP_Real)scip->stat->nbarrierlpiterations/(SCIP_Real)scip->stat->nbarrierlps : 0.0);
45128  if( SCIPclockGetTime(scip->stat->barrierlptime) >= 0.01 )
45130  else
45131  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -");
45132  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10" SCIP_LONGINT_FORMAT "\n",
45133  scip->stat->barrierzeroittime,
45134  scip->stat->nbarrierzeroitlps);
45135 
45136  SCIPmessageFPrintInfo(scip->messagehdlr, file, " diving/probing LP: %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
45138  scip->stat->ndivinglps,
45139  scip->stat->ndivinglpiterations,
45140  scip->stat->ndivinglps > 0 ? (SCIP_Real)scip->stat->ndivinglpiterations/(SCIP_Real)scip->stat->ndivinglps : 0.0);
45141  if( SCIPclockGetTime(scip->stat->divinglptime) >= 0.01 )
45143  else
45144  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -\n");
45145 
45146  SCIPmessageFPrintInfo(scip->messagehdlr, file, " strong branching : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
45148  scip->stat->nstrongbranchs,
45149  scip->stat->nsblpiterations,
45150  scip->stat->nstrongbranchs > 0 ? (SCIP_Real)scip->stat->nsblpiterations/(SCIP_Real)scip->stat->nstrongbranchs : 0.0);
45151  if( SCIPclockGetTime(scip->stat->strongbranchtime) >= 0.01 )
45153  else
45154  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -");
45155  SCIPmessageFPrintInfo(scip->messagehdlr, file, " - - %10d\n", scip->stat->nsbtimesiterlimhit);
45156 
45157  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (at root node) : - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f -\n",
45158  scip->stat->nrootstrongbranchs,
45159  scip->stat->nrootsblpiterations,
45160  scip->stat->nrootstrongbranchs > 0
45162 
45163  SCIPmessageFPrintInfo(scip->messagehdlr, file, " conflict analysis: %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
45165  scip->stat->nconflictlps,
45166  scip->stat->nconflictlpiterations,
45167  scip->stat->nconflictlps > 0 ? (SCIP_Real)scip->stat->nconflictlpiterations/(SCIP_Real)scip->stat->nconflictlps : 0.0);
45168  if( SCIPclockGetTime(scip->stat->conflictlptime) >= 0.01 )
45170  else
45171  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -\n");
45172 }
45173 
45174 /** outputs NLP statistics
45175  *
45176  * @pre This method can be called if SCIP is in one of the following stages:
45177  * - \ref SCIP_STAGE_SOLVING
45178  * - \ref SCIP_STAGE_SOLVED
45179  */
45181  SCIP* scip, /**< SCIP data structure */
45182  FILE* file /**< output file */
45183  )
45184 {
45185  assert(scip != NULL);
45186  assert(scip->stat != NULL);
45187 
45188  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintNLPStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45189 
45190  if( scip->nlp == NULL )
45191  return;
45192 
45193  SCIPmessageFPrintInfo(scip->messagehdlr, file, "NLP : Time Calls\n");
45194 
45195  SCIPmessageFPrintInfo(scip->messagehdlr, file, " all NLPs : %10.2f %10" SCIP_LONGINT_FORMAT "\n",
45197  scip->stat->nnlps);
45198 }
45199 
45200 /** outputs relaxator statistics
45201  *
45202  * @pre This method can be called if SCIP is in one of the following stages:
45203  * - \ref SCIP_STAGE_SOLVING
45204  * - \ref SCIP_STAGE_SOLVED
45205  */
45207  SCIP* scip, /**< SCIP data structure */
45208  FILE* file /**< output file */
45209  )
45210 {
45211  int i;
45212 
45213  assert(scip != NULL);
45214  assert(scip->set != NULL);
45215 
45216  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintRelaxatorStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45217 
45218  if( scip->set->nrelaxs == 0 )
45219  return;
45220 
45221  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Relaxators : Time Calls\n");
45222 
45223  /* sort relaxators w.r.t. their name */
45224  SCIPsetSortRelaxsName(scip->set);
45225 
45226  for( i = 0; i < scip->set->nrelaxs; ++i )
45227  {
45228  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10" SCIP_LONGINT_FORMAT "\n",
45229  SCIPrelaxGetName(scip->set->relaxs[i]),
45230  SCIPrelaxGetTime(scip->set->relaxs[i]),
45231  SCIPrelaxGetNCalls(scip->set->relaxs[i]));
45232  }
45233 }
45234 
45235 /** outputs tree statistics
45236  *
45237  * @pre This method can be called if SCIP is in one of the following stages:
45238  * - \ref SCIP_STAGE_SOLVING
45239  * - \ref SCIP_STAGE_SOLVED
45240  */
45242  SCIP* scip, /**< SCIP data structure */
45243  FILE* file /**< output file */
45244  )
45245 {
45246  assert(scip != NULL);
45247  assert(scip->stat != NULL);
45248  assert(scip->tree != NULL);
45249 
45250  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintTreeStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45251 
45252  SCIPmessageFPrintInfo(scip->messagehdlr, file, "B&B Tree :\n");
45253  SCIPmessageFPrintInfo(scip->messagehdlr, file, " number of runs : %10d\n", scip->stat->nruns);
45254  SCIPmessageFPrintInfo(scip->messagehdlr, file,
45255  " nodes : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " internal, %" SCIP_LONGINT_FORMAT " leaves)\n",
45256  scip->stat->nnodes, scip->stat->ninternalnodes, scip->stat->nnodes - scip->stat->ninternalnodes );
45257  SCIPmessageFPrintInfo(scip->messagehdlr, file, " feasible leaves : %10d\n", scip->stat->nfeasleaves);
45258  SCIPmessageFPrintInfo(scip->messagehdlr, file, " infeas. leaves : %10d\n", scip->stat->ninfeasleaves);
45259  SCIPmessageFPrintInfo(scip->messagehdlr, file, " objective leaves : %10d\n", scip->stat->nobjleaves);
45260  SCIPmessageFPrintInfo(scip->messagehdlr, file,
45261  " nodes (total) : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " internal, %" SCIP_LONGINT_FORMAT " leaves)\n",
45263  SCIPmessageFPrintInfo(scip->messagehdlr, file, " nodes left : %10d\n", SCIPtreeGetNNodes(scip->tree));
45264  SCIPmessageFPrintInfo(scip->messagehdlr, file, " max depth : %10d\n", scip->stat->maxdepth);
45265  SCIPmessageFPrintInfo(scip->messagehdlr, file, " max depth (total): %10d\n", scip->stat->maxtotaldepth);
45266  SCIPmessageFPrintInfo(scip->messagehdlr, file, " backtracks : %10" SCIP_LONGINT_FORMAT " (%.1f%%)\n", scip->stat->nbacktracks,
45267  scip->stat->nnodes > 0 ? 100.0 * (SCIP_Real)scip->stat->nbacktracks / (SCIP_Real)scip->stat->nnodes : 0.0);
45268  SCIPmessageFPrintInfo(scip->messagehdlr, file, " early backtracks : %10" SCIP_LONGINT_FORMAT " (%.1f%%)\n", scip->stat->nearlybacktracks,
45269  scip->stat->nbacktracks > 0 ? 100.0 * (SCIP_Real)scip->stat->nearlybacktracks / (SCIP_Real)scip->stat->nbacktracks : 0.0);
45270  SCIPmessageFPrintInfo(scip->messagehdlr, file, " nodes exc. ref. : %10" SCIP_LONGINT_FORMAT " (%.1f%%)\n", scip->stat->nnodesaboverefbound,
45271  scip->stat->nnodes > 0 ? 100.0 * (SCIP_Real)scip->stat->nnodesaboverefbound / (SCIP_Real)scip->stat->nnodes : 0.0);
45272 
45273  SCIPmessageFPrintInfo(scip->messagehdlr, file, " delayed cutoffs : %10" SCIP_LONGINT_FORMAT "\n", scip->stat->ndelayedcutoffs);
45274  SCIPmessageFPrintInfo(scip->messagehdlr, file, " repropagations : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " domain reductions, %" SCIP_LONGINT_FORMAT " cutoffs)\n",
45275  scip->stat->nreprops, scip->stat->nrepropboundchgs, scip->stat->nrepropcutoffs);
45276  SCIPmessageFPrintInfo(scip->messagehdlr, file, " avg switch length: %10.2f\n",
45277  scip->stat->nnodes > 0
45278  ? (SCIP_Real)(scip->stat->nactivatednodes + scip->stat->ndeactivatednodes) / (SCIP_Real)scip->stat->nnodes : 0.0);
45279  SCIPmessageFPrintInfo(scip->messagehdlr, file, " switching time : %10.2f\n", SCIPclockGetTime(scip->stat->nodeactivationtime));
45280 }
45281 
45282 /** outputs solution statistics
45283  *
45284  * @pre This method can be called if SCIP is in one of the following stages:
45285  * - \ref SCIP_STAGE_PRESOLVING
45286  * - \ref SCIP_STAGE_EXITPRESOLVE
45287  * - \ref SCIP_STAGE_PRESOLVED
45288  * - \ref SCIP_STAGE_SOLVING
45289  * - \ref SCIP_STAGE_SOLVED
45290  */
45292  SCIP* scip, /**< SCIP data structure */
45293  FILE* file /**< output file */
45294  )
45295 {
45296  SCIP_Real primalbound;
45297  SCIP_Real dualbound;
45298  SCIP_Real bestsol;
45299  SCIP_Real gap;
45300  SCIP_Real firstprimalbound;
45301  SCIP_Bool objlimitreached;
45302  char limsolstring[SCIP_MAXSTRLEN];
45303 
45304  assert(scip != NULL);
45305  assert(scip->stat != NULL);
45306  assert(scip->primal != NULL);
45307 
45308  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintSolutionStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45309 
45310  primalbound = getPrimalbound(scip);
45311  dualbound = getDualbound(scip);
45312  gap = SCIPgetGap(scip);
45313 
45314  objlimitreached = FALSE;
45315  if( SCIPgetStage(scip) == SCIP_STAGE_SOLVED && scip->primal->nlimsolsfound == 0
45316  && !SCIPisInfinity(scip, primalbound) )
45317  objlimitreached = TRUE;
45318 
45319  if( scip->primal->nsolsfound != scip->primal->nlimsolsfound )
45320  (void) SCIPsnprintf(limsolstring, SCIP_MAXSTRLEN, ", %" SCIP_LONGINT_FORMAT " respecting the objective limit", scip->primal->nlimsolsfound);
45321  else
45322  limsolstring[0] = '\0';
45323 
45324  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Solution :\n");
45325  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Solutions found : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " improvements%s)\n",
45326  scip->primal->nsolsfound, scip->primal->nbestsolsfound, limsolstring);
45327 
45328  if( objlimitreached || SCIPsetIsInfinity(scip->set, REALABS(primalbound)) )
45329  {
45330  if( scip->set->stage == SCIP_STAGE_SOLVED )
45331  {
45332  if( scip->primal->nlimsolsfound == 0 )
45333  {
45334  if( SCIPgetStatus(scip) == SCIP_STATUS_INFORUNBD )
45335  {
45336  assert(!objlimitreached);
45337  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : infeasible or unbounded\n");
45338  }
45339  else
45340  {
45341  assert(SCIPgetStatus(scip) == SCIP_STATUS_INFEASIBLE);
45342  if( objlimitreached )
45343  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : infeasible (objective limit reached)\n");
45344  else
45345  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : infeasible\n");
45346  }
45347  }
45348  else
45349  {
45350  assert(!objlimitreached);
45351  assert(SCIPgetStatus(scip) == SCIP_STATUS_UNBOUNDED);
45352  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : unbounded\n");
45353  }
45354  }
45355  else
45356  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : -\n");
45357  }
45358  else
45359  {
45360  if( scip->primal->nlimsolsfound == 0 )
45361  {
45362  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : %+21.14e", primalbound);
45363  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (user objective limit)\n");
45364  }
45365  else
45366  {
45367  /* display first primal bound line */
45368  firstprimalbound = scip->stat->firstprimalbound;
45369  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First Solution : %+21.14e", firstprimalbound);
45370 
45371  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (in run %d, after %" SCIP_LONGINT_FORMAT " nodes, %.2f seconds, depth %d, found by <%s>)\n",
45372  scip->stat->nrunsbeforefirst,
45373  scip->stat->nnodesbeforefirst,
45374  scip->stat->firstprimaltime,
45375  scip->stat->firstprimaldepth,
45376  ( scip->stat->firstprimalheur != NULL )
45377  ? ( SCIPheurGetName(scip->stat->firstprimalheur) )
45378  : (( scip->stat->nrunsbeforefirst == 0 ) ? "initial" : "relaxation"));
45379 
45380  if( SCIPisInfinity(scip, scip->stat->firstsolgap) )
45381  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap First Sol. : infinite\n");
45382  else
45383  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap First Sol. : %10.2f %%\n", 100.0 * scip->stat->firstsolgap);
45384 
45385  if( SCIPisInfinity(scip, scip->stat->lastsolgap) )
45386  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap Last Sol. : infinite\n");
45387  else
45388  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap Last Sol. : %10.2f %%\n", 100.0 * scip->stat->lastsolgap);
45389 
45390  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : %+21.14e", primalbound);
45391 
45392  /* display (best) primal bound */
45393  bestsol = SCIPsolGetObj(scip->primal->sols[0], scip->set, scip->transprob, scip->origprob);
45394  bestsol = SCIPretransformObj(scip, bestsol);
45395  if( SCIPsetIsGT(scip->set, bestsol, primalbound) )
45396  {
45397  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (user objective limit)\n");
45398  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Best Solution : %+21.14e", bestsol);
45399  }
45400  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (in run %d, after %" SCIP_LONGINT_FORMAT " nodes, %.2f seconds, depth %d, found by <%s>)\n",
45401  SCIPsolGetRunnum(scip->primal->sols[0]),
45402  SCIPsolGetNodenum(scip->primal->sols[0]),
45403  SCIPsolGetTime(scip->primal->sols[0]),
45404  SCIPsolGetDepth(scip->primal->sols[0]),
45405  SCIPsolGetHeur(scip->primal->sols[0]) != NULL
45407  : (SCIPsolGetRunnum(scip->primal->sols[0]) == 0 ? "initial" : "relaxation"));
45408  }
45409  }
45410  if( objlimitreached || SCIPsetIsInfinity(scip->set, REALABS(dualbound)) )
45411  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Dual Bound : -\n");
45412  else
45413  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Dual Bound : %+21.14e\n", dualbound);
45414  if( SCIPsetIsInfinity(scip->set, gap) )
45415  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap : infinite\n");
45416  else
45417  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap : %10.2f %%\n", 100.0 * gap);
45418 
45419  if( scip->set->misc_calcintegral )
45420  {
45421  if( SCIPgetStatus(scip) == SCIP_STATUS_INFEASIBLE )
45422  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Avg. Gap : - (problem infeasible)\n");
45423  else
45424  {
45425  SCIP_Real avggap;
45426  SCIP_Real primaldualintegral;
45427 
45428  if( !SCIPisFeasZero(scip, SCIPgetSolvingTime(scip)) )
45429  {
45430  primaldualintegral = SCIPstatGetPrimalDualIntegral(scip->stat, scip->set, scip->transprob, scip->origprob);
45431  avggap = primaldualintegral/SCIPgetSolvingTime(scip);
45432  }
45433  else
45434  {
45435  avggap = 0.0;
45436  primaldualintegral = 0.0;
45437  }
45438 
45439  /* caution: this assert is non-deterministic since it depends on the solving time */
45440  assert(0.0 <= avggap && SCIPisLE(scip, avggap, 100.0));
45441 
45442  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Avg. Gap : %10.2f %% (%.2f primal-dual integral)\n",
45443  avggap, primaldualintegral);
45444  }
45445  }
45446  else
45447  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Avg. Gap : - (not evaluated)\n");
45448 }
45449 
45450 /** outputs concurrent solver statistics
45451  *
45452  * @pre This method can be called if SCIP is in one of the following stages:
45453  * - \ref SCIP_STAGE_TRANSFORMED
45454  * - \ref SCIP_STAGE_INITPRESOLVE
45455  * - \ref SCIP_STAGE_PRESOLVING
45456  * - \ref SCIP_STAGE_EXITPRESOLVE
45457  * - \ref SCIP_STAGE_PRESOLVED
45458  * - \ref SCIP_STAGE_SOLVING
45459  * - \ref SCIP_STAGE_SOLVED
45460  */
45462  SCIP* scip, /**< SCIP data structure */
45463  FILE* file /**< output file */
45464  )
45465 {
45466  SCIP_CONCSOLVER** concsolvers;
45467  int nconcsolvers;
45468  int i;
45469  int winner;
45470 
45471  assert(scip != NULL);
45472  assert(scip->set != NULL);
45473 
45474  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintConcsolverStatistics", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45475 
45477  return;
45478 
45479  nconcsolvers = SCIPgetNConcurrentSolvers(scip);
45480  concsolvers = SCIPgetConcurrentSolvers(scip);
45481  winner = SCIPsyncstoreGetWinner(scip->syncstore);
45482 
45483  if( nconcsolvers > 0 )
45484  {
45485  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Concurrent Solvers : SolvingTime SyncTime Nodes LP Iters SolsShared SolsRecvd TighterBnds TighterIntBnds\n");
45486  for( i = 0; i < nconcsolvers; ++i )
45487  {
45488  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %c%-16s: %11.2f %11.2f %11" SCIP_LONGINT_FORMAT " %11" SCIP_LONGINT_FORMAT "%11i %11i %11" SCIP_LONGINT_FORMAT " %14" SCIP_LONGINT_FORMAT "\n",
45489  winner == i ? '*' : ' ',
45490  SCIPconcsolverGetName(concsolvers[i]),
45491  SCIPconcsolverGetSolvingTime(concsolvers[i]),
45492  SCIPconcsolverGetSyncTime(concsolvers[i]),
45493  SCIPconcsolverGetNNodes(concsolvers[i]),
45494  SCIPconcsolverGetNLPIterations(concsolvers[i]),
45495  SCIPconcsolverGetNSolsShared(concsolvers[i]),
45496  SCIPconcsolverGetNSolsRecvd(concsolvers[i]),
45497  SCIPconcsolverGetNTighterBnds(concsolvers[i]),
45498  SCIPconcsolverGetNTighterIntBnds(concsolvers[i])
45499  );
45500  }
45501  }
45502 }
45503 
45504 /** outputs root statistics
45505  *
45506  * @pre This method can be called if SCIP is in one of the following stages:
45507  * - \ref SCIP_STAGE_SOLVING
45508  * - \ref SCIP_STAGE_SOLVED
45509  */
45511  SCIP* scip, /**< SCIP data structure */
45512  FILE* file /**< output file */
45513  )
45514 {
45515  SCIP_Real dualboundroot;
45516  SCIP_Real firstdualboundroot;
45517  SCIP_Real firstlptime;
45518  SCIP_Real firstlpspeed;
45519 
45520  assert(scip != NULL);
45521  assert(scip->stat != NULL);
45522  assert(scip->primal != NULL);
45523 
45524  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintRootStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45525 
45526  dualboundroot = SCIPgetDualboundRoot(scip);
45527  firstdualboundroot = SCIPgetFirstLPDualboundRoot(scip);
45528  firstlptime = SCIPgetFirstLPTime(scip);
45529 
45530  if( firstlptime > 0.0 )
45531  firstlpspeed = (SCIP_Real)scip->stat->nrootfirstlpiterations/firstlptime;
45532  else
45533  firstlpspeed = 0.0;
45534 
45535  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Root Node :\n");
45536  if( SCIPsetIsInfinity(scip->set, REALABS(firstdualboundroot)) )
45537  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP value : -\n");
45538  else
45539  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP value : %+21.14e\n", firstdualboundroot);
45540  if( firstlpspeed > 0.0 )
45541  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP Iters : %10" SCIP_LONGINT_FORMAT " (%.2f Iter/sec)\n",
45543  (SCIP_Real)scip->stat->nrootfirstlpiterations/firstlptime);
45544  else
45545  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP Iters : %10" SCIP_LONGINT_FORMAT "\n", scip->stat->nrootfirstlpiterations);
45546  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP Time : %10.2f\n", firstlptime);
45547 
45548  if( SCIPsetIsInfinity(scip->set, REALABS(dualboundroot)) )
45549  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Final Dual Bound : -\n");
45550  else
45551  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Final Dual Bound : %+21.14e\n", dualboundroot);
45552  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Final Root Iters : %10" SCIP_LONGINT_FORMAT "\n", scip->stat->nrootlpiterations);
45553 
45554  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Root LP Estimate : ");
45555  if( scip->stat->rootlpbestestimate != SCIP_INVALID ) /*lint !e777*/
45556  {
45557  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%+21.14e\n", SCIPretransformObj(scip, scip->stat->rootlpbestestimate));
45558  }
45559  else
45560  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%21s\n","-");
45561 }
45562 
45563 /** outputs timing statistics
45564  *
45565  * @pre This method can be called if SCIP is in one of the following stages:
45566  * - \ref SCIP_STAGE_PROBLEM
45567  * - \ref SCIP_STAGE_TRANSFORMED
45568  * - \ref SCIP_STAGE_INITPRESOLVE
45569  * - \ref SCIP_STAGE_PRESOLVING
45570  * - \ref SCIP_STAGE_EXITPRESOLVE
45571  * - \ref SCIP_STAGE_PRESOLVED
45572  * - \ref SCIP_STAGE_SOLVING
45573  * - \ref SCIP_STAGE_SOLVED
45574  */
45576  SCIP* scip, /**< SCIP data structure */
45577  FILE* file /**< output file */
45578  )
45579 {
45580  SCIP_Real readingtime;
45581 
45582  assert(scip != NULL);
45583  assert(scip->set != NULL);
45584 
45585  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintTimingStatistics", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45586 
45587  readingtime = SCIPgetReadingTime(scip);
45588 
45589  if( SCIPgetStage(scip) == SCIP_STAGE_PROBLEM )
45590  {
45591  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Total Time : %10.2f\n", readingtime);
45592  SCIPmessageFPrintInfo(scip->messagehdlr, file, " reading : %10.2f\n", readingtime);
45593  }
45594  else
45595  {
45596  SCIP_Real totaltime;
45597  SCIP_Real solvingtime;
45598 
45599  solvingtime = SCIPclockGetTime(scip->stat->solvingtime);
45600 
45601  if( scip->set->time_reading )
45602  totaltime = solvingtime;
45603  else
45604  totaltime = solvingtime + readingtime;
45605 
45606  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Total Time : %10.2f\n", totaltime);
45607  SCIPmessageFPrintInfo(scip->messagehdlr, file, " solving : %10.2f\n", solvingtime);
45608  SCIPmessageFPrintInfo(scip->messagehdlr, file, " presolving : %10.2f (included in solving)\n", SCIPclockGetTime(scip->stat->presolvingtime));
45609  SCIPmessageFPrintInfo(scip->messagehdlr, file, " reading : %10.2f%s\n", readingtime, scip->set->time_reading ? " (included in solving)" : "");
45610 
45611  if( scip->stat->ncopies > 0 )
45612  {
45613  SCIP_Real copytime;
45614 
45615  copytime = SCIPclockGetTime(scip->stat->copyclock);
45616 
45617  SCIPmessageFPrintInfo(scip->messagehdlr, file, " copying : %10.2f (%d #copies) (minimal %.2f, maximal %.2f, average %.2f)\n",
45618  copytime, scip->stat->ncopies, scip->stat->mincopytime, scip->stat->maxcopytime, copytime / scip->stat->ncopies);
45619  }
45620  else
45621  SCIPmessageFPrintInfo(scip->messagehdlr, file, " copying : %10.2f %s\n", 0.0, "(0 times copied the problem)");
45622  }
45623 }
45624 
45625 /** comparison method for statistics tables */
45626 static
45628 { /*lint --e{715}*/
45629  return (SCIPtableGetPosition((SCIP_TABLE*)elem1) - (SCIPtableGetPosition((SCIP_TABLE*)elem2)));
45630 }
45631 
45632 /** outputs solving statistics
45633  *
45634  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
45635  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
45636  *
45637  * @note If limits have been changed between the solution and the call to this function, the status is recomputed and
45638  * thus may to correspond to the original status.
45639  *
45640  * @pre This method can be called if SCIP is in one of the following stages:
45641  * - \ref SCIP_STAGE_INIT
45642  * - \ref SCIP_STAGE_PROBLEM
45643  * - \ref SCIP_STAGE_TRANSFORMED
45644  * - \ref SCIP_STAGE_INITPRESOLVE
45645  * - \ref SCIP_STAGE_PRESOLVING
45646  * - \ref SCIP_STAGE_EXITPRESOLVE
45647  * - \ref SCIP_STAGE_PRESOLVED
45648  * - \ref SCIP_STAGE_SOLVING
45649  * - \ref SCIP_STAGE_SOLVED
45650  */
45652  SCIP* scip, /**< SCIP data structure */
45653  FILE* file /**< output file (or NULL for standard output) */
45654  )
45655 {
45656  SCIP_TABLE** tables;
45657  int ntables;
45658  int i;
45659 
45660  assert(scip != NULL);
45661  assert(scip->set != NULL);
45662 
45663  SCIP_CALL( checkStage(scip, "SCIPprintStatistics", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45664 
45665  ntables = SCIPgetNTables(scip);
45666  tables = SCIPgetTables(scip);
45667 
45668  /* sort all tables by position unless this has already been done */
45669  if( ! scip->set->tablessorted )
45670  {
45671  SCIPsortPtr((void**)tables, tablePosComp, ntables);
45672 
45673  scip->set->tablessorted = TRUE;
45674  }
45675 
45676  for( i = 0; i < ntables; ++i )
45677  {
45678  /* skip tables which are not active or only used in later stages */
45679  if( ( ! SCIPtableIsActive(tables[i]) ) || SCIPtableGetEarliestStage(tables[i]) > SCIPgetStage(scip) )
45680  continue;
45681 
45682  SCIP_CALL( SCIPtableOutput(tables[i], scip->set, file) );
45683  }
45684 
45685  return SCIP_OKAY;
45686 }
45687 
45688 /** outputs reoptimization statistics
45689  *
45690  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
45691  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
45692  *
45693  * @pre This method can be called if SCIP is in one of the following stages:
45694  * - \ref SCIP_STAGE_INIT
45695  * - \ref SCIP_STAGE_PROBLEM
45696  * - \ref SCIP_STAGE_TRANSFORMED
45697  * - \ref SCIP_STAGE_INITPRESOLVE
45698  * - \ref SCIP_STAGE_PRESOLVING
45699  * - \ref SCIP_STAGE_EXITPRESOLVE
45700  * - \ref SCIP_STAGE_PRESOLVED
45701  * - \ref SCIP_STAGE_SOLVING
45702  * - \ref SCIP_STAGE_SOLVED
45703  */
45705  SCIP* scip, /**< SCIP data structure */
45706  FILE* file /**< output file (or NULL for standard output) */
45707  )
45708 {
45709  SCIP_Real solving;
45710  SCIP_Real presolving;
45711  SCIP_Real updatetime;
45712 
45713  SCIP_CALL( checkStage(scip, "SCIPprintReoptStatistics", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45714 
45715  /* skip if reoptimization is disabled */
45716  if( !scip->set->reopt_enable )
45717  return SCIP_OKAY;
45718 
45719  solving = SCIPclockGetTime(scip->stat->solvingtimeoverall);
45720  presolving = SCIPclockGetTime(scip->stat->presolvingtimeoverall);
45721  updatetime = SCIPclockGetTime(scip->stat->reoptupdatetime);
45722 
45723  SCIPmessageFPrintInfo(scip->messagehdlr, file, "SCIP Reopt Status : finish after %d runs.\n", scip->stat->nreoptruns);
45724  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Time (sec) :\n");
45725  SCIPmessageFPrintInfo(scip->messagehdlr, file, " solving : %10.2f\n", solving);
45726  SCIPmessageFPrintInfo(scip->messagehdlr, file, " presolving : %10.2f (included in solving)\n", presolving);
45727  SCIPmessageFPrintInfo(scip->messagehdlr, file, " save time : %10.2f\n", SCIPreoptGetSavingtime(scip->reopt));
45728  SCIPmessageFPrintInfo(scip->messagehdlr, file, " update time : %10.2f\n", updatetime);
45729  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Nodes : feas infeas pruned cutoff\n");
45730  SCIPmessageFPrintInfo(scip->messagehdlr, file, " total : %10d %10d %10d %10d\n",
45733  SCIPmessageFPrintInfo(scip->messagehdlr, file, " avg : %10.2f %10.2f %10.2f %10.2f\n",
45738 
45739  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Restarts : global local\n");
45740  SCIPmessageFPrintInfo(scip->messagehdlr, file, " first : %10d --\n", SCIPreoptGetFirstRestarts(scip->reopt));
45741  SCIPmessageFPrintInfo(scip->messagehdlr, file, " last : %10d --\n", SCIPreoptGetLastRestarts(scip->reopt));
45742  SCIPmessageFPrintInfo(scip->messagehdlr, file, " total : %10d %10d\n", SCIPreoptGetNRestartsGlobal(scip->reopt),
45744  SCIPmessageFPrintInfo(scip->messagehdlr, file, " avg : -- %10.2f\n",
45746 
45747  return SCIP_OKAY;
45748 }
45749 
45750 /** outputs history statistics about branchings on variables
45751  *
45752  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
45753  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
45754  *
45755  * @pre This method can be called if SCIP is in one of the following stages:
45756  * - \ref SCIP_STAGE_INIT
45757  * - \ref SCIP_STAGE_PROBLEM
45758  * - \ref SCIP_STAGE_TRANSFORMED
45759  * - \ref SCIP_STAGE_INITPRESOLVE
45760  * - \ref SCIP_STAGE_PRESOLVING
45761  * - \ref SCIP_STAGE_EXITPRESOLVE
45762  * - \ref SCIP_STAGE_PRESOLVED
45763  * - \ref SCIP_STAGE_SOLVING
45764  * - \ref SCIP_STAGE_SOLVED
45765  */
45767  SCIP* scip, /**< SCIP data structure */
45768  FILE* file /**< output file (or NULL for standard output) */
45769  )
45770 {
45771  SCIP_VAR** vars;
45772  int totalnstrongbranchs;
45773  int v;
45774 
45775  SCIP_CALL( checkStage(scip, "SCIPprintBranchingStatistics", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45776 
45777  switch( scip->set->stage )
45778  {
45779  case SCIP_STAGE_INIT:
45780  case SCIP_STAGE_PROBLEM:
45781  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem not yet solved. branching statistics not available.\n");
45782  return SCIP_OKAY;
45783 
45786  case SCIP_STAGE_PRESOLVING:
45788  case SCIP_STAGE_PRESOLVED:
45789  case SCIP_STAGE_SOLVING:
45790  case SCIP_STAGE_SOLVED:
45791  SCIP_CALL( SCIPallocBufferArray(scip, &vars, scip->transprob->nvars) );
45792  for( v = 0; v < scip->transprob->nvars; ++v )
45793  {
45794  SCIP_VAR* var;
45795  int i;
45796 
45797  var = scip->transprob->vars[v];
45798  for( i = v; i > 0 && strcmp(SCIPvarGetName(var), SCIPvarGetName(vars[i-1])) < 0; i-- )
45799  vars[i] = vars[i-1];
45800  vars[i] = var;
45801  }
45802 
45803  SCIPmessageFPrintInfo(scip->messagehdlr, file, " locks branchings inferences cutoffs LP gain pscostcount gain variance \n");
45804  SCIPmessageFPrintInfo(scip->messagehdlr, file, "variable prio factor down up depth down up sb down up down up down up down up down up\n");
45805 
45806  totalnstrongbranchs = 0;
45807  for( v = 0; v < scip->transprob->nvars; ++v )
45808  {
45811  || SCIPgetVarNStrongbranchs(scip, vars[v]) > 0 )
45812  {
45813  int nstrongbranchs;
45814 
45815  nstrongbranchs = SCIPgetVarNStrongbranchs(scip, vars[v]);
45816  totalnstrongbranchs += nstrongbranchs;
45817  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",
45818  SCIPvarGetName(vars[v]),
45819  SCIPvarGetBranchPriority(vars[v]),
45820  SCIPvarGetBranchFactor(vars[v]),
45821  SCIPvarGetNLocksDown(vars[v]),
45822  SCIPvarGetNLocksUp(vars[v]),
45824  + SCIPvarGetAvgBranchdepth(vars[v], SCIP_BRANCHDIR_UPWARDS))/2.0 - 1.0,
45827  nstrongbranchs,
45830  100.0 * SCIPvarGetAvgCutoffs(vars[v], scip->stat, SCIP_BRANCHDIR_DOWNWARDS),
45831  100.0 * SCIPvarGetAvgCutoffs(vars[v], scip->stat, SCIP_BRANCHDIR_UPWARDS),
45832  SCIPvarGetPseudocost(vars[v], scip->stat, -1.0),
45833  SCIPvarGetPseudocost(vars[v], scip->stat, +1.0),
45838  }
45839  }
45840  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",
45843  totalnstrongbranchs,
45862 
45863  SCIPfreeBufferArray(scip, &vars);
45864 
45865  return SCIP_OKAY;
45866 
45867  default:
45868  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
45869  return SCIP_INVALIDCALL;
45870  } /*lint !e788*/
45871 }
45872 
45873 /** outputs node information display line
45874  *
45875  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
45876  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
45877  *
45878  * @pre This method can be called if SCIP is in one of the following stages:
45879  * - \ref SCIP_STAGE_SOLVING
45880  */
45882  SCIP* scip, /**< SCIP data structure */
45883  FILE* file, /**< output file (or NULL for standard output) */
45884  SCIP_VERBLEVEL verblevel, /**< minimal verbosity level to actually display the information line */
45885  SCIP_Bool endline /**< should the line be terminated with a newline symbol? */
45886  )
45887 {
45888  SCIP_CALL( checkStage(scip, "SCIPprintDisplayLine", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
45889 
45890  if( (SCIP_VERBLEVEL)scip->set->disp_verblevel >= verblevel )
45891  {
45892  SCIP_CALL( SCIPdispPrintLine(scip->set, scip->messagehdlr, scip->stat, file, TRUE, endline) );
45893  }
45894 
45895  return SCIP_OKAY;
45896 }
45897 
45898 /** gets total number of implications between variables that are stored in the implication graph
45899  *
45900  * @return the total number of implications between variables that are stored in the implication graph
45901  *
45902  * @pre This method can be called if SCIP is in one of the following stages:
45903  * - \ref SCIP_STAGE_INITPRESOLVE
45904  * - \ref SCIP_STAGE_PRESOLVING
45905  * - \ref SCIP_STAGE_EXITPRESOLVE
45906  * - \ref SCIP_STAGE_PRESOLVED
45907  * - \ref SCIP_STAGE_INITSOLVE
45908  * - \ref SCIP_STAGE_SOLVING
45909  * - \ref SCIP_STAGE_SOLVED
45910  */
45912  SCIP* scip /**< SCIP data structure */
45913  )
45914 {
45915  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNImplications", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45916 
45917  return scip->stat->nimplications;
45918 }
45919 
45920 /** stores conflict graph of binary variables' implications into a file, which can be used as input for the DOT tool
45921  *
45922  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
45923  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
45924  *
45925  * @pre This method can be called if SCIP is in one of the following stages:
45926  * - \ref SCIP_STAGE_TRANSFORMED
45927  * - \ref SCIP_STAGE_INITPRESOLVE
45928  * - \ref SCIP_STAGE_PRESOLVING
45929  * - \ref SCIP_STAGE_EXITPRESOLVE
45930  * - \ref SCIP_STAGE_PRESOLVED
45931  * - \ref SCIP_STAGE_INITSOLVE
45932  * - \ref SCIP_STAGE_SOLVING
45933  * - \ref SCIP_STAGE_SOLVED
45934  * - \ref SCIP_STAGE_EXITSOLVE
45935  *
45936  * @deprecated because binary implications are now stored as cliques, please use SCIPwriteCliqueGraph() instead
45937  *
45938  */
45940  SCIP* scip, /**< SCIP data structure */
45941  const char* filename /**< file name, or NULL for stdout */
45942  )
45943 { /*lint --e{715}*/
45944  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");
45945 
45946  return SCIP_OKAY;
45947 }
45948 
45949 /** update statistical information when a new solution was found */
45951  SCIP* scip /**< SCIP data structure */
45952  )
45953 {
45954  SCIP_Real primalbound;
45955  SCIP_Real dualbound;
45956 
45957  primalbound = getPrimalbound(scip);
45958  dualbound = getDualbound(scip);
45959 
45960  if( SCIPsetIsEQ(scip->set, primalbound, dualbound) )
45961  scip->stat->lastsolgap = 0.0;
45962 
45963  else if( SCIPsetIsZero(scip->set, dualbound)
45964  || SCIPsetIsZero(scip->set, primalbound)
45965  || SCIPsetIsInfinity(scip->set, REALABS(primalbound))
45966  || SCIPsetIsInfinity(scip->set, REALABS(dualbound))
45967  || primalbound * dualbound < 0.0 )
45968  {
45969  scip->stat->lastsolgap = SCIPsetInfinity(scip->set);
45970  }
45971  else
45972  {
45973  SCIP_Real absdual = REALABS(dualbound);
45974  SCIP_Real absprimal = REALABS(primalbound);
45975 
45976  scip->stat->lastsolgap = REALABS((primalbound - dualbound)/MIN(absdual, absprimal));
45977  }
45978 
45979  if( scip->primal->nsols == 1 )
45980  scip->stat->firstsolgap = scip->stat->lastsolgap;
45981 
45982  if( scip->set->stage == SCIP_STAGE_SOLVING && scip->set->misc_calcintegral )
45983  {
45985  }
45986 }
45987 
45988 
45989 
45990 
45991 /*
45992  * timing methods
45993  */
45994 
45995 /** gets current time of day in seconds (standard time zone)
45996  *
45997  * @return the current time of day in seconds (standard time zone).
45998  */
46000  SCIP* scip /**< SCIP data structure */
46001  )
46002 {
46003  assert(scip != NULL);
46004 
46005  return SCIPclockGetTimeOfDay();
46006 }
46007 
46008 /** creates a clock using the default clock type
46009  *
46010  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46011  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46012  */
46014  SCIP* scip, /**< SCIP data structure */
46015  SCIP_CLOCK** clck /**< pointer to clock timer */
46016  )
46017 {
46018  assert(scip != NULL);
46019 
46021 
46022  return SCIP_OKAY;
46023 }
46024 
46025 /** creates a clock counting the CPU user seconds
46026  *
46027  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46028  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46029  */
46031  SCIP* scip, /**< SCIP data structure */
46032  SCIP_CLOCK** clck /**< pointer to clock timer */
46033  )
46034 {
46035  assert(scip != NULL);
46036 
46038 
46039  return SCIP_OKAY;
46040 }
46041 
46042 /** creates a clock counting the wall clock seconds
46043  *
46044  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46045  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46046  */
46048  SCIP* scip, /**< SCIP data structure */
46049  SCIP_CLOCK** clck /**< pointer to clock timer */
46050  )
46051 {
46052  assert(scip != NULL);
46053 
46055 
46056  return SCIP_OKAY;
46057 }
46058 
46059 /** frees a clock
46060  *
46061  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46062  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46063  */
46065  SCIP* scip, /**< SCIP data structure */
46066  SCIP_CLOCK** clck /**< pointer to clock timer */
46067  )
46068 {
46069  assert(scip != NULL);
46070 
46071  SCIPclockFree(clck);
46072 
46073  return SCIP_OKAY;
46074 }
46075 
46076 /** resets the time measurement of a clock to zero and completely stops the clock
46077  *
46078  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46079  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46080  */
46082  SCIP* scip, /**< SCIP data structure */
46083  SCIP_CLOCK* clck /**< clock timer */
46084  )
46085 {
46086  assert(scip != NULL);
46087 
46088  SCIPclockReset(clck);
46089 
46090  return SCIP_OKAY;
46091 }
46092 
46093 /** starts the time measurement of a clock
46094  *
46095  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46096  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46097  */
46099  SCIP* scip, /**< SCIP data structure */
46100  SCIP_CLOCK* clck /**< clock timer */
46101  )
46102 {
46103  assert(scip != NULL);
46104 
46105  SCIPclockStart(clck, scip->set);
46106 
46107  return SCIP_OKAY;
46108 }
46109 
46110 /** stops the time measurement of a clock
46111  *
46112  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46113  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46114  */
46116  SCIP* scip, /**< SCIP data structure */
46117  SCIP_CLOCK* clck /**< clock timer */
46118  )
46119 {
46120  assert(scip != NULL);
46121 
46122  SCIPclockStop(clck, scip->set);
46123 
46124  return SCIP_OKAY;
46125 }
46126 
46127 /** enables or disables all statistic clocks of SCIP concerning plugin statistics,
46128  * LP execution time, strong branching time, etc.
46129  *
46130  * Method reads the value of the parameter timing/statistictiming. In order to disable statistic timing,
46131  * set the parameter to FALSE.
46132  *
46133  * @note: The (pre-)solving time clocks which are relevant for the output during (pre-)solving
46134  * are not affected by this method
46135  *
46136  * @see: For completely disabling all timing of SCIP, consider setting the parameter timing/enabled to FALSE
46137  *
46138  * @pre This method can be called if SCIP is in one of the following stages:
46139  * - \ref SCIP_STAGE_INIT
46140  * - \ref SCIP_STAGE_PROBLEM
46141  * - \ref SCIP_STAGE_TRANSFORMING
46142  * - \ref SCIP_STAGE_TRANSFORMED
46143  * - \ref SCIP_STAGE_INITPRESOLVE
46144  * - \ref SCIP_STAGE_PRESOLVING
46145  * - \ref SCIP_STAGE_EXITPRESOLVE
46146  * - \ref SCIP_STAGE_PRESOLVED
46147  * - \ref SCIP_STAGE_INITSOLVE
46148  * - \ref SCIP_STAGE_SOLVING
46149  * - \ref SCIP_STAGE_SOLVED
46150  * - \ref SCIP_STAGE_EXITSOLVE
46151  * - \ref SCIP_STAGE_FREETRANS
46152  *
46153  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
46154  */
46156  SCIP* scip /**< SCIP data structure */
46157  )
46158 {
46159  SCIP_CALL( checkStage(scip, "SCIPenableOrDisableStatisticTiming", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
46160 
46162 
46163  if( scip->set->stage > SCIP_STAGE_INIT )
46164  {
46165  assert(scip->stat != NULL);
46167  }
46168  if( scip->set->stage >= SCIP_STAGE_TRANSFORMING )
46169  {
46170  assert(scip->conflict != NULL);
46172  }
46173 
46174  return SCIP_OKAY;
46175 }
46176 
46177 /** starts the current solving time
46178  *
46179  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46180  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46181  *
46182  * @pre This method can be called if SCIP is in one of the following stages:
46183  * - \ref SCIP_STAGE_PROBLEM
46184  * - \ref SCIP_STAGE_TRANSFORMING
46185  * - \ref SCIP_STAGE_TRANSFORMED
46186  * - \ref SCIP_STAGE_INITPRESOLVE
46187  * - \ref SCIP_STAGE_PRESOLVING
46188  * - \ref SCIP_STAGE_EXITPRESOLVE
46189  * - \ref SCIP_STAGE_PRESOLVED
46190  * - \ref SCIP_STAGE_INITSOLVE
46191  * - \ref SCIP_STAGE_SOLVING
46192  * - \ref SCIP_STAGE_SOLVED
46193  * - \ref SCIP_STAGE_EXITSOLVE
46194  * - \ref SCIP_STAGE_FREETRANS
46195  *
46196  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
46197  */
46199  SCIP* scip /**< SCIP data structure */
46200  )
46201 {
46202  SCIP_CALL( checkStage(scip, "SCIPstartSolvingTime", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
46203 
46204  SCIPclockStart(scip->stat->solvingtime, scip->set);
46205  SCIPclockStart(scip->stat->solvingtimeoverall, scip->set);
46206 
46207  return SCIP_OKAY;
46208 }
46209 
46210 /** stops the current solving time in seconds
46211  *
46212  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46213  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46214  *
46215  * @pre This method can be called if SCIP is in one of the following stages:
46216  * - \ref SCIP_STAGE_PROBLEM
46217  * - \ref SCIP_STAGE_TRANSFORMING
46218  * - \ref SCIP_STAGE_TRANSFORMED
46219  * - \ref SCIP_STAGE_INITPRESOLVE
46220  * - \ref SCIP_STAGE_PRESOLVING
46221  * - \ref SCIP_STAGE_EXITPRESOLVE
46222  * - \ref SCIP_STAGE_PRESOLVED
46223  * - \ref SCIP_STAGE_INITSOLVE
46224  * - \ref SCIP_STAGE_SOLVING
46225  * - \ref SCIP_STAGE_SOLVED
46226  * - \ref SCIP_STAGE_EXITSOLVE
46227  * - \ref SCIP_STAGE_FREETRANS
46228  *
46229  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
46230  */
46232  SCIP* scip /**< SCIP data structure */
46233  )
46234 {
46235  SCIP_CALL( checkStage(scip, "SCIPstopSolvingTime", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
46236 
46237  SCIPclockStop(scip->stat->solvingtime, scip->set);
46238  SCIPclockStop(scip->stat->solvingtimeoverall, scip->set);
46239 
46240  return SCIP_OKAY;
46241 }
46242 
46243 /** gets the measured time of a clock in seconds
46244  *
46245  * @return the measured time of a clock in seconds.
46246  */
46248  SCIP* scip, /**< SCIP data structure */
46249  SCIP_CLOCK* clck /**< clock timer */
46250  )
46251 {
46252  assert(scip != NULL);
46253 
46254  return SCIPclockGetTime(clck);
46255 }
46256 
46257 /** sets the measured time of a clock to the given value in seconds
46258  *
46259  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46260  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46261  */
46263  SCIP* scip, /**< SCIP data structure */
46264  SCIP_CLOCK* clck, /**< clock timer */
46265  SCIP_Real sec /**< time in seconds to set the clock's timer to */
46266  )
46267 {
46268  assert(scip != NULL);
46269 
46270  SCIPclockSetTime(clck, sec);
46271 
46272  return SCIP_OKAY;
46273 }
46274 
46275 /** gets the current total SCIP time in seconds, possibly accumulated over several problems.
46276  *
46277  * @return the current total SCIP time in seconds, ie. the total time since the SCIP instance has been created
46278  */
46280  SCIP* scip /**< SCIP data structure */
46281  )
46282 {
46283  assert(scip != NULL);
46284 
46285  return SCIPclockGetTime(scip->totaltime);
46286 }
46287 
46288 /** gets the current solving time in seconds
46289  *
46290  * @return the current solving time in seconds.
46291  *
46292  * @pre This method can be called if SCIP is in one of the following stages:
46293  * - \ref SCIP_STAGE_PROBLEM
46294  * - \ref SCIP_STAGE_TRANSFORMING
46295  * - \ref SCIP_STAGE_TRANSFORMED
46296  * - \ref SCIP_STAGE_INITPRESOLVE
46297  * - \ref SCIP_STAGE_PRESOLVING
46298  * - \ref SCIP_STAGE_EXITPRESOLVE
46299  * - \ref SCIP_STAGE_PRESOLVED
46300  * - \ref SCIP_STAGE_INITSOLVE
46301  * - \ref SCIP_STAGE_SOLVING
46302  * - \ref SCIP_STAGE_SOLVED
46303  *
46304  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
46305  */
46307  SCIP* scip /**< SCIP data structure */
46308  )
46309 {
46310  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolvingTime", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
46311 
46312  return SCIPclockGetTime(scip->stat->solvingtime);
46313 }
46314 
46315 /** gets the current reading time in seconds
46316  *
46317  * @return the current reading time in seconds.
46318  *
46319  * @pre This method can be called if SCIP is in one of the following stages:
46320  * - \ref SCIP_STAGE_PROBLEM
46321  * - \ref SCIP_STAGE_TRANSFORMING
46322  * - \ref SCIP_STAGE_TRANSFORMED
46323  * - \ref SCIP_STAGE_INITPRESOLVE
46324  * - \ref SCIP_STAGE_PRESOLVING
46325  * - \ref SCIP_STAGE_EXITPRESOLVE
46326  * - \ref SCIP_STAGE_PRESOLVED
46327  * - \ref SCIP_STAGE_INITSOLVE
46328  * - \ref SCIP_STAGE_SOLVING
46329  * - \ref SCIP_STAGE_SOLVED
46330  *
46331  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
46332  */
46334  SCIP* scip /**< SCIP data structure */
46335  )
46336 {
46337  SCIP_Real readingtime;
46338  int r;
46339 
46340  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetReadingTime", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
46341 
46342  readingtime = 0.0;
46343 
46344  /* sum up the reading time of all readers */
46345  for( r = 0; r < scip->set->nreaders; ++r )
46346  {
46347  assert(scip->set->readers[r] != NULL);
46348  assert(!SCIPisNegative(scip, SCIPreaderGetReadingTime(scip->set->readers[r])));
46349  readingtime += SCIPreaderGetReadingTime(scip->set->readers[r]);
46350  }
46351 
46352  return readingtime;
46353 }
46354 
46355 /** gets the current presolving time in seconds
46356  *
46357  * @return the current presolving time in seconds.
46358  *
46359  * @pre This method can be called if SCIP is in one of the following stages:
46360  * - \ref SCIP_STAGE_INITPRESOLVE
46361  * - \ref SCIP_STAGE_PRESOLVING
46362  * - \ref SCIP_STAGE_EXITPRESOLVE
46363  * - \ref SCIP_STAGE_PRESOLVED
46364  * - \ref SCIP_STAGE_INITSOLVE
46365  * - \ref SCIP_STAGE_SOLVING
46366  * - \ref SCIP_STAGE_SOLVED
46367  *
46368  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
46369  */
46371  SCIP* scip /**< SCIP data structure */
46372  )
46373 {
46374  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPresolvingTime", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
46375 
46376  return SCIPclockGetTime(scip->stat->presolvingtime);
46377 }
46378 
46379 /** gets the time need to solve the first LP in the root node
46380  *
46381  * @return the solving time for the first LP in the root node in seconds.
46382  *
46383  * @pre This method can be called if SCIP is in one of the following stages:
46384  * - \ref SCIP_STAGE_TRANSFORMING
46385  * - \ref SCIP_STAGE_TRANSFORMED
46386  * - \ref SCIP_STAGE_INITPRESOLVE
46387  * - \ref SCIP_STAGE_PRESOLVING
46388  * - \ref SCIP_STAGE_EXITPRESOLVE
46389  * - \ref SCIP_STAGE_PRESOLVED
46390  * - \ref SCIP_STAGE_INITSOLVE
46391  * - \ref SCIP_STAGE_SOLVING
46392  * - \ref SCIP_STAGE_SOLVED
46393  *
46394  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
46395  */
46397  SCIP* scip /**< SCIP data structure */
46398  )
46399 {
46400  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFirstLPTime", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
46401 
46402  return scip->stat->firstlptime;
46403 }
46404 
46405 
46406 
46407 /*
46408  * numeric values and comparisons
46409  */
46410 
46411 /** returns value treated as zero
46412  *
46413  * @return value treated as zero
46414  */
46416  SCIP* scip /**< SCIP data structure */
46417  )
46418 {
46419  assert(scip != NULL);
46420  assert(scip->set != NULL);
46421 
46422  return SCIPsetEpsilon(scip->set);
46423 }
46424 
46425 /** returns value treated as zero for sums of floating point values
46426  *
46427  * @return value treated as zero for sums of floating point values
46428  */
46430  SCIP* scip /**< SCIP data structure */
46431  )
46432 {
46433  assert(scip != NULL);
46434  assert(scip->set != NULL);
46435 
46436  return SCIPsetSumepsilon(scip->set);
46437 }
46438 
46439 /** returns feasibility tolerance for constraints
46440  *
46441  * @return feasibility tolerance for constraints
46442  */
46444  SCIP* scip /**< SCIP data structure */
46445  )
46446 {
46447  assert(scip != NULL);
46448  assert(scip->set != NULL);
46449 
46450  return SCIPsetFeastol(scip->set);
46451 }
46452 
46453 /** returns primal feasibility tolerance of LP solver
46454  *
46455  * @return primal feasibility tolerance of LP solver
46456  */
46458  SCIP* scip /**< SCIP data structure */
46459  )
46460 {
46461  assert(scip != NULL);
46462  assert(scip->set != NULL);
46463 
46464  return SCIPsetLpfeastol(scip->set);
46465 }
46466 
46467 /** returns feasibility tolerance for reduced costs
46468  *
46469  * @return feasibility tolerance for reduced costs
46470  */
46472  SCIP* scip /**< SCIP data structure */
46473  )
46474 {
46475  assert(scip != NULL);
46476  assert(scip->set != NULL);
46477 
46478  return SCIPsetDualfeastol(scip->set);
46479 }
46480 
46481 /** returns convergence tolerance used in barrier algorithm
46482  *
46483  * @return convergence tolerance used in barrier algorithm
46484  */
46486  SCIP* scip /**< SCIP data structure */
46487  )
46488 {
46489  assert(scip != NULL);
46490  assert(scip->set != NULL);
46491 
46492  return SCIPsetBarrierconvtol(scip->set);
46493 }
46494 
46495 /** return the cutoff bound delta
46496  *
46497  * @return cutoff bound data
46498  */
46500  SCIP* scip /**< SCIP data structure */
46501  )
46502 {
46503  assert(scip != NULL);
46504  assert(scip->set != NULL);
46505 
46506  return SCIPsetCutoffbounddelta(scip->set);
46507 }
46508 
46509 /** return the relaxation primal feasibility tolerance
46510  *
46511  * @see SCIPchgRelaxfeastol
46512  * @return relaxfeastol
46513  */
46515  SCIP* scip /**< SCIP data structure */
46516  )
46517 {
46518  assert(scip != NULL);
46519  assert(scip->set != NULL);
46520 
46521  return SCIPsetRelaxfeastol(scip->set);
46522 }
46523 
46524 /** sets the feasibility tolerance for constraints
46525  *
46526  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46527  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46528  */
46530  SCIP* scip, /**< SCIP data structure */
46531  SCIP_Real feastol /**< new feasibility tolerance for constraints */
46532  )
46533 {
46534  assert(scip != NULL);
46535 
46536  /* change the settings */
46537  SCIP_CALL( SCIPsetSetFeastol(scip->set, feastol) );
46538 
46539  return SCIP_OKAY;
46540 }
46541 
46542 /** sets the primal feasibility tolerance of LP solver
46543  *
46544  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46545  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46546  */
46548  SCIP* scip, /**< SCIP data structure */
46549  SCIP_Real lpfeastol, /**< new primal feasibility tolerance of LP solver */
46550  SCIP_Bool printnewvalue /**< should "numerics/lpfeastol = ..." be printed? */
46551  )
46552 {
46553  assert(scip != NULL);
46554 
46555  /* mark the LP unsolved, if the primal feasibility tolerance was tightened */
46556  if( scip->lp != NULL && lpfeastol < SCIPsetLpfeastol(scip->set) )
46557  {
46558  scip->lp->solved = FALSE;
46560  }
46561 
46562  /* change the settings */
46563  SCIP_CALL( SCIPsetSetLpfeastol(scip->set, lpfeastol, printnewvalue) );
46564 
46565  return SCIP_OKAY;
46566 }
46567 
46568 /** sets the feasibility tolerance for reduced costs
46569  *
46570  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46571  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46572  */
46574  SCIP* scip, /**< SCIP data structure */
46575  SCIP_Real dualfeastol /**< new feasibility tolerance for reduced costs */
46576  )
46577 {
46578  assert(scip != NULL);
46579 
46580  /* mark the LP unsolved, if the dual feasibility tolerance was tightened */
46581  if( scip->lp != NULL && dualfeastol < SCIPsetDualfeastol(scip->set) )
46582  {
46583  scip->lp->solved = FALSE;
46585  }
46586 
46587  /* change the settings */
46588  SCIP_CALL( SCIPsetSetDualfeastol(scip->set, dualfeastol) );
46589 
46590  return SCIP_OKAY;
46591 }
46592 
46593 /** sets the convergence tolerance used in barrier algorithm
46594  *
46595  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46596  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46597  */
46599  SCIP* scip, /**< SCIP data structure */
46600  SCIP_Real barrierconvtol /**< new convergence tolerance used in barrier algorithm */
46601  )
46602 {
46603  assert(scip != NULL);
46604 
46605  /* mark the LP unsolved, if the convergence tolerance was tightened, and the LP was solved with the barrier algorithm */
46606  if( scip->lp != NULL && barrierconvtol < SCIPsetBarrierconvtol(scip->set)
46608  scip->lp->solved = FALSE;
46609 
46610  /* change the settings */
46611  SCIP_CALL( SCIPsetSetBarrierconvtol(scip->set, barrierconvtol) );
46612 
46613  return SCIP_OKAY;
46614 }
46615 
46616 /** sets the primal feasibility tolerance of relaxations
46617  *
46618  * This tolerance value is used by the SCIP core and plugins to tighten then feasibility tolerance on relaxations
46619  * (especially the LP relaxation) during a solve. It is set to SCIP_INVALID initially, which means that only the
46620  * feasibility tolerance of the particular relaxation is taken into account. If set to a valid value, however,
46621  * then this value should be used to reduce the primal feasibility tolerance of a relaxation (thus, use the
46622  * minimum of relaxfeastol and the relaxations primal feastol).
46623  *
46624  * @pre The value of relaxfeastol is reset to SCIP_INVALID when initializing the solve (INITSOL).
46625  * Therefore, this method can only be called in one of the following stages of the SCIP solving process:
46626  * - \ref SCIP_STAGE_INITSOLVE
46627  * - \ref SCIP_STAGE_SOLVING
46628  *
46629  * @return previous value of relaxfeastol
46630  */
46632  SCIP* scip, /**< SCIP data structure */
46633  SCIP_Real relaxfeastol /**< new primal feasibility tolerance of relaxations */
46634  )
46635 {
46636  assert(scip != NULL);
46637  assert(scip->set != NULL);
46638 
46639  SCIP_CALL_ABORT( checkStage(scip, "SCIPchgRelaxfeastol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
46640 
46641  return SCIPsetSetRelaxfeastol(scip->set, relaxfeastol);
46642 }
46643 
46644 /** marks that some limit parameter was changed */
46646  SCIP* scip /**< SCIP data structure */
46647  )
46648 {
46649  assert(scip != NULL);
46650 
46651  /* change the settings */
46652  SCIPsetSetLimitChanged(scip->set);
46653 }
46654 
46655 /** outputs a real number, or "+infinity", or "-infinity" to a file */
46657  SCIP* scip, /**< SCIP data structure */
46658  FILE* file, /**< output file (or NULL for standard output) */
46659  SCIP_Real val, /**< value to print */
46660  int width, /**< width of the field */
46661  int precision /**< number of significant digits printed */
46662  )
46663 {
46664  char s[SCIP_MAXSTRLEN];
46665  char strformat[SCIP_MAXSTRLEN];
46666 
46667  assert(scip != NULL);
46668 
46669  if( SCIPsetIsInfinity(scip->set, val) )
46670  (void) SCIPsnprintf(s, SCIP_MAXSTRLEN, "+infinity");
46671  else if( SCIPsetIsInfinity(scip->set, -val) )
46672  (void) SCIPsnprintf(s, SCIP_MAXSTRLEN, "-infinity");
46673  else
46674  {
46675  (void) SCIPsnprintf(strformat, SCIP_MAXSTRLEN, "%%.%dg", precision);
46676  (void) SCIPsnprintf(s, SCIP_MAXSTRLEN, (const char*)strformat, val);
46677  }
46678  (void) SCIPsnprintf(strformat, SCIP_MAXSTRLEN, "%%%ds", width);
46679  SCIPmessageFPrintInfo(scip->messagehdlr, file, (const char*)strformat, s);
46680 }
46681 
46682 /** parse a real value that was written with SCIPprintReal() */
46684  SCIP* scip, /**< SCIP data structure */
46685  const char* str, /**< string to search */
46686  SCIP_Real* value, /**< pointer to store the parsed value */
46687  char** endptr /**< pointer to store the final string position if successfully parsed, otherwise @p str */
46688  )
46689 {
46690  char* localstr;
46691 
46692  assert(scip != NULL);
46693  assert(str != NULL);
46694  assert(value != NULL);
46695  assert(endptr != NULL);
46696 
46697  localstr = (char*)str;
46698 
46699  /* ignore white space */
46700  while(isspace((unsigned char)*localstr))
46701  ++localstr;
46702 
46703  /* test for a special infinity first */
46704  if( strncmp(localstr, "+infinity", 9) == 0 )
46705  {
46706  *value = SCIPinfinity(scip);
46707  *endptr = (char*)(localstr + 9);
46708  return TRUE;
46709  }
46710  else if( strncmp(localstr, "-infinity", 9) == 0 )
46711  {
46712  *value = -SCIPinfinity(scip);
46713  *endptr = (char*)(localstr + 9);
46714  return TRUE;
46715  }
46716  else
46717  {
46718  /* parse a finite value */
46719  return SCIPstrToRealValue(str, value, endptr);
46720  }
46721 }
46722 
46723 /*
46724  * memory management
46725  */
46726 
46727 /** returns block memory to use at the current time
46728  *
46729  * @return the block memory to use at the current time.
46730  */
46732  SCIP* scip /**< SCIP data structure */
46733  )
46734 {
46735  assert(scip != NULL);
46736  assert(scip->set != NULL);
46737  assert(scip->mem != NULL);
46738 
46739  return scip->mem->probmem;
46740 }
46741 
46742 /** returns buffer memory for short living temporary objects
46743  *
46744  * @return the buffer memory for short living temporary objects
46745  */
46747  SCIP* scip /**< SCIP data structure */
46748  )
46749 {
46750  assert(scip != NULL);
46751  assert(scip->mem != NULL);
46752 
46753  return scip->mem->buffer;
46754 }
46755 
46756 /** returns clean buffer memory for short living temporary objects initialized to all zero
46757  *
46758  * @return the buffer memory for short living temporary objects initialized to all zero
46759  */
46761  SCIP* scip /**< SCIP data structure */
46762  )
46763 {
46764  assert(scip != NULL);
46765  assert(scip->mem != NULL);
46766 
46767  return scip->mem->cleanbuffer;
46768 }
46769 
46770 /** returns the total number of bytes used in block and buffer memory
46771  *
46772  * @return the total number of bytes used in block and buffer memory.
46773  */
46775  SCIP* scip /**< SCIP data structure */
46776  )
46777 {
46778  assert(scip != NULL);
46779 
46780  return SCIPmemGetUsed(scip->mem);
46781 }
46782 
46783 /** returns the total number of bytes in block and buffer memory
46784  *
46785  * @return the total number of bytes in block and buffer memory.
46786  */
46788  SCIP* scip /**< SCIP data structure */
46789  )
46790 {
46791  assert(scip != NULL);
46792 
46793  return SCIPmemGetTotal(scip->mem);
46794 }
46795 
46796 /** returns the estimated number of bytes used by external software, e.g., the LP solver
46797  *
46798  * @return the estimated number of bytes used by external software, e.g., the LP solver.
46799  */
46801  SCIP* scip /**< SCIP data structure */
46802  )
46803 {
46804  assert(scip != NULL);
46805 
46806  return SCIPstatGetMemExternEstim(scip->stat);
46807 }
46808 
46809 /** calculate memory size for dynamically allocated arrays
46810  *
46811  * @return the memory size for dynamically allocated arrays.
46812  */
46814  SCIP* scip, /**< SCIP data structure */
46815  int num /**< minimum number of entries to store */
46816  )
46817 {
46818  assert(scip != NULL);
46819 
46820  return SCIPsetCalcMemGrowSize(scip->set, num);
46821 }
46822 
46823 /** extends a dynamically allocated block memory array to be able to store at least the given number of elements;
46824  * use SCIPensureBlockMemoryArray() define to call this method!
46825  *
46826  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46827  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46828  */
46830  SCIP* scip, /**< SCIP data structure */
46831  void** arrayptr, /**< pointer to dynamically sized array */
46832  size_t elemsize, /**< size in bytes of each element in array */
46833  int* arraysize, /**< pointer to current array size */
46834  int minsize /**< required minimal array size */
46835  )
46836 {
46837  assert(scip != NULL);
46838  assert(arrayptr != NULL);
46839  assert(elemsize > 0);
46840  assert(arraysize != NULL);
46841 
46842  if( minsize > *arraysize )
46843  {
46844  int newsize;
46845 
46846  newsize = SCIPsetCalcMemGrowSize(scip->set, minsize);
46847  SCIP_ALLOC( BMSreallocBlockMemorySize(SCIPblkmem(scip), arrayptr, *arraysize * elemsize, newsize * elemsize) );
46848  *arraysize = newsize;
46849  }
46850 
46851  return SCIP_OKAY;
46852 }
46853 
46854 /** prints output about used memory */
46856  SCIP* scip /**< SCIP data structure */
46857  )
46858 {
46859  assert(scip != NULL);
46860  assert(scip->mem != NULL);
46861  assert(scip->set != NULL);
46862 
46863  BMSdisplayMemory();
46864 
46865  SCIPmessagePrintInfo(scip->messagehdlr, "\nParameter Block Memory (%p):\n", scip->mem->setmem);
46867 
46868  SCIPmessagePrintInfo(scip->messagehdlr, "\nSolution Block Memory (%p):\n", scip->mem->probmem);
46870 
46871  SCIPmessagePrintInfo(scip->messagehdlr, "\nMemory Buffers:\n");
46873 
46874  SCIPmessagePrintInfo(scip->messagehdlr, "\nClean Memory Buffers:\n");
46876 }
46877 
46878 
46879 
46880 
46881 /*
46882  * simple functions implemented as defines
46883  */
46884 
46885 /* In debug mode, the following methods are implemented as function calls to ensure
46886  * type validity.
46887  * In optimized mode, the methods are implemented as defines to improve performance.
46888  * However, we want to have them in the library anyways, so we have to undef the defines.
46889  */
46890 
46891 #undef SCIPinfinity
46892 #undef SCIPisInfinity
46893 #undef SCIPisEQ
46894 #undef SCIPisLT
46895 #undef SCIPisLE
46896 #undef SCIPisGT
46897 #undef SCIPisGE
46898 #undef SCIPisZero
46899 #undef SCIPisPositive
46900 #undef SCIPisNegative
46901 #undef SCIPisIntegral
46902 #undef SCIPisScalingIntegral
46903 #undef SCIPisFracIntegral
46904 #undef SCIPfloor
46905 #undef SCIPceil
46906 #undef SCIPround
46907 #undef SCIPfrac
46908 #undef SCIPisSumEQ
46909 #undef SCIPisSumLT
46910 #undef SCIPisSumLE
46911 #undef SCIPisSumGT
46912 #undef SCIPisSumGE
46913 #undef SCIPisSumZero
46914 #undef SCIPisSumPositive
46915 #undef SCIPisSumNegative
46916 #undef SCIPisFeasEQ
46917 #undef SCIPisFeasLT
46918 #undef SCIPisFeasLE
46919 #undef SCIPisFeasGT
46920 #undef SCIPisFeasGE
46921 #undef SCIPisFeasZero
46922 #undef SCIPisFeasPositive
46923 #undef SCIPisFeasNegative
46924 #undef SCIPisFeasIntegral
46925 #undef SCIPisFeasFracIntegral
46926 #undef SCIPfeasFloor
46927 #undef SCIPfeasCeil
46928 #undef SCIPfeasRound
46929 #undef SCIPfeasFrac
46930 #undef SCIPisDualfeasEQ
46931 #undef SCIPisDualfeasLT
46932 #undef SCIPisDualfeasLE
46933 #undef SCIPisDualfeasGT
46934 #undef SCIPisDualfeasGE
46935 #undef SCIPisDualfeasZero
46936 #undef SCIPisDualfeasPositive
46937 #undef SCIPisDualfeasNegative
46938 #undef SCIPisDualfeasIntegral
46939 #undef SCIPisDualfeasFracIntegral
46940 #undef SCIPdualfeasFloor
46941 #undef SCIPdualfeasCeil
46942 #undef SCIPdualfeasRound
46943 #undef SCIPdualfeasFrac
46944 #undef SCIPisLbBetter
46945 #undef SCIPisUbBetter
46946 #undef SCIPisRelEQ
46947 #undef SCIPisRelLT
46948 #undef SCIPisRelLE
46949 #undef SCIPisRelGT
46950 #undef SCIPisRelGE
46951 #undef SCIPisSumRelEQ
46952 #undef SCIPisSumRelLT
46953 #undef SCIPisSumRelLE
46954 #undef SCIPisSumRelGT
46955 #undef SCIPisSumRelGE
46956 #undef SCIPconvertRealToInt
46957 #undef SCIPconvertRealToLongint
46958 #undef SCIPisUpdateUnreliable
46959 #undef SCIPisHugeValue
46960 #undef SCIPgetHugeValue
46961 
46962 /** checks, if values are in range of epsilon */
46964  SCIP* scip, /**< SCIP data structure */
46965  SCIP_Real val1, /**< first value to be compared */
46966  SCIP_Real val2 /**< second value to be compared */
46967  )
46968 {
46969  assert(scip != NULL);
46970  assert(scip->set != NULL);
46971 
46972  return SCIPsetIsEQ(scip->set, val1, val2);
46973 }
46974 
46975 /** checks, if val1 is (more than epsilon) lower than val2 */
46977  SCIP* scip, /**< SCIP data structure */
46978  SCIP_Real val1, /**< first value to be compared */
46979  SCIP_Real val2 /**< second value to be compared */
46980  )
46981 {
46982  assert(scip != NULL);
46983  assert(scip->set != NULL);
46984 
46985  return SCIPsetIsLT(scip->set, val1, val2);
46986 }
46987 
46988 /** checks, if val1 is not (more than epsilon) greater than val2 */
46990  SCIP* scip, /**< SCIP data structure */
46991  SCIP_Real val1, /**< first value to be compared */
46992  SCIP_Real val2 /**< second value to be compared */
46993  )
46994 {
46995  assert(scip != NULL);
46996  assert(scip->set != NULL);
46997 
46998  return SCIPsetIsLE(scip->set, val1, val2);
46999 }
47000 
47001 /** checks, if val1 is (more than epsilon) greater than val2 */
47003  SCIP* scip, /**< SCIP data structure */
47004  SCIP_Real val1, /**< first value to be compared */
47005  SCIP_Real val2 /**< second value to be compared */
47006  )
47007 {
47008  assert(scip != NULL);
47009  assert(scip->set != NULL);
47010 
47011  return SCIPsetIsGT(scip->set, val1, val2);
47012 }
47013 
47014 /** checks, if val1 is not (more than epsilon) lower than val2 */
47016  SCIP* scip, /**< SCIP data structure */
47017  SCIP_Real val1, /**< first value to be compared */
47018  SCIP_Real val2 /**< second value to be compared */
47019  )
47020 {
47021  assert(scip != NULL);
47022  assert(scip->set != NULL);
47023 
47024  return SCIPsetIsGE(scip->set, val1, val2);
47025 }
47026 
47027 /** returns value treated as infinity */
47029  SCIP* scip /**< SCIP data structure */
47030  )
47031 {
47032  assert(scip != NULL);
47033  assert(scip->set != NULL);
47034 
47035  return SCIPsetInfinity(scip->set);
47036 }
47037 
47038 /** checks, if value is (positive) infinite */
47040  SCIP* scip, /**< SCIP data structure */
47041  SCIP_Real val /**< value to be compared against infinity */
47042  )
47043 {
47044  assert(scip != NULL);
47045  assert(scip->set != NULL);
47046 
47047  return SCIPsetIsInfinity(scip->set, val);
47048 }
47049 
47050 /** checks, if value is huge and should be handled separately (e.g., in activity computation) */
47052  SCIP* scip, /**< SCIP data structure */
47053  SCIP_Real val /**< value to be checked whether it is huge */
47054  )
47055 {
47056  assert(scip != NULL);
47057  assert(scip->set != NULL);
47058 
47059  return SCIPsetIsHugeValue(scip->set, val);
47060 }
47061 
47062 /** returns the minimum value that is regarded as huge and should be handled separately (e.g., in activity
47063  * computation)
47064  */
47066  SCIP* scip /**< SCIP data structure */
47067  )
47068 {
47069  assert(scip != NULL);
47070  assert(scip->set != NULL);
47071 
47072  return SCIPsetGetHugeValue(scip->set);
47073 }
47074 
47075 /** checks, if value is in range epsilon of 0.0 */
47077  SCIP* scip, /**< SCIP data structure */
47078  SCIP_Real val /**< value to process */
47079  )
47080 {
47081  assert(scip != NULL);
47082  assert(scip->set != NULL);
47083 
47084  return SCIPsetIsZero(scip->set, val);
47085 }
47086 
47087 /** checks, if value is greater than epsilon */
47089  SCIP* scip, /**< SCIP data structure */
47090  SCIP_Real val /**< value to process */
47091  )
47092 {
47093  assert(scip != NULL);
47094  assert(scip->set != NULL);
47095 
47096  return SCIPsetIsPositive(scip->set, val);
47097 }
47098 
47099 /** checks, if value is lower than -epsilon */
47101  SCIP* scip, /**< SCIP data structure */
47102  SCIP_Real val /**< value to process */
47103  )
47104 {
47105  assert(scip != NULL);
47106  assert(scip->set != NULL);
47107 
47108  return SCIPsetIsNegative(scip->set, val);
47109 }
47110 
47111 /** checks, if value is integral within epsilon */
47113  SCIP* scip, /**< SCIP data structure */
47114  SCIP_Real val /**< value to process */
47115  )
47116 {
47117  assert(scip != NULL);
47118  assert(scip->set != NULL);
47119 
47120  return SCIPsetIsIntegral(scip->set, val);
47121 }
47122 
47123 /** checks whether the product val * scalar is integral in epsilon scaled by scalar */
47125  SCIP* scip, /**< SCIP data structure */
47126  SCIP_Real val, /**< unscaled value to check for scaled integrality */
47127  SCIP_Real scalar /**< value to scale val with for checking for integrality */
47128  )
47129 {
47130  assert(scip != NULL);
47131  assert(scip->set != NULL);
47132 
47133  return SCIPsetIsScalingIntegral(scip->set, val, scalar);
47134 }
47135 
47136 /** checks, if given fractional part is smaller than epsilon */
47138  SCIP* scip, /**< SCIP data structure */
47139  SCIP_Real val /**< value to process */
47140  )
47141 {
47142  assert(scip != NULL);
47143  assert(scip->set != NULL);
47144 
47145  return SCIPsetIsFracIntegral(scip->set, val);
47146 }
47147 
47148 /** rounds value + epsilon down to the next integer */
47150  SCIP* scip, /**< SCIP data structure */
47151  SCIP_Real val /**< value to process */
47152  )
47153 {
47154  assert(scip != NULL);
47155  assert(scip->set != NULL);
47156 
47157  return SCIPsetFloor(scip->set, val);
47158 }
47159 
47160 /** rounds value - epsilon up to the next integer */
47162  SCIP* scip, /**< SCIP data structure */
47163  SCIP_Real val /**< value to process */
47164  )
47165 {
47166  assert(scip != NULL);
47167  assert(scip->set != NULL);
47168 
47169  return SCIPsetCeil(scip->set, val);
47170 }
47171 
47172 /** rounds value to the nearest integer with epsilon tolerance */
47174  SCIP* scip, /**< SCIP data structure */
47175  SCIP_Real val /**< value to process */
47176  )
47177 {
47178  assert(scip != NULL);
47179  assert(scip->set != NULL);
47180 
47181  return SCIPsetRound(scip->set, val);
47182 }
47183 
47184 /** returns fractional part of value, i.e. x - floor(x) in epsilon tolerance */
47186  SCIP* scip, /**< SCIP data structure */
47187  SCIP_Real val /**< value to return fractional part for */
47188  )
47189 {
47190  assert(scip != NULL);
47191  assert(scip->set != NULL);
47192 
47193  return SCIPsetFrac(scip->set, val);
47194 }
47195 
47196 /** checks, if values are in range of sumepsilon */
47198  SCIP* scip, /**< SCIP data structure */
47199  SCIP_Real val1, /**< first value to be compared */
47200  SCIP_Real val2 /**< second value to be compared */
47201  )
47202 {
47203  assert(scip != NULL);
47204  assert(scip->set != NULL);
47205 
47206  return SCIPsetIsSumEQ(scip->set, val1, val2);
47207 }
47208 
47209 /** checks, if val1 is (more than sumepsilon) lower than val2 */
47211  SCIP* scip, /**< SCIP data structure */
47212  SCIP_Real val1, /**< first value to be compared */
47213  SCIP_Real val2 /**< second value to be compared */
47214  )
47215 {
47216  assert(scip != NULL);
47217  assert(scip->set != NULL);
47218 
47219  return SCIPsetIsSumLT(scip->set, val1, val2);
47220 }
47221 
47222 /** checks, if val1 is not (more than sumepsilon) greater than val2 */
47224  SCIP* scip, /**< SCIP data structure */
47225  SCIP_Real val1, /**< first value to be compared */
47226  SCIP_Real val2 /**< second value to be compared */
47227  )
47228 {
47229  assert(scip != NULL);
47230  assert(scip->set != NULL);
47231 
47232  return SCIPsetIsSumLE(scip->set, val1, val2);
47233 }
47234 
47235 /** checks, if val1 is (more than sumepsilon) greater than val2 */
47237  SCIP* scip, /**< SCIP data structure */
47238  SCIP_Real val1, /**< first value to be compared */
47239  SCIP_Real val2 /**< second value to be compared */
47240  )
47241 {
47242  assert(scip != NULL);
47243  assert(scip->set != NULL);
47244 
47245  return SCIPsetIsSumGT(scip->set, val1, val2);
47246 }
47247 
47248 /** checks, if val1 is not (more than sumepsilon) lower than val2 */
47250  SCIP* scip, /**< SCIP data structure */
47251  SCIP_Real val1, /**< first value to be compared */
47252  SCIP_Real val2 /**< second value to be compared */
47253  )
47254 {
47255  assert(scip != NULL);
47256  assert(scip->set != NULL);
47257 
47258  return SCIPsetIsSumGE(scip->set, val1, val2);
47259 }
47260 
47261 /** checks, if value is in range sumepsilon of 0.0 */
47263  SCIP* scip, /**< SCIP data structure */
47264  SCIP_Real val /**< value to process */
47265  )
47266 {
47267  assert(scip != NULL);
47268  assert(scip->set != NULL);
47269 
47270  return SCIPsetIsSumZero(scip->set, val);
47271 }
47272 
47273 /** checks, if value is greater than sumepsilon */
47275  SCIP* scip, /**< SCIP data structure */
47276  SCIP_Real val /**< value to process */
47277  )
47278 {
47279  assert(scip != NULL);
47280  assert(scip->set != NULL);
47281 
47282  return SCIPsetIsSumPositive(scip->set, val);
47283 }
47284 
47285 /** checks, if value is lower than -sumepsilon */
47287  SCIP* scip, /**< SCIP data structure */
47288  SCIP_Real val /**< value to process */
47289  )
47290 {
47291  assert(scip != NULL);
47292  assert(scip->set != NULL);
47293 
47294  return SCIPsetIsSumNegative(scip->set, val);
47295 }
47296 
47297 /** checks, if relative difference of values is in range of feasibility tolerance */
47299  SCIP* scip, /**< SCIP data structure */
47300  SCIP_Real val1, /**< first value to be compared */
47301  SCIP_Real val2 /**< second value to be compared */
47302  )
47303 {
47304  assert(scip != NULL);
47305  assert(scip->set != NULL);
47306 
47307  return SCIPsetIsFeasEQ(scip->set, val1, val2);
47308 }
47309 
47310 /** checks, if relative difference val1 and val2 is lower than feasibility tolerance */
47312  SCIP* scip, /**< SCIP data structure */
47313  SCIP_Real val1, /**< first value to be compared */
47314  SCIP_Real val2 /**< second value to be compared */
47315  )
47316 {
47317  assert(scip != NULL);
47318  assert(scip->set != NULL);
47319 
47320  return SCIPsetIsFeasLT(scip->set, val1, val2);
47321 }
47322 
47323 /** checks, if relative difference of val1 and val2 is not greater than feasibility tolerance */
47325  SCIP* scip, /**< SCIP data structure */
47326  SCIP_Real val1, /**< first value to be compared */
47327  SCIP_Real val2 /**< second value to be compared */
47328  )
47329 {
47330  assert(scip != NULL);
47331  assert(scip->set != NULL);
47332 
47333  return SCIPsetIsFeasLE(scip->set, val1, val2);
47334 }
47335 
47336 /** checks, if relative difference of val1 and val2 is greater than feastol */
47338  SCIP* scip, /**< SCIP data structure */
47339  SCIP_Real val1, /**< first value to be compared */
47340  SCIP_Real val2 /**< second value to be compared */
47341  )
47342 {
47343  assert(scip != NULL);
47344  assert(scip->set != NULL);
47345 
47346  return SCIPsetIsFeasGT(scip->set, val1, val2);
47347 }
47348 
47349 /** checks, if relative difference of val1 and val2 is not lower than -feastol */
47351  SCIP* scip, /**< SCIP data structure */
47352  SCIP_Real val1, /**< first value to be compared */
47353  SCIP_Real val2 /**< second value to be compared */
47354  )
47355 {
47356  assert(scip != NULL);
47357  assert(scip->set != NULL);
47358 
47359  return SCIPsetIsFeasGE(scip->set, val1, val2);
47360 }
47361 
47362 /** checks, if value is in range feasibility tolerance of 0.0 */
47364  SCIP* scip, /**< SCIP data structure */
47365  SCIP_Real val /**< value to process */
47366  )
47367 {
47368  assert(scip != NULL);
47369  assert(scip->set != NULL);
47370 
47371  return SCIPsetIsFeasZero(scip->set, val);
47372 }
47373 
47374 /** checks, if value is greater than feasibility tolerance */
47376  SCIP* scip, /**< SCIP data structure */
47377  SCIP_Real val /**< value to process */
47378  )
47379 {
47380  assert(scip != NULL);
47381  assert(scip->set != NULL);
47382 
47383  return SCIPsetIsFeasPositive(scip->set, val);
47384 }
47385 
47386 /** checks, if value is lower than -feasibility tolerance */
47388  SCIP* scip, /**< SCIP data structure */
47389  SCIP_Real val /**< value to process */
47390  )
47391 {
47392  assert(scip != NULL);
47393  assert(scip->set != NULL);
47394 
47395  return SCIPsetIsFeasNegative(scip->set, val);
47396 }
47397 
47398 /** checks, if value is integral within the LP feasibility bounds */
47400  SCIP* scip, /**< SCIP data structure */
47401  SCIP_Real val /**< value to process */
47402  )
47403 {
47404  assert(scip != NULL);
47405  assert(scip->set != NULL);
47406 
47407  return SCIPsetIsFeasIntegral(scip->set, val);
47408 }
47409 
47410 /** checks, if given fractional part is smaller than feastol */
47412  SCIP* scip, /**< SCIP data structure */
47413  SCIP_Real val /**< value to process */
47414  )
47415 {
47416  assert(scip != NULL);
47417  assert(scip->set != NULL);
47418 
47419  return SCIPsetIsFeasFracIntegral(scip->set, val);
47420 }
47421 
47422 /** rounds value + feasibility tolerance down to the next integer */
47424  SCIP* scip, /**< SCIP data structure */
47425  SCIP_Real val /**< value to process */
47426  )
47427 {
47428  assert(scip != NULL);
47429  assert(scip->set != NULL);
47430 
47431  return SCIPsetFeasFloor(scip->set, val);
47432 }
47433 
47434 /** rounds value - feasibility tolerance up to the next integer */
47436  SCIP* scip, /**< SCIP data structure */
47437  SCIP_Real val /**< value to process */
47438  )
47439 {
47440  assert(scip != NULL);
47441  assert(scip->set != NULL);
47442 
47443  return SCIPsetFeasCeil(scip->set, val);
47444 }
47445 
47446 /** rounds value to the nearest integer in feasibility tolerance */
47448  SCIP* scip, /**< SCIP data structure */
47449  SCIP_Real val /**< value to process */
47450  )
47451 {
47452  assert(scip != NULL);
47453  assert(scip->set != NULL);
47454 
47455  return SCIPsetFeasRound(scip->set, val);
47456 }
47457 
47458 /** returns fractional part of value, i.e. x - floor(x) in feasibility tolerance */
47460  SCIP* scip, /**< SCIP data structure */
47461  SCIP_Real val /**< value to process */
47462  )
47463 {
47464  assert(scip != NULL);
47465  assert(scip->set != NULL);
47466 
47467  return SCIPsetFeasFrac(scip->set, val);
47468 }
47469 
47470 /** checks, if relative difference of values is in range of dual feasibility tolerance */
47472  SCIP* scip, /**< SCIP data structure */
47473  SCIP_Real val1, /**< first value to be compared */
47474  SCIP_Real val2 /**< second value to be compared */
47475  )
47476 {
47477  assert(scip != NULL);
47478  assert(scip->set != NULL);
47479 
47480  return SCIPsetIsDualfeasEQ(scip->set, val1, val2);
47481 }
47482 
47483 /** checks, if relative difference val1 and val2 is lower than dual feasibility tolerance */
47485  SCIP* scip, /**< SCIP data structure */
47486  SCIP_Real val1, /**< first value to be compared */
47487  SCIP_Real val2 /**< second value to be compared */
47488  )
47489 {
47490  assert(scip != NULL);
47491  assert(scip->set != NULL);
47492 
47493  return SCIPsetIsDualfeasLT(scip->set, val1, val2);
47494 }
47495 
47496 /** checks, if relative difference of val1 and val2 is not greater than dual feasibility tolerance */
47498  SCIP* scip, /**< SCIP data structure */
47499  SCIP_Real val1, /**< first value to be compared */
47500  SCIP_Real val2 /**< second value to be compared */
47501  )
47502 {
47503  assert(scip != NULL);
47504  assert(scip->set != NULL);
47505 
47506  return SCIPsetIsDualfeasLE(scip->set, val1, val2);
47507 }
47508 
47509 /** checks, if relative difference of val1 and val2 is greater than dual feasibility tolerance */
47511  SCIP* scip, /**< SCIP data structure */
47512  SCIP_Real val1, /**< first value to be compared */
47513  SCIP_Real val2 /**< second value to be compared */
47514  )
47515 {
47516  assert(scip != NULL);
47517  assert(scip->set != NULL);
47518 
47519  return SCIPsetIsDualfeasGT(scip->set, val1, val2);
47520 }
47521 
47522 /** checks, if relative difference of val1 and val2 is not lower than -dual feasibility tolerance */
47524  SCIP* scip, /**< SCIP data structure */
47525  SCIP_Real val1, /**< first value to be compared */
47526  SCIP_Real val2 /**< second value to be compared */
47527  )
47528 {
47529  assert(scip != NULL);
47530  assert(scip->set != NULL);
47531 
47532  return SCIPsetIsDualfeasGE(scip->set, val1, val2);
47533 }
47534 
47535 /** checks, if value is in range dual feasibility tolerance of 0.0 */
47537  SCIP* scip, /**< SCIP data structure */
47538  SCIP_Real val /**< value to process */
47539  )
47540 {
47541  assert(scip != NULL);
47542  assert(scip->set != NULL);
47543 
47544  return SCIPsetIsDualfeasZero(scip->set, val);
47545 }
47546 
47547 /** checks, if value is greater than dual feasibility tolerance */
47549  SCIP* scip, /**< SCIP data structure */
47550  SCIP_Real val /**< value to process */
47551  )
47552 {
47553  assert(scip != NULL);
47554  assert(scip->set != NULL);
47555 
47556  return SCIPsetIsDualfeasPositive(scip->set, val);
47557 }
47558 
47559 /** checks, if value is lower than -dual feasibility tolerance */
47561  SCIP* scip, /**< SCIP data structure */
47562  SCIP_Real val /**< value to process */
47563  )
47564 {
47565  assert(scip != NULL);
47566  assert(scip->set != NULL);
47567 
47568  return SCIPsetIsDualfeasNegative(scip->set, val);
47569 }
47570 
47571 /** checks, if value is integral within the LP dual feasibility tolerance */
47573  SCIP* scip, /**< SCIP data structure */
47574  SCIP_Real val /**< value to process */
47575  )
47576 {
47577  assert(scip != NULL);
47578  assert(scip->set != NULL);
47579 
47580  return SCIPsetIsDualfeasIntegral(scip->set, val);
47581 }
47582 
47583 /** checks, if given fractional part is smaller than dual feasibility tolerance */
47585  SCIP* scip, /**< SCIP data structure */
47586  SCIP_Real val /**< value to process */
47587  )
47588 {
47589  assert(scip != NULL);
47590  assert(scip->set != NULL);
47591 
47592  return SCIPsetIsDualfeasFracIntegral(scip->set, val);
47593 }
47594 
47595 /** rounds value + dual feasibility tolerance down to the next integer */
47597  SCIP* scip, /**< SCIP data structure */
47598  SCIP_Real val /**< value to process */
47599  )
47600 {
47601  assert(scip != NULL);
47602  assert(scip->set != NULL);
47603 
47604  return SCIPsetDualfeasFloor(scip->set, val);
47605 }
47606 
47607 /** rounds value - dual feasibility tolerance up to the next integer */
47609  SCIP* scip, /**< SCIP data structure */
47610  SCIP_Real val /**< value to process */
47611  )
47612 {
47613  assert(scip != NULL);
47614  assert(scip->set != NULL);
47615 
47616  return SCIPsetDualfeasCeil(scip->set, val);
47617 }
47618 
47619 /** rounds value to the nearest integer in dual feasibility tolerance */
47621  SCIP* scip, /**< SCIP data structure */
47622  SCIP_Real val /**< value to process */
47623  )
47624 {
47625  assert(scip != NULL);
47626  assert(scip->set != NULL);
47627 
47628  return SCIPsetDualfeasRound(scip->set, val);
47629 }
47630 
47631 /** returns fractional part of value, i.e. x - floor(x) in dual feasibility tolerance */
47633  SCIP* scip, /**< SCIP data structure */
47634  SCIP_Real val /**< value to process */
47635  )
47636 {
47637  assert(scip != NULL);
47638  assert(scip->set != NULL);
47639 
47640  return SCIPsetDualfeasFrac(scip->set, val);
47641 }
47642 
47643 /** checks, if the given new lower bound is at least min(oldub - oldlb, |oldlb|) times the bound
47644  * strengthening epsilon better than the old one
47645  */
47647  SCIP* scip, /**< SCIP data structure */
47648  SCIP_Real newlb, /**< new lower bound */
47649  SCIP_Real oldlb, /**< old lower bound */
47650  SCIP_Real oldub /**< old upper bound */
47651  )
47652 {
47653  assert(scip != NULL);
47654 
47655  return SCIPsetIsLbBetter(scip->set, newlb, oldlb, oldub);
47656 }
47657 
47658 /** checks, if the given new upper bound is at least min(oldub - oldlb, |oldub|) times the bound
47659  * strengthening epsilon better than the old one
47660  */
47662  SCIP* scip, /**< SCIP data structure */
47663  SCIP_Real newub, /**< new upper bound */
47664  SCIP_Real oldlb, /**< old lower bound */
47665  SCIP_Real oldub /**< old upper bound */
47666  )
47667 {
47668  assert(scip != NULL);
47669 
47670  return SCIPsetIsUbBetter(scip->set, newub, oldlb, oldub);
47671 }
47672 
47673 /** checks, if relative difference of values is in range of epsilon */
47675  SCIP* scip, /**< SCIP data structure */
47676  SCIP_Real val1, /**< first value to be compared */
47677  SCIP_Real val2 /**< second value to be compared */
47678  )
47679 {
47680  assert(scip != NULL);
47681  assert(scip->set != NULL);
47682 
47683  return SCIPsetIsRelEQ(scip->set, val1, val2);
47684 }
47685 
47686 /** checks, if relative difference of val1 and val2 is lower than epsilon */
47688  SCIP* scip, /**< SCIP data structure */
47689  SCIP_Real val1, /**< first value to be compared */
47690  SCIP_Real val2 /**< second value to be compared */
47691  )
47692 {
47693  assert(scip != NULL);
47694  assert(scip->set != NULL);
47695 
47696  return SCIPsetIsRelLT(scip->set, val1, val2);
47697 }
47698 
47699 /** checks, if relative difference of val1 and val2 is not greater than epsilon */
47701  SCIP* scip, /**< SCIP data structure */
47702  SCIP_Real val1, /**< first value to be compared */
47703  SCIP_Real val2 /**< second value to be compared */
47704  )
47705 {
47706  assert(scip != NULL);
47707  assert(scip->set != NULL);
47708 
47709  return SCIPsetIsRelLE(scip->set, val1, val2);
47710 }
47711 
47712 /** checks, if relative difference of val1 and val2 is greater than epsilon */
47714  SCIP* scip, /**< SCIP data structure */
47715  SCIP_Real val1, /**< first value to be compared */
47716  SCIP_Real val2 /**< second value to be compared */
47717  )
47718 {
47719  assert(scip != NULL);
47720  assert(scip->set != NULL);
47721 
47722  return SCIPsetIsRelGT(scip->set, val1, val2);
47723 }
47724 
47725 /** checks, if relative difference of val1 and val2 is not lower than -epsilon */
47727  SCIP* scip, /**< SCIP data structure */
47728  SCIP_Real val1, /**< first value to be compared */
47729  SCIP_Real val2 /**< second value to be compared */
47730  )
47731 {
47732  assert(scip != NULL);
47733  assert(scip->set != NULL);
47734 
47735  return SCIPsetIsRelGE(scip->set, val1, val2);
47736 }
47737 
47738 /** checks, if relative difference of values is in range of sumepsilon */
47740  SCIP* scip, /**< SCIP data structure */
47741  SCIP_Real val1, /**< first value to be compared */
47742  SCIP_Real val2 /**< second value to be compared */
47743  )
47744 {
47745  assert(scip != NULL);
47746  assert(scip->set != NULL);
47747 
47748  return SCIPsetIsSumRelEQ(scip->set, val1, val2);
47749 }
47750 
47751 /** checks, if relative difference of val1 and val2 is lower than sumepsilon */
47753  SCIP* scip, /**< SCIP data structure */
47754  SCIP_Real val1, /**< first value to be compared */
47755  SCIP_Real val2 /**< second value to be compared */
47756  )
47757 {
47758  assert(scip != NULL);
47759  assert(scip->set != NULL);
47760 
47761  return SCIPsetIsSumRelLT(scip->set, val1, val2);
47762 }
47763 
47764 /** checks, if relative difference of val1 and val2 is not greater than sumepsilon */
47766  SCIP* scip, /**< SCIP data structure */
47767  SCIP_Real val1, /**< first value to be compared */
47768  SCIP_Real val2 /**< second value to be compared */
47769  )
47770 {
47771  assert(scip != NULL);
47772  assert(scip->set != NULL);
47773 
47774  return SCIPsetIsSumRelLE(scip->set, val1, val2);
47775 }
47776 
47777 /** checks, if relative difference of val1 and val2 is greater than sumepsilon */
47779  SCIP* scip, /**< SCIP data structure */
47780  SCIP_Real val1, /**< first value to be compared */
47781  SCIP_Real val2 /**< second value to be compared */
47782  )
47783 {
47784  assert(scip != NULL);
47785  assert(scip->set != NULL);
47786 
47787  return SCIPsetIsSumRelGT(scip->set, val1, val2);
47788 }
47789 
47790 /** checks, if relative difference of val1 and val2 is not lower than -sumepsilon */
47792  SCIP* scip, /**< SCIP data structure */
47793  SCIP_Real val1, /**< first value to be compared */
47794  SCIP_Real val2 /**< second value to be compared */
47795  )
47796 {
47797  assert(scip != NULL);
47798  assert(scip->set != NULL);
47799 
47800  return SCIPsetIsSumRelGE(scip->set, val1, val2);
47801 }
47802 
47803 /** converts the given real number representing an integer to an int; in optimized mode the function gets inlined for
47804  * performance; in debug mode we check some additional conditions
47805  */
47807  SCIP* scip, /**< SCIP data structure */
47808  SCIP_Real real /**< double bound to convert */
47809  )
47810 {
47811  assert(SCIPisFeasIntegral(scip, real));
47812  assert(SCIPisFeasEQ(scip, real, (SCIP_Real)(int)(real < 0 ? real - 0.5 : real + 0.5)));
47813  assert(real < INT_MAX);
47814  assert(real > INT_MIN);
47815 
47816  return (int)(real < 0 ? (real - 0.5) : (real + 0.5));
47817 }
47818 
47819 /** converts the given real number representing an integer to a long integer; in optimized mode the function gets inlined for
47820  * performance; in debug mode we check some additional conditions
47821  */
47823  SCIP* scip, /**< SCIP data structure */
47824  SCIP_Real real /**< double bound to convert */
47825  )
47826 {
47827  assert(SCIPisFeasIntegral(scip, real));
47828  assert(SCIPisFeasEQ(scip, real, (SCIP_Real)(SCIP_Longint)(real < 0 ? real - 0.5 : real + 0.5)));
47829  assert(real < SCIP_LONGINT_MAX);
47830  assert(real > SCIP_LONGINT_MIN);
47831 
47832  return (SCIP_Longint)(real < 0 ? (real - 0.5) : (real + 0.5));
47833 }
47834 
47835 /** Checks, if an iteratively updated value is reliable or should be recomputed from scratch.
47836  * This is useful, if the value, e.g., the activity of a linear constraint or the pseudo objective value, gets a high
47837  * absolute value during the optimization process which is later reduced significantly. In this case, the last digits
47838  * were canceled out when increasing the value and are random after decreasing it.
47839  * We do not consider the cancellations which can occur during increasing the absolute value because they just cannot
47840  * be expressed using fixed precision floating point arithmetic, anymore.
47841  * In order to get more reliable values, the idea is to always store the last reliable value, where increasing the
47842  * absolute of the value is viewed as preserving reliability. Then, after each update, the new absolute value can be
47843  * compared against the last reliable one with this method, checking whether it was decreased by a factor of at least
47844  * "lp/recompfac" and should be recomputed.
47845  */
47847  SCIP* scip, /**< SCIP data structure */
47848  SCIP_Real newvalue, /**< new value after update */
47849  SCIP_Real oldvalue /**< old value, i.e., last reliable value */
47850  )
47851 {
47852  assert(scip != NULL);
47853 
47854  SCIP_CALL_ABORT( checkStage(scip, "SCIPisUpdateUnreliable", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
47855 
47856  return SCIPsetIsUpdateUnreliable(scip->set, newvalue, oldvalue);
47857 }
47858 
47859 /** creates a dynamic array of real values
47860  *
47861  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
47862  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
47863  */
47865  SCIP* scip, /**< SCIP data structure */
47866  SCIP_REALARRAY** realarray /**< pointer to store the real array */
47867  )
47868 {
47869  assert(scip != NULL);
47870 
47871  SCIP_CALL( SCIPrealarrayCreate(realarray, SCIPblkmem(scip)) );
47872 
47873  return SCIP_OKAY;
47874 }
47875 
47876 /** frees a dynamic array of real values
47877  *
47878  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
47879  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
47880  */
47882  SCIP* scip, /**< SCIP data structure */
47883  SCIP_REALARRAY** realarray /**< pointer to the real array */
47884  )
47885 {
47886  assert(scip != NULL);
47887 
47888  SCIP_CALL( SCIPrealarrayFree(realarray) );
47889 
47890  return SCIP_OKAY;
47891 }
47892 
47893 /** extends dynamic array to be able to store indices from minidx to maxidx
47894  *
47895  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
47896  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
47897  */
47899  SCIP* scip, /**< SCIP data structure */
47900  SCIP_REALARRAY* realarray, /**< dynamic real array */
47901  int minidx, /**< smallest index to allocate storage for */
47902  int maxidx /**< largest index to allocate storage for */
47903  )
47904 {
47905  assert(scip != NULL);
47906 
47907  SCIP_CALL( SCIPrealarrayExtend(realarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
47908 
47909  return SCIP_OKAY;
47910 }
47911 
47912 /** clears a dynamic real array
47913  *
47914  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
47915  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
47916  */
47918  SCIP* scip, /**< SCIP data structure */
47919  SCIP_REALARRAY* realarray /**< dynamic real array */
47920  )
47921 {
47922  assert(scip != NULL);
47923 
47924  SCIP_CALL( SCIPrealarrayClear(realarray) );
47925 
47926  return SCIP_OKAY;
47927 }
47928 
47929 /** gets value of entry in dynamic array
47930  *
47931  * @return value of entry in dynamic array
47932  */
47934  SCIP* scip, /**< SCIP data structure */
47935  SCIP_REALARRAY* realarray, /**< dynamic real array */
47936  int idx /**< array index to get value for */
47937  )
47938 {
47939  assert(scip != NULL);
47940 
47941  return SCIPrealarrayGetVal(realarray, idx);
47942 }
47943 
47944 /** sets value of entry in dynamic array
47945  *
47946  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
47947  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
47948  */
47950  SCIP* scip, /**< SCIP data structure */
47951  SCIP_REALARRAY* realarray, /**< dynamic real array */
47952  int idx, /**< array index to set value for */
47953  SCIP_Real val /**< value to set array index to */
47954  )
47955 {
47956  assert(scip != NULL);
47957 
47958  SCIP_CALL( SCIPrealarraySetVal(realarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
47959 
47960  return SCIP_OKAY;
47961 }
47962 
47963 /** increases value of entry in dynamic array
47964  *
47965  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
47966  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
47967  */
47969  SCIP* scip, /**< SCIP data structure */
47970  SCIP_REALARRAY* realarray, /**< dynamic real array */
47971  int idx, /**< array index to increase value for */
47972  SCIP_Real incval /**< value to increase array index */
47973  )
47974 {
47975  assert(scip != NULL);
47976 
47977  SCIP_CALL( SCIPrealarrayIncVal(realarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, incval) );
47978 
47979  return SCIP_OKAY;
47980 }
47981 
47982 /** returns the minimal index of all stored non-zero elements
47983  *
47984  * @return the minimal index of all stored non-zero elements
47985  */
47987  SCIP* scip, /**< SCIP data structure */
47988  SCIP_REALARRAY* realarray /**< dynamic real array */
47989  )
47990 {
47991  assert(scip != NULL);
47992 
47993  return SCIPrealarrayGetMinIdx(realarray);
47994 }
47995 
47996 /** returns the maximal index of all stored non-zero elements
47997  *
47998  * @return the maximal index of all stored non-zero elements
47999  */
48001  SCIP* scip, /**< SCIP data structure */
48002  SCIP_REALARRAY* realarray /**< dynamic real array */
48003  )
48004 {
48005  assert(scip != NULL);
48006 
48007  return SCIPrealarrayGetMaxIdx(realarray);
48008 }
48009 
48010 /** creates a dynamic array of int values
48011  *
48012  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48013  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48014  */
48016  SCIP* scip, /**< SCIP data structure */
48017  SCIP_INTARRAY** intarray /**< pointer to store the int array */
48018  )
48019 {
48020  assert(scip != NULL);
48021 
48022  SCIP_CALL( SCIPintarrayCreate(intarray, SCIPblkmem(scip)) );
48023 
48024  return SCIP_OKAY;
48025 }
48026 
48027 /** frees a dynamic array of int values
48028  *
48029  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48030  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48031  */
48033  SCIP* scip, /**< SCIP data structure */
48034  SCIP_INTARRAY** intarray /**< pointer to the int array */
48035  )
48036 {
48037  assert(scip != NULL);
48038 
48039  SCIP_CALL( SCIPintarrayFree(intarray) );
48040 
48041  return SCIP_OKAY;
48042 }
48043 
48044 /** extends dynamic array to be able to store indices from minidx to maxidx
48045  *
48046  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48047  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48048  */
48050  SCIP* scip, /**< SCIP data structure */
48051  SCIP_INTARRAY* intarray, /**< dynamic int array */
48052  int minidx, /**< smallest index to allocate storage for */
48053  int maxidx /**< largest index to allocate storage for */
48054  )
48055 {
48056  assert(scip != NULL);
48057 
48058  SCIP_CALL( SCIPintarrayExtend(intarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
48059 
48060  return SCIP_OKAY;
48061 }
48062 
48063 /** clears a dynamic int array
48064  *
48065  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48066  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48067  */
48069  SCIP* scip, /**< SCIP data structure */
48070  SCIP_INTARRAY* intarray /**< dynamic int array */
48071  )
48072 {
48073  assert(scip != NULL);
48074 
48075  SCIP_CALL( SCIPintarrayClear(intarray) );
48076 
48077  return SCIP_OKAY;
48078 }
48079 
48080 /** gets value of entry in dynamic array
48081  *
48082  * @return value of entry in dynamic array
48083  */
48085  SCIP* scip, /**< SCIP data structure */
48086  SCIP_INTARRAY* intarray, /**< dynamic int array */
48087  int idx /**< array index to get value for */
48088  )
48089 {
48090  assert(scip != NULL);
48091 
48092  return SCIPintarrayGetVal(intarray, idx);
48093 }
48094 
48095 /** sets value of entry in dynamic array
48096  *
48097  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48098  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48099  */
48101  SCIP* scip, /**< SCIP data structure */
48102  SCIP_INTARRAY* intarray, /**< dynamic int array */
48103  int idx, /**< array index to set value for */
48104  int val /**< value to set array index to */
48105  )
48106 {
48107  assert(scip != NULL);
48108 
48109  SCIP_CALL( SCIPintarraySetVal(intarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
48110 
48111  return SCIP_OKAY;
48112 }
48113 
48114 /** increases value of entry in dynamic array
48115  *
48116  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48117  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48118  */
48120  SCIP* scip, /**< SCIP data structure */
48121  SCIP_INTARRAY* intarray, /**< dynamic int array */
48122  int idx, /**< array index to increase value for */
48123  int incval /**< value to increase array index */
48124  )
48125 {
48126  assert(scip != NULL);
48127 
48128  SCIP_CALL( SCIPintarrayIncVal(intarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, incval) );
48129 
48130  return SCIP_OKAY;
48131 }
48132 
48133 /** returns the minimal index of all stored non-zero elements
48134  *
48135  * @return the minimal index of all stored non-zero elements
48136  */
48138  SCIP* scip, /**< SCIP data structure */
48139  SCIP_INTARRAY* intarray /**< dynamic int array */
48140  )
48141 {
48142  assert(scip != NULL);
48143 
48144  return SCIPintarrayGetMinIdx(intarray);
48145 }
48146 
48147 /** returns the maximal index of all stored non-zero elements
48148  *
48149  * @return the maximal index of all stored non-zero elements
48150  */
48152  SCIP* scip, /**< SCIP data structure */
48153  SCIP_INTARRAY* intarray /**< dynamic int array */
48154  )
48155 {
48156  assert(scip != NULL);
48157 
48158  return SCIPintarrayGetMaxIdx(intarray);
48159 }
48160 
48161 /** creates a dynamic array of bool values
48162  *
48163  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48164  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48165  */
48167  SCIP* scip, /**< SCIP data structure */
48168  SCIP_BOOLARRAY** boolarray /**< pointer to store the bool array */
48169  )
48170 {
48171  assert(scip != NULL);
48172 
48173  SCIP_CALL( SCIPboolarrayCreate(boolarray, SCIPblkmem(scip)) );
48174 
48175  return SCIP_OKAY;
48176 }
48177 
48178 /** frees a dynamic array of bool values
48179  *
48180  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48181  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48182  */
48184  SCIP* scip, /**< SCIP data structure */
48185  SCIP_BOOLARRAY** boolarray /**< pointer to the bool array */
48186  )
48187 {
48188  assert(scip != NULL);
48189 
48190  SCIP_CALL( SCIPboolarrayFree(boolarray) );
48191 
48192  return SCIP_OKAY;
48193 }
48194 
48195 /** extends dynamic array to be able to store indices from minidx to maxidx
48196  *
48197  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48198  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48199  */
48201  SCIP* scip, /**< SCIP data structure */
48202  SCIP_BOOLARRAY* boolarray, /**< dynamic bool array */
48203  int minidx, /**< smallest index to allocate storage for */
48204  int maxidx /**< largest index to allocate storage for */
48205  )
48206 {
48207  assert(scip != NULL);
48208 
48209  SCIP_CALL( SCIPboolarrayExtend(boolarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
48210 
48211  return SCIP_OKAY;
48212 }
48213 
48214 /** clears a dynamic bool array
48215  *
48216  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48217  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48218  */
48220  SCIP* scip, /**< SCIP data structure */
48221  SCIP_BOOLARRAY* boolarray /**< dynamic bool array */
48222  )
48223 {
48224  assert(scip != NULL);
48225 
48226  SCIP_CALL( SCIPboolarrayClear(boolarray) );
48227 
48228  return SCIP_OKAY;
48229 }
48230 
48231 /** gets value of entry in dynamic array
48232  *
48233  * @return value of entry in dynamic array at position idx
48234  */
48236  SCIP* scip, /**< SCIP data structure */
48237  SCIP_BOOLARRAY* boolarray, /**< dynamic bool array */
48238  int idx /**< array index to get value for */
48239  )
48240 {
48241  assert(scip != NULL);
48242 
48243  return SCIPboolarrayGetVal(boolarray, idx);
48244 }
48245 
48246 /** sets value of entry in dynamic array
48247  *
48248  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48249  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48250  */
48252  SCIP* scip, /**< SCIP data structure */
48253  SCIP_BOOLARRAY* boolarray, /**< dynamic bool array */
48254  int idx, /**< array index to set value for */
48255  SCIP_Bool val /**< value to set array index to */
48256  )
48257 {
48258  assert(scip != NULL);
48259 
48260  SCIP_CALL( SCIPboolarraySetVal(boolarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
48261 
48262  return SCIP_OKAY;
48263 }
48264 
48265 /** returns the minimal index of all stored non-zero elements
48266  *
48267  * @return the minimal index of all stored non-zero elements
48268  */
48270  SCIP* scip, /**< SCIP data structure */
48271  SCIP_BOOLARRAY* boolarray /**< dynamic bool array */
48272  )
48273 {
48274  assert(scip != NULL);
48275 
48276  return SCIPboolarrayGetMinIdx(boolarray);
48277 }
48278 
48279 /** returns the maximal index of all stored non-zero elements
48280  *
48281  * @return the maximal index of all stored non-zero elements
48282  */
48284  SCIP* scip, /**< SCIP data structure */
48285  SCIP_BOOLARRAY* boolarray /**< dynamic bool array */
48286  )
48287 {
48288  assert(scip != NULL);
48289 
48290  return SCIPboolarrayGetMaxIdx(boolarray);
48291 }
48292 
48293 /** creates a dynamic array of pointers
48294  *
48295  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48296  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48297  */
48299  SCIP* scip, /**< SCIP data structure */
48300  SCIP_PTRARRAY** ptrarray /**< pointer to store the int array */
48301  )
48302 {
48303  assert(scip != NULL);
48304 
48305  SCIP_CALL( SCIPptrarrayCreate(ptrarray, SCIPblkmem(scip)) );
48306 
48307  return SCIP_OKAY;
48308 }
48309 
48310 /** frees a dynamic array of pointers
48311  *
48312  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48313  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48314  */
48316  SCIP* scip, /**< SCIP data structure */
48317  SCIP_PTRARRAY** ptrarray /**< pointer to the int array */
48318  )
48319 {
48320  assert(scip != NULL);
48321 
48322  SCIP_CALL( SCIPptrarrayFree(ptrarray) );
48323 
48324  return SCIP_OKAY;
48325 }
48326 
48327 /** extends dynamic array to be able to store indices from minidx to maxidx
48328  *
48329  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48330  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48331  */
48333  SCIP* scip, /**< SCIP data structure */
48334  SCIP_PTRARRAY* ptrarray, /**< dynamic int array */
48335  int minidx, /**< smallest index to allocate storage for */
48336  int maxidx /**< largest index to allocate storage for */
48337  )
48338 {
48339  assert(scip != NULL);
48340 
48341  SCIP_CALL( SCIPptrarrayExtend(ptrarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
48342 
48343  return SCIP_OKAY;
48344 }
48345 
48346 /** clears a dynamic pointer array
48347  *
48348  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48349  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48350  */
48352  SCIP* scip, /**< SCIP data structure */
48353  SCIP_PTRARRAY* ptrarray /**< dynamic int array */
48354  )
48355 {
48356  assert(scip != NULL);
48357 
48358  SCIP_CALL( SCIPptrarrayClear(ptrarray) );
48359 
48360  return SCIP_OKAY;
48361 }
48362 
48363 /** gets value of entry in dynamic array */
48365  SCIP* scip, /**< SCIP data structure */
48366  SCIP_PTRARRAY* ptrarray, /**< dynamic int array */
48367  int idx /**< array index to get value for */
48368  )
48369 {
48370  assert(scip != NULL);
48371 
48372  return SCIPptrarrayGetVal(ptrarray, idx);
48373 }
48374 
48375 /** sets value of entry in dynamic array
48376  *
48377  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48378  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48379  */
48381  SCIP* scip, /**< SCIP data structure */
48382  SCIP_PTRARRAY* ptrarray, /**< dynamic int array */
48383  int idx, /**< array index to set value for */
48384  void* val /**< value to set array index to */
48385  )
48386 {
48387  assert(scip != NULL);
48388 
48389  SCIP_CALL( SCIPptrarraySetVal(ptrarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
48390 
48391  return SCIP_OKAY;
48392 }
48393 
48394 /** returns the minimal index of all stored non-zero elements
48395  *
48396  * @return the minimal index of all stored non-zero elements
48397  */
48399  SCIP* scip, /**< SCIP data structure */
48400  SCIP_PTRARRAY* ptrarray /**< dynamic ptr array */
48401  )
48402 {
48403  assert(scip != NULL);
48404 
48405  return SCIPptrarrayGetMinIdx(ptrarray);
48406 }
48407 
48408 /** returns the maximal index of all stored non-zero elements
48409  *
48410  * @return the maximal index of all stored non-zero elements
48411  */
48413  SCIP* scip, /**< SCIP data structure */
48414  SCIP_PTRARRAY* ptrarray /**< dynamic ptr array */
48415  )
48416 {
48417  assert(scip != NULL);
48418 
48419  return SCIPptrarrayGetMaxIdx(ptrarray);
48420 }
48421 
48422 /** validate the result of the solve
48423  *
48424  * the validation includes
48425  *
48426  * - checking the feasibility of the incumbent solution in the original problem (using SCIPcheckSolOrig())
48427  *
48428  * - checking if the objective bounds computed by SCIP agree with external primal and dual reference bounds.
48429  *
48430  * All external reference bounds the original problem space and the original objective sense.
48431  *
48432  * For infeasible problems, +/-SCIPinfinity() should be passed as reference bounds depending on the objective sense
48433  * of the original problem.
48434  */
48436  SCIP* scip, /**< SCIP data structure */
48437  SCIP_Real primalreference, /**< external primal reference value for the problem, or SCIP_UNKNOWN */
48438  SCIP_Real dualreference, /**< external dual reference value for the problem, or SCIP_UNKNOWN */
48439  SCIP_Real reftol, /**< relative tolerance for acceptable violation of reference values */
48440  SCIP_Bool quiet, /**< TRUE if no status line should be printed */
48441  SCIP_Bool* feasible, /**< pointer to store if the best solution is feasible in the original problem,
48442  * or NULL */
48443  SCIP_Bool* primalboundcheck, /**< pointer to store if the primal bound respects the given dual reference
48444  * value, or NULL */
48445  SCIP_Bool* dualboundcheck /**< pointer to store if the dual bound respects the given primal reference
48446  * value, or NULL */
48447  )
48448 {
48449  SCIP_Bool localfeasible;
48450  SCIP_Bool localprimalboundcheck;
48451  SCIP_Bool localdualboundcheck;
48452  SCIP_Real primviol;
48453  SCIP_Real dualviol;
48454  assert(scip != NULL);
48455 
48456  /* if no problem exists, there is no need for validation */
48457  if( SCIPgetStage(scip) < SCIP_STAGE_PROBLEM )
48458  {
48459  if( feasible != NULL )
48460  *feasible = TRUE;
48461  if( primalboundcheck != NULL )
48462  *primalboundcheck = TRUE;
48463  if( dualboundcheck != NULL )
48464  *dualboundcheck = TRUE;
48465 
48466  return SCIP_OKAY;
48467  }
48468 
48469  localfeasible = TRUE;
48470  localdualboundcheck = TRUE;
48471 
48472  /* check the best solution for feasibility in the original problem */
48473  if( SCIPgetNSols(scip) > 0 )
48474  {
48475  SCIP_SOL* bestsol = SCIPgetBestSol(scip);
48476  SCIP_Real checkfeastolfac;
48477  SCIP_Real oldfeastol;
48478 
48479  assert(bestsol != NULL);
48480 
48481  /* scale feasibility tolerance by set->num_checkfeastolfac */
48482  oldfeastol = SCIPfeastol(scip);
48483  SCIP_CALL( SCIPgetRealParam(scip, "numerics/checkfeastolfac", &checkfeastolfac) );
48484  if( !SCIPisEQ(scip, checkfeastolfac, 1.0) )
48485  {
48486  SCIP_CALL( SCIPchgFeastol(scip, oldfeastol * checkfeastolfac) );
48487  }
48488 
48489  SCIP_CALL( SCIPcheckSolOrig(scip, bestsol, &localfeasible, !quiet, TRUE) );
48490 
48491  /* restore old feasibilty tolerance */
48492  if( !SCIPisEQ(scip, checkfeastolfac, 1.0) )
48493  {
48494  SCIP_CALL( SCIPchgFeastol(scip, oldfeastol) );
48495  }
48496  }
48497  else
48498  {
48499  localfeasible = TRUE;
48500  }
48501 
48502  primviol = 0.0;
48503  dualviol = 0.0;
48504  /* check the primal and dual bounds computed by SCIP against the external reference values within reference tolerance */
48505  /* solution for an infeasible problem */
48506  if( SCIPgetNSols(scip) > 0 && ((SCIPgetObjsense(scip) == SCIP_OBJSENSE_MINIMIZE && SCIPisInfinity(scip, dualreference))
48507  || (SCIPgetObjsense(scip) == SCIP_OBJSENSE_MAXIMIZE && SCIPisInfinity(scip, -dualreference))) )
48508  localprimalboundcheck = FALSE;
48509  else
48510  {
48511  /* check if reference primal bound is not better than the proven dual bound and, if SCIP claims to be optimal,
48512  * if the
48513  */
48514  SCIP_Real pb = SCIPgetPrimalbound(scip);
48515  SCIP_Real db = SCIPgetDualbound(scip);
48516 
48517  /* compute the relative violation between the primal bound and dual reference value, and vice versa */
48519  {
48520  if( dualreference != SCIP_UNKNOWN ) /*lint !e777 */
48521  primviol = SCIPrelDiff(dualreference, pb);
48522  if( primalreference != SCIP_UNKNOWN ) /*lint !e777 */
48523  dualviol = SCIPrelDiff(db, primalreference);
48524  }
48525  else
48526  {
48527  if( dualreference != SCIP_UNKNOWN ) /*lint !e777 */
48528  primviol = SCIPrelDiff(pb, dualreference);
48529 
48530  if( primalreference != SCIP_UNKNOWN ) /*lint !e777 */
48531  dualviol = SCIPrelDiff(primalreference, db);
48532  }
48533  primviol = MAX(primviol, 0.0);
48534  dualviol = MAX(dualviol, 0.0);
48535 
48536  localprimalboundcheck = EPSP(reftol, primviol);
48537  localdualboundcheck = EPSP(reftol, dualviol);
48538  }
48539 
48540  if( !quiet )
48541  {
48542  SCIPinfoMessage(scip, NULL, "Validation : ");
48543  if( ! localfeasible )
48544  SCIPinfoMessage(scip, NULL, "Fail (infeasible)");
48545  else if( ! localprimalboundcheck )
48546  SCIPinfoMessage(scip, NULL, "Fail (primal bound)");
48547  else if( ! localdualboundcheck )
48548  SCIPinfoMessage(scip, NULL, "Fail (dual bound)");
48549  else
48550  SCIPinfoMessage(scip, NULL, "Success");
48551  SCIPinfoMessage(scip, NULL, "\n");
48552  SCIPinfoMessage(scip, NULL, " %-17s: %10u\n", "cons violation", !localfeasible);
48553  SCIPinfoMessage(scip, NULL, " %-17s: %10.8g (reference: %16.9e)\n", "primal violation", primviol, dualreference);
48554  SCIPinfoMessage(scip, NULL, " %-17s: %10.8g (reference: %16.9e)\n", "dual violation", dualviol, primalreference);
48555  }
48556 
48557  if( feasible != NULL )
48558  *feasible = localfeasible;
48559  if( primalboundcheck != NULL )
48560  *primalboundcheck = localprimalboundcheck;
48561  if( dualboundcheck != NULL )
48562  *dualboundcheck = localdualboundcheck;
48563 
48564  return SCIP_OKAY;
48565 }
48566 
48567 /** creates directed graph structure */
48569  SCIP* scip, /**< SCIP data structure */
48570  SCIP_DIGRAPH** digraph, /**< pointer to store the created directed graph */
48571  int nnodes /**< number of nodes */
48572  )
48573 {
48574  assert(scip != NULL);
48575  assert(digraph != NULL);
48576 
48577  SCIP_CALL( SCIPdigraphCreate(digraph, scip->mem->probmem, nnodes) );
48578 
48579  return SCIP_OKAY;
48580 }
48581 
48582 /** copies directed graph structure
48583  *
48584  * The copying procedure uses the memory of the passed SCIP instance. The user must ensure that the digraph lives
48585  * as most as long as the SCIP instance.
48586  *
48587  * @note The data in nodedata is copied verbatim. This possibly has to be adapted by the user.
48588  */
48590  SCIP* scip, /**< SCIP data structure */
48591  SCIP_DIGRAPH** targetdigraph, /**< pointer to store the copied directed graph */
48592  SCIP_DIGRAPH* sourcedigraph /**< source directed graph */
48593  )
48594 {
48595  assert(scip != NULL);
48596  assert(sourcedigraph != NULL);
48597  assert(targetdigraph != NULL);
48598 
48599  SCIP_CALL( SCIPdigraphCopy(targetdigraph, sourcedigraph, scip->mem->probmem) );
48600 
48601  return SCIP_OKAY;
48602 }
48603 
48604 /** creates and initializes a random number generator
48605  *
48606  * @note The initial seed is changed using SCIPinitializeRandomSeed()
48607  */
48609  SCIP* scip, /**< SCIP data structure */
48610  SCIP_RANDNUMGEN** randnumgen, /**< random number generator */
48611  unsigned int initialseed /**< initial random seed */
48612  )
48613 {
48614  unsigned int modifiedseed;
48615  assert(scip != NULL);
48616  assert(randnumgen != NULL);
48617 
48618  modifiedseed = SCIPinitializeRandomSeed(scip, (int)(initialseed % INT_MAX));
48619 
48620  SCIP_CALL( SCIPrandomCreate(randnumgen, SCIPblkmem(scip), modifiedseed) );
48621 
48622  return SCIP_OKAY;
48623 }
48624 
48625 /** frees a random number generator */
48627  SCIP* scip, /**< SCIP data structure */
48628  SCIP_RANDNUMGEN** randnumgen /**< random number generator */
48629  )
48630 {
48631  assert(scip != NULL);
48632  assert(randnumgen != NULL);
48633 
48634  SCIPrandomFree(randnumgen, SCIPblkmem(scip));
48635 }
48636 
48637 /** initializes a random number generator with a given start seed
48638  *
48639  * @note The seed is changed using SCIPinitializeRandomSeed()
48640  */
48642  SCIP* scip, /**< SCIP data structure */
48643  SCIP_RANDNUMGEN* randnumgen, /**< random number generator */
48644  unsigned int seed /**< new random seed */
48645  )
48646 {
48647  unsigned int modifiedseed;
48648  assert(scip != NULL);
48649  assert(randnumgen != NULL);
48650 
48651  modifiedseed = SCIPinitializeRandomSeed(scip, (int)(seed % INT_MAX));
48652 
48653  SCIPrandomSetSeed(randnumgen, modifiedseed);
48654 }
48655 
48656 /** creates a disjoint set (union find) structure \p uf for \p ncomponents many components (of size one) */
48658  SCIP* scip, /**< SCIP data structure */
48659  SCIP_DISJOINTSET** djset, /**< disjoint set (union find) data structure */
48660  int ncomponents /**< number of components */
48661  )
48662 {
48663  assert(scip != NULL);
48664  assert(djset != NULL);
48665 
48666  SCIP_CALL( SCIPdisjointsetCreate(djset, scip->mem->probmem, ncomponents) );
48667 
48668  return SCIP_OKAY;
48669 }
48670 
48671 /** frees the disjoint set (union find) data structure */
48673  SCIP* scip, /**< SCIP data structure */
48674  SCIP_DISJOINTSET** djset /**< disjoint set (union find) data structure */
48675  )
48676 {
48677  assert(scip != NULL);
48678 
48679  SCIPdisjointsetFree(djset, scip->mem->probmem);
48680 }
int nconcsolvertypes
Definition: struct_set.h:130
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:28926
SCIP_RETCODE SCIPaddLinearCoefsToNlRow(SCIP *scip, SCIP_NLROW *nlrow, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:32414
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
SCIP_Real SCIPhistoryGetAvgConflictlength(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
Definition: history.c:555
SCIP_Real cutoffbound
Definition: struct_primal.h:46
void SCIPconflictEnableOrDisableClocks(SCIP_CONFLICT *conflict, SCIP_Bool enable)
Definition: conflict.c:8901
void SCIPsepaSetFree(SCIP_SEPA *sepa, SCIP_DECL_SEPAFREE((*sepafree)))
Definition: sepa.c:591
SCIP_RETCODE SCIPsetInitprePlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat)
Definition: set.c:5078
SCIP_Bool SCIPsolIsOriginal(SCIP_SOL *sol)
Definition: sol.c:2465
SCIP_RETCODE SCIPclearConflictStore(SCIP *scip, SCIP_EVENT *event)
Definition: scip.c:13109
SCIP_RETCODE SCIPsetNodeselCopy(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELCOPY((*nodeselcopy)))
Definition: scip.c:8861
SCIP_Real SCIPdualfeasRound(SCIP *scip, SCIP_Real val)
Definition: scip.c:47620
SCIP_RETCODE SCIPcreatePartialSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:38055
SCIP_RETCODE SCIPsetHeurExitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXITSOL((*heurexitsol)))
Definition: scip.c:8209
SCIP_RETCODE SCIPsetIncludePresol(SCIP_SET *set, SCIP_PRESOL *presol)
Definition: set.c:3837
SCIP_RETCODE SCIPnlpSetRealPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, SCIP_Real dval)
Definition: nlp.c:6072
SCIP_RETCODE SCIPsetPropPresol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPPRESOL((*proppresol)), int presolpriority, int presolmaxrounds, SCIP_PRESOLTIMING presoltiming)
Definition: scip.c:7823
SCIP_RETCODE SCIPprintReoptStatistics(SCIP *scip, FILE *file)
Definition: scip.c:45704
SCIP_Longint nlexduallps
Definition: struct_stat.h:179
SCIP_RETCODE SCIPprintBestSol(SCIP *scip, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:39948
SCIP_Real SCIPsetFeasRound(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6363
SCIP_RETCODE SCIPtreeClear(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: tree.c:4822
SCIP_RETCODE SCIPgetLPBranchCands(SCIP *scip, SCIP_VAR ***lpcands, SCIP_Real **lpcandssol, SCIP_Real **lpcandsfrac, int *nlpcands, int *npriolpcands, int *nfracimplvars)
Definition: scip.c:37001
internal methods for separators
void SCIPfreeRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen)
Definition: scip.c:48626
SCIP_Bool SCIPsetIsUpdateUnreliable(SCIP_SET *set, SCIP_Real newvalue, SCIP_Real oldvalue)
Definition: set.c:6891
SCIP_RETCODE SCIPsetExitsolPlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat, SCIP_Bool restart)
Definition: set.c:5238
SCIP_Longint nprimallps
Definition: struct_stat.h:175
SCIP_Longint SCIPconflictGetNStrongbranchSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:8613
SCIP_RETCODE SCIPsetPricerPriority(SCIP *scip, SCIP_PRICER *pricer, int priority)
Definition: scip.c:5729
SCIP_RETCODE SCIPconsSetChecked(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool check)
Definition: cons.c:6473
int SCIPrealarrayGetMaxIdx(SCIP_REALARRAY *realarray)
Definition: misc.c:3973
SCIP_STAT * stat
Definition: struct_scip.h:69
#define SCIP_DECL_RELAXFREE(x)
Definition: type_relax.h:55
SCIP_RETCODE SCIPaddVarsToRowSameCoef(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real val)
Definition: scip.c:30740
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:6917
void SCIPsetSortPropsName(SCIP_SET *set)
Definition: set.c:4135
SCIP_RETCODE SCIPconsDelete(SCIP_CONS *cons, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_REOPT *reopt)
Definition: cons.c:6259
SCIP_Real SCIPgetAvgPseudocostCountCurrentRun(SCIP *scip, SCIP_BRANCHDIR dir)
Definition: scip.c:43749
void SCIPdispChgMode(SCIP_DISP *disp, SCIP_DISPMODE mode)
Definition: disp.c:516
SCIP_RETCODE SCIPreoptSplitRoot(SCIP_REOPT *reopt, SCIP_TREE *tree, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, int *ncreatedchilds, int *naddedconss)
Definition: reopt.c:6896
void SCIPcomprSetInitsol(SCIP_COMPR *compr, SCIP_DECL_COMPRINITSOL((*comprinitsol)))
Definition: compr.c:373
enum SCIP_BoundType SCIP_BOUNDTYPE
Definition: type_lp.h:50
SCIP_ROW ** SCIPgetLPRows(SCIP *scip)
Definition: scip.c:29675
void SCIPnodeselSetFree(SCIP_NODESEL *nodesel, SCIP_DECL_NODESELFREE((*nodeselfree)))
Definition: nodesel.c:1103
SCIP_RETCODE SCIPeventfilterCreate(SCIP_EVENTFILTER **eventfilter, BMS_BLKMEM *blkmem)
Definition: event.c:1698
int ndisps
Definition: struct_set.h:122
SCIP_RETCODE SCIPclearCuts(SCIP *scip)
Definition: scip.c:35213
SCIP_RETCODE SCIPsetSetEmphasis(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMEMPHASIS paramemphasis, SCIP_Bool quiet)
Definition: set.c:3386
int SCIPgetNIntVars(SCIP *scip)
Definition: scip.c:11902
SCIP_Real SCIPgetFirstPrimalBound(SCIP *scip)
Definition: scip.c:43380
SCIP_Longint ndualresolvelpiterations
Definition: struct_stat.h:61
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:30304
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
Definition: scip.c:47363
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:30491
SCIP_RETCODE SCIPtreeAddDiveBoundChange(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_VAR *var, SCIP_BRANCHDIR dir, SCIP_Real value, SCIP_Bool preferred)
Definition: tree.c:6188
SCIP_PARAM ** SCIPgetParams(SCIP *scip)
Definition: scip.c:5178
void SCIPcolMarkNotRemovableLocal(SCIP_COL *col, SCIP_STAT *stat)
Definition: lp.c:4641
SCIP_RETCODE SCIPgetStringParam(SCIP *scip, const char *name, char **value)
Definition: scip.c:4527
int SCIPgetNPrioPseudoBranchBins(SCIP *scip)
Definition: scip.c:37402
SCIP_RETCODE SCIPincConsAge(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28372
void SCIPeventhdlrSetInit(SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTINIT((*eventinit)))
Definition: event.c:331
SCIP_RETCODE SCIPreoptReleaseData(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition: reopt.c:5112
int SCIPbranchcandGetNPrioExternBins(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:526
void SCIPconflicthdlrSetInit(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTINIT((*conflictinit)))
Definition: conflict.c:668
int SCIPgetFocusDepth(SCIP *scip)
Definition: scip.c:43071
SCIP_Real SCIProwGetSolFeasibility(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol)
Definition: lp.c:6383
static SCIP_RETCODE compressReoptTree(SCIP *scip)
Definition: scip.c:15792
SCIP_RETCODE SCIPsetRelaxCopy(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXCOPY((*relaxcopy)))
Definition: scip.c:7182
int SCIPgetNCheckConss(SCIP *scip)
Definition: scip.c:13004
SCIP_Real sbup
Definition: struct_lp.h:145
SCIP_NODE ** SCIPnodepqNodes(const SCIP_NODEPQ *nodepq)
Definition: nodesel.c:548
static SCIP_RETCODE freeTransform(SCIP *scip)
Definition: scip.c:15494
void SCIPeventhdlrSetCopy(SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTCOPY((*eventcopy)))
Definition: event.c:309
SCIP_SOL * primalray
Definition: struct_primal.h:52
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_CONFLICTSTORE *conflictstore, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable)
Definition: tree.c:4927
SCIP_RETCODE SCIPaddConsAge(SCIP *scip, SCIP_CONS *cons, SCIP_Real deltaage)
Definition: scip.c:28343
void SCIPlpInvalidateRootObjval(SCIP_LP *lp)
Definition: lp.c:12703
SCIP_Longint SCIPconflictGetNLocalChgBds(SCIP_CONFLICT *conflict)
Definition: conflict.c:3548
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:4597
SCIP_RETCODE SCIPreoptApplyGlbConss(SCIP *scip, SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem)
Definition: reopt.c:7608
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:614
SCIP_Real SCIPvarGetAvgConflictlengthCurrentRun(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:14810
void SCIPheurSetInitsol(SCIP_HEUR *heur, SCIP_DECL_HEURINITSOL((*heurinitsol)))
Definition: heur.c:1176
SCIP_RETCODE SCIPflattenVarAggregationGraph(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:19211
SCIP_RETCODE SCIPnlrowGetPseudoFeasibility(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *pseudofeasibility)
Definition: nlp.c:3053
SCIP_RETCODE SCIPsetIncludeEventhdlr(SCIP_SET *set, SCIP_EVENTHDLR *eventhdlr)
Definition: set.c:4429
SCIP_Bool SCIPsolveIsStopped(SCIP_SET *set, SCIP_STAT *stat, SCIP_Bool checknodelimits)
Definition: solve.c:71
SCIP_RETCODE SCIPconsUnmarkPropagate(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:6940
SCIP_RETCODE SCIPsolUnlink(SCIP_SOL *sol, SCIP_SET *set, SCIP_PROB *prob)
Definition: sol.c:998
SCIP_RETCODE SCIPgetCharParam(SCIP *scip, const char *name, char *value)
Definition: scip.c:4508
SCIP_Bool SCIPinRepropagation(SCIP *scip)
Definition: scip.c:41459
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
Definition: scip.c:6291
#define SCIP_DECL_NODESELCOMP(x)
Definition: type_nodesel.h:126
SCIP_Longint nsbdivinglps
Definition: struct_stat.h:189
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:1267
int npresoladdconss
Definition: struct_stat.h:233
int SCIPgetNNLPNlRows(SCIP *scip)
Definition: scip.c:31462
SCIP_Real SCIPreoptGetSimToPrevious(SCIP_REOPT *reopt)
Definition: reopt.c:5612
SCIP_RETCODE SCIPgetLPBInvRow(SCIP *scip, int r, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip.c:29784
SCIP_RETCODE SCIPchgVarLbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:22282
void SCIPmessageVFPrintVerbInfo(SCIP_MESSAGEHDLR *messagehdlr, SCIP_VERBLEVEL verblevel, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr, va_list ap)
Definition: message.c:713
SCIP_Bool SCIPsetIsInfinity(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5776
SCIP_RETCODE SCIPsolRound(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_Bool *success)
Definition: sol.c:1715
SCIP_RETCODE SCIPprimalClear(SCIP_PRIMAL **primal, BMS_BLKMEM *blkmem)
Definition: primal.c:190
SCIP_Bool SCIPsetIsSumGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6079
SCIP_Longint ninfeasleaves
Definition: struct_stat.h:75
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:6238
SCIP_RETCODE SCIPlinkLPSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38576
int SCIPpresolGetNDelConss(SCIP_PRESOL *presol)
Definition: presol.c:721
SCIP_Real sepa_minefficacyroot
Definition: struct_set.h:482
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
Definition: scip.c:46306
SCIP_Longint SCIPgetNRootLPIterations(SCIP *scip)
Definition: scip.c:42377
SCIP_RETCODE SCIPsolCreatePartial(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_HEUR *heur)
Definition: sol.c:684
struct SCIP_PresolData SCIP_PRESOLDATA
Definition: type_presol.h:37
#define SCIP_DECL_HEURINITSOL(x)
Definition: type_heur.h:97
SCIP_RETCODE SCIPconflictAnalyzeLP(SCIP_CONFLICT *conflict, SCIP_CONFLICTSTORE *conflictstore, 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:7982
SCIP_RETCODE SCIPconsIncAge(SCIP_CONS *cons, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_REOPT *reopt)
Definition: cons.c:7037
void SCIPprintSeparatorStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44817
SCIP_Real firstlpdualbound
Definition: struct_stat.h:116
SCIP_RETCODE SCIPgetNlRowPseudoActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *pseudoactivity)
Definition: scip.c:32805
SCIP_Real SCIPgetAvgPseudocostScoreCurrentRun(SCIP *scip)
Definition: scip.c:43842
SCIP_RETCODE SCIPdisableConsSeparation(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28512
SCIP_Bool SCIPmessagehdlrIsQuiet(SCIP_MESSAGEHDLR *messagehdlr)
Definition: message.c:900
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip.c:5158
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_RELAXATION *relaxation, SCIP_PRIMAL *primal, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable)
Definition: tree.c:6775
int npresolroundsfast
Definition: struct_stat.h:224
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:9038
SCIP_RETCODE SCIPincIntarrayVal(SCIP *scip, SCIP_INTARRAY *intarray, int idx, int incval)
Definition: scip.c:48119
SCIP_RETCODE SCIPsetComprFree(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPRFREE((*comprfree)))
Definition: scip.c:8379
struct SCIP_ConcSolverTypeData SCIP_CONCSOLVERTYPEDATA
SCIP_RETCODE SCIPpricerDeactivate(SCIP_PRICER *pricer, SCIP_SET *set)
Definition: pricer.c:325
SCIP_RETCODE SCIPincludeDialogDefault(SCIP *scip)
#define SCIP_DECL_DISPINITSOL(x)
Definition: type_disp.h:106
void SCIPvarGetClosestVlb(SCIP_VAR *var, SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *closestvlb, int *closestvlbidx)
Definition: var.c:13528
internal methods for managing events
SCIP_Longint SCIPconflictGetNPropConflictConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:5477
void SCIPpricerSetInit(SCIP_PRICER *pricer, SCIP_DECL_PRICERINIT((*pricerinit)))
Definition: pricer.c:506
SCIP_Bool SCIPisDualfeasIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:47572
enum SCIP_NlpTermStat SCIP_NLPTERMSTAT
Definition: type_nlpi.h:84
SCIP_Bool SCIPparamIsValidInt(SCIP_PARAM *param, int value)
Definition: paramset.c:4252
int SCIPreoptGetNLeaves(SCIP_REOPT *reopt, SCIP_NODE *node)
Definition: reopt.c:5910
SCIP_READER ** readers
Definition: struct_set.h:67
SCIP_Real SCIPfeastol(SCIP *scip)
Definition: scip.c:46443
const char * SCIPexprintGetName(void)
SCIP_Bool SCIPlpDivingRowsChanged(SCIP_LP *lp)
Definition: lp.c:17034
SCIP_RETCODE SCIPnlrowPrint(SCIP_NLROW *nlrow, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: nlp.c:2289
void SCIPpropSetCopy(SCIP_PROP *prop, SCIP_DECL_PROPCOPY((*propcopy)))
Definition: prop.c:756
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, SCIP_REOPTNODE *reoptnode, unsigned int id, SCIP_Real estimate, SCIP_NODE **childnodes, int *ncreatedchilds, int *naddedconss, int childnodessize, SCIP_Bool *success)
Definition: reopt.c:7294
SCIP_Bool SCIPconsIsEnabled(SCIP_CONS *cons)
Definition: cons.c:8083
#define SCIP_DECL_TABLEINITSOL(x)
Definition: type_table.h:88
int SCIPdivesetGetMinSolutionDepth(SCIP_DIVESET *diveset)
Definition: heur.c:435
default message handler
SCIP_Real SCIPgetVarAvgInferences(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26636
SCIP_VAR * SCIPprobFindVar(SCIP_PROB *prob, const char *name)
Definition: prob.c:2113
SCIP_Longint nnodelpiterations
Definition: struct_stat.h:63
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 allowlocal, SCIP_Bool onlydelayed, SCIP_Bool *delayed, SCIP_Bool *cutoff)
Definition: solve.c:1895
SCIP_RETCODE SCIPnlrowChgRhs(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real rhs)
Definition: nlp.c:2812
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:14937
void SCIPinterruptCapture(SCIP_INTERRUPT *interrupt)
Definition: interrupt.c:99
SCIP_Real SCIPheurGetSetupTime(SCIP_HEUR *heur)
Definition: heur.c:1376
SCIP_Bool SCIPvarsHaveCommonClique(SCIP_VAR *var1, SCIP_Bool value1, SCIP_VAR *var2, SCIP_Bool value2, SCIP_Bool regardimplics)
Definition: var.c:10889
SCIP_RETCODE SCIPsolLinkPseudoSol(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_LP *lp)
Definition: sol.c:909
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:980
SCIP_Real SCIPgetVarAvgCutoffs(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26890
SCIP_RETCODE SCIPcomputeLPRelIntPoint(SCIP *scip, SCIP_Bool relaxrows, SCIP_Bool inclobjcutoff, SCIP_Real timelimit, int iterlimit, SCIP_SOL **point)
Definition: scip.c:30140
SCIP_RETCODE SCIPtreeSetProbingLPState(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_LP *lp, SCIP_LPISTATE **lpistate, SCIP_LPINORMS **lpinorms, SCIP_Bool primalfeas, SCIP_Bool dualfeas)
Definition: tree.c:6432
SCIP_VAR ** SCIPcliqueGetVars(SCIP_CLIQUE *clique)
Definition: implics.c:3353
int SCIPgetPlungeDepth(SCIP *scip)
Definition: scip.c:43160
SCIP_Bool SCIPsetIsLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5834
int SCIPcliquetableGetVarComponentIdx(SCIP_CLIQUETABLE *cliquetable, SCIP_VAR *var)
Definition: implics.c:2330
void SCIPstatEnableVarHistory(SCIP_STAT *stat)
Definition: stat.c:161
SCIP_Longint nlpsolsfound
Definition: struct_stat.h:90
SCIP_Bool SCIPisNLPConstructed(SCIP *scip)
Definition: scip.c:31233
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:5343
trivialnegation primal heuristic
SCIP_Bool SCIPsetIsFeasZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6284
int SCIPgetNDelayedPoolCuts(SCIP *scip)
Definition: scip.c:35105
internal methods for storing primal CIP solutions
void SCIPpricerSetExitsol(SCIP_PRICER *pricer, SCIP_DECL_PRICEREXITSOL((*pricerexitsol)))
Definition: pricer.c:539
int SCIPpresolGetNAggrVars(SCIP_PRESOL *presol)
Definition: presol.c:681
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:4133
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:14457
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:22523
SCIP_Real * SCIPnlpGetVarsLbDualsol(SCIP_NLP *nlp)
Definition: nlp.c:5905
SCIP_RETCODE SCIPcacheRowExtensions(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30613
int nnodesels
Definition: struct_set.h:118
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:10006
SCIP_Bool SCIPisDualfeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47510
SCIP_Bool SCIPisSumRelLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47752
SCIP_RETCODE SCIPsyncstoreRelease(SCIP_SYNCSTORE **syncstore)
Definition: syncstore.c:77
SCIP_RETCODE SCIPexprtreeEvalInt(SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *varvals, SCIP_INTERVAL *val)
Definition: expr.c:8739
void SCIPvarUpdateBestRootSol(SCIP_VAR *var, SCIP_SET *set, SCIP_Real rootsol, SCIP_Real rootredcost, SCIP_Real rootlpobjval)
Definition: var.c:12688
SCIP_Real SCIPgetVarUbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: scip.c:19649
SCIP_RETCODE SCIPlinkCurrentSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38681
SCIP_Bool misc_estimexternmem
Definition: struct_set.h:358
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:3960
SCIP_RETCODE SCIPsetPresolFree(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLFREE((*presolfree)))
Definition: scip.c:6968
void SCIPbranchruleSetCopy(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHCOPY((*branchcopy)))
Definition: branch.c:1831
SCIP_STATUS status
Definition: struct_stat.h:167
SCIP_Bool compr_enable
Definition: struct_set.h:541
SCIP_RETCODE SCIPincludeTable(SCIP *scip, const char *name, const char *desc, SCIP_Bool active, SCIP_DECL_TABLECOPY((*tablecopy)), SCIP_DECL_TABLEFREE((*tablefree)), SCIP_DECL_TABLEINIT((*tableinit)), SCIP_DECL_TABLEEXIT((*tableexit)), SCIP_DECL_TABLEINITSOL((*tableinitsol)), SCIP_DECL_TABLEEXITSOL((*tableexitsol)), SCIP_DECL_TABLEOUTPUT((*tableoutput)), SCIP_TABLEDATA *tabledata, int position, SCIP_STAGE earlieststage)
Definition: scip.c:9452
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47298
SCIP_Longint nlpiterations
Definition: struct_stat.h:53
const char * SCIPpricerGetName(SCIP_PRICER *pricer)
Definition: pricer.c:550
int sepa_cutagelimit
Definition: struct_set.h:507
int random_permutationseed
Definition: struct_set.h:373
SCIP_Bool SCIPlpDiving(SCIP_LP *lp)
Definition: lp.c:16992
SCIP_RETCODE SCIPsetEventhdlrInitsol(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTINITSOL((*eventinitsol)))
Definition: scip.c:8699
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_VAR ** SCIPgetNLPVars(SCIP *scip)
Definition: scip.c:31300
void SCIPprintConstraintStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44501
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:5976
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
Definition: scip.c:41404
SCIP_STAGE SCIPgetStage(SCIP *scip)
Definition: scip.c:821
int SCIPgetSolRunnum(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:39180
SCIP_Real SCIPgetFirstLPLowerboundRoot(SCIP *scip)
Definition: scip.c:43367
#define SCIP_DECL_CONCSOLVERSYNCREAD(x)
SCIP_Bool SCIPlpiIsInfinity(SCIP_LPI *lpi, SCIP_Real val)
BMS_BUFMEM * cleanbuffer
Definition: struct_mem.h:42
SCIP_Real * origobjvals
Definition: struct_tree.h:53
SCIP_RETCODE SCIPextendBoolarray(SCIP *scip, SCIP_BOOLARRAY *boolarray, int minidx, int maxidx)
Definition: scip.c:48200
methods to interpret (evaluate) an expression tree "fast"
SCIP_RETCODE SCIPchgBarrierconvtol(SCIP *scip, SCIP_Real barrierconvtol)
Definition: scip.c:46598
SCIP_NODESEL ** SCIPgetNodesels(SCIP *scip)
Definition: scip.c:8970
void SCIPlpSetIsRelax(SCIP_LP *lp, SCIP_Bool relax)
Definition: lp.c:16929
SCIP_Longint externmemestim
Definition: struct_stat.h:114
struct SCIP_DispData SCIP_DISPDATA
Definition: type_disp.h:62
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
Definition: cons.c:8245
SCIP_Real * SCIPvarGetMultaggrScalars(SCIP_VAR *var)
Definition: var.c:17068
SCIP_RETCODE SCIPincSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real incval)
Definition: scip.c:38868
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
Definition: scip.c:6314
SCIP_Real SCIPrelaxationGetSolObj(SCIP_RELAXATION *relaxation)
Definition: relax.c:680
SCIP_RETCODE SCIPgetNLPIntPar(SCIP *scip, SCIP_NLPPARAM type, int *ival)
Definition: scip.c:31767
SCIP_RETCODE SCIPgetBinvarRepresentative(SCIP *scip, SCIP_VAR *var, SCIP_VAR **repvar, SCIP_Bool *negated)
Definition: scip.c:19115
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:647
SCIP_RETCODE SCIPbacktrackProbing(SCIP *scip, int probingdepth)
Definition: scip.c:35964
SCIP_CONFLICTHDLR ** conflicthdlrs
Definition: struct_set.h:73
SCIP_RETCODE SCIPsetBranchruleExecPs(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECPS((*branchexecps)))
Definition: scip.c:9253
internal methods for branch and bound tree
void SCIPeventhdlrSetExitsol(SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTEXITSOL((*eventexitsol)))
Definition: event.c:364
SCIP_Longint SCIPgetNLPIterations(SCIP *scip)
Definition: scip.c:42333
SCIP_RETCODE SCIPcopyOrigProb(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *name)
Definition: scip.c:1792
SCIP_Longint nfeasleaves
Definition: struct_stat.h:74
SCIP_Real SCIPgetVarAvgInferenceCutoffScore(SCIP *scip, SCIP_VAR *var, SCIP_Real cutoffweight)
Definition: scip.c:27007
SCIP_Bool SCIPsetIsSumZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6097
int SCIPgetNRelaxs(SCIP *scip)
Definition: scip.c:7305
SCIP_Real SCIPtreeCalcChildEstimate(SCIP_TREE *tree, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var, SCIP_Real targetvalue)
Definition: tree.c:5284
SCIP_CONFLICT * conflict
Definition: struct_scip.h:85
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)
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:30460
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47311
SCIP_NLPI * SCIPsetFindNlpi(SCIP_SET *set, const char *name)
Definition: set.c:4799
SCIP_Bool SCIPtableIsActive(SCIP_TABLE *table)
Definition: table.c:302
SCIP_RETCODE SCIPaddVarObj(SCIP *scip, SCIP_VAR *var, SCIP_Real addobj)
Definition: scip.c:21902
SCIP_Real SCIPvarGetAvgCutoffsCurrentRun(SCIP_VAR *var, SCIP_STAT *stat, SCIP_BRANCHDIR dir)
Definition: var.c:15716
SCIP_Bool SCIPprobIsConsCompressionEnabled(SCIP_PROB *prob)
Definition: prob.c:2386
SCIP_RETCODE SCIPrecalcRowLPActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30941
SCIP_Bool SCIPisSumGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47249
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:5675
SCIP_Real SCIPsetFeastol(SCIP_SET *set)
Definition: set.c:5678
SCIP_Longint ndeactivatednodes
Definition: struct_stat.h:82
static SCIP_RETCODE readXmlSolFile(SCIP *scip, const char *filename, SCIP_SOL *sol, SCIP_Bool *partial, SCIP_Bool *error)
Definition: scip.c:40288
SCIP_Real SCIProwGetMinval(SCIP_ROW *row, SCIP_SET *set)
Definition: lp.c:6550
SCIP_Real SCIPvarGetBranchFactor(SCIP_VAR *var)
Definition: var.c:17436
void SCIPdialogMessage(SCIP *scip, FILE *file, const char *formatstr,...)
Definition: scip.c:1326
SCIP_Bool SCIPisRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47674
#define SCIP_DECL_COMPREXEC(x)
Definition: type_compr.h:111
void SCIPtreeSetFocusNodeLP(SCIP_TREE *tree, SCIP_Bool solvelp)
Definition: tree.c:8254
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:6385
void SCIPprobSetData(SCIP_PROB *prob, SCIP_PROBDATA *probdata)
Definition: prob.c:689
SCIP_Longint SCIPconflictGetNPropSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:5467
SCIP_Real SCIPgetVarLbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: scip.c:19509
void SCIPconshdlrSetPrint(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint)))
Definition: cons.c:4425
SCIP_Real SCIPpropGetRespropTime(SCIP_PROP *prop)
Definition: prop.c:1022
SCIP_PRICER * SCIPsetFindPricer(SCIP_SET *set, const char *name)
Definition: set.c:3552
void SCIPconflicthdlrSetExit(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTEXIT((*conflictexit)))
Definition: conflict.c:679
SCIP_PROBDATA * SCIPprobGetData(SCIP_PROB *prob)
Definition: prob.c:2286
SCIP_RETCODE SCIPbranchVarHole(SCIP *scip, SCIP_VAR *var, SCIP_Real left, SCIP_Real right, SCIP_NODE **downchild, SCIP_NODE **upchild)
Definition: scip.c:37651
void SCIPlpEndStrongbranchProbing(SCIP_LP *lp)
Definition: lp.c:15583
#define SCIPdebugFreeDebugData(set)
Definition: debug.h:248
SCIP_Longint SCIPdivesetGetNBacktracks(SCIP_DIVESET *diveset)
Definition: heur.c:485
SCIP_RETCODE SCIPcreateBoolarray(SCIP *scip, SCIP_BOOLARRAY **boolarray)
Definition: scip.c:48166
SCIP_RETCODE SCIPgetNLPNlRowsData(SCIP *scip, SCIP_NLROW ***nlrows, int *nnlrows)
Definition: scip.c:31412
SCIP_TABLE * SCIPsetFindTable(SCIP_SET *set, const char *name)
Definition: set.c:4712
SCIP_Bool misc_allowdualreds
Definition: struct_set.h:365
SCIP_RETCODE SCIPgetSolVarsData(SCIP *scip, SCIP_SOL *sol, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
Definition: scip.c:12441
SCIP_RETCODE SCIPdispAutoActivate(SCIP_SET *set)
Definition: disp.c:449
SCIP_RETCODE SCIPdialogRelease(SCIP *scip, SCIP_DIALOG **dialog)
Definition: dialog.c:915
int SCIPconsGetValidDepth(SCIP_CONS *cons)
Definition: cons.c:8069
SCIP_RETCODE SCIPsetClockTime(SCIP *scip, SCIP_CLOCK *clck, SCIP_Real sec)
Definition: scip.c:46262
#define SCIP_DECL_DIALOGCOPY(x)
Definition: type_dialog.h:53
int SCIPgetNConcurrentSolvers(SCIP *scip)
Definition: concurrent.c:107
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:17740
SCIP_Bool misc_finitesolstore
Definition: struct_set.h:363
void SCIPnodeselSetInit(SCIP_NODESEL *nodesel, SCIP_DECL_NODESELINIT((*nodeselinit)))
Definition: nodesel.c:1114
BMS_BUFMEM * buffer
Definition: struct_mem.h:41
SCIP_RETCODE SCIPaddOrigObjoffset(SCIP *scip, SCIP_Real addval)
Definition: scip.c:11114
static SCIP_RETCODE initPresolve(SCIP *scip)
Definition: scip.c:14154
int npricerounds
Definition: struct_stat.h:213
int SCIPpricestoreGetNVars(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:601
SCIP_RETCODE SCIPaddDialogEntry(SCIP *scip, SCIP_DIALOG *dialog, SCIP_DIALOG *subdialog)
Definition: scip.c:9827
SCIP_Real SCIPgetVarAvgInferencesCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26664
SCIP_Real SCIPgetDualboundRoot(SCIP *scip)
Definition: scip.c:43298
SCIP_RETCODE SCIPmarkRelaxSolValid(SCIP *scip, SCIP_Bool includeslp)
Definition: scip.c:20072
SCIP_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: scip.c:41226
SCIP_RETCODE SCIPlpFlush(SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue)
Definition: lp.c:8477
SCIP_RETCODE SCIPlpGetBInvCol(SCIP_LP *lp, int c, SCIP_Real *coef, int *inds, int *ninds)
Definition: lp.c:9656
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
Definition: scip.c:6604
SCIP_RETCODE SCIPnlrowAddQuadElement(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_QUADELEM elem)
Definition: nlp.c:2607
void SCIPnlrowCapture(SCIP_NLROW *nlrow)
Definition: nlp.c:2344
int SCIPgetProbingDepth(SCIP *scip)
Definition: scip.c:35937
SCIP_RETCODE SCIPsetPresolExit(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXIT((*presolexit)))
Definition: scip.c:7000
SCIP_NODE * SCIPtreeGetLowerboundNode(SCIP_TREE *tree, SCIP_SET *set)
Definition: tree.c:7193
SCIP_Real SCIPgetReadingTime(SCIP *scip)
Definition: scip.c:46333
void SCIPconsSetDynamic(SCIP_CONS *cons, SCIP_Bool dynamic)
Definition: cons.c:6580
void SCIPconsSetStickingAtNode(SCIP_CONS *cons, SCIP_Bool stickingatnode)
Definition: cons.c:6602
SCIP_RETCODE SCIPwriteLP(SCIP *scip, const char *filename)
Definition: scip.c:29947
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
Definition: scip.c:43453
SCIP_Real SCIPgetVarConflictlengthScoreCurrentRun(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26551
SCIP_Real SCIPsetFloor(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5963
SCIP_RETCODE SCIPflushRowExtensions(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30636
SCIP_Bool SCIPsetIsFeasEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6174
SCIP_Real SCIPgetPrimalbound(SCIP *scip)
Definition: scip.c:43402
SCIP_RETCODE SCIPsetSetRealParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_Real value)
Definition: set.c:3230
#define SCIPallocClearBufferArray(scip, ptr, num)
Definition: scip.h:22622
#define SCIPsetDuplicateBufferArray(set, ptr, source, num)
Definition: set.h:1879
SCIP_Real SCIPvarGetWorstBoundGlobal(SCIP_VAR *var)
Definition: var.c:17319
SCIP_RETCODE SCIPintarrayIncVal(SCIP_INTARRAY *intarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, int incval)
Definition: misc.c:4315
void SCIPconflicthdlrSetInitsol(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTINITSOL((*conflictinitsol)))
Definition: conflict.c:690
#define SCIP_DECL_VARTRANS(x)
Definition: type_var.h:129
SCIP_Longint SCIPconflictGetNBoundexceedingLPConflictConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:8239
SCIP_Bool SCIPisUbBetter(SCIP *scip, SCIP_Real newub, SCIP_Real oldlb, SCIP_Real oldub)
Definition: scip.c:47661
int SCIPpricestoreGetNProbvarsFound(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:643
SCIP_Longint SCIPmemGetUsed(SCIP_MEM *mem)
Definition: mem.c:87
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:6820
SCIP_REOPTNODE * SCIPreoptGetReoptnode(SCIP_REOPT *reopt, unsigned int id)
Definition: reopt.c:5663
SCIP_RETCODE SCIPapplyCutsProbing(SCIP *scip, SCIP_Bool *cutoff)
Definition: scip.c:36678
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:14370
SCIP_RETCODE SCIPcreateNlpiProb(SCIP *scip, SCIP_NLPI *nlpi, SCIP_NLROW **nlrows, int nnlrows, SCIP_NLPIPROBLEM *nlpiprob, SCIP_HASHMAP *var2idx, SCIP_Real *nlscore, SCIP_Real cutoffbound, SCIP_Bool setobj, SCIP_Bool onlyconvex)
Definition: scip.c:34032
SCIP_Bool SCIPvarDoNotMultaggr(SCIP_VAR *var)
Definition: var.c:5592
SCIP_Real SCIProwGetPseudoActivity(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat)
Definition: lp.c:6297
#define SCIP_DECL_PROBINITSOL(x)
Definition: type_prob.h:97
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:2035
int SCIPgetIntarrayMaxIdx(SCIP *scip, SCIP_INTARRAY *intarray)
Definition: scip.c:48151
SCIP_Real SCIPnodeGetLowerbound(SCIP_NODE *node)
Definition: tree.c:7362
SCIP_PARAMDATA * SCIPparamGetData(SCIP_PARAM *param)
Definition: paramset.c:661
SCIP_Longint SCIPcutpoolGetNCutsFound(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:1093
SCIP_NODESEL ** nodesels
Definition: struct_set.h:82
SCIP_RETCODE SCIPdispPrintLine(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, FILE *file, SCIP_Bool forcedisplay, SCIP_Bool endline)
Definition: disp.c:363
SCIP_Longint nlps
Definition: struct_stat.h:173
SCIP_Real SCIPvarGetPseudocostCountCurrentRun(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:14022
SCIP_DECL_CONSSEPALP(ConshdlrSubtour::scip_sepalp)
#define infinity
Definition: gastrans.c:71
SCIP_RETCODE SCIPadjustImplicitSolVals(SCIP *scip, SCIP_SOL *sol, SCIP_Bool uselprows)
Definition: scip.c:39282
methods for implications, variable bounds, and cliques
SCIP_Real * SCIPgetNLPVarsUbDualsol(SCIP *scip)
Definition: scip.c:31390
SCIP_Bool SCIPisFeasFracIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:47411
SCIP_PROP * SCIPfindProp(SCIP *scip, const char *name)
Definition: scip.c:7873
SCIP_RETCODE SCIPconsSepasol(SCIP_CONS *cons, SCIP_SET *set, SCIP_SOL *sol, SCIP_RESULT *result)
Definition: cons.c:7438
int SCIPgetNEventhdlrs(SCIP *scip)
Definition: scip.c:8765
SCIP_Longint SCIPbranchruleGetNChildren(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2124
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
Definition: var.c:17276
SCIP_Longint SCIPconflictGetNAppliedGlobalConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:3528
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:30338
SCIP_Longint SCIPconshdlrGetNDomredsFound(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4819
int presol_maxrounds
Definition: struct_set.h:404
SCIP_Longint nbarrierlpiterations
Definition: struct_stat.h:59
void SCIPreaderSetCopy(SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
Definition: reader.c:471
SCIP_RETCODE SCIPsolLinkNLPSol(SCIP_SOL *sol, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_NLP *nlp)
Definition: sol.c:828
#define SCIP_DECL_BRANCHEXECPS(x)
Definition: type_branch.h:161
SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars)))
Definition: scip.c:6544
SCIP_Real SCIPpricestoreGetProbPricingTime(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:623
SCIP_Real SCIPvarGetAvgBranchdepth(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:15193
SCIP_Longint SCIPpropGetNRespropCalls(SCIP_PROP *prop)
Definition: prop.c:1052
SCIP_RETCODE SCIPvarGetProbvarBinary(SCIP_VAR **var, SCIP_Bool *negated)
Definition: var.c:11720
SCIP_Real SCIPgetLocalTransEstimate(SCIP *scip)
Definition: scip.c:13369
SCIP_Longint SCIPconflictGetNBoundexceedingLPIterations(SCIP_CONFLICT *conflict)
Definition: conflict.c:8279
SCIP_LPALGO lastlpalgo
Definition: struct_lp.h:335
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
Definition: scip.c:4489
SCIP_CLOCK * conflictlptime
Definition: struct_stat.h:152
int SCIPpropGetNChgSides(SCIP_PROP *prop)
Definition: prop.c:1202
int SCIPconflictstoreGetNConflictsInStore(SCIP_CONFLICTSTORE *conflictstore)
SCIP_RETCODE SCIPsetComprInit(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPRINIT((*comprinit)))
Definition: scip.c:8395
SCIP_Bool SCIPvarIsPscostRelerrorReliable(SCIP_VAR *var, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real threshold, SCIP_CONFIDENCELEVEL clevel)
Definition: var.c:14189
int nrunsbeforefirst
Definition: struct_stat.h:252
SCIP_RETCODE SCIPupdateCutoffbound(SCIP *scip, SCIP_Real cutoffbound)
Definition: scip.c:43481
#define SCIP_MAXSTRLEN
Definition: def.h:259
SCIP_Bool conf_usesb
Definition: struct_set.h:202
SCIP_Longint SCIPconshdlrGetNCutoffs(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4759
SCIP_RETCODE SCIPgetLeaves(SCIP *scip, SCIP_NODE ***leaves, int *nleaves)
Definition: scip.c:41561
SCIP_SEPA * SCIPfindSepa(SCIP *scip, const char *name)
Definition: scip.c:7523
SCIP_RETCODE SCIPsetMessagehdlr(SCIP *scip, SCIP_MESSAGEHDLR *messagehdlr)
Definition: scip.c:1200
SCIP_Real SCIPgetVarPseudocostVal(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta)
Definition: scip.c:26031
int concurrent_initseed
Definition: struct_set.h:521
#define SCIP_DECL_PROBDELORIG(x)
Definition: type_prob.h:55
SCIP_Longint SCIPheurGetNBestSolsFound(SCIP_HEUR *heur)
Definition: heur.c:1344
SCIP_Real rootlowerbound
Definition: struct_stat.h:117
#define SCIP_DECL_CONSINITPRE(x)
Definition: type_cons.h:140
SCIP_RETCODE SCIPeventChgType(SCIP_EVENT *event, SCIP_EVENTTYPE eventtype)
Definition: event.c:969
SCIP_Real SCIPconcsolverTypeGetPrefPrio(SCIP_CONCSOLVERTYPE *concsolvertype)
Definition: concsolver.c:146
SCIP_RETCODE SCIPsetProbCopy(SCIP *scip, SCIP_DECL_PROBCOPY((*probcopy)))
Definition: scip.c:10123
SCIP_RETCODE SCIPsetEventhdlrExitsol(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTEXITSOL((*eventexitsol)))
Definition: scip.c:8713
int SCIPnlpiGetPriority(SCIP_NLPI *nlpi)
Definition: nlpi.c:763
SCIP_Bool SCIPparseReal(SCIP *scip, const char *str, SCIP_Real *value, char **endptr)
Definition: scip.c:46683
void SCIProwRecalcLPActivity(SCIP_ROW *row, SCIP_STAT *stat)
Definition: lp.c:6047
SCIP_PRIMAL * origprimal
Definition: struct_scip.h:71
SCIP_Bool SCIPsetIsDualfeasGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6473
int SCIPgetNPrioPseudoBranchImpls(SCIP *scip)
Definition: scip.c:37438
void SCIPgmlWriteArc(FILE *file, unsigned int source, unsigned int target, const char *label, const char *color)
Definition: misc.c:627
SCIP_Longint SCIPgetNSolsFound(SCIP *scip)
Definition: scip.c:43619
SCIP_RETCODE SCIPnlrowRelease(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: nlp.c:2356
int validdepth
Definition: struct_cons.h:60
SCIP_Longint SCIPgetNBarrierLPs(SCIP *scip)
Definition: scip.c:42486
SCIP_RETCODE SCIPconflictstoreCleanNewIncumbent(SCIP_CONFLICTSTORE *conflictstore, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_PROB *transprob, SCIP_REOPT *reopt, SCIP_Real cutoffbound)
SCIP_RETCODE SCIPaddSolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool *stored)
Definition: scip.c:40590
SCIP_Longint SCIPconflictGetNPseudoReconvergenceLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:8890
void SCIPlpRecalculateObjSqrNorm(SCIP_SET *set, SCIP_LP *lp)
Definition: lp.c:16821
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 completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition: primal.c:1437
internal methods for clocks and timing issues
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENFORELAX((*consenforelax)))
Definition: scip.c:6036
SCIP_Longint ntotalnodes
Definition: struct_stat.h:76
int SCIPbranchcandGetNPseudoCands(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:853
SCIP_RETCODE SCIPcreateRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen, unsigned int initialseed)
Definition: scip.c:48608
SCIP_Bool SCIPsetIsSumGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6061
SCIP_Longint SCIPcomprGetNFound(SCIP_COMPR *compr)
Definition: compr.c:473
unsigned int SCIP_HEURTIMING
Definition: type_timing.h:97
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:9936
SCIP_RETCODE SCIPsetCreate(SCIP_SET **set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, SCIP *scip)
Definition: set.c:1107
SCIP_Longint SCIPconflictGetNGlobalChgBds(SCIP_CONFLICT *conflict)
Definition: conflict.c:3518
SCIP_RETCODE SCIPresetConsAge(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28400
#define SCIP_VARTYPE_INTEGER_CHAR
Definition: def.h:121
SCIP_RETCODE SCIPvarChgLbOriginal(SCIP_VAR *var, SCIP_SET *set, SCIP_Real newbound)
Definition: var.c:6202
SCIP_RETCODE SCIPchgConsName(SCIP *scip, SCIP_CONS *cons, const char *name)
Definition: scip.c:27812
SCIP_RETCODE SCIPsetParam(SCIP *scip, const char *name, void *value)
Definition: scip.c:4585
#define SCIP_DECL_CONSGETDIVEBDCHGS(x)
Definition: type_cons.h:900
SCIP_Real SCIPcomprGetTime(SCIP_COMPR *compr)
Definition: compr.c:503
#define SCIP_DECL_CONSPRESOL(x)
Definition: type_cons.h:544
SCIP_Longint SCIPcolGetStrongbranchNode(SCIP_COL *col)
Definition: lp.c:16375
SCIP_RETCODE SCIPprimalRetransformSolutions(SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_PROB *origprob, SCIP_PROB *transprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp)
Definition: primal.c:1691
int npresolaggrvars
Definition: struct_stat.h:228
SCIP_RETCODE SCIPsetEventhdlrExit(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTEXIT((*eventexit)))
Definition: scip.c:8685
SCIP_RETCODE SCIPsetIncludeRelax(SCIP_SET *set, SCIP_RELAX *relax)
Definition: set.c:3910
void SCIPconshdlrSetDeactive(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDEACTIVE((*consdeactive)))
Definition: cons.c:4381
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:12663
SCIP_ROW ** SCIPsepastoreGetCuts(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1227
SCIP_Bool SCIPsetIsPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5899
void SCIPsetRandomSeed(SCIP *scip, SCIP_RANDNUMGEN *randnumgen, unsigned int seed)
Definition: scip.c:48641
SCIP_EVENTHDLR * SCIPsetFindEventhdlr(SCIP_SET *set, const char *name)
Definition: set.c:4452
int SCIPintarrayGetMinIdx(SCIP_INTARRAY *intarray)
Definition: misc.c:4327
SCIP_RETCODE SCIPsetHeurExit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXIT((*heurexit)))
Definition: scip.c:8177
SCIP_RETCODE SCIPsetRelaxInit(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXINIT((*relaxinit)))
Definition: scip.c:7214
int SCIPcalcMemGrowSize(SCIP *scip, int num)
Definition: scip.c:46813
static long bound
SCIP_VAR ** SCIPvarGetMultaggrVars(SCIP_VAR *var)
Definition: var.c:17056
SCIP_Bool SCIPisSumPositive(SCIP *scip, SCIP_Real val)
Definition: scip.c:47274
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
Definition: scip.c:30668
SCIP_RETCODE SCIPrecomputeSolObj(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:39072
static SCIP_DECL_PARAMCHGD(paramChgdNlpiPriority)
Definition: scip.c:9526
SCIP_RETCODE SCIPcreateCPUClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip.c:46030
SCIP_Real SCIPgetVarRedcost(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:19381
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:464
void SCIPconshdlrSetInitpre(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITPRE((*consinitpre)))
Definition: cons.c:4275
SCIP_RETCODE SCIPrealarrayCreate(SCIP_REALARRAY **realarray, BMS_BLKMEM *blkmem)
Definition: misc.c:3611
SCIP_Bool concurrent_changeseeds
Definition: struct_set.h:517
int SCIProwGetNNonz(SCIP_ROW *row)
Definition: lp.c:16405
SCIP_RETCODE SCIPevalExprtreeGlobalBounds(SCIP *scip, SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *val)
Definition: scip.c:33166
SCIP_RETCODE SCIPsetConsPropagated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool propagate)
Definition: scip.c:27959
int SCIPtreeGetProbingDepth(SCIP_TREE *tree)
Definition: tree.c:8330
SCIP_Longint nrootfirstlpiterations
Definition: struct_stat.h:55
int nprops
Definition: struct_set.h:110
void SCIPheurSetExitsol(SCIP_HEUR *heur, SCIP_DECL_HEUREXITSOL((*heurexitsol)))
Definition: heur.c:1187
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:5918
SCIP_RETCODE SCIPnodeDelCons(SCIP_NODE *node, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_CONS *cons)
Definition: tree.c:1608
static SCIP_RETCODE analyzeStrongbranch(SCIP *scip, SCIP_VAR *var, SCIP_Bool *downinf, SCIP_Bool *upinf, SCIP_Bool *downconflict, SCIP_Bool *upconflict)
Definition: scip.c:20329
struct SCIP_ParamData SCIP_PARAMDATA
Definition: type_paramset.h:76
void SCIPprintConcsolverStatistics(SCIP *scip, FILE *file)
Definition: scip.c:45461
SCIP_Real SCIPgetRowPseudoFeasibility(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:31031
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_Longint SCIPconflictGetNPseudoConflictLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:8870
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
Definition: scip.c:47088
SCIP_Bool SCIPisSumRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47739
static SCIP_RETCODE doCopy(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *suffix, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars, SCIP_Bool useconscompression, SCIP_Bool global, SCIP_Bool original, SCIP_Bool enablepricing, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
Definition: scip.c:3587
SCIP_RETCODE SCIPgetNegatedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **negvars)
Definition: scip.c:19078
void SCIPbranchruleSetFree(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHFREE((*branchfree)))
Definition: branch.c:1842
SCIP_Bool SCIPboolarrayGetVal(SCIP_BOOLARRAY *boolarray, int idx)
Definition: misc.c:4594
SCIP_Bool presol_donotaggr
Definition: struct_set.h:415
int SCIPgetNOrigVars(SCIP *scip)
Definition: scip.c:12252
#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:1769
int SCIPgetNSiblings(SCIP *scip)
Definition: scip.c:41543
void SCIPconflicthdlrSetCopy(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTCOPY((*conflictcopy)))
Definition: conflict.c:646
SCIP_Longint ndivinglps
Definition: struct_stat.h:187
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:1856
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
Definition: var.c:17332
SCIP_Bool SCIPisStringParamValid(SCIP *scip, SCIP_PARAM *param, const char *value)
Definition: scip.c:4935
SCIP_Bool SCIPisUpdateUnreliable(SCIP *scip, SCIP_Real newvalue, SCIP_Real oldvalue)
Definition: scip.c:47846
SCIP_RETCODE SCIPvarChgLbLazy(SCIP_VAR *var, SCIP_SET *set, SCIP_Real lazylb)
Definition: var.c:7104
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:21517
#define SCIP_CALL_FINALLY(x, y)
Definition: def.h:392
SCIP_Real SCIPgetColRedcost(SCIP *scip, SCIP_COL *col)
Definition: scip.c:30200
SCIP_CUT ** SCIPgetDelayedPoolCuts(SCIP *scip)
Definition: scip.c:35089
SCIP_RETCODE SCIPaddConflictBinvar(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:27388
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:1125
SCIP_RETCODE SCIPchgNlRowRhs(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real rhs)
Definition: scip.c:32344
SCIP_Longint SCIPconflictGetNInfeasibleLPSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:8149
SCIP_RELAX ** SCIPgetRelaxs(SCIP *scip)
Definition: scip.c:7292
int SCIPgetNPseudoBranchCands(SCIP *scip)
Definition: scip.c:37365
SCIP_Real constant
Definition: struct_var.h:184
SCIP_RETCODE SCIPreoptGetLeaves(SCIP_REOPT *reopt, SCIP_NODE *node, unsigned int *leaves, int leavessize, int *nleaves)
Definition: reopt.c:6401
SCIP_RETCODE SCIPvarAddLocks(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, int addnlocksdown, int addnlocksup)
Definition: var.c:3047
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:8825
int nconcsolvers
Definition: struct_set.h:132
void SCIPdeactivateSolViolationUpdates(SCIP *scip)
Definition: scip.c:13822
void SCIPsetSortComprsName(SCIP_SET *set)
Definition: set.c:4414
void SCIProwCapture(SCIP_ROW *row)
Definition: lp.c:5214
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47015
SCIP_Bool SCIPsetIsSumRelGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6837
void SCIPconshdlrSetInitsol(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITSOL((*consinitsol)))
Definition: cons.c:4253
SCIP_EVENTQUEUE * eventqueue
Definition: struct_scip.h:78
internal methods for NLPI solver interfaces
SCIP_Longint nsbtimesiterlimhit
Definition: struct_stat.h:110
char ** SCIPgetExternalCodeDescriptions(SCIP *scip)
Definition: scip.c:9659
SCIP_RETCODE SCIPsetIncludeConshdlr(SCIP_SET *set, SCIP_CONSHDLR *conshdlr)
Definition: set.c:3602
SCIP_RETCODE SCIPnlrowEnsureQuadVarsSize(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
Definition: nlp.c:2524
void SCIPpresolSetPriority(SCIP_PRESOL *presol, SCIP_SET *set, int priority)
Definition: presol.c:593
SCIP_PROBINGNODE * probingnode
Definition: struct_tree.h:137
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:23211
SCIP_RETCODE SCIPdisableConsPropagation(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28569
#define SCIP_DECL_COMPREXITSOL(x)
Definition: type_compr.h:95
SCIP_RETCODE SCIPsetConshdlrDeactive(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDEACTIVE((*consdeactive)))
Definition: scip.c:6406
SCIP_Longint SCIPconflictGetNPropCalls(SCIP_CONFLICT *conflict)
Definition: conflict.c:5457
int SCIPgetNLeaves(SCIP *scip)
Definition: scip.c:41585
SCIP_Longint SCIPconflictGetNDualrayInfSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:8543
SCIP_Real SCIPvarGetMultaggrLbGlobal(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:8199
SCIP_RETCODE SCIPchgVarLbNode(SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:22186
SCIP_Longint SCIPsepaGetNDomredsFound(SCIP_SEPA *sepa)
Definition: sepa.c:863
SCIP_RETCODE SCIPtreeCreate(SCIP_TREE **tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_NODESEL *nodesel)
Definition: tree.c:4695
int nintvars
Definition: struct_prob.h:63
SCIP_Bool SCIPconsIsAdded(SCIP_CONS *cons)
Definition: cons.c:8355
int npresolfixedvars
Definition: struct_stat.h:227
SCIP_Bool SCIPreoptimizeNode(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:17459
SCIP_Real SCIPgetAvgCutoffScoreCurrentRun(SCIP *scip)
Definition: scip.c:44110
SCIP_CLOCK * totaltime
Definition: struct_scip.h:66
SCIP_RETCODE SCIPsetGetStringParam(SCIP_SET *set, const char *name, char **value)
Definition: set.c:3022
SCIP_Bool SCIPisDualfeasFracIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:47584
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
Definition: scip.c:8611
SCIP_RETCODE SCIPdelConsNode(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons)
Definition: scip.c:13247
struct SCIP_BranchruleData SCIP_BRANCHRULEDATA
Definition: type_branch.h:43
SCIP_Real SCIPpricerGetTime(SCIP_PRICER *pricer)
Definition: pricer.c:624
SCIP_RETCODE SCIPcreateRealarray(SCIP *scip, SCIP_REALARRAY **realarray)
Definition: scip.c:47864
SCIP_RETCODE SCIPbranchcandCreate(SCIP_BRANCHCAND **branchcand)
Definition: branch.c:133
SCIP_PRIMAL * primal
Definition: struct_scip.h:83
SCIP_NLPSOLSTAT SCIPgetNLPSolstat(SCIP *scip)
Definition: scip.c:31616
void SCIPstatDisableVarHistory(SCIP_STAT *stat)
Definition: stat.c:151
#define SCIP_SUBVERSION
Definition: def.h:111
const char * SCIProwGetName(SCIP_ROW *row)
Definition: lp.c:16543
SCIP_Bool SCIPpscostThresholdProbabilityTest(SCIP *scip, SCIP_VAR *var, SCIP_Real frac, SCIP_Real threshold, SCIP_BRANCHDIR dir, SCIP_CONFIDENCELEVEL clevel)
Definition: scip.c:26276
SCIP_CUTPOOL * delayedcutpool
Definition: struct_scip.h:95
enum SCIP_DispMode SCIP_DISPMODE
Definition: type_disp.h:59
#define SCIP_DECL_PRESOLINITPRE(x)
Definition: type_presol.h:84
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 copytables, SCIP_Bool copynlpis, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
Definition: scip.c:1568
void SCIPprobAddObjoffset(SCIP_PROB *prob, SCIP_Real addval)
Definition: prob.c:1420
SCIP_DIVESET ** SCIPheurGetDivesets(SCIP_HEUR *heur)
Definition: heur.c:1396
SCIP_RETCODE SCIPsolLinkLPSol(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_LP *lp)
Definition: sol.c:770
SCIP_RETCODE SCIPvarChgUbOriginal(SCIP_VAR *var, SCIP_SET *set, SCIP_Real newbound)
Definition: var.c:6261
SCIP_Real SCIPgetAvgConflictScore(SCIP *scip)
Definition: scip.c:43865
void SCIPgmlWriteNode(FILE *file, unsigned int id, const char *label, const char *nodetype, const char *fillcolor, const char *bordercolor)
Definition: misc.c:485
SCIP_RETCODE SCIPgetTransformedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **transvar)
Definition: scip.c:18957
void SCIPsplitFilename(char *filename, char **path, char **name, char **extension, char **compression)
Definition: misc.c:10200
SCIP_DECL_READERFREE(ReaderTSP::scip_free)
Definition: ReaderTSP.cpp:137
SCIP_RETCODE SCIPcatchRowEvent(SCIP *scip, SCIP_ROW *row, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: scip.c:41312
SCIP_RETCODE SCIPprintTransProblem(SCIP *scip, FILE *file, const char *extension, SCIP_Bool genericnames)
Definition: scip.c:44262
SCIP_Real lastsolgap
Definition: struct_stat.h:122
SCIP_RETCODE SCIPaddNewRowCutpool(SCIP *scip, SCIP_CUTPOOL *cutpool, SCIP_ROW *row)
Definition: scip.c:34947
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:5277
SCIP_Real SCIPfeasRound(SCIP *scip, SCIP_Real val)
Definition: scip.c:47447
void SCIPrelaxSetPriority(SCIP_RELAX *relax, SCIP_SET *set, int priority)
Definition: relax.c:474
SCIP_RETCODE SCIPsetResetParams(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: set.c:3363
SCIP_Longint SCIPconflictGetNStrongbranchIterations(SCIP_CONFLICT *conflict)
Definition: conflict.c:8663
SCIP_RETCODE SCIPupdateConsFlags(SCIP *scip, SCIP_CONS *cons0, SCIP_CONS *cons1)
Definition: scip.c:28112
SCIP_RETCODE SCIPsetNlRowExprtreeParam(SCIP *scip, SCIP_NLROW *nlrow, int paramidx, SCIP_Real paramval)
Definition: scip.c:32654
SCIP_DECL_EVENTEXIT(EventhdlrNewSol::scip_exit)
SCIP_RETCODE SCIPreoptAddOptSol(SCIP_REOPT *reopt, SCIP_SOL *sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *origprimal, SCIP_VAR **vars, int nvars)
Definition: reopt.c:5330
SCIP_Longint nrootstrongbranchs
Definition: struct_stat.h:192
const char * SCIPreaderGetName(SCIP_READER *reader)
Definition: reader.c:515
SCIP_RETCODE SCIPparseVarName(SCIP *scip, const char *str, SCIP_VAR **var, char **endptr)
Definition: scip.c:18038
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:2404
SCIP_RETCODE SCIPsetBranchruleInitsol(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHINITSOL((*branchinitsol)))
Definition: scip.c:9187
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:6741
static SCIP_Real getPrimalbound(SCIP *scip)
Definition: scip.c:504
SCIP_RETCODE SCIPextendIntarray(SCIP *scip, SCIP_INTARRAY *intarray, int minidx, int maxidx)
Definition: scip.c:48049
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:718
SCIP_Longint SCIPgetNDualLPs(SCIP *scip)
Definition: scip.c:42450
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
Definition: scip.c:18766
interface methods for specific LP solvers
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
Definition: var.c:16842
struct SCIP_EventhdlrData SCIP_EVENTHDLRDATA
Definition: type_event.h:138
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_CUTPOOL *cutpool, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool newinitconss, SCIP_Bool *cutoff)
Definition: solve.c:1218
SCIP_RETCODE SCIPchgVarObjDiveNLP(SCIP *scip, SCIP_VAR *var, SCIP_Real coef)
Definition: scip.c:32066
SCIP_Bool SCIPsetIsScalingIntegral(SCIP_SET *set, SCIP_Real val, SCIP_Real scalar)
Definition: set.c:5932
SCIP_NODE * SCIPtreeGetBestNode(SCIP_TREE *tree, SCIP_SET *set)
Definition: tree.c:7121
SCIP_Real SCIPsetInfinity(SCIP_SET *set)
Definition: set.c:5636
SCIP_Real SCIPgetBranchingPoint(SCIP *scip, SCIP_VAR *var, SCIP_Real suggestion)
Definition: scip.c:37504
SCIP_Bool time_reading
Definition: struct_set.h:536
int SCIPintarrayGetVal(SCIP_INTARRAY *intarray, int idx)
Definition: misc.c:4226
SCIP_TABLE * SCIPfindTable(SCIP *scip, const char *name)
Definition: scip.c:9490
SCIP_RETCODE SCIPgetOpenNodesData(SCIP *scip, SCIP_NODE ***leaves, SCIP_NODE ***children, SCIP_NODE ***siblings, int *nleaves, int *nchildren, int *nsiblings)
Definition: scip.c:41711
SCIP_RETCODE SCIPreoptAddCons(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_CONS *cons)
Definition: reopt.c:8093
#define SCIP_DECL_PRICEREXIT(x)
Definition: type_pricer.h:70
SCIP_RETCODE SCIPsetConshdlrInitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITPRE((*consinitpre)))
Definition: scip.c:6205
internal methods for displaying statistics tables
SCIP_CONCURRENT * concurrent
Definition: struct_scip.h:99
SCIP_RETCODE SCIPstopClock(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip.c:46115
SCIP_Bool history_allowmerge
Definition: struct_set.h:263
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:1268
SCIP_RETCODE SCIPaddRowDive(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:35509
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
Definition: scip.c:47387
SCIP_RETCODE SCIPgetLPI(SCIP *scip, SCIP_LPI **lpi)
Definition: scip.c:30031
SCIP_RETCODE SCIPsolLinkCurrentSol(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_LP *lp)
Definition: sol.c:938
SCIP_RETCODE SCIPsetBranchruleExit(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXIT((*branchexit)))
Definition: scip.c:9171
int nreoptruns
Definition: struct_stat.h:255
SCIP_Real SCIPlpGetGlobalPseudoObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:12782
SCIP_Real SCIPvarGetSol(SCIP_VAR *var, SCIP_Bool getlpval)
Definition: var.c:12665
SCIP_RETCODE SCIPaddDelayedPoolCut(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:35051
SCIP_RETCODE SCIProwEnsureSize(SCIP_ROW *row, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
Definition: lp.c:586
SCIP_NODE * SCIPtreeGetBestChild(SCIP_TREE *tree, SCIP_SET *set)
Definition: tree.c:7057
SCIP_RETCODE SCIPchgVarUbLazy(SCIP *scip, SCIP_VAR *var, SCIP_Real lazyub)
Definition: scip.c:22489
int SCIPbranchcandGetNPrioExternCands(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:516
SCIP_DECL_CONSENFOPS(ConshdlrSubtour::scip_enfops)
SCIP_RETCODE SCIPsetIncludeDialog(SCIP_SET *set, SCIP_DIALOG *dialog)
Definition: set.c:4732
SCIP_RETCODE SCIPconcsolverTypeCreate(SCIP_CONCSOLVERTYPE **concsolvertype, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, SCIP_Real prefpriodefault, SCIP_DECL_CONCSOLVERCREATEINST((*concsolvercreateinst)), SCIP_DECL_CONCSOLVERDESTROYINST((*concsolverdestroyinst)), SCIP_DECL_CONCSOLVERINITSEEDS((*concsolverinitseeds)), SCIP_DECL_CONCSOLVEREXEC((*concsolverexec)), SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA((*concsolvercopysolvdata)), SCIP_DECL_CONCSOLVERSTOP((*concsolverstop)), SCIP_DECL_CONCSOLVERSYNCWRITE((*concsolversyncwrite)), SCIP_DECL_CONCSOLVERSYNCREAD((*concsolversyncread)), SCIP_DECL_CONCSOLVERTYPEFREEDATA((*concsolvertypefreedata)), SCIP_CONCSOLVERTYPEDATA *data)
Definition: concsolver.c:41
SCIP_RETCODE SCIPincRealarrayVal(SCIP *scip, SCIP_REALARRAY *realarray, int idx, SCIP_Real incval)
Definition: scip.c:47968
SCIP_RETCODE SCIPnlpGetStatistics(SCIP_NLP *nlp, SCIP_NLPSTATISTICS *statistics)
Definition: nlp.c:5995
void SCIPconsMarkConflict(SCIP_CONS *cons)
Definition: cons.c:6900
SCIP_Real SCIPdualfeastol(SCIP *scip)
Definition: scip.c:46471
int SCIPnodepqLen(const SCIP_NODEPQ *nodepq)
Definition: nodesel.c:558
SCIP_RETCODE SCIPsetRelaxExitsol(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXEXITSOL((*relaxexitsol)))
Definition: scip.c:7262
SCIP_SOL ** sols
Definition: struct_primal.h:48
void SCIPmessagehdlrCapture(SCIP_MESSAGEHDLR *messagehdlr)
Definition: message.c:329
int npresoldelconss
Definition: struct_stat.h:232
void SCIPgmlWriteClosing(FILE *file)
Definition: misc.c:687
int SCIPgetMaxDepth(SCIP *scip)
Definition: scip.c:43095
SCIP_RETCODE SCIPconvertCutsToConss(SCIP *scip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, int *ncutsadded)
Definition: scip.c:3005
void SCIPprintStatusStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44305
SCIP_Real SCIPbranchGetScore(SCIP_SET *set, SCIP_VAR *var, SCIP_Real downgain, SCIP_Real upgain)
Definition: branch.c:2151
SCIP_RETCODE SCIPvarMarkDoNotMultaggr(SCIP_VAR *var)
Definition: var.c:5815
SCIP_Real SCIPvarGetLbLP(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:12342
SCIP_RETCODE SCIPtransformConss(SCIP *scip, int nconss, SCIP_CONS **conss, SCIP_CONS **transconss)
Definition: scip.c:28213
SCIP_Real SCIPgetVarPseudocostCountCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26167
SCIP_RETCODE SCIPsetNlRowExprtree(SCIP *scip, SCIP_NLROW *nlrow, SCIP_EXPRTREE *exprtree)
Definition: scip.c:32628
SCIP_BOUNDTYPE SCIPboundchgGetBoundtype(SCIP_BOUNDCHG *boundchg)
Definition: var.c:16589
#define SCIP_DECL_PROBDELTRANS(x)
Definition: type_prob.h:86
SCIP_Longint nstrongbranchs
Definition: struct_stat.h:191
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:17756
void SCIPreaderSetFree(SCIP_READER *reader, SCIP_DECL_READERFREE((*readerfree)))
Definition: reader.c:482
#define SCIP_EVENTTYPE_ROWCHANGED
Definition: type_event.h:131
SCIP_RETCODE SCIPchgNlRowLinearCoef(SCIP *scip, SCIP_NLROW *nlrow, SCIP_VAR *var, SCIP_Real coef)
Definition: scip.c:32451
void SCIPcomprSetExitsol(SCIP_COMPR *compr, SCIP_DECL_COMPREXITSOL((*comprexitsol)))
Definition: compr.c:384
void SCIPgetDiveBoundChangeData(SCIP *scip, SCIP_VAR ***variables, SCIP_BRANCHDIR **directions, SCIP_Real **values, int *ndivebdchgs, SCIP_Bool preferred)
Definition: scip.c:36941
SCIP_Longint SCIPpropGetNCalls(SCIP_PROP *prop)
Definition: prop.c:1042
SCIP_Real SCIPgetVarPseudocostScoreCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_Real solval)
Definition: scip.c:26358
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47350
SCIP_RETCODE SCIPextendRealarray(SCIP *scip, SCIP_REALARRAY *realarray, int minidx, int maxidx)
Definition: scip.c:47898
static SCIP_RETCODE labelSortStable(SCIP *scip, SCIP_VAR **vars, int *classlabels, SCIP_VAR **sortedvars, int *sortedindices, int *classesstartposs, int nvars, int nclasses)
Definition: scip.c:24315
SCIP_RETCODE SCIPreoptnodeDelete(SCIP_REOPTNODE **reoptnode, BMS_BLKMEM *blkmem)
Definition: reopt.c:7960
SCIP_RETCODE SCIPsetBranchruleFree(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHFREE((*branchfree)))
Definition: scip.c:9139
SCIP_RETCODE SCIPprintDisplayLine(SCIP *scip, FILE *file, SCIP_VERBLEVEL verblevel, SCIP_Bool endline)
Definition: scip.c:45881
#define SCIP_DECL_BRANCHFREE(x)
Definition: type_branch.h:60
int SCIPmajorVersion(void)
Definition: scip.c:567
void SCIPswapPointers(void **pointer1, void **pointer2)
Definition: misc.c:9639
SCIP_Real SCIPsepaGetSetupTime(SCIP_SEPA *sepa)
Definition: sepa.c:743
int SCIPpresolGetNChgCoefs(SCIP_PRESOL *presol)
Definition: presol.c:751
SCIP_BRANCHCAND * branchcand
Definition: struct_scip.h:79
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
Definition: scip.c:11686
int lastnpresolchgvartypes
Definition: struct_stat.h:239
int SCIPsepastoreGetNCutsApplied(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1267
SCIP_Bool time_statistictiming
Definition: struct_set.h:538
SCIP_Longint SCIPgetNPrimalResolveLPs(SCIP *scip)
Definition: scip.c:42560
#define SCIP_DECL_CONSRESPROP(x)
Definition: type_cons.h:595
void SCIPclockStop(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:350
SCIP_RETCODE SCIPsetHeuristics(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip.c:5106
SCIP_RETCODE SCIPsetProbExitsol(SCIP *scip, SCIP_DECL_PROBEXITSOL((*probexitsol)))
Definition: scip.c:10102
SCIP_RETCODE SCIPconsGetVars(SCIP_CONS *cons, SCIP_SET *set, SCIP_VAR **vars, int varssize, SCIP_Bool *success)
Definition: cons.c:6191
#define SCIP_DECL_CONCSOLVEREXEC(x)
SCIP_Bool tablessorted
Definition: struct_set.h:157
SCIP_Longint nrootsblpiterations
Definition: struct_stat.h:69
SCIP_Longint SCIPconflictGetNInfeasibleLPReconvergenceConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:8179
SCIP_Bool SCIPisSumNegative(SCIP *scip, SCIP_Real val)
Definition: scip.c:47286
void SCIPprintTransProblemStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44358
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4485
SCIP_Longint SCIPconflictGetNInfeasibleLPReconvergenceLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:8189
SCIP_RETCODE SCIPchgReoptObjective(SCIP *scip, SCIP_OBJSENSE objsense, SCIP_VAR **vars, SCIP_Real *coefs, int nvars)
Definition: scip.c:10943
SCIP_SOL ** SCIPgetSols(SCIP *scip)
Definition: scip.c:39832
void SCIPprintTimingStatistics(SCIP *scip, FILE *file)
Definition: scip.c:45575
SCIP_RETCODE SCIPconsSetSeparated(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool separate)
Definition: cons.c:6403
void * SCIPptrarrayGetVal(SCIP_PTRARRAY *ptrarray, int idx)
Definition: misc.c:4947
SCIP_Bool probdiverelaxstored
Definition: struct_tree.h:238
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
Definition: lp.c:16484
void SCIPsetSortHeurs(SCIP_SET *set)
Definition: set.c:4325
#define FALSE
Definition: def.h:64
SCIP_SEPA ** sepas
Definition: struct_set.h:76
SCIP_Real SCIPadjustedVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real ub)
Definition: scip.c:21985
void SCIPselectDownRealInt(SCIP_Real *realarray, int *intarray, int k, int len)
SCIP_Bool SCIPconshdlrDoesPresolve(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:5039
#define SCIP_DECL_PRESOLCOPY(x)
Definition: type_presol.h:46
SCIP_RETCODE SCIPnlpSolveDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat)
Definition: nlp.c:6356
SCIP_Real SCIPgetDeterministicTime(SCIP *scip)
Definition: scip.c:44135
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
Definition: misc.c:2793
SCIP_RETCODE SCIPlpWrite(SCIP_LP *lp, const char *fname)
Definition: lp.c:15752
void SCIPpropSetExitsol(SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol)))
Definition: prop.c:811
SCIP_Longint SCIPgetNStrongbranchs(SCIP *scip)
Definition: scip.c:42744
SCIP_RETCODE SCIPnlpGetVarsNonlinearity(SCIP_NLP *nlp, int *nlcount)
Definition: nlp.c:5808
SCIP_RETCODE SCIPeventProcess(SCIP_EVENT *event, SCIP_SET *set, SCIP_PRIMAL *primal, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTFILTER *eventfilter)
Definition: event.c:1460
void SCIPstatEnableOrDisableStatClocks(SCIP_STAT *stat, SCIP_Bool enable)
Definition: stat.c:644
SCIP_RETCODE SCIPsetNodeselMemsavePriority(SCIP *scip, SCIP_NODESEL *nodesel, int priority)
Definition: scip.c:9007
void SCIPsetSubscipDepth(SCIP *scip, int newdepth)
Definition: scip.c:3563
SCIP_Bool SCIPlpIsSolBasic(SCIP_LP *lp)
Definition: lp.c:16982
methods for the aggregation rows
char sepa_cutselrestart
Definition: struct_set.h:492
#define SCIP_DECL_PRICERINIT(x)
Definition: type_pricer.h:62
SCIP_Longint SCIPpropGetNCutoffs(SCIP_PROP *prop)
Definition: prop.c:1062
SCIP_RETCODE SCIPbranchVarValNary(SCIP *scip, SCIP_VAR *var, SCIP_Real val, int n, SCIP_Real minwidth, SCIP_Real widthfactor, int *nchildren)
Definition: scip.c:37749
SCIP_Longint SCIPbranchruleGetNDomredsFound(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2114
SCIP_Real SCIPsetSetRelaxfeastol(SCIP_SET *set, SCIP_Real relaxfeastol)
Definition: set.c:5463
int SCIPboolarrayGetMaxIdx(SCIP_BOOLARRAY *boolarray)
Definition: misc.c:4693
SCIP_Bool SCIPsetIsFeasIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6317
SCIP_Real SCIPgetVarVSIDS(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26394
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:5379
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:4293
SCIP_Real objoffset
Definition: struct_prob.h:41
struct SCIP_VarData SCIP_VARDATA
Definition: type_var.h:98
SCIP_RETCODE SCIPnlpiAddConstraints(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int nconss, const SCIP_Real *lhss, const SCIP_Real *rhss, const int *nlininds, int *const *lininds, SCIP_Real *const *linvals, const int *nquadelems, SCIP_QUADELEM *const *quadelems, int *const *exprvaridxs, SCIP_EXPRTREE *const *exprtrees, const char **names)
Definition: nlpi.c:268
SCIP_NODESEL * SCIPsetGetNodesel(SCIP_SET *set, SCIP_STAT *stat)
Definition: set.c:4523
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:8282
SCIP_Bool SCIPhasNLPContinuousNonlinearity(SCIP *scip)
Definition: scip.c:31248
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:7148
SCIP_Bool solved
Definition: struct_lp.h:348
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:23434
#define SCIP_DECL_RELAXINIT(x)
Definition: type_relax.h:63
SCIP_Real SCIPrelDiff(SCIP_Real val1, SCIP_Real val2)
Definition: misc.c:10289
SCIP_RETCODE SCIPcopyLimits(SCIP *sourcescip, SCIP *targetscip)
Definition: scip.c:4192
SCIP_NODE * SCIPgetBestSibling(SCIP *scip)
Definition: scip.c:41649
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:2678
#define SCIP_DECL_RELAXINITSOL(x)
Definition: type_relax.h:82
struct SCIP_LPiNorms SCIP_LPINORMS
Definition: type_lpi.h:98
int SCIPgetSubscipDepth(SCIP *scip)
Definition: scip.c:3542
char * SCIPconcsolverGetName(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:246
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:5894
int SCIPgetNPartialSols(SCIP *scip)
Definition: scip.c:40953
void SCIPclockStart(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:280
SCIP_RETCODE SCIPdelPoolCut(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:34792
SCIP_Bool SCIPisIntParamValid(SCIP *scip, SCIP_PARAM *param, int value)
Definition: scip.c:4703
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:27668
int SCIPgetNActivePricers(SCIP *scip)
Definition: scip.c:5718
SCIP_Real SCIPgetVarMultaggrUbLocal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23905
SCIP_COMPR * SCIPfindCompr(SCIP *scip, const char *name)
Definition: scip.c:8459
SCIP_RETCODE SCIPvarTransform(SCIP_VAR *origvar, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_OBJSENSE objsense, SCIP_VAR **transvar)
Definition: var.c:3290
int limit_maxorigsol
Definition: struct_set.h:280
SCIP_PROP * SCIPsetFindProp(SCIP_SET *set, const char *name)
Definition: set.c:4085
SCIP_RETCODE SCIPreoptApplyCompression(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_REOPTNODE **representatives, int nrepresentatives, SCIP_Bool *success)
Definition: reopt.c:6669
SCIP_RETCODE SCIPaddQuadElementToNlRow(SCIP *scip, SCIP_NLROW *nlrow, SCIP_QUADELEM quadelem)
Definition: scip.c:32538
SCIP_RETCODE SCIPsetNodeselExit(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELEXIT((*nodeselexit)))
Definition: scip.c:8909
SCIP_RETCODE SCIPpropagateProbingImplications(SCIP *scip, SCIP_Bool *cutoff)
Definition: scip.c:36420
void SCIPprintExternalCodes(SCIP *scip, FILE *file)
Definition: scip.c:9684
int SCIPbranchcandGetNPrioPseudoImpls(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:893
#define SCIP_DECL_TABLEFREE(x)
Definition: type_table.h:61
SCIP_RETCODE SCIPcopyConsCompression(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *suffix, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars, SCIP_Bool global, SCIP_Bool enablepricing, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
Definition: scip.c:3884
SCIP_RETCODE SCIPcutoffNode(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:41747
int parallel_maxnthreads
Definition: struct_set.h:514
SCIP_RETCODE SCIPsolCopy(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_SOL *sourcesol)
Definition: sol.c:344
SCIP_Real SCIPinfinity(SCIP *scip)
Definition: scip.c:47028
SCIP_Real SCIPgetVarPseudocostValCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta)
Definition: scip.c:26059
SCIP_Real constant
Definition: struct_var.h:194
SCIP_VERBLEVEL SCIPgetVerbLevel(SCIP *scip)
Definition: scip.c:1384
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:10011
SCIP_Bool SCIPsetIsZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5888
SCIP_STAGE stage
Definition: struct_set.h:62
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
Definition: scip.c:47100
SCIP_RETCODE SCIPenableConsSeparation(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28484
SCIP_Bool SCIPexistsDialog(SCIP *scip, SCIP_DIALOG *dialog)
Definition: scip.c:9748
SCIP_PRICER * SCIPfindPricer(SCIP *scip, const char *name)
Definition: scip.c:5681
void SCIPclearExternBranchCands(SCIP *scip)
Definition: scip.c:37296
void SCIPrandomPermuteArray(SCIP_RANDNUMGEN *randnumgen, void **array, int begin, int end)
Definition: misc.c:9437
#define TRUE
Definition: def.h:63
#define SCIPdebug(x)
Definition: pub_message.h:74
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:8325
const char * SCIPsepaGetName(SCIP_SEPA *sepa)
Definition: sepa.c:646
SCIP_Real SCIPcutGetLPActivityQuot(SCIP_CUT *cut)
Definition: cutpool.c:396
SCIP_RETCODE SCIPunmarkConsPropagate(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28630
SCIP_RETCODE SCIPnlrowEnsureQuadElementsSize(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
Definition: nlp.c:2583
SCIP_Real SCIPvarGetAvgConflictlength(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:14766
SCIP_Real SCIPgetConflictVarUb(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:27474
void SCIPprobSetExitsol(SCIP_PROB *prob, SCIP_DECL_PROBEXITSOL((*probexitsol)))
Definition: prob.c:372
SCIP_RETCODE SCIPsetBranchruleCopy(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHCOPY((*branchcopy)))
Definition: scip.c:9123
void SCIPprobMarkNConss(SCIP_PROB *prob)
Definition: prob.c:1394
#define SCIP_DECL_HEURCOPY(x)
Definition: type_heur.h:62
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_Longint SCIPconflictGetNPropConflictLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:5487
SCIP_Real SCIPgetLocalLowerbound(SCIP *scip)
Definition: scip.c:13408
SCIP_Bool SCIPcliqueIsEquation(SCIP_CLIQUE *clique)
Definition: implics.c:3409
#define SCIP_DECL_PROPEXITPRE(x)
Definition: type_prop.h:100
#define SCIP_DECL_HEUREXEC(x)
Definition: type_heur.h:128
SCIP_RETCODE SCIPnlpCreate(SCIP_NLP **nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, const char *name, int nvars_estimate)
Definition: nlp.c:5060
SCIP_Real SCIPgetSolTime(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:39153
SCIP_RETCODE SCIPaddConflictUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
Definition: scip.c:27251
SCIP_RETCODE SCIPsolveNLP(SCIP *scip)
Definition: scip.c:31593
SCIP_RETCODE SCIPcliquetableCreate(SCIP_CLIQUETABLE **cliquetable, SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition: implics.c:1766
#define SCIP_DECL_CONSGETNVARS(x)
Definition: type_cons.h:865
SCIP_PRESOL * SCIPsetFindPresol(SCIP_SET *set, const char *name)
Definition: set.c:3860
SCIP_RETCODE SCIPaddVarLocks(SCIP *scip, SCIP_VAR *var, int nlocksdown, int nlocksup)
Definition: scip.c:21660
int nenabledconss
Definition: struct_stat.h:221
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
Definition: cons.c:8265
SCIP_Longint SCIPgetVarStrongbranchNode(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:21561
void SCIPconshdlrSetFree(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree)))
Definition: cons.c:4220
void SCIPcomprSetPriority(SCIP_COMPR *compr, SCIP_SET *set, int priority)
Definition: compr.c:439
SCIP_RETCODE SCIPcreateIntarray(SCIP *scip, SCIP_INTARRAY **intarray)
Definition: scip.c:48015
#define SCIP_PRESOLTIMING_EXHAUSTIVE
Definition: type_timing.h:45
SCIP_Longint SCIPcutpoolGetNCalls(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:1083
SCIP_Real sepa_minefficacy
Definition: struct_set.h:481
void SCIPcomprSetInit(SCIP_COMPR *compr, SCIP_DECL_COMPRINIT((*comprinit)))
Definition: compr.c:351
SCIP_RETCODE SCIPincludeHeur(SCIP *scip, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, SCIP_HEURTIMING 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:8034
SCIP_Real SCIPsepaGetTime(SCIP_SEPA *sepa)
Definition: sepa.c:753
SCIP_Real SCIProwGetLPEfficacy(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:6614
SCIP_RETCODE SCIPwriteOrigProblem(SCIP *scip, const char *filename, const char *extension, SCIP_Bool genericnames)
Definition: scip.c:10426
SCIP_Real SCIPgetBranchScoreMultiple(SCIP *scip, SCIP_VAR *var, int nchildren, SCIP_Real *gains)
Definition: scip.c:37479
SCIP_Longint SCIPconcsolverGetNSolsShared(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:538
SCIP_RETCODE SCIPsetPresolving(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip.c:5132
SCIP_Longint nnlps
Definition: struct_stat.h:194
static SCIP_RETCODE copySofttimelimit(SCIP *sourcescip, SCIP *targetscip)
Definition: scip.c:4100
SCIP_RETCODE SCIPnlpChgVarsBoundsDive(SCIP_NLP *nlp, SCIP_SET *set, int nvars, SCIP_VAR **vars, SCIP_Real *lbs, SCIP_Real *ubs)
Definition: nlp.c:6304
SCIP_RETCODE SCIPsetComprInitsol(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPRINITSOL((*comprinitsol)))
Definition: scip.c:8427
#define SCIP_MEM_NOLIMIT
Definition: def.h:280
SCIP_Real SCIPlpGetRootColumnObjval(SCIP_LP *lp)
Definition: lp.c:16897
#define EPSP(x, eps)
Definition: def.h:180
void SCIPconflicthdlrSetPriority(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_SET *set, int priority)
Definition: conflict.c:742
SCIP_Real SCIPprobInternObjval(SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_SET *set, SCIP_Real objval)
Definition: prob.c:2091
void SCIPlpStartStrongbranchProbing(SCIP_LP *lp)
Definition: lp.c:15570
enum SCIP_Varstatus SCIP_VARSTATUS
Definition: type_var.h:48
void SCIPprintHeuristicStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44941
SCIP_Real SCIPconshdlrGetEnfoLPTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4619
int SCIPgetNReoptnodes(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:16822
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
Definition: scip.c:9269
SCIP_Longint nbacktracks
Definition: struct_stat.h:85
#define SCIPsetAllocBufferArray(set, ptr, num)
Definition: set.h:1877
char ** SCIPgetExternalCodeNames(SCIP *scip)
Definition: scip.c:9645
int SCIPtreeGetCurrentDepth(SCIP_TREE *tree)
Definition: tree.c:8302
int SCIPconshdlrGetNUpgdConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4929
SCIP_Real SCIPsolGetRayVal(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var)
Definition: sol.c:1423
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:7106
SCIP_DECL_READERWRITE(ReaderTSP::scip_write)
Definition: ReaderTSP.cpp:472
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:1992
SCIP_HEUR ** SCIPgetHeurs(SCIP *scip)
Definition: scip.c:8238
SCIP_Longint SCIPconshdlrGetNCutsApplied(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4779
SCIP_RETCODE SCIPsetProbData(SCIP *scip, SCIP_PROBDATA *probdata)
Definition: scip.c:10838
SCIP_RETCODE SCIPchgVarLbDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:35445
SCIP_RETCODE SCIPsetSetParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, void *value)
Definition: set.c:3050
void SCIPsepaSetExit(SCIP_SEPA *sepa, SCIP_DECL_SEPAEXIT((*sepaexit)))
Definition: sepa.c:613
SCIP_Longint SCIPbranchruleGetNCutoffs(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2082
int SCIPnlrowGetNQuadVars(SCIP_NLROW *nlrow)
Definition: nlp.c:3275
SCIP_Bool branch_checksbsol
Definition: struct_set.h:173
void SCIPrelaxSetCopy(SCIP_RELAX *relax, SCIP_DECL_RELAXCOPY((*relaxcopy)))
Definition: relax.c:378
const char * SCIPgetGitHash(void)
Definition: scipgithash.c:27
SCIP_Real SCIPnlrowGetRhs(SCIP_NLROW *nlrow)
Definition: nlp.c:3383
int SCIPvarGetProbindex(SCIP_VAR *var)
Definition: var.c:16969
void SCIPpropSetFree(SCIP_PROP *prop, SCIP_DECL_PROPFREE((*propfree)))
Definition: prop.c:767
SCIP_Longint SCIPdivesetGetNSols(SCIP_DIVESET *diveset)
Definition: heur.c:495
SCIP_RETCODE SCIPfreeIntarray(SCIP *scip, SCIP_INTARRAY **intarray)
Definition: scip.c:48032
int SCIPgetNPrioPseudoBranchInts(SCIP *scip)
Definition: scip.c:37420
SCIP_RETCODE SCIPptrarrayExtend(SCIP_PTRARRAY *ptrarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
Definition: misc.c:4761
SCIP_Real SCIPgetAvgLowerbound(SCIP *scip)
Definition: scip.c:43234
SCIP_Bool branch_divingpscost
Definition: struct_set.h:170
SCIP_Longint SCIPgetNRootFirstLPIterations(SCIP *scip)
Definition: scip.c:42396
SCIP_RETCODE SCIPgetLPBInvCol(SCIP *scip, int c, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip.c:29819
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:10361
#define SCIP_DECL_VARCOPY(x)
Definition: type_var.h:172
enum SCIP_VerbLevel SCIP_VERBLEVEL
Definition: type_message.h:48
unsigned int sbdownvalid
Definition: struct_lp.h:179
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:1269
SCIP_RETCODE SCIPpricestoreCreate(SCIP_PRICESTORE **pricestore)
Definition: pricestore.c:96
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:2893
SCIP_RETCODE SCIPreoptFree(SCIP_REOPT **reopt, SCIP_SET *set, SCIP_PRIMAL *origprimal, BMS_BLKMEM *blkmem)
Definition: reopt.c:5138
SCIP_RETCODE SCIPcutpoolAddNewRow(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_ROW *row)
Definition: cutpool.c:716
void SCIPpricerSetFree(SCIP_PRICER *pricer, SCIP_DECL_PRICERFREE((*pricerfree)))
Definition: pricer.c:495
SCIP_Bool SCIPsolsAreEqual(SCIP_SOL *sol1, SCIP_SOL *sol2, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *origprob, SCIP_PROB *transprob)
Definition: sol.c:1977
SCIP_RETCODE SCIPvarChgLbDive(SCIP_VAR *var, SCIP_SET *set, SCIP_LP *lp, SCIP_Real newbound)
Definition: var.c:7882
SCIP_Longint SCIPsepaGetNCutsFound(SCIP_SEPA *sepa)
Definition: sepa.c:793
SCIP_RETCODE SCIPreoptnodeAddCons(SCIP_REOPTNODE *reoptnode, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR **vars, SCIP_Real *bounds, SCIP_BOUNDTYPE *boundtypes, SCIP_Real lhs, SCIP_Real rhs, int nvars, REOPT_CONSTYPE constype, SCIP_Bool linear)
Definition: reopt.c:8002
void SCIPbranchcandClearExternCands(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:698
SCIP_Real SCIPsetCutoffbounddelta(SCIP_SET *set)
Definition: set.c:5741
const char * SCIPexprintGetDesc(void)
int SCIPsetCalcMemGrowSize(SCIP_SET *set, int num)
Definition: set.c:5326
#define SCIP_UNUSED(x)
Definition: def.h:404
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:17699
SCIP_Longint SCIPgetNNZs(SCIP *scip)
Definition: scip.c:42359
const char * SCIPnlpiGetName(SCIP_NLPI *nlpi)
Definition: nlpi.c:743
SCIP_RETCODE SCIPisConflictVarUsed(SCIP *scip, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool *used)
Definition: scip.c:27422
SCIP_Real SCIPgetVarAvgCutoffsCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26918
void SCIPintervalSetBounds(SCIP_INTERVAL *resultant, SCIP_Real inf, SCIP_Real sup)
SCIP_Longint SCIPconshdlrGetNCutsFound(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4769
SCIP_Real SCIPgetVectorEfficacyNorm(SCIP *scip, SCIP_Real *vals, int nvals)
Definition: scip.c:34560
SCIP_Bool presol_donotmultaggr
Definition: struct_set.h:414
SCIP_Bool SCIPsetIsSumLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6025
datastructures for concurrent solvers
SCIP_PARAM ** SCIPsetGetParams(SCIP_SET *set)
Definition: set.c:3467
SCIP_Bool SCIPisDualfeasZero(SCIP *scip, SCIP_Real val)
Definition: scip.c:47536
SCIP_Real SCIPsetRound(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5985
SCIP_Real SCIPsolGetTime(SCIP_SOL *sol)
Definition: sol.c:2508
void SCIPreoptResetSolMarks(SCIP_REOPT *reopt)
Definition: reopt.c:5737
SCIP_VAR ** SCIPgetOrigVars(SCIP *scip)
Definition: scip.c:12225
SCIP_Real SCIPgetVarVSIDSCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26426
SCIP_RETCODE SCIPchgRealParam(SCIP *scip, SCIP_PARAM *param, SCIP_Real value)
Definition: scip.c:4778
#define infty2infty(infty1, infty2, val)
Definition: scip.c:33050
SCIP_Real SCIPvarGetAggrScalar(SCIP_VAR *var)
Definition: var.c:17022
int SCIPnlrowGetNLinearVars(SCIP_NLROW *nlrow)
Definition: nlp.c:3245
SCIP_RETCODE SCIPprobInitSolve(SCIP_PROB *prob, SCIP_SET *set)
Definition: prob.c:1849
SCIP_RETCODE SCIPconsEnableSeparation(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:6782
SCIP_NODE * SCIPtreeGetFocusNode(SCIP_TREE *tree)
Definition: tree.c:8210
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
Definition: cons.c:8295
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:6963
SCIP_NLPTERMSTAT SCIPnlpGetTermstat(SCIP_NLP *nlp)
Definition: nlp.c:5985
SCIP_Real SCIPgetVarAvgCutoffScoreCurrentRun(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26975
struct SCIP_HeurData SCIP_HEURDATA
Definition: type_heur.h:51
#define BMSdisplayBlockMemory(mem)
Definition: memory.h:461
SCIP_Longint SCIPgetNRootStrongbranchLPIterations(SCIP *scip)
Definition: scip.c:42798
#define SCIP_DECL_CONSEXITSOL(x)
Definition: type_cons.h:200
int SCIPgetNActiveConss(SCIP *scip)
Definition: scip.c:43180
void SCIPconshdlrSetCopy(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
Definition: cons.c:4205
int SCIPgetNNodesLeft(SCIP *scip)
Definition: scip.c:42178
SCIP_Longint SCIPdivesetGetNLPIterations(SCIP_DIVESET *diveset)
Definition: heur.c:465
SCIP_RETCODE SCIPevalExprtreeSol(SCIP *scip, SCIP_EXPRTREE *tree, SCIP_SOL *sol, SCIP_Real *val)
Definition: scip.c:33111
void SCIPdebugMessagePrint(SCIP *scip, const char *formatstr,...)
Definition: scip.c:1310
SCIP_RETCODE SCIPsetSepaPriority(SCIP *scip, SCIP_SEPA *sepa, int priority)
Definition: scip.c:7560
SCIP_VAR ** fixedvars
Definition: struct_prob.h:56
static GRAPHNODE ** active
SCIP_RETCODE SCIPaddConflictRelaxedLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedlb)
Definition: scip.c:27218
SCIP_RETCODE SCIPeventqueueFree(SCIP_EVENTQUEUE **eventqueue)
Definition: event.c:2077
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:15334
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:5856
SCIP_Real mem_arraygrowfac
Definition: struct_set.h:339
SCIP_RETCODE SCIPaddDiveBoundChange(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir, SCIP_Real value, SCIP_Bool preferred)
Definition: scip.c:36915
SCIP_Bool SCIPisVarPscostRelerrorReliable(SCIP *scip, SCIP_VAR *var, SCIP_Real threshold, SCIP_CONFIDENCELEVEL clevel)
Definition: scip.c:26295
struct SCIP_DialogData SCIP_DIALOGDATA
Definition: type_dialog.h:42
SCIP_RETCODE SCIPsetConflicthdlrExitsol(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol)))
Definition: scip.c:6800
SCIP_Bool SCIPsetIsDualfeasLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6429
SCIP_RETCODE SCIPinitConflictAnalysis(SCIP *scip, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
Definition: scip.c:27155
SCIP_RETCODE SCIPclearRelaxSolVals(SCIP *scip)
Definition: scip.c:19889
SCIP_Longint nsolsfound
Definition: struct_primal.h:39
SCIP_Longint SCIPgetNBacktracks(SCIP *scip)
Definition: scip.c:43143
int nheurs
Definition: struct_set.h:112
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:22639
SCIP_Real SCIPconshdlrGetEnfoPSTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4629
SCIP_Longint SCIPgetNDivingLPIterations(SCIP *scip)
Definition: scip.c:42726
XML_NODE * xmlProcess(const char *filename)
Definition: xmlparse.c:1072
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:1584
#define SCIP_DECL_BRANCHEXECEXT(x)
Definition: type_branch.h:140
SCIP_Real SCIPgetRelaxSolObj(SCIP *scip)
Definition: scip.c:20145
SCIP_RETCODE SCIPincludeHeurBasic(SCIP *scip, SCIP_HEUR **heur, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, SCIP_HEURTIMING timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata)
Definition: scip.c:8084
SCIP_RETCODE SCIPsetIncludeNlpi(SCIP_SET *set, SCIP_NLPI *nlpi)
Definition: set.c:4776
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:4376
SCIP_Bool SCIPgetVarWasFixedAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: scip.c:19807
SCIP_RETCODE SCIPenableOrDisableStatisticTiming(SCIP *scip)
Definition: scip.c:46155
int maxtotaldepth
Definition: struct_stat.h:218
SCIP_RETCODE SCIPconsSetPropagated(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool propagate)
Definition: cons.c:6521
SCIP_Real SCIPvarGetAvgInferences(SCIP_VAR *var, SCIP_STAT *stat, SCIP_BRANCHDIR dir)
Definition: var.c:15471
SCIP_Real SCIPreoptGetOldObjCoef(SCIP_REOPT *reopt, int run, int idx)
Definition: reopt.c:5677
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:12048
SCIP_READER * SCIPfindReader(SCIP *scip, const char *name)
Definition: scip.c:5390
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 SCIPenableConsPropagation(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28539
SCIP_RETCODE SCIPcliquetableFree(SCIP_CLIQUETABLE **cliquetable, BMS_BLKMEM *blkmem)
Definition: implics.c:1802
SCIP_CLOCK * barrierlptime
Definition: struct_stat.h:149
void SCIPprintPresolverStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44383
SCIP_Bool SCIPallVarsInProb(SCIP *scip)
Definition: scip.c:12564
SCIP_Real SCIPsetRelaxfeastol(SCIP_SET *set)
Definition: set.c:5755
SCIP_Real SCIPhistoryGetVSIDS(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
Definition: history.c:513
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:33409
SCIP_RETCODE SCIPnlrowChgExprtreeParams(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real *paramvals)
Definition: nlp.c:2750
SCIP_ROW ** SCIPlpGetRows(SCIP_LP *lp)
Definition: lp.c:16757
SCIP_Bool diving
Definition: struct_lp.h:361
SCIP_RETCODE SCIPinterruptCreate(SCIP_INTERRUPT **interrupt)
Definition: interrupt.c:76
SCIP_RETCODE SCIPconflictFree(SCIP_CONFLICT **conflict, BMS_BLKMEM *blkmem)
Definition: conflict.c:3727
SCIP_RETCODE SCIPinitRepresentation(SCIP *scip, SCIP_REOPTNODE **representatives, int nrepresentatives)
Definition: scip.c:16985
int SCIPrandomGetInt(SCIP_RANDNUMGEN *randnumgen, int minrandval, int maxrandval)
Definition: misc.c:9366
SCIP_Real SCIPgetVarPseudocost(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26085
const XML_NODE * xmlFirstChild(const XML_NODE *node)
Definition: xmlparse.c:1456
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:5948
SCIP_RETCODE SCIPrecalcRowActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:31049
SCIP_RETCODE SCIPchgVarLbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:36040
SCIP_Real SCIPlpGetPseudoObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:12814
#define SCIP_DECL_PRICEREXITSOL(x)
Definition: type_pricer.h:92
int SCIPgetPtrarrayMaxIdx(SCIP *scip, SCIP_PTRARRAY *ptrarray)
Definition: scip.c:48412
int SCIPpresolGetNFixedVars(SCIP_PRESOL *presol)
Definition: presol.c:671
SCIP_RETCODE SCIPnlpiSetMessageHdlr(SCIP_NLPI *nlpi, SCIP_MESSAGEHDLR *messagehdlr)
Definition: nlpi.c:720
SCIP_RETCODE SCIPgetOrigVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
Definition: scip.c:12177
unsigned int SCIP_DIVETYPE
Definition: type_heur.h:48
SCIP_RETCODE SCIPgetNlRowSolActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_SOL *sol, SCIP_Real *activity)
Definition: scip.c:32935
SCIP_RETCODE SCIPvarsGetActiveVars(SCIP_SET *set, SCIP_VAR **vars, int *nvars, int varssize, int *requiredsize)
Definition: var.c:11417
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:382
SCIP_RETCODE SCIPwriteParam(SCIP *scip, SCIP_PARAM *param, const char *filename, SCIP_Bool comments, SCIP_Bool onlychanged)
Definition: scip.c:4970
SCIP_RETCODE SCIPgetNLPVarsNonlinearity(SCIP *scip, int *nlcount)
Definition: scip.c:31344
SCIP_EVENTHDLR * SCIPfindEventhdlr(SCIP *scip, const char *name)
Definition: scip.c:8741
SCIP_EXPRCURV SCIPnlrowGetCurvature(SCIP_NLROW *nlrow)
Definition: nlp.c:3393
SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)
Definition: scip.c:1235
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:9086
void SCIPprintReal(SCIP *scip, FILE *file, SCIP_Real val, int width, int precision)
Definition: scip.c:46656
SCIP_DECL_CONSSEPASOL(ConshdlrSubtour::scip_sepasol)
SCIP_RETCODE SCIPsetPricerExit(SCIP *scip, SCIP_PRICER *pricer, SCIP_DECL_PRICEREXIT((*pricerexit)))
Definition: scip.c:5617
#define SCIP_DECL_SEPAEXECLP(x)
Definition: type_sepa.h:116
SCIP_RETCODE SCIPchgVarUbNode(SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:22230
static SCIP_RETCODE exitPresolve(SCIP *scip, SCIP_Bool solved, SCIP_Bool *infeasible)
Definition: scip.c:14218
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:17909
int nimplvars
Definition: struct_prob.h:64
void SCIPrelaxationSetSolValid(SCIP_RELAXATION *relaxation, SCIP_Bool isvalid, SCIP_Bool includeslp)
Definition: relax.c:636
SCIP_RETCODE SCIPnlpiChgVarBounds(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int nvars, const int *indices, const SCIP_Real *lbs, const SCIP_Real *ubs)
Definition: nlpi.c:325
static SCIP_Real getDualbound(SCIP *scip)
Definition: scip.c:513
void SCIPresetReoptSolMarks(SCIP *scip)
Definition: scip.c:17399
SCIP_RETCODE SCIPsetPricerExitsol(SCIP *scip, SCIP_PRICER *pricer, SCIP_DECL_PRICEREXITSOL((*pricerexitsol)))
Definition: scip.c:5665
SCIP_Real SCIPconshdlrGetStrongBranchPropTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4659
#define SCIPduplicateBufferArray(scip, ptr, source, num)
Definition: scip.h:22628
SCIP_Real SCIPgetVarMultaggrUbGlobal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23875
SCIP_Longint nnodesaboverefbound
Definition: struct_stat.h:84
#define SCIP_DECL_PROBCOPY(x)
Definition: type_prob.h:140
SCIP_RETCODE SCIPfreeClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip.c:46064
SCIP_Bool probingsolvedlp
Definition: struct_tree.h:230
int limit_maxsol
Definition: struct_set.h:279
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip.c:46731
SCIP_RETCODE SCIPcomprExec(SCIP_COMPR *compr, SCIP_SET *set, SCIP_REOPT *reopt, SCIP_RESULT *result)
Definition: compr.c:252
SCIP_RETCODE SCIPflushNLP(SCIP *scip)
Definition: scip.c:31508
SCIP_RETCODE SCIPlpiGetRealSolQuality(SCIP_LPI *lpi, SCIP_LPSOLQUALITY qualityindicator, SCIP_Real *quality)
int SCIPgetNCutsFoundRound(SCIP *scip)
Definition: scip.c:42920
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:5001
SCIP_Longint SCIPbranchruleGetNExternCalls(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2062
SCIP_CONS ** SCIPgetConss(SCIP *scip)
Definition: scip.c:12908
SCIP_RETCODE SCIPsetNLPIntPar(SCIP *scip, SCIP_NLPPARAM type, int ival)
Definition: scip.c:31795
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:87
SCIP_Bool SCIPrelaxationIsSolValid(SCIP_RELAXATION *relaxation)
Definition: relax.c:649
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:30372
SCIP_RETCODE SCIPchgVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:22016
SCIP_Bool SCIPisLPDualReliable(SCIP *scip)
Definition: scip.c:29332
SCIP_RETCODE SCIPsetIncludeConcsolverType(SCIP_SET *set, SCIP_CONCSOLVERTYPE *concsolvertype)
Definition: set.c:4193
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:2931
int npresolroundsext
Definition: struct_stat.h:226
int SCIPgetNPresols(SCIP *scip)
Definition: scip.c:7074
SCIP_Real constant
Definition: struct_var.h:177
SCIP_Bool conf_enable
Definition: struct_set.h:193
SCIP_Real SCIPfeasFrac(SCIP *scip, SCIP_Real val)
Definition: scip.c:47459
SCIP_RETCODE SCIPsetNLPStringPar(SCIP *scip, SCIP_NLPPARAM type, const char *sval)
Definition: scip.c:31907
SCIP_Bool SCIPsetIsNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5910
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46963
SCIP_NODE ** siblings
Definition: struct_tree.h:189
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:23975
int SCIPnodeGetDepth(SCIP_NODE *node)
Definition: tree.c:7352
SCIP_PRESOL ** presols
Definition: struct_set.h:74
SCIP_RETCODE SCIPconstructLP(SCIP *scip, SCIP_Bool *cutoff)
Definition: scip.c:29249
void SCIPconflicthdlrSetExitsol(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol)))
Definition: conflict.c:701
int SCIPdivesetGetNSolutionCalls(SCIP_DIVESET *diveset)
Definition: heur.c:395
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:37117
methods for creating output for visualization tools (VBC, BAK)
SCIP_CLOCK * copyclock
Definition: struct_stat.h:159
nodereopt branching rule
#define SCIP_LONGINT_MAX
Definition: def.h:135
#define SCIP_DECL_BRANCHEXITSOL(x)
Definition: type_branch.h:98
SCIP_RETCODE SCIPsolClear(SCIP_SOL *sol, SCIP_STAT *stat, SCIP_TREE *tree)
Definition: sol.c:964
SCIP_RETCODE SCIPcaptureDialog(SCIP *scip, SCIP_DIALOG *dialog)
Definition: scip.c:9763
SCIP_RETCODE SCIPcreateLPSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:37920
int SCIPptrarrayGetMinIdx(SCIP_PTRARRAY *ptrarray)
Definition: misc.c:5036
SCIP_RETCODE SCIPnlpGetIntPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, int *ival)
Definition: nlp.c:6022
SCIP_Real SCIPdivesetGetAvgSolutionDepth(SCIP_DIVESET *diveset)
Definition: heur.c:455
int SCIPcutpoolGetMaxNCuts(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:1063
SCIP_RETCODE SCIPmarkRelaxSolInvalid(SCIP *scip)
Definition: scip.c:20095
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, SCIP_HEURTIMING 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:692
SCIP_DECL_CONSDELETE(ConshdlrSubtour::scip_delete)
SCIP_Real rootlpbestestimate
Definition: struct_stat.h:137
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip.h:22632
void SCIPconshdlrSetProp(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING timingmask)
Definition: cons.c:4175
SCIP_RELAX ** relaxs
Definition: struct_set.h:75
SCIP_RETCODE SCIPvarUpdatePseudocost(SCIP_VAR *var, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real solvaldelta, SCIP_Real objdelta, SCIP_Real weight)
Definition: var.c:13783
SCIP_Real SCIPconflictGetGlobalApplTime(SCIP_CONFLICT *conflict)
Definition: conflict.c:5437
#define SCIPsetFreeBufferArray(set, ptr)
Definition: set.h:1884
SCIP_Real SCIPadjustedVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real lb)
Definition: scip.c:21953
enum SCIP_LPSolStat SCIP_LPSOLSTAT
Definition: type_lp.h:42
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip.c:748
#define BMSfreeMemory(ptr)
Definition: memory.h:127
SCIP_RETCODE SCIPaddCurrentSol(SCIP *scip, SCIP_HEUR *heur, SCIP_Bool *stored)
Definition: scip.c:40660
void SCIPvarAdjustLb(SCIP_VAR *var, SCIP_SET *set, SCIP_Real *lb)
Definition: var.c:6152
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:6688
#define SCIP_DECL_PROPEXEC(x)
Definition: type_prop.h:203
SCIP_RETCODE SCIPconcsolverCreateInstance(SCIP_SET *set, SCIP_CONCSOLVERTYPE *concsolvertype, SCIP_CONCSOLVER **concsolver)
Definition: concsolver.c:156
#define SCIPallocBlockMemory(scip, ptr)
Definition: scip.h:22585
#define SCIPdebugPrintCons(x, y, z)
Definition: pub_message.h:83
SCIP_Bool SCIPconsIsLockedNeg(SCIP_CONS *cons)
Definition: cons.c:8315
int maxdepth
Definition: struct_stat.h:217
SCIP_Bool SCIPisTransformed(SCIP *scip)
Definition: scip.c:1017
SCIP_RETCODE SCIPcutpoolFree(SCIP_CUTPOOL **cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
Definition: cutpool.c:456
int SCIPgetNLPBranchCands(SCIP *scip)
Definition: scip.c:37034
SCIP_RETCODE SCIPgetLPColsData(SCIP *scip, SCIP_COL ***cols, int *ncols)
Definition: scip.c:29562
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:24034
SCIP_Bool SCIPpressedCtrlC(SCIP *scip)
Definition: scip.c:1132
SCIP_RETCODE SCIPsetSepaCopy(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPACOPY((*sepacopy)))
Definition: scip.c:7427
SCIP_RETCODE SCIPsetConshdlrDelvars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELVARS((*consdelvars)))
Definition: scip.c:6475
SCIP_RETCODE SCIPdropRowEvent(SCIP *scip, SCIP_ROW *row, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip.c:41352
SCIP_RETCODE SCIPvarChgBranchDirection(SCIP_VAR *var, SCIP_BRANCHDIR branchdirection)
Definition: var.c:11230
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:6628
SCIP_VAR * SCIPvarGetNegationVar(SCIP_VAR *var)
Definition: var.c:17102
void SCIPvisualExit(SCIP_VISUAL *visual, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: visual.c:176
SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value)
Definition: scip.c:4804
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
Definition: cons.c:8255
SCIP_Longint SCIPconshdlrGetNCheckCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4739
SCIP_Bool branch_forceall
Definition: struct_set.h:171
#define SCIP_LONGINT_MIN
Definition: def.h:136
SCIP_Longint SCIPconflictGetNStrongbranchReconvergenceLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:8653
#define SCIP_DECL_DIVESETGETSCORE(x)
Definition: type_heur.h:149
SCIP_STAGE SCIPtableGetEarliestStage(SCIP_TABLE *table)
Definition: table.c:292
SCIP_RETCODE SCIPchgStringParam(SCIP *scip, SCIP_PARAM *param, const char *value)
Definition: scip.c:4894
void SCIPcomputeBilinEnvelope2(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 xcoef1, SCIP_Real ycoef1, SCIP_Real constant1, SCIP_Real xcoef2, SCIP_Real ycoef2, SCIP_Real constant2, SCIP_Real *RESTRICT lincoefx, SCIP_Real *RESTRICT lincoefy, SCIP_Real *RESTRICT linconstant, SCIP_Bool *RESTRICT success)
Definition: scip.c:33899
SCIP_RETCODE SCIPsetConshdlrInitlp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp)))
Definition: scip.c:6337
SCIP_Real SCIPconflictGetPseudoTime(SCIP_CONFLICT *conflict)
Definition: conflict.c:8830
SCIP_NODE * SCIPgetRootNode(SCIP *scip)
Definition: scip.c:41423
SCIP_CLOCK * nlpsoltime
Definition: struct_stat.h:158
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
Definition: scip.c:1267
SCIP_SOL ** SCIPgetPartialSols(SCIP *scip)
Definition: scip.c:40930
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:1532
int SCIPbranchcandGetNPrioExternInts(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:536
SCIP_RETCODE SCIPnlrowChgQuadElem(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_QUADELEM elem)
Definition: nlp.c:2656
int SCIPgetNPrioExternBranchImpls(SCIP *scip)
Definition: scip.c:37230
SCIP_Longint SCIPrelaxGetNCalls(SCIP_RELAX *relax)
Definition: relax.c:530
int SCIPreoptGetLastRestarts(SCIP_REOPT *reopt)
Definition: reopt.c:4943
SCIP_RETCODE SCIPchgVarUbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:22369
#define SCIPdebugMsg
Definition: scip.h:455
#define SCIP_DECL_NODESELEXITSOL(x)
Definition: type_nodesel.h:94
#define SCIP_DECL_CONFLICTEXIT(x)
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:4265
SCIP_Longint SCIPconflictGetNInfeasibleLPConflictLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:8169
SCIP_RETCODE SCIPgetTransformedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
Definition: scip.c:18998
#define SCIP_DECL_COMPRINIT(x)
Definition: type_compr.h:65
SCIP_RETCODE SCIPcopyParamSettings(SCIP *sourcescip, SCIP *targetscip)
Definition: scip.c:3501
SCIP_Bool SCIPisRootLPRelax(SCIP *scip)
Definition: scip.c:29476
SCIP_Longint SCIPconflictGetNPropReconvergenceConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:5497
SCIP_Bool SCIPisSumZero(SCIP *scip, SCIP_Real val)
Definition: scip.c:47262
SCIP_LPSOLSTAT SCIPlpGetSolstat(SCIP_LP *lp)
Definition: lp.c:12615
SCIP_VISUAL * visual
Definition: struct_stat.h:165
SCIP_Real SCIPsetCeil(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5974
int lastnpresoladdconss
Definition: struct_stat.h:243
int SCIPgetIntarrayMinIdx(SCIP *scip, SCIP_INTARRAY *intarray)
Definition: scip.c:48137
SCIP_RETCODE SCIPaddLinearCoefToNlRow(SCIP *scip, SCIP_NLROW *nlrow, SCIP_VAR *var, SCIP_Real val)
Definition: scip.c:32390
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Longint nlpbestsolsfound
Definition: struct_stat.h:94
SCIP_CUT ** SCIPgetPoolCuts(SCIP *scip)
Definition: scip.c:34813
SCIP_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
Definition: scip.c:6521
SCIP_RETCODE SCIPconcurrentSolve(SCIP *scip)
Definition: concurrent.c:474
SCIP_RETCODE SCIPfreeReoptSolve(SCIP *scip)
Definition: scip.c:17189
SCIP_Longint SCIPcolGetStrongbranchLPAge(SCIP_COL *col, SCIP_STAT *stat)
Definition: lp.c:4629
void SCIPprintBranchruleStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44898
SCIP_Real SCIPgetPresolvingTime(SCIP *scip)
Definition: scip.c:46370
SCIP_Real SCIPsetGetHugeValue(SCIP_SET *set)
Definition: set.c:5648
SCIP_Real dualzeroittime
Definition: struct_stat.h:124
#define SCIP_DECL_CONSINITLP(x)
Definition: type_cons.h:243
internal methods for LP management
SCIP_RETCODE SCIPensureBlockMemoryArray_call(SCIP *scip, void **arrayptr, size_t elemsize, int *arraysize, int minsize)
Definition: scip.c:46829
SCIP_Real SCIPrelaxGetTime(SCIP_RELAX *relax)
Definition: relax.c:520
SCIP_Bool SCIPsetIsFeasFracIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6328
#define SCIP_DECL_CONCSOLVERDESTROYINST(x)
SCIP_RETCODE SCIPprintStatistics(SCIP *scip, FILE *file)
Definition: scip.c:45651
SCIP_Real SCIPpresolGetSetupTime(SCIP_PRESOL *presol)
Definition: presol.c:651
int SCIPbranchcandGetNPrioPseudoCands(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:863
void SCIPsetSortHeursName(SCIP_SET *set)
Definition: set.c:4340
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
Definition: cons.c:8047
int nbranchrules
Definition: struct_set.h:120
int SCIPvarGetNCliques(SCIP_VAR *var, SCIP_Bool varfixing)
Definition: var.c:17628
SCIP_RETCODE SCIPactiveCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:29023
SCIP_PROB * origprob
Definition: struct_scip.h:70
SCIP_Real SCIPgetAvgCutoffs(SCIP *scip, SCIP_BRANCHDIR dir)
Definition: scip.c:44049
SCIP_RETCODE SCIPaddCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
Definition: scip.c:1343
int SCIPgetNContVars(SCIP *scip)
Definition: scip.c:11992
SCIP_Bool SCIPtreeIsFocusNodeLPConstructed(SCIP_TREE *tree)
Definition: tree.c:8265
SCIP_Longint nexternalsolsfound
Definition: struct_stat.h:98
SCIP_VAR ** SCIPexprtreeGetVars(SCIP_EXPRTREE *tree)
Definition: nlp.c:101
void SCIPstatEnforceLPUpdates(SCIP_STAT *stat)
Definition: stat.c:581
SCIP_Real SCIPconflictGetVarUb(SCIP_CONFLICT *conflict, SCIP_VAR *var)
Definition: conflict.c:4435
SCIP_Real SCIPgetRowFeasibility(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:31091
int SCIPconshdlrGetStartNActiveConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4849
#define SCIP_DECL_DISPCOPY(x)
Definition: type_disp.h:71
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:27584
SCIP_RETCODE SCIPcreateProbBasic(SCIP *scip, const char *name)
Definition: scip.c:9997
SCIP_Real SCIPgetObjNorm(SCIP *scip)
Definition: scip.c:11465
SCIP_NLROW ** SCIPgetNLPNlRows(SCIP *scip)
Definition: scip.c:31440
SCIP_RETCODE SCIPcreateDigraph(SCIP *scip, SCIP_DIGRAPH **digraph, int nnodes)
Definition: scip.c:48568
int SCIPconshdlrGetSepaPriority(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4969
SCIP_DISP * SCIPfindDisp(SCIP *scip, const char *name)
Definition: scip.c:9393
int SCIPreoptGetNTotalInfNodes(SCIP_REOPT *reopt)
Definition: reopt.c:5023
SCIP_Real SCIPepsilon(SCIP *scip)
Definition: scip.c:46415
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:18214
SCIP_DECL_EVENTINITSOL(EventhdlrNewSol::scip_initsol)
SCIP_RETCODE SCIPcreateOrigSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:38115
SCIP_Bool SCIPlpIsRootLPRelax(SCIP_LP *lp)
Definition: lp.c:16875
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:2792
SCIP_RETCODE SCIPgetVarClosestVlb(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real *closestvlb, int *closestvlbidx)
Definition: scip.c:23923
SCIP_Bool objsqrnormunreliable
Definition: struct_lp.h:336
#define SCIP_PRESOLTIMING_FAST
Definition: type_timing.h:43
SCIP_RETCODE SCIPlpRecordOldRowSideDive(SCIP_LP *lp, SCIP_ROW *row, SCIP_SIDETYPE sidetype)
Definition: lp.c:15516
SCIP_VAR ** vars
Definition: struct_var.h:186
SCIP_RETCODE SCIPaddConflictLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
Definition: scip.c:27184
SCIP_Real SCIPsolGetOrigObj(SCIP_SOL *sol)
Definition: sol.c:2485
SCIP_RETCODE SCIPgetSiblings(SCIP *scip, SCIP_NODE ***siblings, int *nsiblings)
Definition: scip.c:41519
SCIP_Real SCIPgetLowerboundRoot(SCIP *scip)
Definition: scip.c:43322
int SCIPpropGetNPresolCalls(SCIP_PROP *prop)
Definition: prop.c:1212
int SCIPrealarrayGetMinIdx(SCIP_REALARRAY *realarray)
Definition: misc.c:3963
SCIP_RETCODE SCIPnlrowGetNLPFeasibility(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real *feasibility)
Definition: nlp.c:2952
SCIP_Real SCIPbarrierconvtol(SCIP *scip)
Definition: scip.c:46485
SCIP_RETCODE SCIPsetIncludeSepa(SCIP_SET *set, SCIP_SEPA *sepa)
Definition: set.c:3984
SCIP_Real SCIPgetRowMaxCoef(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30889
SCIP_DECL_CONSENFOLP(ConshdlrSubtour::scip_enfolp)
SCIP_RETCODE SCIPconsResetAge(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:7058
SCIP_Real SCIPcomputeVarUbGlobal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23798
internal methods for branching and inference history
SCIP_RETCODE SCIPconsActive(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:7637
void SCIPpropSetPriority(SCIP_PROP *prop, SCIP_SET *set, int priority)
Definition: prop.c:927
SCIP_RETCODE SCIPdeleteReoptnode(SCIP *scip, SCIP_REOPTNODE **reoptnode)
Definition: scip.c:17499
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
Definition: scip.c:47435
SCIP_Real SCIPcomputeVarLbLocal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23819
int nrootintfixings
Definition: struct_stat.h:204
SCIP_Real SCIPgetRowMaxActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30923
SCIP_RETCODE SCIPsetIncludeCompr(SCIP_SET *set, SCIP_COMPR *compr)
Definition: set.c:4355
SCIP_Real SCIPrelaxfeastol(SCIP *scip)
Definition: scip.c:46514
SCIP_RETCODE SCIPconflictstoreClean(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_REOPT *reopt)
SCIP_RETCODE SCIPrepropagateNode(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:41768
SCIP_Real SCIPconflictGetStrongbranchTime(SCIP_CONFLICT *conflict)
Definition: conflict.c:8533
SCIP_RETCODE SCIPtransformVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
Definition: scip.c:18907
SCIP_RETCODE SCIPsetSetStringParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, const char *value)
Definition: set.c:3306
SCIP_Longint SCIPconflictGetNAppliedLocalLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:3568
internal methods for collecting primal CIP solutions and primal informations
SCIP_RETCODE SCIPcreateNlRowFromRow(SCIP *scip, SCIP_NLROW **nlrow, SCIP_ROW *row)
Definition: scip.c:32253
SCIP_Real SCIPsolGetVal(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var)
Definition: sol.c:1298
SCIP_RETCODE SCIPsetBoolarrayVal(SCIP *scip, SCIP_BOOLARRAY *boolarray, int idx, SCIP_Bool val)
Definition: scip.c:48251
SCIP_Longint SCIPconflictGetNDualrayBndNonzeros(SCIP_CONFLICT *conflict)
Definition: conflict.c:8593
#define SCIP_DECL_COMPRFREE(x)
Definition: type_compr.h:57
SCIP_Longint SCIPconflictGetNPseudoConflictConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:8860
SCIP_Bool reopt_enable
Definition: struct_set.h:453
SCIP_RETCODE SCIPconflictstoreCreate(SCIP_CONFLICTSTORE **conflictstore, SCIP_SET *set)
SCIP_Real SCIPgetVarPseudocostScore(SCIP *scip, SCIP_VAR *var, SCIP_Real solval)
Definition: scip.c:26320
SCIP_Bool SCIPisRelGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47713
SCIP_RETCODE SCIPchgChildPrio(SCIP *scip, SCIP_NODE *child, SCIP_Real priority)
Definition: scip.c:13614
SCIP_CONSSETCHG * addconssetchg
Definition: struct_cons.h:48
SCIP_RETCODE SCIPscaleVarBranchFactor(SCIP *scip, SCIP_VAR *var, SCIP_Real scale)
Definition: scip.c:25226
int SCIPconshdlrGetNFixedVars(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4859
SCIP_Longint SCIPconflictGetNDualrayInfGlobal(SCIP_CONFLICT *conflict)
Definition: conflict.c:8553
enum SCIP_ParamSetting SCIP_PARAMSETTING
Definition: type_paramset.h:56
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
Definition: scip.c:47423
SCIP_Bool SCIPconsIsGlobal(SCIP_CONS *cons)
Definition: cons.c:8215
void SCIPpricerSetPriority(SCIP_PRICER *pricer, SCIP_SET *set, int priority)
Definition: pricer.c:580
void SCIPprobSetObjIntegral(SCIP_PROB *prob)
Definition: prob.c:1455
SCIP_Bool SCIPconsIsOriginal(SCIP_CONS *cons)
Definition: cons.c:8285
SCIP_RETCODE SCIPboolarraySetVal(SCIP_BOOLARRAY *boolarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, SCIP_Bool val)
Definition: misc.c:4615
SCIP_Longint nsblpiterations
Definition: struct_stat.h:68
int SCIPnlrowGetNQuadElems(SCIP_NLROW *nlrow)
Definition: nlp.c:3322
SCIP_RETCODE SCIPsetBranchruleExecLp(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECLP((*branchexeclp)))
Definition: scip.c:9221
#define SCIP_DECL_NODESELINIT(x)
Definition: type_nodesel.h:64
int SCIPlpGetNCols(SCIP_LP *lp)
Definition: lp.c:16747
SCIP_Real primalzeroittime
Definition: struct_stat.h:123
SCIP_RETCODE SCIPconstructSyncstore(SCIP *scip)
Definition: scip.c:41952
SCIP_VAR * var
Definition: struct_var.h:178
SCIP_RETCODE SCIPreoptResetActiveConss(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat)
Definition: reopt.c:8261
SCIP_Real SCIPvarGetUbLP(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:12412
int nrootboundchgs
Definition: struct_stat.h:202
SCIP_RETCODE SCIPsetSetFeastol(SCIP_SET *set, SCIP_Real feastol)
Definition: set.c:5372
SCIP_RETCODE SCIPclearRealarray(SCIP *scip, SCIP_REALARRAY *realarray)
Definition: scip.c:47917
SCIP_DIALOGHDLR * dialoghdlr
Definition: struct_scip.h:64
int SCIPgetNConshdlrs(SCIP *scip)
Definition: scip.c:6628
void SCIPdialogCapture(SCIP_DIALOG *dialog)
Definition: dialog.c:905
#define SCIP_DECL_VARDELTRANS(x)
Definition: type_var.h:142
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:2885
void SCIPupdateSolBoundViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
Definition: scip.c:13766
#define SCIP_DECL_SEPACOPY(x)
Definition: type_sepa.h:47
int neventhdlrs
Definition: struct_set.h:116
SCIP_Bool SCIPsetIsGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5870
SCIP_HISTORY * glbhistorycrun
Definition: struct_stat.h:163
internal methods for propagators
int SCIPcliquetableGetNCliquesCreated(SCIP_CLIQUETABLE *cliquetable)
Definition: implics.c:3489
SCIP_Bool SCIPisRelLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47687
int SCIPreoptGetNNodes(SCIP_REOPT *reopt, SCIP_NODE *node)
Definition: reopt.c:5758
int SCIPpresolGetNChgVarTypes(SCIP_PRESOL *presol)
Definition: presol.c:691
SCIP_RETCODE SCIPprintBranchingStatistics(SCIP *scip, FILE *file)
Definition: scip.c:45766
int SCIPconshdlrGetNChgSides(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4949
SCIP_DECL_CONSCHECK(ConshdlrSubtour::scip_check)
SCIP_RETCODE SCIPfreeRepresentation(SCIP *scip, SCIP_REOPTNODE **representatives, int nrepresentatives)
Definition: scip.c:17044
SCIP_Bool reopt_storevarhistory
Definition: struct_set.h:464
SCIP_Longint SCIPgetNDualResolveLPIterations(SCIP *scip)
Definition: scip.c:42618
const char * SCIPgetProbName(SCIP *scip)
Definition: scip.c:10891
SCIP_RETCODE SCIPclearPtrarray(SCIP *scip, SCIP_PTRARRAY *ptrarray)
Definition: scip.c:48351
SCIP_RETCODE SCIPcreateWallClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip.c:46047
SCIP_Bool SCIProwIsInLP(SCIP_ROW *row)
Definition: lp.c:16695
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:1407
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:3025
int SCIPtreeGetFocusDepth(SCIP_TREE *tree)
Definition: tree.c:8227
SCIP_Real SCIPvarGetVSIDSCurrentRun(SCIP_VAR *var, SCIP_STAT *stat, SCIP_BRANCHDIR dir)
Definition: var.c:15332
SCIP_NLPI ** nlpis
Definition: struct_set.h:88
SCIP_Real dualbound
Definition: struct_prob.h:45
void SCIPclockSetTime(SCIP_CLOCK *clck, SCIP_Real sec)
Definition: clock.c:518
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:2445
SCIP_PRICESTORE * pricestore
Definition: struct_scip.h:90
SCIP_RETCODE SCIPupdateVarPseudocost(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta, SCIP_Real objdelta, SCIP_Real weight)
Definition: scip.c:25997
SCIP_Real SCIPgetBranchScore(SCIP *scip, SCIP_VAR *var, SCIP_Real downgain, SCIP_Real upgain)
Definition: scip.c:37456
#define SCIP_DECL_DIALOGDESC(x)
Definition: type_dialog.h:73
SCIP_Bool SCIPisConflictAnalysisApplicable(SCIP *scip)
Definition: scip.c:27133
SCIP_RETCODE SCIPprobFree(SCIP_PROB **prob, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: prob.c:394
void SCIPdivesetUpdateLPStats(SCIP_DIVESET *diveset, SCIP_STAT *stat, SCIP_Longint niterstoadd)
Definition: heur.c:615
SCIP_Bool SCIPsetIsEfficacious(SCIP_SET *set, SCIP_Bool root, SCIP_Real efficacy)
Definition: set.c:6646
void SCIPprobPrintStatistics(SCIP_PROB *prob, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: prob.c:2173
SCIP_RETCODE SCIPnlrowAddQuadVar(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_VAR *var)
Definition: nlp.c:2548
SCIP_RETCODE SCIPsetHeurPriority(SCIP *scip, SCIP_HEUR *heur, int priority)
Definition: scip.c:8262
SCIP_RETCODE SCIPcopyOrigConss(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool enablepricing, SCIP_Bool *valid)
Definition: scip.c:2872
SCIP_Real SCIPgetVarBdAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: scip.c:19789
SCIP_Real * vals
Definition: struct_lp.h:220
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:404
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 SCIPreoptGetSimilarity(SCIP_REOPT *reopt, SCIP_SET *set, int run1, int run2, SCIP_VAR **origvars, int norigvars)
Definition: reopt.c:5630
SCIP_RETCODE SCIPlinkNLPSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38602
static SCIP_RETCODE initSolve(SCIP *scip, SCIP_Bool solved)
Definition: scip.c:15150
SCIP_RETCODE SCIPintarrayFree(SCIP_INTARRAY **intarray)
Definition: misc.c:4026
int SCIPgetNFixedVars(SCIP *scip)
Definition: scip.c:12129
enum SCIP_BranchDir SCIP_BRANCHDIR
Definition: type_history.h:39
SCIP_DECL_EVENTINIT(EventhdlrNewSol::scip_init)
#define SCIP_DECL_CONSINITSOL(x)
Definition: type_cons.h:185
SCIP_Bool SCIPisLPConstructed(SCIP *scip)
Definition: scip.c:29226
SCIP_Bool SCIPisLbBetter(SCIP *scip, SCIP_Real newlb, SCIP_Real oldlb, SCIP_Real oldub)
Definition: scip.c:47646
SCIP_Real SCIPsetDualfeasFloor(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6552
int SCIPconshdlrGetNChgBds(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4889
SCIP_Bool SCIPisLPRelax(SCIP *scip)
Definition: scip.c:29350
SCIP_VAR * SCIPfindVar(SCIP *scip, const char *name)
Definition: scip.c:12506
SCIP_RETCODE SCIPsetConflicthdlrInit(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTINIT((*conflictinit)))
Definition: scip.c:6752
void * SCIPgetPtrarrayVal(SCIP *scip, SCIP_PTRARRAY *ptrarray, int idx)
Definition: scip.c:48364
SCIP_RETCODE SCIPsetInitPlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat)
Definition: set.c:4879
int SCIPtableGetPosition(SCIP_TABLE *table)
Definition: table.c:282
SCIP_RETCODE SCIPenableCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28425
int SCIPtreeGetNChildren(SCIP_TREE *tree)
Definition: tree.c:8127
SCIP_RETCODE SCIPnlpiAddVars(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int nvars, const SCIP_Real *lbs, const SCIP_Real *ubs, const char **varnames)
Definition: nlpi.c:250
SCIP_Real SCIPprobGetObjlim(SCIP_PROB *prob, SCIP_SET *set)
Definition: prob.c:2274
SCIP_VAR ** SCIPgetFixedVars(SCIP *scip)
Definition: scip.c:12086
SCIP_RETCODE SCIPsetConsSeparated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool separate)
Definition: scip.c:27884
SCIP_NODE * SCIPtreeGetBestLeaf(SCIP_TREE *tree)
Definition: tree.c:7111
SCIP_RETCODE SCIPsetFree(SCIP_SET **set, BMS_BLKMEM *blkmem)
Definition: set.c:2614
SCIP_RETCODE SCIPsetReoptCompression(SCIP *scip, SCIP_REOPTNODE **representation, int nrepresentatives, SCIP_Bool *success)
Definition: scip.c:16900
SCIP_RETCODE SCIPrealarrayIncVal(SCIP_REALARRAY *realarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, SCIP_Real incval)
Definition: misc.c:3945
int SCIPbranchcandGetNExternCands(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:506
SCIP_Bool SCIPisCharParamValid(SCIP *scip, SCIP_PARAM *param, const char value)
Definition: scip.c:4877
void SCIPclearDiveBoundChanges(SCIP *scip)
Definition: scip.c:36968
int SCIPgetNPrioLPBranchCands(SCIP *scip)
Definition: scip.c:37072
SCIP_Real avgnnz
Definition: struct_stat.h:115
#define SCIP_DECL_CONCSOLVERSTOP(x)
SCIP_RETCODE SCIPchgVarType(SCIP *scip, SCIP_VAR *var, SCIP_VARTYPE vartype, SCIP_Bool *infeasible)
Definition: scip.c:25479
SCIP_Real SCIPgetFirstLPDualboundRoot(SCIP *scip)
Definition: scip.c:43346
SCIP_RETCODE SCIPnodeCutoff(SCIP_NODE *node, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_REOPT *reopt, SCIP_LP *lp, BMS_BLKMEM *blkmem)
Definition: tree.c:1146
struct SCIP_NodeselData SCIP_NODESELDATA
Definition: type_nodesel.h:38
SCIP_RETCODE SCIPresetParams(SCIP *scip)
Definition: scip.c:5033
SCIP_FILE * SCIPfopen(const char *path, const char *mode)
Definition: fileio.c:140
void SCIPconflicthdlrSetFree(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTFREE((*conflictfree)))
Definition: conflict.c:657
SCIP_RETCODE SCIPaddClique(SCIP *scip, SCIP_VAR **vars, SCIP_Bool *values, int nvars, SCIP_Bool isequation, SCIP_Bool *infeasible, int *nbdchgs)
Definition: scip.c:24222
SCIP_RETCODE SCIPnlpStartDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: nlp.c:6125
SCIP_Real SCIPlpGetRootObjval(SCIP_LP *lp)
Definition: lp.c:16885
union SCIP_Var::@13 data
SCIP_RETCODE SCIPconsDisableSeparation(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:6812
SCIP_RETCODE SCIPprobAddConsName(SCIP_PROB *prob, SCIP_CONS *cons)
Definition: prob.c:1229
SCIP_Longint nlexduallpiterations
Definition: struct_stat.h:58
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:7605
SCIP_Bool SCIPisLPSolBasic(SCIP *scip)
Definition: scip.c:29737
SCIP_DIALOG * SCIPgetRootDialog(SCIP *scip)
Definition: scip.c:9813
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
Definition: var.c:17286
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_CONFLICTSTORE *conflictstore, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool *restart)
Definition: solve.c:4766
void SCIPcomputeBilinEnvelope1(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 xcoef, SCIP_Real ycoef, SCIP_Real constant, SCIP_Real *RESTRICT lincoefx, SCIP_Real *RESTRICT lincoefy, SCIP_Real *RESTRICT linconstant, SCIP_Bool *RESTRICT success)
Definition: scip.c:33665
int lppos
Definition: struct_lp.h:230
SCIP_RETCODE SCIPenableConsCompression(SCIP *scip)
Definition: scip.c:1830
void SCIPprobSetInitsol(SCIP_PROB *prob, SCIP_DECL_PROBINITSOL((*probinitsol)))
Definition: prob.c:361
void SCIProwForceSort(SCIP_ROW *row, SCIP_SET *set)
Definition: lp.c:6034
SCIP_Bool SCIPsetIsLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5816
SCIP_VAR * SCIPvarGetProbvar(SCIP_VAR *var)
Definition: var.c:11628
SCIP_READER ** SCIPgetReaders(SCIP *scip)
Definition: scip.c:5403
SCIP_RETCODE SCIPsetReadParams(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *filename)
Definition: set.c:3321
SCIP_Real SCIPvarGetObjLP(SCIP_VAR *var)
Definition: var.c:12296
SCIP_RETCODE SCIPbranchcandAddExternCand(SCIP_BRANCHCAND *branchcand, SCIP_SET *set, SCIP_VAR *var, SCIP_Real score, SCIP_Real solval)
Definition: branch.c:568
char ** extcodedescs
Definition: struct_set.h:94
SCIP_RETCODE SCIPsetConshdlrInitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITSOL((*consinitsol)))
Definition: scip.c:6157
SCIP_Real SCIPtreeCalcNodeselPriority(SCIP_TREE *tree, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var, SCIP_BRANCHDIR branchdir, SCIP_Real targetvalue)
Definition: tree.c:5134
#define SCIP_DECL_PRESOLEXEC(x)
Definition: type_presol.h:153
int SCIPcliquetableGetNCliques(SCIP_CLIQUETABLE *cliquetable)
Definition: implics.c:3479
SCIP_CLOCK * strongpropclock
Definition: struct_stat.h:160
SCIP_RETCODE SCIPsetRelaxFree(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXFREE((*relaxfree)))
Definition: scip.c:7198
SCIP_DECL_EVENTFREE(EventhdlrNewSol::scip_free)
SCIP_RETCODE SCIPvarChgType(SCIP_VAR *var, SCIP_VARTYPE vartype)
Definition: var.c:5850
void SCIPprobSetCopy(SCIP_PROB *prob, SCIP_DECL_PROBCOPY((*probcopy)))
Definition: prob.c:383
int npresolchgcoefs
Definition: struct_stat.h:235
SCIP_Bool SCIPsepastoreIsCutApplicable(SCIP_SET *set, SCIP_ROW *cut)
Definition: sepastore.c:1218
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:9715
SCIP_Bool SCIPnlpHasContinuousNonlinearity(SCIP_NLP *nlp)
Definition: nlp.c:5867
void SCIPprintMemoryDiagnostic(SCIP *scip)
Definition: scip.c:46855
#define SCIP_DECL_BRANCHINIT(x)
Definition: type_branch.h:68
int npresolchgvartypes
Definition: struct_stat.h:229
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:25818
SCIP_RETCODE SCIPdelVar(SCIP *scip, SCIP_VAR *var, SCIP_Bool *deleted)
Definition: scip.c:11610
#define SCIP_DECL_DISPINIT(x)
Definition: type_disp.h:87
int SCIPdivesetGetMaxSolutionDepth(SCIP_DIVESET *diveset)
Definition: heur.c:445
static SCIP_RETCODE getCopyMemlimit(SCIP *sourcescip, SCIP_Real *memorylimit)
Definition: scip.c:4125
SCIP_RETCODE SCIPreoptGetSolsRun(SCIP_REOPT *reopt, int run, SCIP_SOL **sols, int solssize, int *nsols)
Definition: reopt.c:5474
SCIP_Real coef
Definition: type_expr.h:102
SCIP_MEM * mem
Definition: struct_scip.h:61
SCIP_Bool SCIPsetIsSumLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6043
SCIP_Bool SCIPisCutEfficacious(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut)
Definition: scip.c:34528
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 copytables, SCIP_Bool copynlpis, SCIP_Bool *allvalid)
Definition: set.c:877
SCIP_CONSHDLR * SCIPsetFindConshdlr(SCIP_SET *set, const char *name)
Definition: set.c:3743
SCIP_RETCODE SCIPsetObjsense(SCIP *scip, SCIP_OBJSENSE objsense)
Definition: scip.c:11066
SCIP_Bool SCIPisBoolParamValid(SCIP *scip, SCIP_PARAM *param, SCIP_Bool value)
Definition: scip.c:4645
SCIP_Real SCIPhistoryGetPseudocostVariance(SCIP_HISTORY *history, SCIP_BRANCHDIR direction)
Definition: history.c:437
SCIP_RETCODE SCIPsetPropExitpre(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXITPRE((*propexitpre)))
Definition: scip.c:7807
SCIP_RETCODE SCIPchgRowLhsDive(SCIP *scip, SCIP_ROW *row, SCIP_Real newlhs)
Definition: scip.c:35548
SCIP_Real SCIPvarGetImplRedcost(SCIP_VAR *var, SCIP_SET *set, SCIP_Bool varfixing, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_LP *lp)
Definition: var.c:12875
SCIP_Bool SCIPtreeProbing(SCIP_TREE *tree)
Definition: tree.c:8184
SCIP_RETCODE SCIPaddReoptDualBndchg(SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound, SCIP_Real oldbound)
Definition: scip.c:16674
SCIP_RETCODE SCIPincludeConcsolverType(SCIP *scip, const char *name, SCIP_Real prefpriodefault, SCIP_DECL_CONCSOLVERCREATEINST((*concsolvercreateinst)), SCIP_DECL_CONCSOLVERDESTROYINST((*concsolverdestroyinst)), SCIP_DECL_CONCSOLVERINITSEEDS((*concsolverinitseeds)), SCIP_DECL_CONCSOLVEREXEC((*concsolverexec)), SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA((*concsolvercopysolvdata)), SCIP_DECL_CONCSOLVERSTOP((*concsolverstop)), SCIP_DECL_CONCSOLVERSYNCWRITE((*concsolversyncwrite)), SCIP_DECL_CONCSOLVERSYNCREAD((*concsolversyncread)), SCIP_DECL_CONCSOLVERTYPEFREEDATA((*concsolvertypefreedata)), SCIP_CONCSOLVERTYPEDATA *data)
Definition: scip.c:7948
SCIP_RETCODE SCIPsolveProbingRelax(SCIP *scip, SCIP_Bool *cutoff)
Definition: scip.c:36707
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:1054
int nsiblings
Definition: struct_tree.h:212
#define SCIP_DECL_RELAXEXIT(x)
Definition: type_relax.h:71
SCIP_RETCODE SCIPsetIncludeHeur(SCIP_SET *set, SCIP_HEUR *heur)
Definition: set.c:4281
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:18115
int SCIPgetNNLPVars(SCIP *scip)
Definition: scip.c:31322
void SCIPconshdlrSetExitsol(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol)))
Definition: cons.c:4264
SCIP_RETCODE SCIPsetChgIntParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAM *param, int value)
Definition: set.c:3117
void SCIPpropSetExit(SCIP_PROP *prop, SCIP_DECL_PROPEXIT((*propexit)))
Definition: prop.c:789
SCIP_Real barrierzeroittime
Definition: struct_stat.h:125
SCIP_RETCODE SCIPsetConshdlrGetDiveBdChgs(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)))
Definition: scip.c:6590
SCIP_Real lb
Definition: struct_lp.h:129
SCIP_RETCODE SCIPcreateSolCopy(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol)
Definition: scip.c:38168
SCIP_NLPTERMSTAT SCIPgetNLPTermstat(SCIP *scip)
Definition: scip.c:31638
BMS_BUFMEM * SCIPbuffer(SCIP *scip)
Definition: scip.c:46746
SCIP_Bool SCIPsetIsParamFixed(SCIP_SET *set, const char *name)
Definition: set.c:2930
int cutoffdepth
Definition: struct_tree.h:218
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:7337
SCIP_Bool SCIPisPresolveFinished(SCIP *scip)
Definition: scip.c:1054
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:7639
enum SCIP_Confidencelevel SCIP_CONFIDENCELEVEL
Definition: type_misc.h:44
int lastnpresolfixedvars
Definition: struct_stat.h:237
SCIP_RETCODE SCIPdelRowCutpool(SCIP *scip, SCIP_CUTPOOL *cutpool, SCIP_ROW *row)
Definition: scip.c:34970
SCIP_RETCODE SCIPvarChgBranchPriority(SCIP_VAR *var, int branchpriority)
Definition: var.c:11100
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:2299
SCIP_CONFLICTHDLR ** SCIPgetConflicthdlrs(SCIP *scip)
Definition: scip.c:6829
SCIP_Real SCIPvarGetPseudocost(SCIP_VAR *var, SCIP_STAT *stat, SCIP_Real solvaldelta)
Definition: var.c:13881
void SCIPconshdlrSetEnforelax(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENFORELAX((*consenforelax)))
Definition: cons.c:4194
SCIP_RETCODE SCIPprobRemoveVarName(SCIP_PROB *prob, SCIP_VAR *var)
Definition: prob.c:899
SCIP_Real SCIPgetLPLooseObjval(SCIP *scip)
Definition: scip.c:29408
SCIP_Bool SCIPisSumRelGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47778
SCIP_RETCODE SCIPsetObjIntegral(SCIP *scip)
Definition: scip.c:11343
void SCIPrelaxSetFree(SCIP_RELAX *relax, SCIP_DECL_RELAXFREE((*relaxfree)))
Definition: relax.c:389
void SCIPprobSetObjsense(SCIP_PROB *prob, SCIP_OBJSENSE objsense)
Definition: prob.c:1407
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:785
SCIP_Real SCIPgetVarUbDive(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:35671
SCIP_VAR ** SCIPnlrowGetQuadVars(SCIP_NLROW *nlrow)
Definition: nlp.c:3285
SCIP_RETCODE SCIPconshdlrGetDiveBoundChanges(SCIP_CONSHDLR *conshdlr, SCIP_SET *set, SCIP_DIVESET *diveset, SCIP_SOL *sol, SCIP_Bool *success, SCIP_Bool *infeasible)
Definition: cons.c:3453
SCIP_RETCODE SCIPnlpAddVars(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, int nvars, SCIP_VAR **vars)
Definition: nlp.c:5349
SCIP_Longint nobjleaves
Definition: struct_stat.h:73
SCIP_AGGREGATE aggregate
Definition: struct_var.h:225
SCIP_Longint SCIPconcsolverGetNSolsRecvd(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:528
SCIP_RETCODE SCIPsetConsRemovable(SCIP *scip, SCIP_CONS *cons, SCIP_Bool removable)
Definition: scip.c:28062
SCIP_RETCODE SCIPconsEnablePropagation(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:6840
SCIP_Bool SCIPsetIsSumRelGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6859
#define SCIP_DECL_CONFLICTINITSOL(x)
SCIP_RETCODE SCIPcreateCutpool(SCIP *scip, SCIP_CUTPOOL **cutpool, int agelimit)
Definition: scip.c:34873
SCIP_Real SCIPsolGetObj(SCIP_SOL *sol, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob)
Definition: sol.c:1492
SCIP_RETCODE SCIPcopyOrigConsCompression(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *suffix, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars, SCIP_Bool enablepricing, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
Definition: scip.c:4042
SCIP_Longint npssolsfound
Definition: struct_stat.h:92
int SCIPgetNCutsApplied(SCIP *scip)
Definition: scip.c:42938
void SCIPpricerSetCopy(SCIP_PRICER *pricer, SCIP_DECL_PRICERCOPY((*pricercopy)))
Definition: pricer.c:484
SCIP_Real SCIPconcsolverGetSolvingTime(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:488
#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:15228
SCIP_RETCODE SCIPsetSetSubscipsOff(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: set.c:3401
SCIP_RETCODE SCIPsetHeurInitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINITSOL((*heurinitsol)))
Definition: scip.c:8193
SCIP_Bool probingobjchanged
Definition: struct_tree.h:232
SCIP_Longint SCIPconflictGetNInfeasibleLPConflictConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:8159
SCIP_Real sbdown
Definition: struct_lp.h:144
void SCIPmarkRowNotRemovableLocal(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30835
git hash methods
int SCIPpricestoreGetNVarsApplied(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:663
SCIP_RETCODE SCIPsolve(SCIP *scip)
Definition: scip.c:16115
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
Definition: scip.c:6060
SCIP_RETCODE SCIProwChgLhs(SCIP_ROW *row, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp, SCIP_Real lhs)
Definition: lp.c:5541
void SCIPsetSetPriorityNlpi(SCIP_SET *set, SCIP_NLPI *nlpi, int priority)
Definition: set.c:4833
SCIP_PROP ** SCIPgetProps(SCIP *scip)
Definition: scip.c:7886
void SCIPsetReinsertConshdlrSepaPrio(SCIP_SET *set, SCIP_CONSHDLR *conshdlr, int oldpriority)
Definition: set.c:3658
#define SCIP_DECL_BRANCHCOPY(x)
Definition: type_branch.h:52
SCIP_RETCODE SCIPconflictstoreClear(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_REOPT *reopt)
const char * SCIPheurGetName(SCIP_HEUR *heur)
Definition: heur.c:1198
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:439
SCIP_RETCODE SCIPcreateClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip.c:46013
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 completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition: primal.c:1507
#define SCIP_DECL_CONFLICTEXEC(x)
SCIP_Real mincopytime
Definition: struct_stat.h:127
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:89
SCIP_Bool SCIPisRelGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47726
SCIP_RETCODE SCIPsetNodeselExitsol(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELEXITSOL((*nodeselexitsol)))
Definition: scip.c:8941
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:33456
SCIP_RETCODE SCIPdeactivatePricer(SCIP *scip, SCIP_PRICER *pricer)
Definition: scip.c:5775
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:7993
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:1763
int npresolroundsmed
Definition: struct_stat.h:225
SCIP_HEUR * SCIPfindHeur(SCIP *scip, const char *name)
Definition: scip.c:8225
SCIP_RETCODE SCIPsetComprCopy(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPRCOPY((*comprcopy)))
Definition: scip.c:8363
SCIP_RETCODE SCIPbranchVar(SCIP *scip, SCIP_VAR *var, SCIP_NODE **downchild, SCIP_NODE **eqchild, SCIP_NODE **upchild)
Definition: scip.c:37610
void SCIPmessagehdlrSetLogfile(SCIP_MESSAGEHDLR *messagehdlr, const char *filename)
Definition: message.c:383
SCIP_RETCODE SCIPsetNlRowExprtreeParams(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *paramvals)
Definition: scip.c:32678
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:15767
SCIP_Real SCIPdualfeasCeil(SCIP *scip, SCIP_Real val)
Definition: scip.c:47608
SCIP_RETCODE SCIPsolveDiveNLP(SCIP *scip)
Definition: scip.c:32157
#define BMSfreeMemoryArray(ptr)
Definition: memory.h:129
SCIP_RETCODE SCIPvarChgUbLazy(SCIP_VAR *var, SCIP_SET *set, SCIP_Real lazyub)
Definition: var.c:7127
SCIP_RETCODE SCIPfreeCutpool(SCIP *scip, SCIP_CUTPOOL **cutpool)
Definition: scip.c:34904
void SCIPupdateSolLPRowViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
Definition: scip.c:13778
SCIP_RETCODE SCIPsetChgBoolParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAM *param, SCIP_Bool value)
Definition: set.c:3065
SCIP_CONSHDLR ** conshdlrs_enfo
Definition: struct_set.h:71
int lastnpresoladdholes
Definition: struct_stat.h:241
void SCIPvarMergeHistories(SCIP_VAR *targetvar, SCIP_VAR *othervar, SCIP_STAT *stat)
Definition: var.c:4295
int prevrunnvars
Definition: struct_stat.h:206
SCIP_Real SCIPgetVarPseudocostVariance(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir, SCIP_Bool onlycurrentrun)
Definition: scip.c:26193
SCIP_Bool SCIPisSumRelLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47765
SCIP_Real SCIPgetRowMinCoef(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30871
int SCIPreoptGetFirstRestarts(SCIP_REOPT *reopt)
Definition: reopt.c:4933
SCIP_RETCODE SCIPgetBinvarRepresentatives(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **repvars, SCIP_Bool *negated)
Definition: scip.c:19162
SCIP_Bool SCIPlpIsPrimalReliable(SCIP_LP *lp)
Definition: lp.c:16962
internal methods for storing and manipulating the main problem
SCIP_Real SCIPsetLpfeastol(SCIP_SET *set)
Definition: set.c:5698
void SCIPmessagePrintError(const char *formatstr,...)
Definition: message.c:781
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:7521
#define SCIPerrorMessage
Definition: pub_message.h:45
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4113
SCIP_Longint SCIPgetNNodeLPs(SCIP *scip)
Definition: scip.c:42636
void SCIPmessagePrintVerbInfo(SCIP_MESSAGEHDLR *messagehdlr, SCIP_VERBLEVEL verblevel, SCIP_VERBLEVEL msgverblevel, const char *formatstr,...)
Definition: message.c:668
SCIP_RETCODE SCIPconsTransform(SCIP_CONS *origcons, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_CONS **transcons)
Definition: cons.c:6319
SCIP_RETCODE SCIPchgNlRowQuadElement(SCIP *scip, SCIP_NLROW *nlrow, SCIP_QUADELEM quadelement)
Definition: scip.c:32605
SCIP_Bool SCIPisParamFixed(SCIP *scip, const char *name)
Definition: scip.c:4401
SCIP_RETCODE SCIPgetConsNVars(SCIP *scip, SCIP_CONS *cons, int *nvars, SCIP_Bool *success)
Definition: scip.c:29176
void SCIPstatResetCurrentRun(SCIP_STAT *stat, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_Bool solved)
Definition: stat.c:508
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:12591
SCIP_CONSHDLR ** SCIPgetConshdlrs(SCIP *scip)
Definition: scip.c:6617
SCIP_Bool SCIPboundchgIsRedundant(SCIP_BOUNDCHG *boundchg)
Definition: var.c:16599
SCIP_Real SCIPvarGetLbOriginal(SCIP_VAR *var)
Definition: var.c:17222
#define SCIP_DECL_PRESOLFREE(x)
Definition: type_presol.h:54
SCIP_Bool SCIPsyncstoreIsInitialized(SCIP_SYNCSTORE *syncstore)
Definition: syncstore.c:776
SCIP_Real SCIPconshdlrGetCheckTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4669
SCIP_EVENTFILTER * eventfilter
Definition: struct_scip.h:77
int SCIPgetCutoffdepth(SCIP *scip)
Definition: scip.c:41787
void SCIPstoreSolutionGap(SCIP *scip)
Definition: scip.c:45950
SCIP_Real SCIPgetDualsolLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPlpIsDualReliable(SCIP_LP *lp)
Definition: lp.c:16972
SCIP_Real SCIPbranchruleGetSetupTime(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2032
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:1884
SCIP_RETCODE SCIPgetReoptChildIDs(SCIP *scip, SCIP_NODE *node, unsigned int *ids, int idssize, int *nids)
Definition: scip.c:16765
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:14333
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:5497
SCIP_RETCODE SCIPchgVarLbLazy(SCIP *scip, SCIP_VAR *var, SCIP_Real lazylb)
Definition: scip.c:22456
SCIP_RETCODE SCIPsetEventhdlrFree(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTFREE((*eventfree)))
Definition: scip.c:8657
SCIP_INTERRUPT * interrupt
Definition: struct_scip.h:63
SCIP_RETCODE SCIPrecalcNlRowPseudoActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip.c:32784
SCIP_RETCODE SCIPsetEventhdlrCopy(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTCOPY((*eventcopy)))
Definition: scip.c:8643
SCIP_RETCODE SCIPsolveDiveLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: scip.c:35704
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_CONSENFORELAX((*consenforelax)), 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:1989
static SCIP_RETCODE doScipCreate(SCIP **scip)
Definition: scip.c:691
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
Definition: scip.c:8145
SCIP_Real SCIPbranchGetBranchingPoint(SCIP_SET *set, SCIP_TREE *tree, SCIP_VAR *var, SCIP_Real suggestion)
Definition: branch.c:2249
SCIP_Longint lpcount
Definition: struct_stat.h:171
SCIP_Real SCIPpropGetSetupTime(SCIP_PROP *prop)
Definition: prop.c:980
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46976
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:2486
SCIP_RETCODE SCIPaddConsLocal(SCIP *scip, SCIP_CONS *cons, SCIP_NODE *validnode)
Definition: scip.c:13216
int SCIPreoptGetNRestartsGlobal(SCIP_REOPT *reopt)
Definition: reopt.c:4903
SCIP_RETCODE SCIPaddNlRow(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip.c:31484
SCIP_CONS * SCIPprobFindCons(SCIP_PROB *prob, const char *name)
Definition: prob.c:2132
SCIP_RETCODE SCIPwriteNLP(SCIP *scip, const char *filename)
Definition: scip.c:31935
void SCIPdisjointsetFree(SCIP_DISJOINTSET **djset, BMS_BLKMEM *blkmem)
Definition: misc.c:10455
#define SCIP_DECL_PRICERFARKAS(x)
Definition: type_pricer.h:165
SCIP_Longint nbestsolsfound
Definition: struct_primal.h:42
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:108
SCIP_Bool SCIPdoNotMultaggrVar(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:25868
SCIP_Longint SCIPconflictGetNBoundexceedingLPReconvergenceConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:8259
SCIP_RETCODE SCIPseparateCutpool(SCIP *scip, SCIP_CUTPOOL *cutpool, SCIP_RESULT *result)
Definition: scip.c:34991
SCIP_RETCODE SCIPstatFree(SCIP_STAT **stat, BMS_BLKMEM *blkmem)
Definition: stat.c:110
SCIP_RETCODE SCIPpropagateProbing(SCIP *scip, int maxproprounds, SCIP_Bool *cutoff, SCIP_Longint *ndomredsfound)
Definition: scip.c:36314
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:5901
#define SCIP_DECL_COMPRCOPY(x)
Definition: type_compr.h:49
SCIP_Bool misc_resetstat
Definition: struct_set.h:352
SCIP_RETCODE SCIPsetWriteParams(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *filename, SCIP_Bool comments, SCIP_Bool onlychanged)
Definition: set.c:3335
SCIP_Longint SCIPconshdlrGetNRespropCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4749
#define SCIP_DECL_CONSPARSE(x)
Definition: type_cons.h:825
methods for block memory pools and memory buffers
enum SCIP_NlpSolStat SCIP_NLPSOLSTAT
Definition: type_nlpi.h:69
struct XML_NODE_struct XML_NODE
Definition: xml.h:41
SCIP_SYNCSTORE * syncstore
Definition: struct_scip.h:98
SCIP_RETCODE SCIPtryCurrentSol(SCIP *scip, SCIP_HEUR *heur, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition: scip.c:40887
SCIP_Bool SCIPrelaxationIsSolZero(SCIP_RELAXATION *relaxation)
Definition: relax.c:626
SCIP_RETCODE SCIPfreeProb(SCIP *scip)
Definition: scip.c:10519
SCIP_RETCODE SCIPreadProb(SCIP *scip, const char *filename, const char *extension)
Definition: scip.c:10156
int SCIPgetNCutsFound(SCIP *scip)
Definition: scip.c:42902
SCIP_RETCODE SCIPdelConsLocal(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:13297
SCIP_COL ** cols
Definition: struct_lp.h:218
SCIP_Bool misc_printreason
Definition: struct_set.h:357
void SCIPclockReset(SCIP_CLOCK *clck)
Definition: clock.c:199
SCIP_Bool SCIPtreeInRepropagation(SCIP_TREE *tree)
Definition: tree.c:8275
SCIP_RETCODE SCIPsetSepaExit(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAEXIT((*sepaexit)))
Definition: scip.c:7475
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_CONFLICTSTORE *conflictstore, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool *cutoff, SCIP_Bool postponed, SCIP_Bool exitsolve)
Definition: tree.c:4236
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:657
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:38948
SCIP_RETCODE SCIPaddDialogHistoryLine(SCIP *scip, const char *inputline)
Definition: scip.c:9865
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:22750
SCIP_RETCODE SCIPfixVarProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval)
Definition: scip.c:36157
SCIP_Longint SCIPconflictGetNDualrayBndGlobal(SCIP_CONFLICT *conflict)
Definition: conflict.c:8583
SCIP_Bool SCIPsetIsSumRelEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6771
SCIP_Bool SCIPisFracIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:47137
SCIP_Bool propspresolsorted
Definition: struct_set.h:149
SCIP_RETCODE SCIPconflictstoreFree(SCIP_CONFLICTSTORE **conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_REOPT *reopt)
SCIP_Longint nconflictlpiterations
Definition: struct_stat.h:70
SCIP_RETCODE SCIPnlpGetRealPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, SCIP_Real *dval)
Definition: nlp.c:6055
#define BMSdisplayMemory()
Definition: memory.h:136
SCIP_RETCODE SCIPrecalcRowPseudoActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30995
SCIP_RETCODE SCIPboolarrayCreate(SCIP_BOOLARRAY **boolarray, BMS_BLKMEM *blkmem)
Definition: misc.c:4348
int SCIPgetNConflicthdlrs(SCIP *scip)
Definition: scip.c:6842
SCIP_Bool SCIPsetIsRelEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6661
SCIP_RETCODE SCIPreadSol(SCIP *scip, const char *filename)
Definition: scip.c:40118
SCIP_RETCODE SCIPeventqueueCreate(SCIP_EVENTQUEUE **eventqueue)
Definition: event.c:2061
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:26754
SCIP_RETCODE SCIPlinkPseudoSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38661
int npresolchgsides
Definition: struct_stat.h:236
#define SCIP_DECL_CONSDEACTIVE(x)
Definition: type_cons.h:686
void SCIPprobEnableConsCompression(SCIP_PROB *prob)
Definition: prob.c:2396
SCIP_CLOCK * pseudosoltime
Definition: struct_stat.h:155
SCIP_RETCODE SCIPvarRelease(SCIP_VAR **var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: var.c:2765
SCIP_RETCODE SCIPconsProp(SCIP_CONS *cons, SCIP_SET *set, SCIP_PROPTIMING proptiming, SCIP_RESULT *result)
Definition: cons.c:7481
SCIP_COL ** SCIPlpGetCols(SCIP_LP *lp)
Definition: lp.c:16737
SCIP_RETCODE SCIPgetChildren(SCIP *scip, SCIP_NODE ***children, int *nchildren)
Definition: scip.c:41477
void SCIPstatReset(SCIP_STAT *stat, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob)
Definition: stat.c:183
SCIP_RETCODE SCIPreleaseNlRow(SCIP *scip, SCIP_NLROW **nlrow)
Definition: scip.c:32299
SCIP_Real SCIPvarGetUbOriginal(SCIP_VAR *var)
Definition: var.c:17242
SCIP_RETCODE SCIPchgCharParam(SCIP *scip, SCIP_PARAM *param, char value)
Definition: scip.c:4836
SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)
Definition: lp.c:16593
static SCIP_RETCODE prepareReoptimization(SCIP *scip)
Definition: scip.c:15851
SCIP_Real SCIPgetDualbound(SCIP *scip)
Definition: scip.c:43256
SCIP_Bool random_permutevars
Definition: struct_set.h:377
SCIP_Longint nrelaxbestsolsfound
Definition: struct_stat.h:95
SCIP_RETCODE SCIPsetSetSeparating(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: set.c:3454
#define SCIP_DECL_PRESOLEXIT(x)
Definition: type_presol.h:70
SCIP_RETCODE SCIPgetProbvarSum(SCIP *scip, SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
Definition: scip.c:19311
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:28961
SCIP_Bool SCIPsetIsDualfeasIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6528
SCIP_Bool SCIPisDualfeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47523
void SCIPinterruptRelease(SCIP_INTERRUPT *interrupt)
Definition: interrupt.c:128
SCIP_Longint SCIPsepaGetNCutoffs(SCIP_SEPA *sepa)
Definition: sepa.c:783
int lastnpresolchgbds
Definition: struct_stat.h:240
SCIP_RETCODE SCIPconsDeactive(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:7661
SCIP_RETCODE SCIPcopyVars(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars, SCIP_Bool global)
Definition: scip.c:2341
SCIP_RETCODE SCIPnlrowGetPseudoActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *pseudoactivity)
Definition: nlp.c:3027
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:24094
int repropdepth
Definition: struct_tree.h:219
SCIP_RETCODE SCIPchgCutoffboundDive(SCIP *scip, SCIP_Real newcutoffbound)
Definition: scip.c:35374
SCIP_Bool SCIPisDualSolAvailable(SCIP *scip, SCIP_Bool printreason)
Definition: scip.c:39651
SCIP_Longint SCIPconflictGetNPseudoReconvergenceConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:8880
SCIP_RETCODE SCIPvarChgObjDive(SCIP_VAR *var, SCIP_SET *set, SCIP_LP *lp, SCIP_Real newobj)
Definition: var.c:6089
register additional core functionality that is designed as plugins
SCIP_Bool misc_allowobjprop
Definition: struct_set.h:366
static SCIP_RETCODE presolve(SCIP *scip, SCIP_Bool *unbounded, SCIP_Bool *infeasible)
Definition: scip.c:14826
#define SCIPfreeBufferArrayNull(scip, ptr)
Definition: scip.h:22633
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
Definition: scip.c:4630
unsigned int sbupvalid
Definition: struct_lp.h:181
SCIP_STATUS SCIPgetStatus(SCIP *scip)
Definition: scip.c:928
SCIP_Real SCIPrealarrayGetVal(SCIP_REALARRAY *realarray, int idx)
Definition: misc.c:3855
SCIP_RETCODE SCIPpresolve(SCIP *scip)
Definition: scip.c:15954
SCIP_CONS * SCIPfindOrigCons(SCIP *scip, const char *name)
Definition: scip.c:12718
SCIP_Real SCIPversion(void)
Definition: scip.c:556
int SCIPdivesetGetMaxDepth(SCIP_DIVESET *diveset)
Definition: heur.c:415
SCIP_HEUR * firstprimalheur
Definition: struct_stat.h:166
SCIP_Bool SCIPisEfficacious(SCIP *scip, SCIP_Real efficacy)
Definition: scip.c:34546
char sepa_cutselsubscip
Definition: struct_set.h:493
#define SCIP_DECL_BRANCHINITSOL(x)
Definition: type_branch.h:87
const XML_NODE * xmlFindNodeMaxdepth(const XML_NODE *node, const char *name, int depth, int maxdepth)
Definition: xmlparse.c:1406
SCIP_RETCODE SCIPcopyCuts(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, int *ncutsadded)
Definition: scip.c:3065
SCIP_Real SCIPgetTransGap(SCIP *scip)
Definition: scip.c:43567
int SCIPfeof(SCIP_FILE *stream)
Definition: fileio.c:214
int SCIPgetNDisps(SCIP *scip)
Definition: scip.c:9417
SCIP_RETCODE SCIPgetReoptSolsRun(SCIP *scip, int run, SCIP_SOL **sols, int solssize, int *nsols)
Definition: scip.c:17373
SCIP_RETCODE SCIPsetEventhdlrInit(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTINIT((*eventinit)))
Definition: scip.c:8671
SCIP_Real SCIPconshdlrGetSepaTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4609
SCIP_Real SCIPvarGetPseudocostCurrentRun(SCIP_VAR *var, SCIP_STAT *stat, SCIP_Real solvaldelta)
Definition: var.c:13930
SCIP_RETCODE SCIPchgVarBoundsDiveNLP(SCIP *scip, SCIP_VAR *var, SCIP_Real lb, SCIP_Real ub)
Definition: scip.c:32096
struct SCIP_File SCIP_FILE
Definition: pub_fileio.h:34
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:28690
char * SCIPfgets(char *s, int size, SCIP_FILE *stream)
Definition: fileio.c:187
SCIP_Bool SCIPisReoptEnabled(SCIP *scip)
Definition: scip.c:17363
int SCIPnlpGetNNlRows(SCIP_NLP *nlp)
Definition: nlp.c:5935
SCIP_Bool objisintegral
Definition: struct_prob.h:78
SCIP_RETCODE SCIPprintTransSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:39407
SCIP_Real SCIPgetConflictVarLb(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:27450
int SCIPintarrayGetMaxIdx(SCIP_INTARRAY *intarray)
Definition: misc.c:4337
void SCIPstrCopySection(const char *str, char startchar, char endchar, char *token, int size, char **endptr)
Definition: misc.c:10112
SCIP_Real SCIPnlpGetObjval(SCIP_NLP *nlp)
Definition: nlp.c:5585
SCIP_Longint SCIPgetNResolveLPIterations(SCIP *scip)
Definition: scip.c:42542
SCIP_RETCODE SCIPunlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
Definition: scip.c:21788
SCIP_RETCODE SCIPsolSetVal(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_VAR *var, SCIP_Real val)
Definition: sol.c:1027
#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:65
SCIP_CONSHDLR ** conshdlrs
Definition: struct_set.h:69
SCIP_RETCODE SCIPsetConsChecked(SCIP *scip, SCIP_CONS *cons, SCIP_Bool check)
Definition: scip.c:27934
static SCIP_RETCODE calcCliquePartitionGreedy(SCIP *const scip, SCIP_VAR **const vars, SCIP_Bool *const values, int const nvars, int *const cliquepartition, int *const ncliques)
Definition: scip.c:24441
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:9731
void SCIPretcodePrintError(SCIP_RETCODE retcode)
Definition: retcode.c:100
internal methods for presolvers
SCIP_Longint SCIPconflictGetNAppliedLocalConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:3558
void SCIPprintConflictStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44684
SCIP_Real SCIPdivesetGetAvgDepth(SCIP_DIVESET *diveset)
Definition: heur.c:425
SCIP_Longint ninitlpiterations
Definition: struct_stat.h:64
SCIP_LPSOLSTAT lastsblpsolstats[2]
Definition: struct_stat.h:169
SCIP_CONFLICTSTORE * conflictstore
Definition: struct_scip.h:93
SCIP_Real lhs
Definition: struct_lp.h:195
SCIP_CLOCK * solvingtimeoverall
Definition: struct_stat.h:143
void SCIPsetSortComprs(SCIP_SET *set)
Definition: set.c:4399
int SCIPsepastoreGetNCuts(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1237
SCIP_RETCODE SCIPsetInitsolPlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat)
Definition: set.c:5142
SCIP_RETCODE SCIPvarGetTransformed(SCIP_VAR *origvar, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR **transvar)
Definition: var.c:3371
SCIP_NLROW ** SCIPnlpGetNlRows(SCIP_NLP *nlp)
Definition: nlp.c:5925
const char * SCIPconsGetName(SCIP_CONS *cons)
Definition: cons.c:7986
SCIP_RETCODE SCIPchgVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:22106
#define SCIP_DECL_PROPCOPY(x)
Definition: type_prop.h:47
int SCIPconshdlrGetNDelConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4909
SCIP_RETCODE SCIPsetPresolInit(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLINIT((*presolinit)))
Definition: scip.c:6984
SCIP_RETCODE SCIPsetConsDynamic(SCIP *scip, SCIP_CONS *cons, SCIP_Bool dynamic)
Definition: scip.c:28037
SCIP_RETCODE SCIPsetSetIntParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, int value)
Definition: set.c:3140
SCIP_Real SCIPcalculatePscostConfidenceBound(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir, SCIP_Bool onlycurrentrun, SCIP_CONFIDENCELEVEL clevel)
Definition: scip.c:26215
SCIP_RELAX * SCIPsetFindRelax(SCIP_SET *set, const char *name)
Definition: set.c:3934
SCIP_RETCODE SCIPcheckSolOrig(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *feasible, SCIP_Bool printreason, SCIP_Bool completely)
Definition: scip.c:41037
SCIP_RETCODE SCIPnlrowGetSolFeasibility(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol, SCIP_Real *feasibility)
Definition: nlp.c:3158
#define SCIP_DECL_BRANCHEXECLP(x)
Definition: type_branch.h:119
void SCIPprintCompressionStatistics(SCIP *scip, FILE *file)
Definition: scip.c:45037
SCIP_RETCODE SCIPprintStage(SCIP *scip, FILE *file)
Definition: scip.c:843
SCIP_RETCODE SCIPgetNLPRealPar(SCIP *scip, SCIP_NLPPARAM type, SCIP_Real *dval)
Definition: scip.c:31823
SCIP_OBJSENSE objsense
Definition: struct_prob.h:77
SCIP_RETCODE SCIPmarkDoNotMultaggrVar(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:25932
SCIP_RETCODE SCIPreaderResetReadingTime(SCIP_READER *reader)
Definition: reader.c:586
int SCIPgetNChildren(SCIP *scip)
Definition: scip.c:41501
char branch_firstsbchild
Definition: struct_set.h:163
SCIP_Real SCIPsetBarrierconvtol(SCIP_SET *set)
Definition: set.c:5711
SCIP_Real SCIPvarGetAggrConstant(SCIP_VAR *var)
Definition: var.c:17033
SCIP_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
Definition: cons.c:8205
int SCIPsetGetNParams(SCIP_SET *set)
Definition: set.c:3477
SCIP_RETCODE SCIPdigraphCreate(SCIP_DIGRAPH **digraph, BMS_BLKMEM *blkmem, int nnodes)
Definition: misc.c:6894
SCIP_Real SCIPdualfeasFloor(SCIP *scip, SCIP_Real val)
Definition: scip.c:47596
SCIP_RETCODE SCIPsumLPRows(SCIP *scip, SCIP_Real *weights, SCIP_REALARRAY *sumcoef, SCIP_Real *sumlhs, SCIP_Real *sumrhs)
Definition: scip.c:29922
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:3787
SCIP_RETCODE SCIPreoptCreate(SCIP_REOPT **reopt, SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition: reopt.c:5033
SCIP_RETCODE SCIPaddCut(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool *infeasible)
Definition: scip.c:34638
void SCIPreaderSetRead(SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
Definition: reader.c:493
SCIP_RETCODE SCIPtableOutput(SCIP_TABLE *table, SCIP_SET *set, FILE *file)
Definition: table.c:225
SCIP_RETCODE SCIPsetChgRealParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAM *param, SCIP_Real value)
Definition: set.c:3207
SCIP_RETCODE SCIPendProbing(SCIP *scip)
Definition: scip.c:35999
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:1162
struct SCIP_EventData SCIP_EVENTDATA
Definition: type_event.h:155
SCIP_CONS ** SCIPgetOrigConss(SCIP *scip)
Definition: scip.c:12981
void SCIPeventhdlrSetExit(SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTEXIT((*eventexit)))
Definition: event.c:342
const char * SCIPvarGetName(SCIP_VAR *var)
Definition: var.c:16662
SCIP_Real SCIPconflictGetBoundexceedingLPTime(SCIP_CONFLICT *conflict)
Definition: conflict.c:8209
SCIP_Bool SCIPsetExistsDialog(SCIP_SET *set, SCIP_DIALOG *dialog)
Definition: set.c:4754
SCIP_RETCODE SCIPbranchcandGetPseudoCands(SCIP_BRANCHCAND *branchcand, SCIP_SET *set, SCIP_PROB *prob, SCIP_VAR ***pseudocands, int *npseudocands, int *npriopseudocands)
Definition: branch.c:789
SCIP_RETCODE SCIPsepastoreCreate(SCIP_SEPASTORE **sepastore)
Definition: sepastore.c:76
SCIP_Bool SCIPsetIsSumRelLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6793
SCIP_VAR * transvar
Definition: struct_var.h:170
SCIP_Real SCIPclockGetTime(SCIP_CLOCK *clck)
Definition: clock.c:428
SCIP_REOPT * reopt
Definition: struct_scip.h:74
SCIP_NODE * SCIPtreeGetBestSibling(SCIP_TREE *tree, SCIP_SET *set)
Definition: tree.c:7084
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree)))
Definition: scip.c:6085
internal methods for NLP management
SCIP_PRESOL * SCIPfindPresol(SCIP *scip, const char *name)
Definition: scip.c:7048
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
Definition: misc.c:2826
SCIP_RETCODE SCIPnlpSetIntPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, int ival)
Definition: nlp.c:6039
SCIP_RETCODE SCIPgetNlRowActivityBounds(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *minactivity, SCIP_Real *maxactivity)
Definition: scip.c:33004
SCIP_RETCODE SCIPmergeVariableStatistics(SCIP *sourcescip, SCIP *targetscip, SCIP_VAR **sourcevars, SCIP_VAR **targetvars, int nvars)
Definition: scip.c:2428
SCIP_Real SCIPsetFeasCeil(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6352
SCIP_DECL_CONSTRANS(ConshdlrSubtour::scip_trans)
void SCIPheurSetCopy(SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
Definition: heur.c:1132
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:6874
void SCIPbranchruleSetInit(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHINIT((*branchinit)))
Definition: branch.c:1853
void SCIPsetSetLimitChanged(SCIP_SET *set)
Definition: set.c:5480
struct SCIP_LPiState SCIP_LPISTATE
Definition: type_lpi.h:97
SCIP_RETCODE SCIPsetBranchruleMaxbounddist(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_Real maxbounddist)
Definition: scip.c:9336
void SCIPmessagePrintWarning(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
Definition: message.c:417
SCIP_RETCODE SCIPtightenVarLbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:23542
void SCIPprintDebugMessage(SCIP *scip, const char *sourcefile, int sourceline, const char *formatstr,...)
Definition: scip.c:1283
SCIP_Real SCIPgetNodeDualbound(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:13428
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
Definition: scip.c:4432
SCIP_DOMCHG * SCIPnodeGetDomchg(SCIP_NODE *node)
Definition: tree.c:7437
SCIP_Bool SCIPsetIsRelLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6705
void SCIPprintLPStatistics(SCIP *scip, FILE *file)
Definition: scip.c:45074
SCIP_RETCODE SCIPaddNlpiProbRows(SCIP *scip, SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *nlpiprob, SCIP_HASHMAP *var2idx, SCIP_ROW **rows, int nrows)
Definition: scip.c:34407
SCIP_CONS * SCIPfindCons(SCIP *scip, const char *name)
Definition: scip.c:12767
SCIP_Bool SCIPisNLPEnabled(SCIP *scip)
Definition: scip.c:31195
SCIP_RETCODE SCIPenforelaxCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool solinfeasible, SCIP_RESULT *result)
Definition: scip.c:28779
void SCIPconshdlrSetEnable(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENABLE((*consenable)))
Definition: cons.c:4392
int SCIPprobGetNObjVars(SCIP_PROB *prob, SCIP_SET *set)
Definition: prob.c:1972
SCIP_Longint SCIPgetNDelayedCutoffs(SCIP *scip)
Definition: scip.c:42287
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:404
SCIP_RETCODE SCIPconsChgName(SCIP_CONS *cons, BMS_BLKMEM *blkmem, const char *name)
Definition: cons.c:6025
void SCIProwDelaySort(SCIP_ROW *row)
Definition: lp.c:6023
int SCIPconshdlrGetNChgCoefs(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4939
SCIP_Real cutoffbound
Definition: struct_lp.h:274
SCIP_Real SCIProwGetPseudoFeasibility(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat)
Definition: lp.c:6325
SCIP_Longint nsbdivinglpiterations
Definition: struct_stat.h:67
SCIP_RETCODE SCIPsetChgLongintParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAM *param, SCIP_Longint value)
Definition: set.c:3169
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:9293
internal miscellaneous methods
#define SCIP_DECL_NODESELFREE(x)
Definition: type_nodesel.h:56
SCIP_RETCODE SCIPboolarrayClear(SCIP_BOOLARRAY *boolarray)
Definition: misc.c:4563
SCIP_RETCODE SCIPprintOrigProblem(SCIP *scip, FILE *file, const char *extension, SCIP_Bool genericnames)
Definition: scip.c:44218
void SCIPprintPropagatorStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44621
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:21192
SCIP_RETCODE SCIPgetExprtreeTransformedVars(SCIP *scip, SCIP_EXPRTREE *tree)
Definition: scip.c:33072
void SCIPvarGetClosestVub(SCIP_VAR *var, SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *closestvub, int *closestvubidx)
Definition: var.c:13603
#define SCIP_DECL_RELAXCOPY(x)
Definition: type_relax.h:47
SCIP_NEGATE negate
Definition: struct_var.h:227
SCIP_RETCODE SCIPmarkConsPropagate(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28602
void SCIPupdateSolIntegralityViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol)
Definition: scip.c:13755
SCIP_RETCODE SCIPvarFlattenAggregationGraph(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: var.c:4237
SCIP_Real SCIPgetVarConflictlengthScore(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26520
SCIP_HEUR * SCIPsolGetHeur(SCIP_SOL *sol)
Definition: sol.c:2548
SCIP_Longint SCIPbranchruleGetNConssFound(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2104
SCIP_Longint SCIPconshdlrGetNPropCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4729
SCIP_Real SCIPgetSolTransObj(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:39041
SCIP_Real SCIPlpGetObjNorm(SCIP_LP *lp)
Definition: lp.c:16852
void SCIPrandomFree(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem)
Definition: misc.c:9350
SCIP_Real SCIPsetDualfeasCeil(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6563
SCIP_RETCODE SCIPseparateSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool pretendroot, SCIP_Bool allowlocal, SCIP_Bool onlydelayed, SCIP_Bool *delayed, SCIP_Bool *cutoff)
Definition: scip.c:35145
SCIP_Longint nprimalresolvelpiterations
Definition: struct_stat.h:60
int SCIPpresolGetPriority(SCIP_PRESOL *presol)
Definition: presol.c:573
SCIP_Bool SCIPsetIsDualfeasFracIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6539
SCIP_RETCODE SCIPsetNLPInitialGuess(SCIP *scip, SCIP_Real *initialguess)
Definition: scip.c:31534
SCIP_Longint SCIPconflictGetNStrongbranchReconvergenceConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:8643
SCIP_Bool SCIPisObjChangedProbing(SCIP *scip)
Definition: scip.c:36291
SCIP_RETCODE SCIPclearBoolarray(SCIP *scip, SCIP_BOOLARRAY *boolarray)
Definition: scip.c:48219
SCIP_RETCODE SCIPvarSetRelaxSol(SCIP_VAR *var, SCIP_SET *set, SCIP_RELAXATION *relaxation, SCIP_Real solval, SCIP_Bool updateobj)
Definition: var.c:13268
int SCIPgetNNlpis(SCIP *scip)
Definition: scip.c:9602
SCIP_RETCODE SCIPconcsolverInitSeeds(SCIP_CONCSOLVER *concsolver, unsigned int seed)
Definition: concsolver.c:256
int nrelaxs
Definition: struct_set.h:106
int nseparounds
Definition: struct_stat.h:214
void SCIPrelaxSetInitsol(SCIP_RELAX *relax, SCIP_DECL_RELAXINITSOL((*relaxinitsol)))
Definition: relax.c:422
SCIP_Bool SCIPsetIsDualfeasGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6451
int SCIPgetNPrioExternBranchCands(SCIP *scip)
Definition: scip.c:37169
void SCIPrelaxSetExitsol(SCIP_RELAX *relax, SCIP_DECL_RELAXEXITSOL((*relaxexitsol)))
Definition: relax.c:433
static SCIP_RETCODE copyVars(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars, SCIP_Bool original, SCIP_Bool global)
Definition: scip.c:2146
SCIP_HISTORY * glbhistory
Definition: struct_stat.h:162
SCIP_Real SCIPboundchgGetNewbound(SCIP_BOUNDCHG *boundchg)
Definition: var.c:16559
SCIP_Bool userinterrupt
Definition: struct_stat.h:258
SCIP_Real SCIPsetFrac(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5996
SCIP_RETCODE SCIPsetIncludePricer(SCIP_SET *set, SCIP_PRICER *pricer)
Definition: set.c:3529
#define REALABS(x)
Definition: def.h:173
SCIP_SEPA * SCIPsetFindSepa(SCIP_SET *set, const char *name)
Definition: set.c:4008
#define SCIP_DECL_CONSDISABLE(x)
Definition: type_cons.h:716
SCIP_RETCODE SCIPprobSetName(SCIP_PROB *prob, const char *name)
Definition: prob.c:1934
SCIP_RETCODE SCIPchgDualfeastol(SCIP *scip, SCIP_Real dualfeastol)
Definition: scip.c:46573
SCIP_Real SCIPgetLocalDualbound(SCIP *scip)
Definition: scip.c:13389
SCIP_CONCSOLVERTYPE ** concsolvertypes
Definition: struct_set.h:89
SCIP_RETCODE SCIPgetIntParam(SCIP *scip, const char *name, int *value)
Definition: scip.c:4451
SCIP_Real SCIPvarGetLPSol(SCIP_VAR *var)
Definition: var.c:17650
SCIP_RETCODE SCIPunfixParam(SCIP *scip, const char *name)
Definition: scip.c:4567
SCIP_RETCODE SCIPmessagehdlrRelease(SCIP_MESSAGEHDLR **messagehdlr)
Definition: message.c:338
void SCIPrandomSetSeed(SCIP_RANDNUMGEN *randnumgen, unsigned int initseed)
Definition: misc.c:9280
int SCIPexprtreeGetNVars(SCIP_EXPRTREE *tree)
Definition: expr.c:8612
SCIP_RETCODE SCIPsetNLPInitialGuessSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:31561
void SCIPupdateDivesetLPStats(SCIP *scip, SCIP_DIVESET *diveset, SCIP_Longint niterstoadd)
Definition: scip.c:36800
SCIP_Bool SCIPparamIsValidReal(SCIP_PARAM *param, SCIP_Real value)
Definition: paramset.c:4274
SCIP_Bool SCIPsetIsRelGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6727
const char * SCIPlpiGetSolverDesc(void)
SCIP_Real unchangedobj
Definition: struct_var.h:204
SCIP_PARAM * SCIPgetParam(SCIP *scip, const char *name)
Definition: scip.c:4416
void SCIPconshdlrSetExit(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXIT((*consexit)))
Definition: cons.c:4242
SCIP_RETCODE SCIPnlpiChgConsSides(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int nconss, const int *indices, const SCIP_Real *lhss, const SCIP_Real *rhss)
Definition: nlpi.c:343
SCIP_Bool SCIPprimalUpdateViolations(SCIP_PRIMAL *primal)
Definition: primal.c:1912
SCIP_Longint SCIPpropGetNDomredsFound(SCIP_PROP *prop)
Definition: prop.c:1072
SCIP_Longint nconflictlps
Definition: struct_stat.h:193
SCIP_RETCODE SCIPsetPresolPriority(SCIP *scip, SCIP_PRESOL *presol, int priority)
Definition: scip.c:7085
internal methods for node selectors and node priority queues
SCIP_RETCODE SCIPsetBranchrulePriority(SCIP *scip, SCIP_BRANCHRULE *branchrule, int priority)
Definition: scip.c:9306
SCIP_RETCODE SCIPtransformCons(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **transcons)
Definition: scip.c:28172
SCIP_Real SCIPgetVarAvgInferenceScoreCurrentRun(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26721
#define SCIP_PROPTIMING_ALWAYS
Definition: type_timing.h:64
SCIP_RETCODE SCIPaddConflictRelaxedBd(SCIP *scip, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedbd)
Definition: scip.c:27354
SCIP_Bool SCIPprobIsObjIntegral(SCIP_PROB *prob)
Definition: prob.c:2250
internal methods for variable pricers
int SCIPgetEffectiveRootDepth(SCIP *scip)
Definition: scip.c:41440
SCIP_RETCODE SCIPcreateChild(SCIP *scip, SCIP_NODE **node, SCIP_Real nodeselprio, SCIP_Real estimate)
Definition: scip.c:37577
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:3572
SCIP_Longint SCIPcomprGetNCalls(SCIP_COMPR *compr)
Definition: compr.c:463
SCIP_RETCODE SCIPsetSepaInitsol(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAINITSOL((*sepainitsol)))
Definition: scip.c:7491
int SCIPgetNLPRows(SCIP *scip)
Definition: scip.c:29696
SCIP_QUADELEM * SCIPnlrowGetQuadElems(SCIP_NLROW *nlrow)
Definition: nlp.c:3332
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:9634
SCIP_RETCODE SCIPfreeBoolarray(SCIP *scip, SCIP_BOOLARRAY **boolarray)
Definition: scip.c:48183
SCIP_ROW * SCIPcutGetRow(SCIP_CUT *cut)
Definition: cutpool.c:372
SCIP_Bool SCIPareSolsEqual(SCIP *scip, SCIP_SOL *sol1, SCIP_SOL *sol2)
Definition: scip.c:39262
SCIP_CUTPOOL * SCIPgetDelayedGlobalCutpool(SCIP *scip)
Definition: scip.c:35121
const char * SCIPrelaxGetName(SCIP_RELAX *relax)
Definition: relax.c:444
SCIP_RETCODE SCIPsetConflicthdlrFree(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTFREE((*conflictfree)))
Definition: scip.c:6736
SCIP_Bool SCIPisSumEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47197
int npresolchgbds
Definition: struct_stat.h:230
void SCIPreoptnodeInit(SCIP_REOPTNODE *reoptnode, SCIP_SET *set)
Definition: reopt.c:7909
SCIP_Longint SCIPconflictGetNStrongbranchConflictLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:8633
SCIP_RETCODE SCIPcopyOrigVars(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars)
Definition: scip.c:2398
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:310
int SCIPptrarrayGetMaxIdx(SCIP_PTRARRAY *ptrarray)
Definition: misc.c:5046
SCIP_NODEPQ * leaves
Definition: struct_tree.h:176
void SCIPsetSortProps(SCIP_SET *set)
Definition: set.c:4105
SCIP_Real SCIPgetSepaMinEfficacy(SCIP *scip)
Definition: scip.c:7583
static SCIP_RETCODE calcNonZeros(SCIP *scip, SCIP_Longint *nchecknonzeros, SCIP_Longint *nactivenonzeros, SCIP_Bool *approxchecknonzeros, SCIP_Bool *approxactivenonzeros)
Definition: scip.c:13831
SCIP_Real SCIPgetVarObjProbing(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:36127
struct SCIP_ConflicthdlrData SCIP_CONFLICTHDLRDATA
Definition: type_conflict.h:40
void SCIPsepaSetExitsol(SCIP_SEPA *sepa, SCIP_DECL_SEPAEXITSOL((*sepaexitsol)))
Definition: sepa.c:635
void SCIPsortPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
internal methods for global SCIP settings
SCIP_DECL_CONSDELVARS(ConshdlrSubtour::scip_delvars)
internal methods for storing conflicts
SCIP_Real SCIPvarCalcPscostConfidenceBound(SCIP_VAR *var, SCIP_SET *set, SCIP_BRANCHDIR dir, SCIP_Bool onlycurrentrun, SCIP_CONFIDENCELEVEL clevel)
Definition: var.c:14151
SCIP * scip
Definition: struct_cons.h:40
#define SCIP_CALL(x)
Definition: def.h:350
SCIP_RETCODE SCIPsetPropPriority(SCIP *scip, SCIP_PROP *prop, int priority)
Definition: scip.c:7910
SCIP_RETCODE SCIPgetNLPI(SCIP *scip, SCIP_NLPI **nlpi, SCIP_NLPIPROBLEM **nlpiproblem)
Definition: scip.c:31972
SCIP_Real SCIPgetLowerbound(SCIP *scip)
Definition: scip.c:43277
int npresoladdholes
Definition: struct_stat.h:231
SCIP_SOL * SCIPgetReoptLastOptSol(SCIP *scip)
Definition: scip.c:16692
SCIP_Bool SCIPisPrimalboundSol(SCIP *scip)
Definition: scip.c:43513
SCIP_RETCODE SCIPsetSetReoptimizationParams(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: set.c:759
SCIP_RETCODE SCIPrecalcNlRowActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip.c:32849
SCIP_RETCODE SCIPprobAddVarName(SCIP_PROB *prob, SCIP_VAR *var)
Definition: prob.c:883
unsigned int SCIP_PRESOLTIMING
Definition: type_timing.h:52
int SCIPconflictstoreGetInitPoolSize(SCIP_CONFLICTSTORE *conflictstore)
#define SCIP_HEURTIMING_DURINGPRESOLLOOP
Definition: type_timing.h:87
SCIP main data structure.
SCIP_RETCODE SCIPprobResetBounds(SCIP_PROB *prob, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat)
Definition: prob.c:605
SCIP_Real SCIPpropGetPresolTime(SCIP_PROP *prop)
Definition: prop.c:1032
SCIP_RETCODE SCIPremoveInefficaciousCuts(SCIP *scip)
Definition: scip.c:35232
SCIP_Longint SCIPbranchruleGetNLPCalls(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2052
SCIP_Bool SCIPsetIsFeasGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6262
SCIP_Longint SCIPconshdlrGetNConssFound(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4809
SCIP_Real SCIPgetAvgPseudocostCurrentRun(SCIP *scip, SCIP_Real solvaldelta)
Definition: scip.c:43710
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:26246
SCIP_Longint SCIPgetNTotalNodes(SCIP *scip)
Definition: scip.c:42160
int SCIPgetNTotalVars(SCIP *scip)
Definition: scip.c:12389
#define SCIP_DECL_CONCSOLVERINITSEEDS(x)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47337
SCIP_RETCODE SCIPsolveProbingLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: scip.c:36550
SCIP_Real SCIPcomputeVarUbLocal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23840
SCIP_Real SCIPbranchruleGetTime(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2042
static SCIP_RETCODE printProblem(SCIP *scip, SCIP_PROB *prob, FILE *file, const char *extension, SCIP_Bool genericnames)
Definition: scip.c:44152
SCIP_Longint nsbbestsolsfound
Definition: struct_stat.h:97
int SCIPgetNOrigConss(SCIP *scip)
Definition: scip.c:12954
int SCIPlpGetNRows(SCIP_LP *lp)
Definition: lp.c:16767
SCIP_RETCODE SCIPprintStatus(SCIP *scip, FILE *file)
Definition: scip.c:951
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:23325
BMS_BLKMEM * setmem
Definition: struct_mem.h:39
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:14853
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:19255
SCIP_RETCODE SCIPrelaxationCreate(SCIP_RELAXATION **relaxation, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree)
Definition: relax.c:576
SCIP_Real SCIPvarGetMultaggrConstant(SCIP_VAR *var)
Definition: var.c:17080
SCIP_RETCODE SCIPbranchVarVal(SCIP *scip, SCIP_VAR *var, SCIP_Real val, SCIP_NODE **downchild, SCIP_NODE **eqchild, SCIP_NODE **upchild)
Definition: scip.c:37686
SCIP_Real SCIPgetVarAvgConflictlength(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26582
SCIP_RETCODE SCIPremoveVarFromGlobalStructures(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:25164
SCIP_RETCODE SCIPreaderRead(SCIP_READER *reader, SCIP_SET *set, const char *filename, const char *extension, SCIP_RESULT *result)
Definition: reader.c:140
#define SCIP_DECL_PROPINITPRE(x)
Definition: type_prop.h:85
SCIP_RETCODE SCIPreoptResetDualBndchgs(SCIP_REOPT *reopt, SCIP_NODE *node, BMS_BLKMEM *blkmem)
Definition: reopt.c:7190
struct SCIP_ComprData SCIP_COMPRDATA
Definition: type_compr.h:40
void SCIPmessagePrintInfo(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
Definition: message.c:584
SCIP_NODE * SCIPgetBestboundNode(SCIP *scip)
Definition: scip.c:41697
SCIP_RETCODE SCIPgetVarClosestVub(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real *closestvub, int *closestvubidx)
Definition: scip.c:23946
SCIP_RETCODE SCIPcutpoolClear(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
Definition: cutpool.c:482
#define SCIP_DECL_CONSENABLE(x)
Definition: type_cons.h:701
SCIP_RETCODE SCIPsetEmphasis(SCIP *scip, SCIP_PARAMEMPHASIS paramemphasis, SCIP_Bool quiet)
Definition: scip.c:5061
SCIP_Longint SCIPgetVarStrongbranchLPAge(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:21595
void SCIPlpMarkDivingObjChanged(SCIP_LP *lp)
Definition: lp.c:17012
int SCIPgetIntarrayVal(SCIP *scip, SCIP_INTARRAY *intarray, int idx)
Definition: scip.c:48084
void SCIPupdateSolLPConsViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
Definition: scip.c:13802
void SCIPpropSetPresolPriority(SCIP_PROP *prop, SCIP_SET *set, int presolpriority)
Definition: prop.c:941
#define MAXNCLIQUEVARSCOMP
Definition: scip.c:24421
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:7215
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47324
SCIP_RETCODE SCIPsetSetLpfeastol(SCIP_SET *set, SCIP_Real lpfeastol, SCIP_Bool printnewvalue)
Definition: set.c:5394
SCIP_NODESEL * SCIPgetNodesel(SCIP *scip)
Definition: scip.c:9022
SCIP_RETCODE SCIPsetSetPresolving(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: set.c:3436
SCIP_RETCODE SCIPconsAddLocks(SCIP_CONS *cons, SCIP_SET *set, int nlockspos, int nlocksneg)
Definition: cons.c:7159
#define SCIP_DECL_CONFLICTCOPY(x)
Definition: type_conflict.h:77
SCIP_Bool SCIPsetIsLbBetter(SCIP_SET *set, SCIP_Real newlb, SCIP_Real oldlb, SCIP_Real oldub)
Definition: set.c:6599
SCIP_RETCODE SCIPconsDisable(SCIP_CONS *cons, SCIP_SET *set, SCIP_STAT *stat)
Definition: cons.c:6748
SCIP_RETCODE SCIPnlpSetInitialGuess(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_Real *initguess)
Definition: nlp.c:5704
SCIP_Real SCIPvarGetPseudocostCount(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:13977
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:249
SCIP_Longint nduallpiterations
Definition: struct_stat.h:57
void SCIPmarkLimitChanged(SCIP *scip)
Definition: scip.c:46645
SCIP_Longint nbarrierzeroitlps
Definition: struct_stat.h:181
SCIP_Longint SCIPconflictGetNPseudoSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:8850
SCIP_RETCODE SCIPanalyzeConflictCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
Definition: scip.c:27535
SCIP_Bool resolvelperror
Definition: struct_lp.h:364
#define SCIPstatAdd(stat, set, field, val)
Definition: stat.h:271
SCIP_CUT ** SCIPcutpoolGetCuts(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:1043
BMS_BUFMEM * SCIPcleanbuffer(SCIP *scip)
Definition: scip.c:46760
SCIP_RETCODE SCIPintarraySetVal(SCIP_INTARRAY *intarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, int val)
Definition: misc.c:4247
SCIP_Real SCIProwGetRhs(SCIP_ROW *row)
Definition: lp.c:16494
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
Definition: scip.c:1360
SCIP_Longint SCIPgetNBarrierLPIterations(SCIP *scip)
Definition: scip.c:42504
#define SCIP_HEURTIMING_BEFOREPRESOL
Definition: type_timing.h:86
internal methods for storing priced variables
SCIP_RETCODE SCIPgetNLPStringPar(SCIP *scip, SCIP_NLPPARAM type, const char **sval)
Definition: scip.c:31879
SCIP_RETCODE SCIPnlrowCreateFromRow(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_ROW *row)
Definition: nlp.c:2184
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
Definition: cons.c:8225
internal methods for relaxators
SCIP_RETCODE SCIPfreeRealarray(SCIP *scip, SCIP_REALARRAY **realarray)
Definition: scip.c:47881
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:2813
SCIP_Real SCIPgetRowLPActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30960
SCIP_Real SCIPhistoryGetPseudocostCount(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
Definition: history.c:461
SCIP_Bool SCIPsetIsEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5798
void SCIPpresolSetInitpre(SCIP_PRESOL *presol, SCIP_DECL_PRESOLINITPRE((*presolinitpre)))
Definition: presol.c:531
void SCIPconshdlrSetSepa(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa)
Definition: cons.c:4154
int SCIPheurGetNDivesets(SCIP_HEUR *heur)
Definition: heur.c:1406
int SCIPcutpoolGetNCuts(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:1053
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:30270
SCIP_Real vsidsweight
Definition: struct_stat.h:118
#define SCIPdebugCheckBInvRow(scip, r, coef)
Definition: debug.h:286
SCIP_RETCODE SCIPsetPricerInit(SCIP *scip, SCIP_PRICER *pricer, SCIP_DECL_PRICERINIT((*pricerinit)))
Definition: scip.c:5593
SCIP_RETCODE SCIPgetTransformedCons(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **transcons)
Definition: scip.c:28262
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:7731
int nsepas
Definition: struct_set.h:108
SCIP_RETCODE SCIPcaptureCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:27726
int SCIPpropGetNChgBds(SCIP_PROP *prop)
Definition: prop.c:1142
SCIP_RETCODE SCIPaddRow(SCIP *scip, SCIP_ROW *row, SCIP_Bool forcecut, SCIP_Bool *infeasible)
Definition: scip.c:34661
SCIP_Bool SCIPisLongintParamValid(SCIP *scip, SCIP_PARAM *param, SCIP_Longint value)
Definition: scip.c:4761
SCIP_Longint SCIPgetNPrimalResolveLPIterations(SCIP *scip)
Definition: scip.c:42580
SCIP_Longint SCIPheurGetNCalls(SCIP_HEUR *heur)
Definition: heur.c:1324
SCIP_Bool SCIPsetIsHugeValue(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5787
SCIP_LPI * SCIPlpGetLPI(SCIP_LP *lp)
Definition: lp.c:16919
void SCIPprintRootStatistics(SCIP *scip, FILE *file)
Definition: scip.c:45510
void SCIPconshdlrSetActive(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSACTIVE((*consactive)))
Definition: cons.c:4370
SCIP_RETCODE SCIPsetConshdlrResprop(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop)))
Definition: scip.c:6360
SCIP_Real SCIPlpGetObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:12631
SCIP_RETCODE SCIPcreateDisjointset(SCIP *scip, SCIP_DISJOINTSET **djset, int ncomponents)
Definition: scip.c:48657
void SCIPprobResortVars(SCIP_PROB *prob)
Definition: prob.c:631
void SCIPstatResetPrimalDualIntegral(SCIP_STAT *stat, SCIP_SET *set, SCIP_Bool partialreset)
Definition: stat.c:372
SCIP_RETCODE SCIPsetRelaxPriority(SCIP *scip, SCIP_RELAX *relax, int priority)
Definition: scip.c:7316
SCIP_Bool SCIPconsIsLockedPos(SCIP_CONS *cons)
Definition: cons.c:8305
SCIP_RETCODE SCIPgetLongintParam(SCIP *scip, const char *name, SCIP_Longint *value)
Definition: scip.c:4470
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:3317
SCIP_RETCODE SCIPnlpChgVarObjDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var, SCIP_Real coef)
Definition: nlp.c:6216
SCIP_Longint SCIPconflictGetNInfeasibleLPCalls(SCIP_CONFLICT *conflict)
Definition: conflict.c:8139
struct SCIP_ConsData SCIP_CONSDATA
Definition: type_cons.h:50
void SCIPnodeselSetInitsol(SCIP_NODESEL *nodesel, SCIP_DECL_NODESELINITSOL((*nodeselinitsol)))
Definition: nodesel.c:1136
SCIP_Bool SCIPbranchcandContainsExternCand(SCIP_BRANCHCAND *branchcand, SCIP_VAR *var)
Definition: branch.c:713
SCIP_RETCODE SCIPdisableCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28459
void SCIProwPrint(SCIP_ROW *row, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: lp.c:5174
internal methods for storing separated cuts
SCIP_RETCODE SCIPgetPseudoBranchCands(SCIP *scip, SCIP_VAR ***pseudocands, int *npseudocands, int *npriopseudocands)
Definition: scip.c:37340
SCIP_RETCODE SCIPsetPresolInitpre(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLINITPRE((*presolinitpre)))
Definition: scip.c:7016
int lastnpresoldelconss
Definition: struct_stat.h:242
SCIP_RETCODE SCIPvarPrint(SCIP_VAR *var, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: var.c:2886
void SCIPstatResetDisplay(SCIP_STAT *stat)
Definition: stat.c:570
SCIP_Bool SCIProwIsModifiable(SCIP_ROW *row)
Definition: lp.c:16603
SCIP_RETCODE SCIPnlrowChgConstant(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real constant)
Definition: nlp.c:2772
SCIP_RETCODE SCIPsetConflicthdlrInitsol(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTINITSOL((*conflictinitsol)))
Definition: scip.c:6784
int SCIPgetNPrioExternBranchBins(SCIP *scip)
Definition: scip.c:37189
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:227
int SCIPgetNPrioExternBranchInts(SCIP *scip)
Definition: scip.c:37210
void SCIPsetSortPropsPresol(SCIP_SET *set)
Definition: set.c:4120
SCIP_RETCODE SCIPnlpChgVarBoundsDive(SCIP_NLP *nlp, SCIP_VAR *var, SCIP_Real lb, SCIP_Real ub)
Definition: nlp.c:6276
int SCIPgetRealarrayMaxIdx(SCIP *scip, SCIP_REALARRAY *realarray)
Definition: scip.c:48000
SCIP_Bool SCIPsetIsFeasLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6218
SCIP_COL ** SCIProwGetCols(SCIP_ROW *row)
Definition: lp.c:16430
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:2727
SCIP_Bool SCIProwIsSolEfficacious(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol, SCIP_Bool root)
Definition: lp.c:6714
void SCIPsetSortPresolsName(SCIP_SET *set)
Definition: set.c:3895
SCIP_Longint nprimalresolvelps
Definition: struct_stat.h:182
SCIP_RETCODE SCIPsetConflicthdlrExit(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTEXIT((*conflictexit)))
Definition: scip.c:6768
SCIP_RETCODE SCIPnlpiSetObjective(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int nlins, const int *lininds, const SCIP_Real *linvals, int nquadelems, const SCIP_QUADELEM *quadelems, const int *exprvaridxs, const SCIP_EXPRTREE *exprtree, const SCIP_Real constant)
Definition: nlpi.c:300
SCIP_RETCODE SCIPgetConsVars(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int varssize, SCIP_Bool *success)
Definition: scip.c:29132
SCIP_RETCODE SCIPsetRealarrayVal(SCIP *scip, SCIP_REALARRAY *realarray, int idx, SCIP_Real val)
Definition: scip.c:47949
SCIP_Bool SCIPisDualfeasNegative(SCIP *scip, SCIP_Real val)
Definition: scip.c:47560
SCIP_Real SCIPgetVarPseudocostCount(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26139
SCIP_Longint SCIPconcsolverGetNNodes(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:518
SCIP_Bool SCIPconshdlrNeedsCons(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:5029
#define BMSduplicateMemoryArray(ptr, source, num)
Definition: memory.h:125
SCIP_RETCODE SCIPlpStartStrongbranch(SCIP_LP *lp)
Definition: lp.c:4083
SCIP_Longint SCIPconcsolverGetNTighterIntBnds(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:558
int SCIProwGetNumIntCols(SCIP_ROW *row, SCIP_SET *set)
Definition: lp.c:6598
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
Definition: scip.c:29208
SCIP_CLOCK * divinglptime
Definition: struct_stat.h:150
SCIP_Bool SCIPhasPrimalRay(SCIP *scip)
Definition: scip.c:41075
SCIP_Longint nprobboundchgs
Definition: struct_stat.h:106
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:33359
SCIP_RETCODE SCIPstopSolvingTime(SCIP *scip)
Definition: scip.c:46231
SCIP_CLOCK * presolvingtimeoverall
Definition: struct_stat.h:145
int SCIPgetBoolarrayMinIdx(SCIP *scip, SCIP_BOOLARRAY *boolarray)
Definition: scip.c:48269
SCIP_RETCODE SCIPgetLPBInvACol(SCIP *scip, int c, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip.c:29889
SCIP_Longint SCIPgetLastDivenode(SCIP *scip)
Definition: scip.c:35772
SCIP_Longint SCIPgetNNodeLPIterations(SCIP *scip)
Definition: scip.c:42654
SCIP_READER * SCIPsetFindReader(SCIP_SET *set, const char *name)
Definition: set.c:3509
SCIP_Real SCIPgetVarPseudocostCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26113
void SCIPsolRecomputeObj(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *origprob)
Definition: sol.c:1942
void SCIPsetSortRelaxs(SCIP_SET *set)
Definition: set.c:3954
SCIP_RETCODE SCIPsetRelaxExit(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXEXIT((*relaxexit)))
Definition: scip.c:7230
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:5227
SCIP_RETCODE SCIPchgNlRowLhs(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real lhs)
Definition: scip.c:32321
SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:160
SCIP_NODE * SCIPgetBestNode(SCIP *scip)
Definition: scip.c:41681
#define SCIP_DECL_COMPRINITSOL(x)
Definition: type_compr.h:84
SCIP_RETCODE SCIPcopyConflicts(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool enablepricing, SCIP_Bool *valid)
Definition: scip.c:3157
SCIP_Real SCIPconshdlrGetRespropTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4679
SCIP_CUTPOOL * cutpool
Definition: struct_scip.h:94
SCIP_BRANCHRULE ** branchrules
Definition: struct_set.h:84
SCIP_Real SCIPtreeGetAvgLowerbound(SCIP_TREE *tree, SCIP_Real cutoffbound)
Definition: tree.c:7245
SCIP_Longint nduallps
Definition: struct_stat.h:177
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 *valid)
Definition: scip.c:2533
SCIP_Bool SCIPisHugeValue(SCIP *scip, SCIP_Real val)
Definition: scip.c:47051
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:7385
SCIP_RETCODE SCIPaddConsNode(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons, SCIP_NODE *validnode)
Definition: scip.c:13146
#define SCIP_DECL_PROBTRANS(x)
Definition: type_prob.h:74
void SCIPbranchruleSetMaxdepth(SCIP_BRANCHRULE *branchrule, int maxdepth)
Definition: branch.c:1986
methods for catching the user CTRL-C interrupt
void SCIPtreeClearDiveBoundChanges(SCIP_TREE *tree)
Definition: tree.c:6243
void SCIPsepaSetCopy(SCIP_SEPA *sepa, SCIP_DECL_SEPACOPY((*sepacopy)))
Definition: sepa.c:580
SCIP_CLIQUETABLE * cliquetable
Definition: struct_scip.h:86
SCIP_Bool SCIPlpiWasSolved(SCIP_LPI *lpi)
static SCIP_RETCODE getCopyTimelimit(SCIP *sourcescip, SCIP_Real *timelimit)
Definition: scip.c:4086
SCIP_RETCODE SCIPchgVarObj(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
Definition: scip.c:21853
SCIP_Real SCIProwGetSolActivity(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol)
Definition: lp.c:6341
SCIP_RETCODE SCIPsetSetLongintParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_Longint value)
Definition: set.c:3192
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:142
SCIP_Longint SCIPbranchruleGetNCutsFound(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2092
SCIP_Longint SCIPsepaGetNCalls(SCIP_SEPA *sepa)
Definition: sepa.c:763
SCIP_RETCODE SCIPmemCreate(SCIP_MEM **mem)
Definition: mem.c:33
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:266
SCIP_Real SCIPgetAvgInferencesCurrentRun(SCIP *scip, SCIP_BRANCHDIR dir)
Definition: scip.c:43983
int SCIPreoptGetNTotalFeasNodes(SCIP_REOPT *reopt)
Definition: reopt.c:4963
#define SCIP_COPYRIGHT
Definition: def.h:113
data structures and methods for collecting reoptimization information
internal methods for problem variables
SCIP_COMPR * SCIPsetFindCompr(SCIP_SET *set, const char *name)
Definition: set.c:4379
the function declarations for the synchronization store
static SCIP_DECL_SORTPTRCOMP(tablePosComp)
Definition: scip.c:45627
SCIP_RETCODE SCIPsetIncludeProp(SCIP_SET *set, SCIP_PROP *prop)
Definition: set.c:4058
SCIP_RETCODE SCIPsetNLPRealPar(SCIP *scip, SCIP_NLPPARAM type, SCIP_Real dval)
Definition: scip.c:31851
SCIP_Bool SCIPvarIsOriginal(SCIP_VAR *var)
Definition: var.c:16791
void SCIPbranchruleSetExecLp(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECLP((*branchexeclp)))
Definition: branch.c:1899
SCIP_RETCODE SCIPnlpWrite(SCIP_NLP *nlp, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *fname)
Definition: nlp.c:5737
#define SCIP_DECL_CONSGETVARS(x)
Definition: type_cons.h:847
SCIP_RETCODE SCIPactivatePricer(SCIP *scip, SCIP_PRICER *pricer)
Definition: scip.c:5754
SCIP_RETCODE SCIPvarChgBranchFactor(SCIP_VAR *var, SCIP_SET *set, SCIP_Real branchfactor)
Definition: var.c:10974
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:5034
SCIP_RETCODE SCIPreoptInstallBounds(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem)
Definition: reopt.c:8211
SCIP_RETCODE SCIPpropCons(SCIP *scip, SCIP_CONS *cons, SCIP_PROPTIMING proptiming, SCIP_RESULT *result)
Definition: scip.c:28895
SCIP_RETCODE SCIPreoptSaveOpenNodes(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_NODE **leaves, int nleaves, SCIP_NODE **childs, int nchilds, SCIP_NODE **siblings, int nsiblings)
Definition: reopt.c:6465
void SCIPbranchruleSetPriority(SCIP_BRANCHRULE *branchrule, SCIP_SET *set, int priority)
Definition: branch.c:1962
#define SCIP_DECL_CONSEXIT(x)
Definition: type_cons.h:120
#define SCIPallocBufferArray(scip, ptr, num)
Definition: scip.h:22620
#define SCIP_UNKNOWN
Definition: def.h:170
SCIP_RETCODE SCIPstartStrongbranch(SCIP *scip, SCIP_Bool enablepropagation)
Definition: scip.c:20175
struct SCIP_ReaderData SCIP_READERDATA
Definition: type_reader.h:37
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
Definition: scip.c:38771
SCIP_Bool userrestart
Definition: struct_stat.h:259
SCIP_RETCODE SCIPlpGetBasisInd(SCIP_LP *lp, int *basisind)
Definition: lp.c:9600
SCIP_RETCODE SCIPgetLPBInvARow(SCIP *scip, int r, SCIP_Real *binvrow, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip.c:29855
SCIP_Bool SCIPsetIsIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5921
SCIP_RETCODE SCIPgetNlRowFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *feasibility)
Definition: scip.c:32906
SCIP_RETCODE SCIPlpiGetObjval(SCIP_LPI *lpi, SCIP_Real *objval)
SCIP_Real * SCIProwGetVals(SCIP_ROW *row)
Definition: lp.c:16440
SCIP_SEPASTORE * sepastore
Definition: struct_scip.h:91
SCIP_Longint nisstoppedcalls
Definition: struct_stat.h:195
SCIP_RETCODE SCIPresetReoptnodeDualcons(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:17551
SCIP_Longint SCIPconshdlrGetNEnfoLPCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4699
SCIP_RETCODE SCIPclearSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38712
SCIP_RETCODE SCIPsetPropInit(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINIT((*propinit)))
Definition: scip.c:7727
SCIP_RETCODE SCIPcheckReoptRestart(SCIP *scip, SCIP_NODE *node, SCIP_Bool *restart)
Definition: scip.c:17423
unsigned int vartype
Definition: struct_var.h:273
SCIP_COMPR ** SCIPgetComprs(SCIP *scip)
Definition: scip.c:8472
SCIP_BOUNDTYPE * SCIPvarGetImplTypes(SCIP_VAR *var, SCIP_Bool varfixing)
Definition: var.c:17586
SCIP_Bool SCIPcliquetableNeedsComponentUpdate(SCIP_CLIQUETABLE *cliquetable)
Definition: implics.c:3527
static SCIP_RETCODE printDualSol(SCIP *scip, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:39594
SCIP_Bool reopt_sepabestsol
Definition: struct_set.h:463
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:817
SCIP_Bool SCIPisSumGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47236
void SCIPnodePropagateAgain(SCIP_NODE *node, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree)
Definition: tree.c:1206
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:15021
int SCIPgetNPrioExternBranchConts(SCIP *scip)
Definition: scip.c:37250
SCIP_RETCODE SCIPconsGetNVars(SCIP_CONS *cons, SCIP_SET *set, int *nvars, SCIP_Bool *success)
Definition: cons.c:6227
SCIP_RETCODE SCIPfreeTransform(SCIP *scip)
Definition: scip.c:17252
SCIP_RETCODE SCIPrelaxationFree(SCIP_RELAXATION **relaxation)
Definition: relax.c:603
void SCIPsepaSetInitsol(SCIP_SEPA *sepa, SCIP_DECL_SEPAINITSOL((*sepainitsol)))
Definition: sepa.c:624
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:10605
SCIP_RETCODE SCIPsetSetHeuristics(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: set.c:3418
SCIP_Real SCIPlpGetRootLooseObjval(SCIP_LP *lp)
Definition: lp.c:16909
SCIP_RETCODE SCIPincludeNlpi(SCIP *scip, SCIP_NLPI *nlpi)
Definition: scip.c:9540
SCIP_RETCODE SCIPsetSepaExitsol(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAEXITSOL((*sepaexitsol)))
Definition: scip.c:7507
SCIP_SOL * SCIPreoptGetLastBestSol(SCIP_REOPT *reopt)
Definition: reopt.c:5649
SCIP_RETCODE SCIPnlpEndDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: nlp.c:6155
SCIP_RETCODE SCIPcheckSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *feasible)
Definition: scip.c:40980
internal methods for user interface dialog
int SCIPgetNExternalCodes(SCIP *scip)
Definition: scip.c:9670
int SCIPreoptnodeGetNChildren(SCIP_REOPTNODE *reoptnode)
Definition: reopt.c:5831
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:3909
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:6348
int SCIPtreeGetEffectiveRootDepth(SCIP_TREE *tree)
Definition: tree.c:8341
#define SCIP_Bool
Definition: def.h:61
void SCIPlpRecomputeLocalAndGlobalPseudoObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:12714
SCIP_RETCODE SCIPsetProbTrans(SCIP *scip, SCIP_DECL_PROBTRANS((*probtrans)))
Definition: scip.c:10038
SCIP_RETCODE SCIPgetNLPStatistics(SCIP *scip, SCIP_NLPSTATISTICS *statistics)
Definition: scip.c:31663
SCIP_Bool SCIPinterrupted(void)
Definition: interrupt.c:147
#define SCIP_DECL_SEPAINIT(x)
Definition: type_sepa.h:63
SCIP_RETCODE SCIPchgRowRhs(SCIP *scip, SCIP_ROW *row, SCIP_Real rhs)
Definition: scip.c:30585
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:23142
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:753
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: scip.c:41158
#define SCIP_DECL_PRICERINITSOL(x)
Definition: type_pricer.h:81
SCIP_Real SCIPreaderGetReadingTime(SCIP_READER *reader)
Definition: reader.c:565
int SCIPgetMaxTotalDepth(SCIP *scip)
Definition: scip.c:43119
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
Definition: scip.c:29293
SCIP_Real SCIPsetSumepsilon(SCIP_SET *set)
Definition: set.c:5668
SCIP_RETCODE SCIPfreeSyncstore(SCIP *scip)
Definition: scip.c:41985
SCIP_RETCODE SCIPsetConsLocal(SCIP *scip, SCIP_CONS *cons, SCIP_Bool local)
Definition: scip.c:27986
SCIP_DECL_CONSPROP(ConshdlrSubtour::scip_prop)
int SCIPgetNImplVars(SCIP *scip)
Definition: scip.c:11947
void SCIPsetSortSepasName(SCIP_SET *set)
Definition: set.c:4043
int SCIPbranchcandGetNPrioExternConts(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:556
SCIP_Longint ndualresolvelps
Definition: struct_stat.h:183
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:9351
#define SCIP_DECL_PRESOLEXITPRE(x)
Definition: type_presol.h:102
SCIP_Real SCIPgetObjlimit(SCIP *scip)
Definition: scip.c:11316
#define SCIP_DECL_PROBEXITSOL(x)
Definition: type_prob.h:110
void SCIPvarCapture(SCIP_VAR *var)
Definition: var.c:2753
SCIP_RETCODE SCIPincludeReaderBasic(SCIP *scip, SCIP_READER **readerptr, const char *name, const char *desc, const char *extension, SCIP_READERDATA *readerdata)
Definition: scip.c:5264
SCIP_RETCODE SCIPcreateSolCopyOrig(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol)
Definition: scip.c:38208
SCIP_CLOCK * sbsoltime
Definition: struct_stat.h:156
#define SCIP_DECL_NODESELEXIT(x)
Definition: type_nodesel.h:72
void SCIPreaderSetWrite(SCIP_READER *reader, SCIP_DECL_READERWRITE((*readerwrite)))
Definition: reader.c:504
SCIP_Real SCIPgetRowPseudoActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:31014
SCIP_Real SCIPpresolGetTime(SCIP_PRESOL *presol)
Definition: presol.c:661
SCIP_RETCODE SCIPsetIncludeTable(SCIP_SET *set, SCIP_TABLE *table)
Definition: set.c:4687
SCIP_Longint SCIPconshdlrGetNEnfoRelaxCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4719
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
Definition: event.c:959
SCIP_RETCODE SCIPsetSetBarrierconvtol(SCIP_SET *set, SCIP_Real barrierconvtol)
Definition: set.c:5445
#define BMSreallocBlockMemorySize(mem, ptr, oldsize, newsize)
Definition: memory.h:437
SCIP_Bool SCIPprobIsPermuted(SCIP_PROB *prob)
Definition: prob.c:2220
SCIP_NODESEL * SCIPsetFindNodesel(SCIP_SET *set, const char *name)
Definition: set.c:4503
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 SCIPgetOrigObjscale(SCIP *scip)
Definition: scip.c:11168
SCIP_RETCODE SCIPchgNlRowConstant(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real constant)
Definition: scip.c:32367
SCIP_Real ub
Definition: struct_var.h:162
SCIP_RETCODE SCIPconsAddAge(SCIP_CONS *cons, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_Real deltaage, SCIP_REOPT *reopt)
Definition: cons.c:6978
SCIP_CLOCK * presolvingtime
Definition: struct_stat.h:144
void SCIPprintVersion(SCIP *scip, FILE *file)
Definition: scip.c:611
SCIP_RETCODE SCIPwriteTransProblem(SCIP *scip, const char *filename, const char *extension, SCIP_Bool genericnames)
Definition: scip.c:10473
SCIP_Longint SCIPsolGetNodenum(SCIP_SOL *sol)
Definition: sol.c:2528
int ncontvars
Definition: struct_prob.h:65
void SCIPprintRelaxatorStatistics(SCIP *scip, FILE *file)
Definition: scip.c:45206
void SCIPinterruptFree(SCIP_INTERRUPT **interrupt)
Definition: interrupt.c:89
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:5543
SCIP_Bool SCIPisSumLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47223
void SCIPprintSysError(const char *message)
Definition: misc.c:9920
SCIP_NODE ** children
Definition: struct_tree.h:188
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:116
SCIP_RETCODE SCIPconsEnfops(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool solinfeasible, SCIP_Bool objinfeasible, SCIP_RESULT *result)
Definition: cons.c:7241
int SCIPgetNCliquesCreated(SCIP *scip)
Definition: scip.c:24906
void SCIPprintTreeStatistics(SCIP *scip, FILE *file)
Definition: scip.c:45241
SCIP_Bool SCIPnlpHasCurrentNodeNLP(SCIP_NLP *nlp)
Definition: nlp.c:5281
SCIP_RETCODE SCIPrecalcNlRowNLPActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip.c:32701
SCIP_Longint SCIPconflictGetNDualrayInfNonzeros(SCIP_CONFLICT *conflict)
Definition: conflict.c:8563
int nbinvars
Definition: struct_prob.h:62
SCIP_RETCODE SCIPprintRay(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:39747
SCIP_RETCODE SCIPvalidateSolve(SCIP *scip, SCIP_Real primalreference, SCIP_Real dualreference, SCIP_Real reftol, SCIP_Bool quiet, SCIP_Bool *feasible, SCIP_Bool *primalboundcheck, SCIP_Bool *dualboundcheck)
Definition: scip.c:48435
enum SCIP_Objsense SCIP_OBJSENSE
Definition: type_prob.h:41
SCIP_RETCODE SCIPlpFree(SCIP_LP **lp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter)
Definition: lp.c:9159
SCIP_RETCODE SCIPprintBestTransSol(SCIP *scip, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:39988
enum SCIP_Status SCIP_STATUS
Definition: type_stat.h:57
#define SCIP_DECL_DISPFREE(x)
Definition: type_disp.h:79
SCIP_NLPSOLSTAT SCIPnlpGetSolstat(SCIP_NLP *nlp)
Definition: nlp.c:5975
SCIP_RETCODE SCIPsetComprExitsol(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPREXITSOL((*comprexitsol)))
Definition: scip.c:8443
SCIP_Bool SCIPlpiIsDualFeasible(SCIP_LPI *lpi)
void SCIPconsSetModifiable(SCIP_CONS *cons, SCIP_Bool modifiable)
Definition: cons.c:6569
void SCIPprintSolutionStatistics(SCIP *scip, FILE *file)
Definition: scip.c:45291
SCIP_Real SCIPconshdlrGetPresolTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4599
int SCIPpresolGetNCalls(SCIP_PRESOL *presol)
Definition: presol.c:771
SCIP_Bool SCIPconflictApplicable(SCIP_SET *set)
Definition: conflict.c:3623
SCIP_VAR ** origobjvars
Definition: struct_tree.h:52
int npresolrounds
Definition: struct_stat.h:223
#define SCIP_DECL_PROPFREE(x)
Definition: type_prop.h:55
SCIP_Longint SCIPsepaGetNConssFound(SCIP_SEPA *sepa)
Definition: sepa.c:853
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:30402
SCIP_RETCODE SCIPnlrowCreate(SCIP_NLROW **nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, const char *name, SCIP_Real constant, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nquadvars, SCIP_VAR **quadvars, int nquadelems, SCIP_QUADELEM *quadelems, SCIP_EXPRTREE *exprtree, SCIP_Real lhs, SCIP_Real rhs, SCIP_EXPRCURV curvature)
Definition: nlp.c:2000
SCIP_Longint nearlybacktracks
Definition: struct_stat.h:83
SCIP_Bool SCIPcutpoolIsCutNew(SCIP_CUTPOOL *cutpool, SCIP_SET *set, SCIP_ROW *row)
Definition: cutpool.c:583
SCIP_RETCODE SCIPtreeStartProbing(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp, SCIP_RELAXATION *relaxation, SCIP_PROB *transprob, SCIP_Bool strongbranching)
Definition: tree.c:6342
SCIP_RETCODE SCIProundSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *success)
Definition: scip.c:40024
SCIP_RETCODE SCIPsetObjlimit(SCIP *scip, SCIP_Real objlimit)
Definition: scip.c:11246
SCIP_RETCODE SCIPsolIncVal(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_VAR *var, SCIP_Real incval)
Definition: sol.c:1222
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:4882
SCIP_RETCODE SCIPautoselectDisps(SCIP *scip)
Definition: scip.c:9428
SCIP_RETCODE SCIPconsRelease(SCIP_CONS **cons, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: cons.c:6112
SCIP_Real SCIPgetClockTime(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip.c:46247
SCIP_RETCODE SCIPupdateNlpiProb(SCIP *scip, SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *nlpiprob, SCIP_HASHMAP *var2nlpiidx, SCIP_VAR **nlpivars, int nlpinvars, SCIP_Real cutoffbound)
Definition: scip.c:34355
int SCIPgetNPricers(SCIP *scip)
Definition: scip.c:5707
#define SCIP_DECL_TABLECOPY(x)
Definition: type_table.h:53
SCIP_CONSHDLR * conshdlr
Definition: struct_cons.h:44
SCIP_Real SCIPgetPseudocostVariance(SCIP *scip, SCIP_BRANCHDIR branchdir, SCIP_Bool onlycurrentrun)
Definition: scip.c:43791
int SCIPvarGetBranchPriority(SCIP_VAR *var)
Definition: var.c:17448
SCIP_SYNCSTORE * SCIPgetSyncstore(SCIP *scip)
Definition: scip.c:42017
void SCIPconshdlrSetDelete(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
Definition: cons.c:4326
int SCIPgetDepth(SCIP *scip)
Definition: scip.c:43045
SCIP_Real lastlowerbound
Definition: struct_stat.h:135
SCIP_RETCODE SCIPaddReoptnodeCons(SCIP *scip, SCIP_REOPTNODE *reoptnode, SCIP_VAR **vars, SCIP_Real *vals, SCIP_BOUNDTYPE *boundtypes, SCIP_Real lhs, SCIP_Real rhs, int nvars, REOPT_CONSTYPE constype, SCIP_Bool linear)
Definition: scip.c:16928
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:276
SCIP_Real SCIPlpfeastol(SCIP *scip)
Definition: scip.c:46457
SCIP_RETCODE SCIPstatCreate(SCIP_STAT **stat, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_MESSAGEHDLR *messagehdlr)
Definition: stat.c:45
SCIP_RETCODE SCIPsyncstoreInit(SCIP *scip)
Definition: syncstore.c:126
SCIP_RETCODE SCIPnlpAddNlRow(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLROW *nlrow)
Definition: nlp.c:5438
SCIP_RETCODE SCIPupdateNodeDualbound(SCIP *scip, SCIP_NODE *node, SCIP_Real newbound)
Definition: scip.c:13558
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:8569
void SCIPtreeGetDiveBoundChangeData(SCIP_TREE *tree, SCIP_VAR ***variables, SCIP_BRANCHDIR **directions, SCIP_Real **values, int *ndivebdchgs, SCIP_Bool preferred)
Definition: tree.c:6220
SCIP_RETCODE SCIPupdateNodeLowerbound(SCIP *scip, SCIP_NODE *node, SCIP_Real newbound)
Definition: scip.c:13580
SCIP_Real SCIPgetGap(SCIP *scip)
Definition: scip.c:43536
SCIP_Real SCIPgetAvgConflictlengthScoreCurrentRun(SCIP *scip)
Definition: scip.c:43940
void SCIPnodeselSetMemsavePriority(SCIP_NODESEL *nodesel, SCIP_SET *set, int priority)
Definition: nodesel.c:1055
internal methods for input file readers
int SCIPgetRowNumIntCols(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30853
SCIP_RETCODE SCIPlpGetBInvRow(SCIP_LP *lp, int r, SCIP_Real *coef, int *inds, int *ninds)
Definition: lp.c:9634
void SCIPconshdlrSetInit(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINIT((*consinit)))
Definition: cons.c:4231
int mem_arraygrowinit
Definition: struct_set.h:342
SCIP_RETCODE SCIPchgVarUbDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:35477
void SCIPclockFree(SCIP_CLOCK **clck)
Definition: clock.c:175
int SCIPvarGetNImpls(SCIP_VAR *var, SCIP_Bool varfixing)
Definition: var.c:17554
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:2669
SCIP_RETCODE SCIPrealarrayFree(SCIP_REALARRAY **realarray)
Definition: misc.c:3655
SCIP_MULTAGGR multaggr
Definition: struct_var.h:226
SCIP_RETCODE SCIPdialoghdlrAddInputLine(SCIP_DIALOGHDLR *dialoghdlr, const char *inputline)
Definition: dialog.c:689
SCIP_RETCODE SCIPchgLongintParam(SCIP *scip, SCIP_PARAM *param, SCIP_Longint value)
Definition: scip.c:4720
int SCIPgetNPrioPseudoBranchCands(SCIP *scip)
Definition: scip.c:37384
SCIP_RETCODE SCIPvarChgUbDive(SCIP_VAR *var, SCIP_SET *set, SCIP_LP *lp, SCIP_Real newbound)
Definition: var.c:7972
SCIP_RETCODE SCIPsetGetIntParam(SCIP_SET *set, const char *name, int *value)
Definition: set.c:2966
SCIP_RETCODE SCIPnlpFlush(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: nlp.c:5521
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
Definition: scip.c:29091
SCIP_RETCODE SCIPcaptureRow(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30518
SCIP_RETCODE SCIPstartSolvingTime(SCIP *scip)
Definition: scip.c:46198
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:20862
void SCIPsolResetViolations(SCIP_SOL *sol)
Definition: sol.c:2282
SCIP_HEUR ** heurs
Definition: struct_set.h:79
SCIP_Bool SCIPlpDivingObjChanged(SCIP_LP *lp)
Definition: lp.c:17002
SCIP_Bool branch_roundsbsol
Definition: struct_set.h:174
SCIP_RETCODE SCIPwriteImplicationConflictGraph(SCIP *scip, const char *filename)
Definition: scip.c:45939
SCIP_RETCODE SCIPgetNLPVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars)
Definition: scip.c:31270
SCIP_RETCODE SCIPsetIncludeExternalCode(SCIP_SET *set, const char *name, const char *description)
Definition: set.c:4847
SCIP_Longint nrepropcutoffs
Definition: struct_stat.h:89
int SCIPvarGetNLocksUp(SCIP_VAR *var)
Definition: var.c:3217
SCIP_RETCODE SCIPconflictAnalyzeStrongbranch(SCIP_CONFLICT *conflict, SCIP_CONFLICTSTORE *conflictstore, 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:8296
void SCIPmessagehdlrSetQuiet(SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: message.c:401
#define SCIP_DECL_CONSEXITPRE(x)
Definition: type_cons.h:164
int probingsumchgdobjs
Definition: struct_tree.h:221
SCIP_RETCODE SCIPcliquetableComputeCliqueComponents(SCIP_CLIQUETABLE *cliquetable, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR **vars, int nbinvars, int nintvars, int nimplvars)
Definition: implics.c:3104
#define MAX(x, y)
Definition: tclique_def.h:75
SCIP_Bool SCIPstrToRealValue(const char *str, SCIP_Real *value, char **endptr)
Definition: misc.c:10082
SCIP_Bool SCIPisLPPrimalReliable(SCIP *scip)
Definition: scip.c:29314
SCIP_RETCODE SCIPsolRetransform(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *origprob, SCIP_PROB *transprob, SCIP_Bool *hasinfval)
Definition: sol.c:1815
SCIP_RETCODE SCIPchgVarsBoundsDiveNLP(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_Real *lbs, SCIP_Real *ubs)
Definition: scip.c:32127
void SCIPprobSetTrans(SCIP_PROB *prob, SCIP_DECL_PROBTRANS((*probtrans)))
Definition: prob.c:339
void SCIPsetSortNlpis(SCIP_SET *set)
Definition: set.c:4819
#define BMSgarbagecollectBlockMemory(mem)
Definition: memory.h:453
int nreaders
Definition: struct_set.h:95
SCIP_RETCODE SCIPtrySolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition: scip.c:40794
SCIP_RETCODE SCIPsetCopyParams(SCIP_SET *sourceset, SCIP_SET *targetset, SCIP_MESSAGEHDLR *messagehdlr)
Definition: set.c:1090
void SCIPsetMessagehdlrQuiet(SCIP *scip, SCIP_Bool quiet)
Definition: scip.c:1255
SCIP_RETCODE SCIPsolMarkPartial(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR **vars, int nvars)
Definition: sol.c:1528
#define SCIP_DECL_PRESOLINIT(x)
Definition: type_presol.h:62
SCIP_RETCODE SCIPgetDiveBoundChanges(SCIP *scip, SCIP_DIVESET *diveset, SCIP_SOL *sol, SCIP_Bool *success, SCIP_Bool *infeasible)
Definition: scip.c:36853
int SCIPpropGetNChgCoefs(SCIP_PROP *prop)
Definition: prop.c:1192
SCIP_Longint SCIPgetNPrimalLPs(SCIP *scip)
Definition: scip.c:42414
void SCIPactivateSolViolationUpdates(SCIP *scip)
Definition: scip.c:13814
SCIP_RETCODE SCIPsetRelaxSolVals(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Bool includeslp)
Definition: scip.c:19966
SCIP_RETCODE SCIPaddPoolCut(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:34772
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 mipstart, SCIP_Bool printzeros)
Definition: sol.c:2037
SCIP_Real SCIPsetDualfeasFrac(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6585
SCIP_RETCODE SCIPcalcCliquePartition(SCIP *const scip, SCIP_VAR **const vars, int const nvars, int *const cliquepartition, int *const ncliques)
Definition: scip.c:24559
SCIP_VAR * SCIPboundchgGetVar(SCIP_BOUNDCHG *boundchg)
Definition: var.c:16569
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
Definition: cons.c:8006
SCIP_SOL ** partialsols
Definition: struct_primal.h:49
SCIP_RETCODE SCIPfreeConcurrent(SCIP *scip)
Definition: concurrent.c:142
SCIP_RETCODE SCIPgetNlRowPseudoFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *pseudofeasibility)
Definition: scip.c:32827
SCIP_RETCODE SCIPgetNlRowActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *activity)
Definition: scip.c:32877
methods for debugging
SCIP_RETCODE SCIPaddConflictRelaxedUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedub)
Definition: scip.c:27286
SCIP_Bool * SCIPcliqueGetValues(SCIP_CLIQUE *clique)
Definition: implics.c:3365
void SCIPheurSetFree(SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
Definition: heur.c:1143
SCIP_RETCODE SCIPaddConflictBd(SCIP *scip, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx)
Definition: scip.c:27319
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:5222
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition: scip.c:4688
SCIP_BOUNDCHG * SCIPdomchgGetBoundchg(SCIP_DOMCHG *domchg, int pos)
Definition: var.c:16617
int SCIPreoptGetNTotalCutoffReoptnodes(SCIP_REOPT *reopt)
Definition: reopt.c:5003
void SCIPsolUpdateConsViolation(SCIP_SOL *sol, SCIP_Real absviolcons, SCIP_Real relviolcons)
Definition: sol.c:2335
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, unsigned int initialseed, SCIP_Bool backtrack, SCIP_Bool onlylpbranchcands, SCIP_Bool specificsos1score, SCIP_DECL_DIVESETGETSCORE((*divesetgetscore)))
Definition: scip.c:8521
int SCIPsubversion(void)
Definition: scip.c:600
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:30431
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:1467
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
Definition: cons.c:8115
SCIP_Longint lastdivenode
Definition: struct_stat.h:100
SCIP_Longint SCIPconshdlrGetNEnfoPSCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4709
void SCIPnodeselSetExit(SCIP_NODESEL *nodesel, SCIP_DECL_NODESELEXIT((*nodeselexit)))
Definition: nodesel.c:1125
SCIP_RETCODE SCIPsepastoreFree(SCIP_SEPASTORE **sepastore)
Definition: sepastore.c:99
SCIP_RETCODE SCIPincludeCorePlugins(SCIP *scip)
SCIP_RETCODE SCIPchgRowLhs(SCIP *scip, SCIP_ROW *row, SCIP_Real lhs)
Definition: scip.c:30561
const char * SCIPpresolGetName(SCIP_PRESOL *presol)
Definition: presol.c:553
SCIP_Bool SCIPsetIsRelLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6683
unsigned int SCIPinitializeRandomSeed(SCIP *scip, int initialseedvalue)
Definition: scip.c:25905
#define SCIP_DECL_PROPINITSOL(x)
Definition: type_prop.h:115
int lastnpresolchgcoefs
Definition: struct_stat.h:245
SCIP_Real SCIPgetCutEfficacy(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut)
Definition: scip.c:34505
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:4113
SCIP_RETCODE SCIPsetConshdlrDisable(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDISABLE((*consdisable)))
Definition: scip.c:6452
SCIP_RETCODE SCIPwriteCliqueGraph(SCIP *scip, const char *fname, SCIP_Bool writenodeweights)
Definition: scip.c:25015
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip.c:41192
SCIP_Real SCIPsetDualfeasRound(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6574
SCIP_RETCODE SCIPsetRelaxSolValsSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool includeslp)
Definition: scip.c:20006
void SCIPconsSetRemovable(SCIP_CONS *cons, SCIP_Bool removable)
Definition: cons.c:6591
SCIP_Real SCIPvarGetMultaggrUbGlobal(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:8265
SCIP_Real SCIPnextafter(SCIP_Real from, SCIP_Real to)
Definition: misc.c:8691
int SCIPpropGetNFixedVars(SCIP_PROP *prop)
Definition: prop.c:1112
void SCIPpresolSetInit(SCIP_PRESOL *presol, SCIP_DECL_PRESOLINIT((*presolinit)))
Definition: presol.c:509
SCIP_RETCODE SCIPfreeSol(SCIP *scip, SCIP_SOL **sol)
Definition: scip.c:38535
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
Definition: cons.c:8185
SCIP_Bool SCIPprobAllColsInLP(SCIP_PROB *prob, SCIP_SET *set, SCIP_LP *lp)
Definition: prob.c:2262
SCIP_RETCODE SCIPsetBranchruleExitsol(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXITSOL((*branchexitsol)))
Definition: scip.c:9203
SCIP_RETCODE SCIPprobRemoveConsName(SCIP_PROB *prob, SCIP_CONS *cons)
Definition: prob.c:1244
void SCIPenableVarHistory(SCIP *scip)
Definition: scip.c:25958
SCIP_RETCODE SCIPsetPricerFree(SCIP *scip, SCIP_PRICER *pricer, SCIP_DECL_PRICERFREE((*pricerfree)))
Definition: scip.c:5569
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
Definition: cons.c:8155
SCIP_Real SCIPclockGetTimeOfDay(void)
Definition: clock.c:600
SCIP_Real SCIPcomputeVarLbGlobal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23777
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
Definition: var.c:17124
int parallel_minnthreads
Definition: struct_set.h:513
SCIP_Real SCIPgetVarAvgInferenceCutoffScoreCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_Real cutoffweight)
Definition: scip.c:27051
SCIP_RETCODE SCIPconshdlrSetPresol(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
Definition: cons.c:4297
SCIP_Real SCIPconshdlrGetPropTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4649
SCIP_RETCODE SCIPsetBranchruleExecExt(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECEXT((*branchexecext)))
Definition: scip.c:9237
SCIP_RETCODE SCIPsetPropCopy(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPCOPY((*propcopy)))
Definition: scip.c:7695
SCIP_RETCODE SCIPcutpoolCreate(SCIP_CUTPOOL **cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, int agelimit, SCIP_Bool globalcutpool)
Definition: cutpool.c:417
#define SCIP_DECL_TABLEEXIT(x)
Definition: type_table.h:77
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip.c:41272
SCIP_RETCODE SCIPnlrowGetNLPActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_Real *activity)
Definition: nlp.c:2925
SCIP_Real SCIPbdchginfoGetNewbound(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:17868
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:21390
SCIP_Longint SCIPconflictGetNStrongbranchConflictConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:8623
SCIP_RETCODE SCIPsetIntarrayVal(SCIP *scip, SCIP_INTARRAY *intarray, int idx, int val)
Definition: scip.c:48100
static const unsigned int randseed
Definition: circle.c:46
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:6645
SCIP_RETCODE SCIPaddReoptnodeBndchg(SCIP *scip, SCIP_REOPTNODE *reoptnode, SCIP_VAR *var, SCIP_Real bound, SCIP_BOUNDTYPE boundtype)
Definition: scip.c:16872
SCIP_Real SCIPcalcNodeselPriority(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR branchdir, SCIP_Real targetvalue)
Definition: scip.c:37527
SCIP_Real SCIPgetLPRootLooseObjval(SCIP *scip)
Definition: scip.c:29543
SCIP_VAR * SCIPvarGetAggrVar(SCIP_VAR *var)
Definition: var.c:17011
int SCIPpropGetNAddConss(SCIP_PROP *prop)
Definition: prop.c:1172
SCIP_RETCODE SCIPsetBranchruleMaxdepth(SCIP *scip, SCIP_BRANCHRULE *branchrule, int maxdepth)
Definition: scip.c:9321
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:17619
void SCIPmarkColNotRemovableLocal(SCIP *scip, SCIP_COL *col)
Definition: scip.c:30247
SCIP_Real SCIPconshdlrGetEnfoRelaxTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4639
SCIP_Real SCIPgetReoptSimilarity(SCIP *scip, int run1, int run2)
Definition: scip.c:17442
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_RETCODE SCIPprintDualSol(SCIP *scip, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:39714
SCIP_RETCODE SCIPaddExternBranchCand(SCIP *scip, SCIP_VAR *var, SCIP_Real score, SCIP_Real solval)
Definition: scip.c:37272
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:610
SCIP_Longint SCIPgetNConflictConssFound(SCIP *scip)
Definition: scip.c:42962
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:13644
#define SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA(x)
int SCIPsyncstoreGetWinner(SCIP_SYNCSTORE *syncstore)
Definition: syncstore.c:515
SCIP_Real SCIPgetAvgCutoffsCurrentRun(SCIP *scip, SCIP_BRANCHDIR dir)
Definition: scip.c:44069
SCIP_RETCODE SCIPsetStringParam(SCIP *scip, const char *name, const char *value)
Definition: scip.c:4920
SCIP_Real SCIPvarGetAvgInferencesCurrentRun(SCIP_VAR *var, SCIP_STAT *stat, SCIP_BRANCHDIR dir)
Definition: var.c:15528
int SCIPgetNSols(SCIP *scip)
Definition: scip.c:39783
SCIP_Bool SCIPtreeHasCurrentNodeLP(SCIP_TREE *tree)
Definition: tree.c:8319
int SCIPboolarrayGetMinIdx(SCIP_BOOLARRAY *boolarray)
Definition: misc.c:4683
void SCIPprintNLPStatistics(SCIP *scip, FILE *file)
Definition: scip.c:45180
SCIP_RETCODE SCIPdialoghdlrSetRoot(SCIP *scip, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog)
Definition: dialog.c:404
#define SCIP_PRESOLTIMING_ALWAYS
Definition: type_timing.h:49
SCIP_RETCODE SCIPsetReaderWrite(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERWRITE((*readerwrite)))
Definition: scip.c:5374
SCIP_Real limit_memory
Definition: struct_set.h:268
SCIP_RETCODE SCIPlpCreate(SCIP_LP **lp, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, const char *name)
Definition: lp.c:8882
SCIP_RETCODE SCIPsetNodeselInitsol(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELINITSOL((*nodeselinitsol)))
Definition: scip.c:8925
SCIP_RETCODE SCIPgetDualSolVal(SCIP *scip, SCIP_CONS *cons, SCIP_Real *dualsolval, SCIP_Bool *boundconstraint)
Definition: scip.c:39507
SCIP_Real SCIPgetLPRootColumnObjval(SCIP *scip)
Definition: scip.c:29520
SCIP_RETCODE SCIPsetSetDefaultBoolParam(SCIP_SET *set, const char *name, SCIP_Bool defaultvalue)
Definition: set.c:3102
SCIP_RETCODE SCIPretransformSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:40060
SCIP_Longint SCIPgetNDualResolveLPs(SCIP *scip)
Definition: scip.c:42598
SCIP_RETCODE SCIPnlrowChgExprtree(SCIP_NLROW *nlrow, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp, SCIP_EXPRTREE *exprtree)
Definition: nlp.c:2688
SCIP_RETCODE SCIPsepasolCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_RESULT *result)
Definition: scip.c:28865
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_CONFLICTSTORE *conflictstore, SCIP_PROB **target)
Definition: prob.c:504
SCIP_RETCODE SCIPupdateLocalDualbound(SCIP *scip, SCIP_Real newbound)
Definition: scip.c:13469
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
Definition: scip.c:25575
#define SCIPreallocMemoryArray(scip, ptr, newnum)
Definition: scip.h:22559
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:2908
#define BMScopyMemoryArray(ptr, source, num)
Definition: memory.h:116
#define SCIP_DECL_DIALOGFREE(x)
Definition: type_dialog.h:61
#define SCIP_DECL_COMPREXIT(x)
Definition: type_compr.h:73
SCIP_Longint SCIPgetNDualLPIterations(SCIP *scip)
Definition: scip.c:42468
SCIP_RETCODE SCIPsetSetCharParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, char value)
Definition: set.c:3268
SCIP_Bool SCIPsetIsSumNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6119
SCIP_RETCODE SCIPchgVarBranchPriority(SCIP *scip, SCIP_VAR *var, int branchpriority)
Definition: scip.c:25285
int SCIPgetNRuns(SCIP *scip)
Definition: scip.c:42050
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:16956
SCIP_Real maxcopytime
Definition: struct_stat.h:126
int SCIPnlpGetNVars(SCIP_NLP *nlp)
Definition: nlp.c:5798
SCIP_RETCODE SCIPsetPropPresolPriority(SCIP *scip, SCIP_PROP *prop, int presolpriority)
Definition: scip.c:7925
SCIP_RETCODE SCIPlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
Definition: scip.c:21714
SCIP_RETCODE SCIPcreateEmptyNlRow(SCIP *scip, SCIP_NLROW **nlrow, const char *name, SCIP_Real lhs, SCIP_Real rhs)
Definition: scip.c:32227
int ntables
Definition: struct_set.h:124
int SCIPconflictGetNConflicts(SCIP_CONFLICT *conflict)
Definition: conflict.c:3488
void SCIPsolUpdateBoundViolation(SCIP_SOL *sol, SCIP_Real absviolbounds, SCIP_Real relviolbounds)
Definition: sol.c:2309
SCIP_HEUR * SCIPsetFindHeur(SCIP_SET *set, const char *name)
Definition: set.c:4305
SCIP_COL * SCIPvarGetCol(SCIP_VAR *var)
Definition: var.c:16990
SCIP_Longint SCIPconflictGetNBoundexceedingLPCalls(SCIP_CONFLICT *conflict)
Definition: conflict.c:8219
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:533
SCIP_RETCODE SCIPgetLPBasisInd(SCIP *scip, int *basisind)
Definition: scip.c:29756
SCIP_RETCODE SCIPenfolpCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool solinfeasible, SCIP_RESULT *result)
Definition: scip.c:28749
SCIP_RETCODE SCIPreoptnodeAddBndchg(SCIP_REOPTNODE *reoptnode, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR *var, SCIP_Real val, SCIP_BOUNDTYPE boundtype)
Definition: reopt.c:7974
SCIP_Real SCIPgetSolOrigObj(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38994
#define SCIP_PROPTIMING_BEFORELP
Definition: type_timing.h:56
int SCIPtechVersion(void)
Definition: scip.c:589
SCIP_RETCODE SCIPcaptureNlRow(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip.c:32276
reoptsols primal heuristic
SCIP_Real SCIPbranchGetScoreMultiple(SCIP_SET *set, SCIP_VAR *var, int nchildren, SCIP_Real *gains)
Definition: branch.c:2211
SCIP_COL ** SCIPgetLPCols(SCIP *scip)
Definition: scip.c:29597
SCIP_RETCODE SCIPnlrowGetActivityBounds(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *minactivity, SCIP_Real *maxactivity)
Definition: nlp.c:3179
SCIP_RETCODE SCIPstartInteraction(SCIP *scip)
Definition: scip.c:9898
#define SCIPallocMemoryArray(scip, ptr, num)
Definition: scip.h:22553
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint)))
Definition: scip.c:6498
internal methods for storing cuts in a cut pool
char sepa_efficacynorm
Definition: struct_set.h:490
SCIP_RETCODE SCIPchgFeastol(SCIP *scip, SCIP_Real feastol)
Definition: scip.c:46529
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:5624
SCIP_RETCODE SCIPsetConflicthdlrCopy(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTCOPY((*conflictcopy)))
Definition: scip.c:6720
SCIP_RETCODE SCIPfixParam(SCIP *scip, const char *name)
Definition: scip.c:4549
void SCIPpresolSetExit(SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXIT((*presolexit)))
Definition: presol.c:520
static SCIP_Real getLowerbound(SCIP *scip)
Definition: scip.c:479
SCIP_DISP * SCIPsetFindDisp(SCIP_SET *set, const char *name)
Definition: set.c:4667
Constraint handler for linear constraints in their most general form, .
SCIP_RETCODE SCIPflushLP(SCIP *scip)
Definition: scip.c:29273
SCIP_RETCODE SCIPcreateUnknownSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:38083
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:2077
int SCIPgetNObjVars(SCIP *scip)
Definition: scip.c:12040
void SCIPbranchruleSetExecPs(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECPS((*branchexecps)))
Definition: branch.c:1921
SCIP_Real SCIPvarGetRelaxSol(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:13329
SCIP_Longint SCIPgetNConflictConssApplied(SCIP *scip)
Definition: scip.c:43019
int nconflicthdlrs
Definition: struct_set.h:102
SCIP_Real SCIPpropGetStrongBranchPropTime(SCIP_PROP *prop)
Definition: prop.c:1012
SCIP_Bool SCIPisRealParamValid(SCIP *scip, SCIP_PARAM *param, SCIP_Real value)
Definition: scip.c:4819
SCIP_Bool SCIPisCutApplicable(SCIP *scip, SCIP_ROW *cut)
Definition: scip.c:34618
SCIP_Real SCIProwGetSolEfficacy(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol)
Definition: lp.c:6671
SCIP_Longint SCIPgetNObjlimLeaves(SCIP *scip)
Definition: scip.c:42259
SCIP_RETCODE SCIPsetIncludeNodesel(SCIP_SET *set, SCIP_NODESEL *nodesel)
Definition: set.c:4472
#define SCIP_DECL_SEPAEXITSOL(x)
Definition: type_sepa.h:93
SCIP_Real SCIPdualfeasFrac(SCIP *scip, SCIP_Real val)
Definition: scip.c:47632
int SCIPvarGetMultaggrNVars(SCIP_VAR *var)
Definition: var.c:17044
SCIP_Bool SCIPisSumRelGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47791
#define SCIP_DECL_SEPAEXECSOL(x)
Definition: type_sepa.h:140
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
Definition: scip.c:47039
int reopt_savesols
Definition: struct_set.h:449
SCIP_Real ub
Definition: struct_lp.h:130
SCIP_Real SCIPgetTimeOfDay(SCIP *scip)
Definition: scip.c:45999
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_Real SCIPgetRowSolActivity(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
Definition: scip.c:31111
SCIP_Bool cutoffdelayed
Definition: struct_tree.h:225
#define SCIP_DECL_CONCSOLVERTYPEFREEDATA(x)
SCIP_Real * SCIPvarGetImplBounds(SCIP_VAR *var, SCIP_Bool varfixing)
Definition: var.c:17600
SCIP_RETCODE SCIPpricerActivate(SCIP_PRICER *pricer, SCIP_SET *set)
Definition: pricer.c:305
#define BMSclearMemory(ptr)
Definition: memory.h:111
int SCIPconvertRealToInt(SCIP *scip, SCIP_Real real)
Definition: scip.c:47806
SCIP_RETCODE SCIPvarGetOrigvarSum(SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
Definition: var.c:12184
SCIP_Bool SCIPsetIsFeasLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6196
int SCIPconflictstoreGetMaxPoolSize(SCIP_CONFLICTSTORE *conflictstore)
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:2358
SCIP_RETCODE SCIPchgLpfeastol(SCIP *scip, SCIP_Real lpfeastol, SCIP_Bool printnewvalue)
Definition: scip.c:46547
void SCIPprobSetObjlim(SCIP_PROB *prob, SCIP_Real objlim)
Definition: prob.c:1444
void SCIPbranchcandInvalidate(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:192
SCIP_Longint SCIPconvertRealToLongint(SCIP *scip, SCIP_Real real)
Definition: scip.c:47822
SCIP_RETCODE SCIPcreateRelaxSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:37983
SCIP_Longint SCIPconflictGetNBoundexceedingLPReconvergenceLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:8269
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:22819
int SCIPgetNOrigContVars(SCIP *scip)
Definition: scip.c:12360
SCIP_Bool SCIPsetIsSumEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6007
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:14593
SCIP_RETCODE SCIPtrySol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition: scip.c:40700
SCIP_Bool SCIPisCutNew(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:34754
static SCIP_RETCODE freeReoptSolve(SCIP *scip)
Definition: scip.c:15381
SCIP_RETCODE SCIPsetConshdlrEnable(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENABLE((*consenable)))
Definition: scip.c:6429
SCIP_CLOCK * relaxsoltime
Definition: struct_stat.h:154
SCIP_RETCODE SCIPsetReaderCopy(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
Definition: scip.c:5302
SCIP_NODE * SCIPgetFocusNode(SCIP *scip)
Definition: scip.c:41385
int nfixedvars
Definition: struct_prob.h:68
void SCIPchgDispMode(SCIP_DISP *disp, SCIP_DISPMODE mode)
Definition: scip.c:9441
SCIP_Real SCIPcalcChildEstimate(SCIP *scip, SCIP_VAR *var, SCIP_Real targetvalue)
Definition: scip.c:37554
void SCIPrelaxationSetSolObj(SCIP_RELAXATION *relaxation, SCIP_Real obj)
Definition: relax.c:669
SCIP_Real * SCIPgetNLPVarsLbDualsol(SCIP *scip)
Definition: scip.c:31368
SCIP_RETCODE SCIPdialoghdlrAddHistory(SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, const char *command, SCIP_Bool escapecommand)
Definition: dialog.c:718
SCIP_RETCODE SCIPnlrowGetSolActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol, SCIP_Real *activity)
Definition: nlp.c:3073
SCIP_EVENTHDLR ** SCIPgetEventhdlrs(SCIP *scip)
Definition: scip.c:8754
static SCIP_RETCODE readSolFile(SCIP *scip, const char *filename, SCIP_SOL *sol, SCIP_Bool *partial, SCIP_Bool *error)
Definition: scip.c:40133
void SCIPconshdlrSetGetNVars(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
Definition: cons.c:4458
SCIP_RETCODE SCIPextendPtrarray(SCIP *scip, SCIP_PTRARRAY *ptrarray, int minidx, int maxidx)
Definition: scip.c:48332
SCIP_RETCODE SCIPsetGetCharParam(SCIP_SET *set, const char *name, char *value)
Definition: set.c:3008
#define SCIP_MAXTREEDEPTH
Definition: def.h:286
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:7663
int SCIPgetNConcsolverTypes(SCIP *scip)
Definition: scip.c:8011
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:2170
SCIP_RETCODE SCIPcreatePseudoSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:38010
SCIP * scip
Definition: struct_var.h:201
SCIP_Real SCIPgetTransObjscale(SCIP *scip)
Definition: scip.c:11214
int SCIPpropGetNAggrVars(SCIP_PROP *prop)
Definition: prop.c:1122
SCIP_RETCODE SCIPsetPropExitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol)))
Definition: scip.c:7775
int SCIPgetNBinVars(SCIP *scip)
Definition: scip.c:11857
static SCIP_RETCODE freeSolve(SCIP *scip, SCIP_Bool restart)
Definition: scip.c:15280
int SCIPconshdlrGetNActiveConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4549
SCIP_Longint nnz
Definition: struct_stat.h:170
helper functions for concurrent scip solvers
void SCIPsetEnableOrDisablePluginClocks(SCIP_SET *set, SCIP_Bool enabled)
Definition: set.c:817
SCIP_BDCHGINFO * SCIPvarGetLbchgInfo(SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: var.c:15814
SCIP_TABLE ** tables
Definition: struct_set.h:86
void SCIPconshdlrSetParse(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
Definition: cons.c:4436
SCIP_RETCODE SCIPsetPricerInitsol(SCIP *scip, SCIP_PRICER *pricer, SCIP_DECL_PRICERINITSOL((*pricerinitsol)))
Definition: scip.c:5641
void SCIPsolUpdateIntegralityViolation(SCIP_SOL *sol, SCIP_Real absviolintegrality)
Definition: sol.c:2298
SCIP_PARAM * SCIPsetGetParam(SCIP_SET *set, const char *name)
Definition: set.c:2941
SCIP_Bool SCIPinProbing(SCIP *scip)
Definition: scip.c:35836
SCIP_RETCODE SCIPsolAdjustImplicitSolVals(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_Bool uselprows)
Definition: sol.c:435
SCIP_Real SCIPstatGetPrimalDualIntegral(SCIP_STAT *stat, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob)
Definition: stat.c:489
const char * SCIPpropGetName(SCIP_PROP *prop)
Definition: prop.c:887
SCIP_CLOCK * lexduallptime
Definition: struct_stat.h:148
SCIP_BDCHGINFO * SCIPvarGetUbchgInfo(SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: var.c:15870
SCIP_RETCODE SCIPbranchcandFree(SCIP_BRANCHCAND **branchcand)
Definition: branch.c:173
void SCIPprintPricerStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44860
SCIP_CONCSOLVERTYPE ** SCIPgetConcsolverTypes(SCIP *scip)
Definition: scip.c:8000
SCIP_Longint nnodesbeforefirst
Definition: struct_stat.h:111
SCIP_RETCODE SCIPsetCharParam(SCIP *scip, const char *name, char value)
Definition: scip.c:4862
void SCIPbranchruleSetInitsol(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHINITSOL((*branchinitsol)))
Definition: branch.c:1875
SCIP_NODE * SCIPgetPrioSibling(SCIP *scip)
Definition: scip.c:41617
#define SCIP_DECL_READERCOPY(x)
Definition: type_reader.h:46
SCIP_RETCODE SCIPptrarrayClear(SCIP_PTRARRAY *ptrarray)
Definition: misc.c:4916
SCIP_Real SCIPsetFeasFrac(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6374
static SCIP_RETCODE writeProblem(SCIP *scip, const char *filename, const char *extension, SCIP_Bool transformed, SCIP_Bool genericnames)
Definition: scip.c:10315
int SCIPgetNVars(SCIP *scip)
Definition: scip.c:11812
enum SCIP_ParamEmphasis SCIP_PARAMEMPHASIS
Definition: type_paramset.h:73
SCIP_RETCODE SCIPnlpSolve(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat)
Definition: nlp.c:5558
int SCIPconshdlrGetNPresolCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4959
SCIP_RETCODE SCIPsetComprPriority(SCIP *scip, SCIP_COMPR *compr, int priority)
Definition: scip.c:8496
SCIP_RETCODE SCIPlpReset(SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter)
Definition: lp.c:9203
SCIP_Real SCIPgetVarMultaggrLbLocal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23890
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:4361
int SCIPpresolGetNChgSides(SCIP_PRESOL *presol)
Definition: presol.c:761
#define SCIP_REAL_MAX
Definition: def.h:150
SCIP_Bool SCIPsetIsDualfeasPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6506
SCIP_Real SCIProwGetMaxActivity(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat)
Definition: lp.c:6482
int SCIPparamGetInt(SCIP_PARAM *param)
Definition: paramset.c:716
SCIP_Bool reopt_sepaglbinfsubtrees
Definition: struct_set.h:462
SCIP_Real rhs
Definition: struct_lp.h:196
SCIP_RETCODE SCIPsetGetRealParam(SCIP_SET *set, const char *name, SCIP_Real *value)
Definition: set.c:2994
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:36441
SCIP_Longint SCIPconflictGetNPseudoCalls(SCIP_CONFLICT *conflict)
Definition: conflict.c:8840
SCIP_RETCODE SCIPsyncstoreExit(SCIP_SYNCSTORE *syncstore)
Definition: syncstore.c:190
SCIP_RETCODE SCIPdelDelayedPoolCut(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:35070
void SCIPprimalSetUpdateViolations(SCIP_PRIMAL *primal, SCIP_Bool updateviolations)
Definition: primal.c:1922
SCIP_RETCODE SCIPsyncstoreCreate(SCIP_SYNCSTORE **syncstore)
Definition: syncstore.c:56
SCIP_Longint nrootlpiterations
Definition: struct_stat.h:54
SCIP_Longint SCIPconflictGetNDualrayBndSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:8573
SCIP_RETCODE SCIPwriteVarsLinearsum(SCIP *scip, FILE *file, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_Bool type)
Definition: scip.c:17848
#define SCIP_DECL_VARDELORIG(x)
Definition: type_var.h:109
SCIP_RETCODE SCIPtreeFree(SCIP_TREE **tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: tree.c:4774
SCIP_Real SCIPnodeGetEstimate(SCIP_NODE *node)
Definition: tree.c:7372
void SCIPenableNLP(SCIP *scip)
Definition: scip.c:31218
SCIP_RETCODE SCIPupdateLocalLowerbound(SCIP *scip, SCIP_Real newbound)
Definition: scip.c:13519
SCIP_Real SCIPlpGetLooseObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:12670
SCIP_EXPRTREE * SCIPnlrowGetExprtree(SCIP_NLROW *nlrow)
Definition: nlp.c:3363
internal methods for return codes for SCIP methods
SCIP_Real SCIPhistoryGetCutoffSum(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
Definition: history.c:655
SCIP_Real SCIPgetAvgDualbound(SCIP *scip)
Definition: scip.c:43215
SCIP_COMPR ** comprs
Definition: struct_set.h:80
int SCIPpropGetNChgVarTypes(SCIP_PROP *prop)
Definition: prop.c:1132
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:13675
SCIP_CLOCK * strongbranchtime
Definition: struct_stat.h:151
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:1323
SCIP_PRESOL ** SCIPgetPresols(SCIP *scip)
Definition: scip.c:7061
SCIP_RETCODE SCIPaddPricedVar(SCIP *scip, SCIP_VAR *var, SCIP_Real score)
Definition: scip.c:11557
int SCIPgetBoolarrayMaxIdx(SCIP *scip, SCIP_BOOLARRAY *boolarray)
Definition: scip.c:48283
SCIP_RETCODE SCIPaddSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *stored)
Definition: scip.c:40500
SCIP_Bool SCIPinDive(SCIP *scip)
Definition: scip.c:35802
SCIP_Longint SCIPgetNResolveLPs(SCIP *scip)
Definition: scip.c:42522
SCIP_RETCODE SCIPaddRowCutpool(SCIP *scip, SCIP_CUTPOOL *cutpool, SCIP_ROW *row)
Definition: scip.c:34925
#define SCIP_DECL_DIALOGEXEC(x)
Definition: type_dialog.h:87
SCIP_Bool SCIPsetIsSumPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6108
void SCIPrelaxationSetSolZero(SCIP_RELAXATION *relaxation, SCIP_Bool iszero)
Definition: relax.c:615
SCIP_RETCODE SCIPsolLinkRelaxSol(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_RELAXATION *relaxation)
Definition: sol.c:879
SCIP_Bool SCIPhasNLPSolution(SCIP *scip)
Definition: scip.c:31711
SCIP_VAR ** SCIPvarGetImplVars(SCIP_VAR *var, SCIP_Bool varfixing)
Definition: var.c:17571
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_Real SCIPsetFeasFloor(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6341
SCIP_RETCODE SCIPgetReoptOldObjCoef(SCIP *scip, SCIP_VAR *var, int run, SCIP_Real *objcoef)
Definition: scip.c:16719
SCIP_RETCODE SCIPsetConshdlrExitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITPRE((*consexitpre)))
Definition: scip.c:6229
SCIP_Real SCIPgetAvgCutoffScore(SCIP *scip)
Definition: scip.c:44087
#define SCIP_VERSION
Definition: def.h:110
SCIP_CLIQUE ** SCIPgetCliques(SCIP *scip)
Definition: scip.c:24933
SCIP_Real SCIProwGetConstant(SCIP_ROW *row)
Definition: lp.c:16450
SCIP_Real SCIPgetVarAvgConflictlengthCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26608
int SCIPconshdlrGetNChgVarTypes(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4879
enum SCIP_ExprCurv SCIP_EXPRCURV
Definition: type_expr.h:93
#define SCIPdebugReset(set)
Definition: debug.h:247
SCIP_Bool SCIPparamIsValidChar(SCIP_PARAM *param, const char value)
Definition: paramset.c:4285
SCIP_Real SCIPgetTransObjoffset(SCIP *scip)
Definition: scip.c:11191
SCIP_RETCODE SCIPprintNodeRootPath(SCIP *scip, SCIP_NODE *node, FILE *file)
Definition: scip.c:41820
SCIP_RETCODE SCIPsetProbInitsol(SCIP *scip, SCIP_DECL_PROBINITSOL((*probinitsol)))
Definition: scip.c:10080
SCIP_RETCODE SCIPaddVarBranchFactor(SCIP *scip, SCIP_VAR *var, SCIP_Real addfactor)
Definition: scip.c:25254
int SCIPgetNHeurs(SCIP *scip)
Definition: scip.c:8251
int SCIPpropGetPresolPriority(SCIP_PROP *prop)
Definition: prop.c:917
SCIP_Bool SCIPisDualfeasPositive(SCIP *scip, SCIP_Real val)
Definition: scip.c:47548
SCIP_Real firstsolgap
Definition: struct_stat.h:121
SCIP_RETCODE SCIPsetConsStickingAtNode(SCIP *scip, SCIP_CONS *cons, SCIP_Bool stickingatnode)
Definition: scip.c:28087
SCIP_LPSOLSTAT SCIPgetLastStrongbranchLPSolStat(SCIP *scip, SCIP_BRANCHDIR branchdir)
Definition: scip.c:21495
int SCIPsepastoreGetNCutsFound(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1247
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, SCIP_Bool *unbounded)
Definition: solve.c:177
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
Definition: scip.c:30540
SCIP_Bool SCIPisObjIntegral(SCIP *scip)
Definition: scip.c:11386
SCIP_RETCODE SCIPcopyProb(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, const char *name)
Definition: scip.c:1739
SCIP_Bool misc_exactsolve
Definition: struct_set.h:351
void SCIPpropSetInit(SCIP_PROP *prop, SCIP_DECL_PROPINIT((*propinit)))
Definition: prop.c:778
SCIP_Real SCIPconflictGetInfeasibleLPTime(SCIP_CONFLICT *conflict)
Definition: conflict.c:8129
const char * SCIPcomprGetName(SCIP_COMPR *compr)
Definition: compr.c:409
SCIP_RETCODE SCIPconflictCreate(SCIP_CONFLICT **conflict, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: conflict.c:3639
SCIP_RETCODE SCIPwriteVarsList(SCIP *scip, FILE *file, SCIP_VAR **vars, int nvars, SCIP_Bool type, char delimiter)
Definition: scip.c:17797
void SCIPbranchruleSetExecExt(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECEXT((*branchexecext)))
Definition: branch.c:1910
#define SCIP_VARTYPE_IMPLINT_CHAR
Definition: def.h:122
int SCIPtreeGetNSiblings(SCIP_TREE *tree)
Definition: tree.c:8137
#define SCIP_DECL_DISPEXITSOL(x)
Definition: type_disp.h:117
#define SCIP_EVENTTYPE_BESTSOLFOUND
Definition: type_event.h:88
void SCIPsetSortBranchrules(SCIP_SET *set)
Definition: set.c:4605
SCIP_Longint SCIPgetNNodeInitLPIterations(SCIP *scip)
Definition: scip.c:42690
void SCIPsepaSetPriority(SCIP_SEPA *sepa, SCIP_SET *set, int priority)
Definition: sepa.c:676
SCIP_Longint SCIPgetNNodeInitLPs(SCIP *scip)
Definition: scip.c:42672
int npricers
Definition: struct_set.h:97
SCIP_RETCODE SCIPreadSolFile(SCIP *scip, const char *filename, SCIP_SOL *sol, SCIP_Bool xml, SCIP_Bool *partial, SCIP_Bool *error)
Definition: scip.c:40460
SCIP_Longint SCIPgetMemTotal(SCIP *scip)
Definition: scip.c:46787
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:1213
SCIP_Bool SCIProwIsLPEfficacious(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_Bool root)
Definition: lp.c:6655
SCIP_Bool SCIPtreeProbingObjChanged(SCIP_TREE *tree)
Definition: tree.c:8363
SCIP_RETCODE SCIPcreateNLPSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:37948
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:2405
void BMSprintBufferMemory(BMS_BUFMEM *buffer)
Definition: memory.c:3115
SCIP_Real SCIPgetAvgConflictlengthScore(SCIP *scip)
Definition: scip.c:43915
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:5817
int SCIPconshdlrGetMaxNActiveConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4839
SCIP_RETCODE SCIPcreatePtrarray(SCIP *scip, SCIP_PTRARRAY **ptrarray)
Definition: scip.c:48298
SCIP_DIALOG * SCIPdialoghdlrGetRoot(SCIP_DIALOGHDLR *dialoghdlr)
Definition: dialog.c:427
int SCIPpresolGetNAddHoles(SCIP_PRESOL *presol)
Definition: presol.c:711
SCIP_RETCODE SCIPaddQuadVarToNlRow(SCIP *scip, SCIP_NLROW *nlrow, SCIP_VAR *var)
Definition: scip.c:32479
int SCIPvarGetNLocksDown(SCIP_VAR *var)
Definition: var.c:3162
SCIP_RETCODE SCIPcreateMessagehdlrDefault(SCIP_MESSAGEHDLR **messagehdlr, SCIP_Bool bufferedoutput, const char *filename, SCIP_Bool quiet)
SCIP_Bool SCIPparamIsValidBool(SCIP_PARAM *param, SCIP_Bool value)
Definition: paramset.c:4243
SCIP_RETCODE SCIPsetSepaFree(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAFREE((*sepafree)))
Definition: scip.c:7443
SCIP_RETCODE SCIPprintLPSolutionQuality(SCIP *scip, FILE *file)
Definition: scip.c:30067
int SCIPgetNOrigIntVars(SCIP *scip)
Definition: scip.c:12306
SCIP_RETCODE SCIPsetPropResprop(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPRESPROP((*propresprop)))
Definition: scip.c:7856
SCIP_Real SCIPgetLPObjval(SCIP *scip)
Definition: scip.c:29372
SCIP_RETCODE SCIPsetSepaInit(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAINIT((*sepainit)))
Definition: scip.c:7459
SCIP_RETCODE SCIPwriteMIP(SCIP *scip, const char *filename, SCIP_Bool genericnames, SCIP_Bool origobj, SCIP_Bool lazyconss)
Definition: scip.c:29981
SCIP_RETCODE SCIPbranchPseudo(SCIP *scip, SCIP_RESULT *result)
Definition: scip.c:37842
int nactiveconss
Definition: struct_stat.h:220
BMS_BLKMEM * probmem
Definition: struct_mem.h:40
SCIP_RETCODE SCIPsetRelaxSolVal(SCIP *scip, SCIP_VAR *var, SCIP_Real val)
Definition: scip.c:19935
SCIP_RETCODE SCIPaddQuadVarsToNlRow(SCIP *scip, SCIP_NLROW *nlrow, int nvars, SCIP_VAR **vars)
Definition: scip.c:32504
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
Definition: scip.c:39882
void SCIPconsCapture(SCIP_CONS *cons)
Definition: cons.c:6100
struct SCIP_RelaxData SCIP_RELAXDATA
Definition: type_relax.h:38
void SCIPstatResetPresolving(SCIP_STAT *stat, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob)
Definition: stat.c:344
SCIP_Real SCIPconcsolverGetSyncTime(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:498
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47002
SCIP_Longint SCIPconflictGetNBoundexceedingLPSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:8229
#define SCIP_DECL_RELAXEXEC(x)
Definition: type_relax.h:118
unsigned int SCIP_PROPTIMING
Definition: type_timing.h:66
int SCIPpricestoreGetNVarsFound(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:653
SCIP_Real SCIPhistoryGetInferenceSum(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
Definition: history.c:629
SCIP_Real SCIProwGetMinActivity(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat)
Definition: lp.c:6461
#define SCIP_DECL_TABLEINIT(x)
Definition: type_table.h:69
struct SCIP_ProbData SCIP_PROBDATA
Definition: type_prob.h:44
SCIP_RETCODE SCIPsetProbName(SCIP *scip, const char *name)
Definition: scip.c:10919
void SCIPnodeselSetStdPriority(SCIP_NODESEL *nodesel, SCIP_SET *set, int priority)
Definition: nodesel.c:1031
char ** extcodenames
Definition: struct_set.h:93
SCIP_RETCODE SCIPsolveProbingLPWithPricing(SCIP *scip, SCIP_Bool pretendroot, SCIP_Bool displayinfo, int maxpricerounds, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: scip.c:36574
SCIP_Bool nlpenabled
Definition: struct_prob.h:80
SCIP_NLPIPROBLEM * SCIPnlpGetNLPIProblem(SCIP_NLP *nlp)
Definition: nlp.c:5955
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:47112
SCIP_RETCODE SCIPchgVarObjDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
Definition: scip.c:35404
SCIP_Real SCIPgetVarImplRedcost(SCIP *scip, SCIP_VAR *var, SCIP_Bool varfixing)
Definition: scip.c:19426
SCIP_RETCODE SCIPptrarrayFree(SCIP_PTRARRAY **ptrarray)
Definition: misc.c:4747
SCIP_Bool misc_catchctrlc
Definition: struct_set.h:347
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:4349
SCIP_RETCODE SCIPgetNlRowSolFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_SOL *sol, SCIP_Real *feasibility)
Definition: scip.c:32969
SCIP_RETCODE SCIPenfopsCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool solinfeasible, SCIP_Bool objinfeasible, SCIP_RESULT *result)
Definition: scip.c:28718
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
Definition: lp.c:16254
SCIP_TABLE ** SCIPgetTables(SCIP *scip)
Definition: scip.c:9503
SCIP_RETCODE SCIPsepalpCons(SCIP *scip, SCIP_CONS *cons, SCIP_RESULT *result)
Definition: scip.c:28838
SCIP_RETCODE SCIPsolveConcurrent(SCIP *scip)
Definition: scip.c:16431
internal methods for conflict analysis
void SCIPfreeParseVarsPolynomialData(SCIP *scip, SCIP_VAR ****monomialvars, SCIP_Real ***monomialexps, SCIP_Real **monomialcoefs, int **monomialnvars, int nmonomials)
Definition: scip.c:18676
void SCIPmessageVFPrintDialog(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *formatstr, va_list ap)
Definition: message.c:539
SCIP_RETCODE SCIPprintMIPStart(SCIP *scip, SCIP_SOL *sol, FILE *file)
Definition: scip.c:39464
SCIP_Longint SCIPgetMemUsed(SCIP *scip)
Definition: scip.c:46774
SCIP_Longint SCIPgetNStrongbranchLPIterations(SCIP *scip)
Definition: scip.c:42762
SCIP_RETCODE SCIPlpSetCutoffbound(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob, SCIP_Real cutoffbound)
Definition: lp.c:9968
static const SCIP_Real scalars[]
Definition: lp.c:5618
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:1920
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:5200
void SCIPsetSortPresols(SCIP_SET *set)
Definition: set.c:3880
SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:11492
SCIP_NLPI * SCIPfindNlpi(SCIP *scip, const char *name)
Definition: scip.c:9576
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_CUTPOOL *cutpool, 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:1948
SCIP_NODE * SCIPtreeGetRootNode(SCIP_TREE *tree)
Definition: tree.c:8352
internal methods for tree compressions
const char * xmlGetAttrval(const XML_NODE *node, const char *name)
Definition: xmlparse.c:1324
SCIP_Bool SCIPprimalUpperboundIsSol(SCIP_PRIMAL *primal, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob)
Definition: primal.c:543
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:22932
int SCIPgetNNodesels(SCIP *scip)
Definition: scip.c:8981
SCIP_Longint SCIPbranchruleGetNPseudoCalls(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2072
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:21279
internal methods for main solving loop and node processing
void SCIPsetSortRelaxsName(SCIP_SET *set)
Definition: set.c:3969
size_t BMSgetNUsedBufferMemory(BMS_BUFMEM *buffer)
Definition: memory.c:3087
SCIP_RETCODE SCIPsetConshdlrInit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINIT((*consinit)))
Definition: scip.c:6109
SCIP_PROBDATA * SCIPgetProbData(SCIP *scip)
Definition: scip.c:10788
SCIP_RETCODE SCIPsetResetParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name)
Definition: set.c:3351
void SCIPmessageVFPrintInfo(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *formatstr, va_list ap)
Definition: message.c:623
SCIP_RETCODE SCIPgetVarSols(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:19852
static SCIP_Bool takeCut(SCIP *scip, SCIP_CUT *cut, char cutsel)
Definition: scip.c:1401
void SCIPsolUpdateLPRowViolation(SCIP_SOL *sol, SCIP_Real absviollprows, SCIP_Real relviollprows)
Definition: sol.c:2322
SCIP_Real SCIPtransformObj(SCIP *scip, SCIP_Real obj)
Definition: scip.c:39101
SCIP_CONS ** SCIPconshdlrGetCheckConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4505
int SCIPgetNReoptRuns(SCIP *scip)
Definition: scip.c:42077
SCIP_Longint SCIPgetNDivingLPs(SCIP *scip)
Definition: scip.c:42708
SCIP_VERBLEVEL disp_verblevel
Definition: struct_set.h:254
SCIP_RETCODE SCIPsetEventhdlrDelete(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTDELETE((*eventdelete)))
Definition: scip.c:8727
SCIP_Real SCIPgetHugeValue(SCIP *scip)
Definition: scip.c:47065
SCIP_RETCODE SCIPrestartSolve(SCIP *scip)
Definition: scip.c:17350
int SCIPdomchgGetNBoundchgs(SCIP_DOMCHG *domchg)
Definition: var.c:16609
SCIP_RETCODE SCIPsetChgParamFixed(SCIP_SET *set, const char *name, SCIP_Bool fixed)
Definition: set.c:3036
unsigned int SCIPnodeGetReoptID(SCIP_NODE *node)
Definition: tree.c:7413
SCIP_Real SCIPgetRealarrayVal(SCIP *scip, SCIP_REALARRAY *realarray, int idx)
Definition: scip.c:47933
SCIP_RETCODE SCIPsetConsEnforced(SCIP *scip, SCIP_CONS *cons, SCIP_Bool enforce)
Definition: scip.c:27909
int nactivepricers
Definition: struct_set.h:98
int SCIPgetNReaders(SCIP *scip)
Definition: scip.c:5414
void SCIPsetSortConflicthdlrs(SCIP_SET *set)
Definition: set.c:3807
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:2021
#define SCIP_VARTYPE_CONTINUOUS_CHAR
Definition: def.h:123
SCIP_RETCODE SCIPendDiveNLP(SCIP *scip)
Definition: scip.c:32040
#define SCIP_DECL_SEPAEXIT(x)
Definition: type_sepa.h:71
int SCIPgetNBranchrules(SCIP *scip)
Definition: scip.c:9295
SCIP_RETCODE SCIPsetConshdlrExit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXIT((*consexit)))
Definition: scip.c:6133
SCIP_Longint SCIPmemGetTotal(SCIP_MEM *mem)
Definition: mem.c:98
#define SCIP_PRESOLTIMING_FINAL
Definition: type_timing.h:46
SCIP_RETCODE SCIPresetClock(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip.c:46081
SCIP_RETCODE SCIPeventfilterFree(SCIP_EVENTFILTER **eventfilter, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: event.c:1723
int SCIPgetNPricevars(SCIP *scip)
Definition: scip.c:42832
SCIP_RETCODE SCIPnlpFree(SCIP_NLP **nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: nlp.c:5181
SCIP_Longint SCIPgetNPrimalLPIterations(SCIP *scip)
Definition: scip.c:42432
int SCIPgetNConss(SCIP *scip)
Definition: scip.c:12862
void SCIPbranchruleSetExitsol(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXITSOL((*branchexitsol)))
Definition: branch.c:1886
SCIP_RETCODE SCIPsetIncludeBranchrule(SCIP_SET *set, SCIP_BRANCHRULE *branchrule)
Definition: set.c:4561
#define SCIP_DECL_CONSFREE(x)
Definition: type_cons.h:100
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:570
SCIP_RETCODE SCIPintarrayExtend(SCIP_INTARRAY *intarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
Definition: misc.c:4040
SCIP_RETCODE SCIPptrarraySetVal(SCIP_PTRARRAY *ptrarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, void *val)
Definition: misc.c:4968
SCIP_BRANCHRULE ** SCIPgetBranchrules(SCIP *scip)
Definition: scip.c:9284
SCIP_Bool SCIPisConsCompressionEnabled(SCIP *scip)
Definition: scip.c:1870
SCIP_RETCODE SCIPtreeMarkProbingNodeHasLP(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_LP *lp)
Definition: tree.c:6567
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:3741
SCIP_NODE * SCIPtreeGetCurrentNode(SCIP_TREE *tree)
Definition: tree.c:8285
SCIP_CLOCK * solvingtime
Definition: struct_stat.h:142
SCIP_Longint nbarrierlps
Definition: struct_stat.h:180
void SCIPconshdlrSetDisable(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDISABLE((*consdisable)))
Definition: cons.c:4403
void SCIPsetMessagehdlrLogfile(SCIP *scip, const char *filename)
Definition: scip.c:1243
void SCIPheurSetExit(SCIP_HEUR *heur, SCIP_DECL_HEUREXIT((*heurexit)))
Definition: heur.c:1165
SCIP_Longint nprimalzeroitlps
Definition: struct_stat.h:176
SCIP_RETCODE SCIPendStrongbranch(SCIP *scip)
Definition: scip.c:20234
SCIP_RETCODE SCIPreoptUpdateVarHistory(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_VAR **vars, int nvars)
Definition: reopt.c:6612
SCIP_RETCODE SCIPsetComprExit(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPREXIT((*comprexit)))
Definition: scip.c:8411
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
Definition: scip.c:27761
SCIP_CLOCK * primallptime
Definition: struct_stat.h:146
int conf_maxstoresize
Definition: struct_set.h:190
#define SCIP_DECL_DISPEXIT(x)
Definition: type_disp.h:95
SCIP_RETCODE SCIPreadParams(SCIP *scip, const char *filename)
Definition: scip.c:4952
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:186
int nconss
Definition: struct_prob.h:73
SCIP_RETCODE SCIPsetPresolCopy(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLCOPY((*presolcopy)))
Definition: scip.c:6952
SCIP_Real SCIPgetAvgPseudocostCount(SCIP *scip, SCIP_BRANCHDIR dir)
Definition: scip.c:43728
int SCIPgetRealarrayMinIdx(SCIP *scip, SCIP_REALARRAY *realarray)
Definition: scip.c:47986
#define SCIP_DECL_SEPAINITSOL(x)
Definition: type_sepa.h:82
SCIP_Bool SCIPisRelaxSolValid(SCIP *scip)
Definition: scip.c:20052
int SCIPbranchcandGetNPrioPseudoBins(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:873
#define SCIP_DECL_PROPRESPROP(x)
Definition: type_prop.h:244
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:14266
SCIP_RETCODE SCIPreoptnodeReset(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_REOPTNODE *reoptnode)
Definition: reopt.c:7942
#define SCIP_DECL_HEUREXIT(x)
Definition: type_heur.h:86
SCIP_RETCODE SCIPclearIntarray(SCIP *scip, SCIP_INTARRAY *intarray)
Definition: scip.c:48068
SCIP_Bool SCIPallowDualReds(SCIP *scip)
Definition: scip.c:25885
SCIP_SET * set
Definition: struct_scip.h:62
int SCIPgetNCuts(SCIP *scip)
Definition: scip.c:35196
int SCIPgetNPriceRounds(SCIP *scip)
Definition: scip.c:42814
SCIP_Real SCIPcomprGetSetupTime(SCIP_COMPR *compr)
Definition: compr.c:493
void SCIPsyncstoreSetSolveIsStopped(SCIP_SYNCSTORE *syncstore, SCIP_Bool stopped)
Definition: syncstore.c:245
SCIP_Bool misc_transsolsorig
Definition: struct_set.h:360
SCIP_RETCODE SCIPsetNodeselFree(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELFREE((*nodeselfree)))
Definition: scip.c:8877
SCIP_RETCODE SCIPnlrowRecalcNLPActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLP *nlp)
Definition: nlp.c:2848
static SCIP_RETCODE transformSols(SCIP *scip)
Definition: scip.c:15075
SCIP_Longint npsbestsolsfound
Definition: struct_stat.h:96
SCIP_RETCODE SCIPdigraphCopy(SCIP_DIGRAPH **targetdigraph, SCIP_DIGRAPH *sourcedigraph, BMS_BLKMEM *targetblkmem)
Definition: misc.c:6966
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:978
int SCIPgetRepropdepth(SCIP *scip)
Definition: scip.c:41803
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
Definition: scip.c:6253
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:3795
SCIP_PROP ** props
Definition: struct_set.h:77
SCIP_RETCODE SCIPaddRowProbing(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:36638
SCIP_RETCODE SCIPboolarrayFree(SCIP_BOOLARRAY **boolarray)
Definition: misc.c:4392
SCIP_SOLORIGIN SCIPsolGetOrigin(SCIP_SOL *sol)
Definition: sol.c:2455
#define SCIP_DECL_HEURINIT(x)
Definition: type_heur.h:78
int SCIPgetNUpgrConss(SCIP *scip)
Definition: scip.c:12820
int SCIPgetNCliques(SCIP *scip)
Definition: scip.c:24879
SCIP_RETCODE SCIPsplitReoptRoot(SCIP *scip, int *ncreatedchilds, int *naddedconss)
Definition: scip.c:17524
SCIP_RETCODE SCIPconflictInit(SCIP_CONFLICT *conflict, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_CONFTYPE conftype, SCIP_Bool usescutoffbound)
Definition: conflict.c:3775
void SCIPupdateSolConsViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
Definition: scip.c:13790
SCIP_RETCODE SCIPpropSetPresol(SCIP_PROP *prop, SCIP_DECL_PROPPRESOL((*proppresol)), int presolpriority, int presolmaxrounds, SCIP_PRESOLTIMING presoltiming)
Definition: prop.c:846
SCIP_Real SCIPgetRowLPFeasibility(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30977
SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
Definition: scip.c:8161
SCIP_RETCODE SCIPaddVarBranchPriority(SCIP *scip, SCIP_VAR *var, int addpriority)
Definition: scip.c:25359
void SCIPprobUpdateDualbound(SCIP_PROB *prob, SCIP_Real newbound)
Definition: prob.c:1547
void SCIPpresolSetCopy(SCIP_PRESOL *presol, SCIP_DECL_PRESOLCOPY((*presolcopy)))
Definition: presol.c:487
#define SCIP_DECL_CONSINIT(x)
Definition: type_cons.h:110
SCIP_Real upperbound
Definition: struct_primal.h:45
int SCIPpricerGetNCalls(SCIP_PRICER *pricer)
Definition: pricer.c:594
SCIP_Bool SCIPsetIsSumRelLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6815
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:20492
#define SCIP_DECL_PROPPRESOL(x)
Definition: type_prop.h:179
static void computeBilinEnvelope2(SCIP *scip, SCIP_Real x, SCIP_Real y, SCIP_Real mi, SCIP_Real qi, SCIP_Real mj, SCIP_Real qj, SCIP_Real *RESTRICT xi, SCIP_Real *RESTRICT yi, SCIP_Real *RESTRICT xj, SCIP_Real *RESTRICT yj, SCIP_Real *RESTRICT xcoef, SCIP_Real *RESTRICT ycoef, SCIP_Real *RESTRICT constant)
Definition: scip.c:33830
SCIP_Real SCIPretransformObj(SCIP *scip, SCIP_Real obj)
Definition: scip.c:39126
SCIP_DECL_CONSLOCK(ConshdlrSubtour::scip_lock)
void SCIPprobSetDelorig(SCIP_PROB *prob, SCIP_DECL_PROBDELORIG((*probdelorig)))
Definition: prob.c:328
SCIP_DECL_EVENTEXEC(EventhdlrNewSol::scip_exec)
SCIP_Bool SCIPisFeasPositive(SCIP *scip, SCIP_Real val)
Definition: scip.c:47375
void SCIPmessageFPrintInfo(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *formatstr,...)
Definition: message.c:608
int ncomprs
Definition: struct_set.h:114
int SCIPgetNImplications(SCIP *scip)
Definition: scip.c:45911
SCIP_Real SCIPgetAvgInferenceScoreCurrentRun(SCIP *scip)
Definition: scip.c:44026
SCIP_Real * scalars
Definition: struct_var.h:185
SCIP_Longint SCIPgetMemExternEstim(SCIP *scip)
Definition: scip.c:46800
SCIP_Real SCIProwGetLPFeasibility(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:6129
SCIP_NODESEL * SCIPfindNodesel(SCIP *scip, const char *name)
Definition: scip.c:8957
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:4194
SCIP_Bool SCIPsetIsGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5852
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:2837
SCIP_VAR ** SCIPgetVars(SCIP *scip)
Definition: scip.c:11767
int SCIPcolGetNStrongbranchs(SCIP_COL *col)
Definition: lp.c:16385
SCIP_RETCODE SCIPsetPropInitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINITSOL((*propinitsol)))
Definition: scip.c:7759
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:1145
SCIP_RETCODE SCIPgetNLPFracVars(SCIP *scip, SCIP_VAR ***fracvars, SCIP_Real **fracvarssol, SCIP_Real **fracvarsfrac, int *nfracvars, int *npriofracvars)
Definition: scip.c:31736
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:17078
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
Definition: var.c:16781
SCIP_Real sepa_minactivityquot
Definition: struct_set.h:487
SCIP_HEUR * SCIPgetSolHeur(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:39234
#define SCIPdebugSolDisable(scip)
Definition: debug.h:265
struct SCIP_LPi SCIP_LPI
Definition: type_lpi.h:96
enum SCIP_DispStatus SCIP_DISPSTATUS
Definition: type_disp.h:50
SCIP_Bool misc_transorigsols
Definition: struct_set.h:359
SCIP_RETCODE SCIPupdatePrimalRay(SCIP *scip, SCIP_SOL *primalray)
Definition: scip.c:41120
SCIP_RETCODE SCIPcalcNegatedCliquePartition(SCIP *const scip, SCIP_VAR **const vars, int const nvars, int *const cliquepartition, int *const ncliques)
Definition: scip.c:24779
SCIP_MESSAGEHDLR * messagehdlr
Definition: struct_scip.h:65
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:25684
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_CONFLICTSTORE *conflictstore, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable)
Definition: tree.c:4968
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:4202
#define SCIP_DECL_CONSENFORELAX(x)
Definition: type_cons.h:372
SCIP_NODETYPE SCIPnodeGetType(SCIP_NODE *node)
Definition: tree.c:7332
default user interface dialog
SCIP_Longint SCIPgetNBestSolsFound(SCIP *scip)
Definition: scip.c:43673
SCIP_Longint SCIPconshdlrGetNChildren(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4829
SCIP_RETCODE SCIPcaptureVar(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:18732
SCIP_RETCODE SCIPconsSetInitial(SCIP_CONS *cons, SCIP_SET *set, SCIP_STAT *stat, SCIP_Bool initial)
Definition: cons.c:6369
void SCIPconshdlrSetResprop(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop)))
Definition: cons.c:4359
#define SCIP_Real
Definition: def.h:149
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
Definition: cons.c:8235
SCIP_RETCODE SCIPaddVarsToRow(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:30694
internal methods for problem statistics
int SCIPgetNPricevarsFound(SCIP *scip)
Definition: scip.c:42850
const char * SCIPbranchruleGetName(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:1932
SCIP_RETCODE SCIPgetNlRowNLPFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *feasibility)
Definition: scip.c:32756
#define SCIP_EVENTTYPE_VARCHANGED
Definition: type_event.h:113
SCIP_VAR ** vars
Definition: struct_prob.h:55
void SCIPstatUpdatePrimalDualIntegral(SCIP_STAT *stat, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_Real upperbound, SCIP_Real lowerbound)
Definition: stat.c:398
SCIP_RETCODE SCIPsetIncludeReader(SCIP_SET *set, SCIP_READER *reader)
Definition: set.c:3487
SCIP_PRICER ** pricers
Definition: struct_set.h:68
SCIP_RETCODE SCIPmemFree(SCIP_MEM **mem)
Definition: mem.c:59
enum SCIP_Stage SCIP_STAGE
Definition: type_set.h:50
void SCIPheurSetInit(SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
Definition: heur.c:1154
SCIP_RETCODE SCIPsolveParallel(SCIP *scip)
Definition: scip.c:16401
SCIP_Real SCIPpricerGetSetupTime(SCIP_PRICER *pricer)
Definition: pricer.c:614
struct SCIP_PropData SCIP_PROPDATA
Definition: type_prop.h:38
SCIP_Bool SCIPisStopped(SCIP *scip)
Definition: scip.c:1145
SCIP_DECL_CONSPRINT(ConshdlrSubtour::scip_print)
SCIP_BRANCHRULE * SCIPsetFindBranchrule(SCIP_SET *set, const char *name)
Definition: set.c:4585
SCIP_Longint SCIPvarGetNBranchings(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:15105
SCIP_Bool SCIPlpIsSolved(SCIP_LP *lp)
Definition: lp.c:16952
SCIP_Real firstprimaltime
Definition: struct_stat.h:120
SCIP_RETCODE SCIPvarsGetProbvarBinary(SCIP_VAR ***vars, SCIP_Bool **negatedarr, int nvars)
Definition: var.c:11688
enum SCIP_ConflictType SCIP_CONFTYPE
Definition: type_conflict.h:56
SCIP_RETCODE SCIPchgVarBranchDirection(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR branchdirection)
Definition: scip.c:25390
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
Definition: scip.c:6567
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:7605
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:5439
SCIP_RETCODE SCIPtreeStoreRelaxSol(SCIP_TREE *tree, SCIP_SET *set, SCIP_RELAXATION *relaxation, SCIP_PROB *transprob)
Definition: tree.c:6936
SCIP_Bool SCIPisScalingIntegral(SCIP *scip, SCIP_Real val, SCIP_Real scalar)
Definition: scip.c:47124
SCIP_Bool SCIPsetIsFeasPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6295
SCIP_Real SCIPgetRowMinActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30906
SCIP_Bool reopt_commontimelimit
Definition: struct_set.h:452
SCIP_Longint SCIPconcsolverGetNTighterBnds(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:548
SCIP_DECL_EVENTEXITSOL(EventhdlrNewSol::scip_exitsol)
SCIP_RETCODE SCIPrealarrayExtend(SCIP_REALARRAY *realarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
Definition: misc.c:3669
void SCIPmessageVFPrintWarning(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr, va_list ap)
Definition: message.c:455
SCIP_Bool SCIPhaveVarsCommonClique(SCIP *scip, SCIP_VAR *var1, SCIP_Bool value1, SCIP_VAR *var2, SCIP_Bool value2, SCIP_Bool regardimplics)
Definition: scip.c:24963
#define SCIP_DECL_EVENTCOPY(x)
Definition: type_event.h:165
SCIP_Real SCIPsetDualfeastol(SCIP_SET *set)
Definition: set.c:5688
SCIP_RETCODE SCIPtreeLoadProbingLPState(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: tree.c:6486
#define SCIP_DECL_NODESELCOPY(x)
Definition: type_nodesel.h:47
SCIP_RETCODE SCIPconflictstoreAddConflict(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_PROB *transprob, SCIP_REOPT *reopt, SCIP_CONS *cons, SCIP_CONFTYPE conftype, SCIP_Bool cutoffinvolved, SCIP_Real primalbound)
SCIP_Longint SCIPstatGetMemExternEstim(SCIP_STAT *stat)
Definition: stat.c:630
SCIP_Longint nrepropboundchgs
Definition: struct_stat.h:88
SCIP_Longint SCIPconflictGetNStrongbranchCalls(SCIP_CONFLICT *conflict)
Definition: conflict.c:8603
SCIP_Longint SCIPconflictGetNInfeasibleLPIterations(SCIP_CONFLICT *conflict)
Definition: conflict.c:8199
SCIP_Real SCIPconflictGetVarLb(SCIP_CONFLICT *conflict, SCIP_VAR *var)
Definition: conflict.c:4418
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:7563
void SCIPsetSortPricers(SCIP_SET *set)
Definition: set.c:3572
SCIP_RETCODE SCIPsetBranchruleInit(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHINIT((*branchinit)))
Definition: scip.c:9155
int SCIPsepastoreGetNCutsFoundRound(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1257
void SCIPprintConstraintTimingStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44560
SCIP_RETCODE SCIPrandomCreate(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem, unsigned int initialseed)
Definition: misc.c:9334
SCIP_NLP * nlp
Definition: struct_scip.h:81
SCIP_Real firstprimalbound
Definition: struct_stat.h:119
int SCIPconshdlrGetNCheckConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4535
SCIP_Real SCIPgetGlobalPseudoObjval(SCIP *scip)
Definition: scip.c:29433
SCIP_Longint ntotalinternalnodes
Definition: struct_stat.h:77
SCIP_Bool random_permuteconss
Definition: struct_set.h:376
SCIP_RETCODE SCIPsetFreeConcsolvers(SCIP_SET *set)
Definition: set.c:4259
void SCIPconshdlrSetDelvars(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELVARS((*consdelvars)))
Definition: cons.c:4414
SCIP_Longint SCIPsepaGetNCutsApplied(SCIP_SEPA *sepa)
Definition: sepa.c:803
#define SCIP_DECL_HEURFREE(x)
Definition: type_heur.h:70
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
Definition: cons.c:8175
SCIP_Longint SCIPconshdlrGetNSepaCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4689
SCIP_Bool SCIPdoNotAggr(SCIP *scip)
Definition: scip.c:25848
int SCIPgetNPoolCuts(SCIP *scip)
Definition: scip.c:34831
SCIP_RETCODE SCIPconflictIsVarUsed(SCIP_CONFLICT *conflict, SCIP_VAR *var, SCIP_SET *set, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool *used)
Definition: conflict.c:4358
SCIP_RETCODE SCIPtransformVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **transvar)
Definition: scip.c:18867
#define BMSallocMemory(ptr)
Definition: memory.h:101
SCIP_CONS ** conss
Definition: struct_prob.h:59
SCIP_RETCODE SCIPconsPrint(SCIP_CONS *cons, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: cons.c:6152
SCIP_RETCODE SCIPgetReoptLeaveIDs(SCIP *scip, SCIP_NODE *node, unsigned int *ids, int idssize, int *nids)
Definition: scip.c:16797
SCIP_Real SCIPvarGetVSIDS(SCIP_VAR *var, SCIP_STAT *stat, SCIP_BRANCHDIR dir)
Definition: var.c:17741
#define SCIP_INVALID
Definition: def.h:169
int nnlpis
Definition: struct_set.h:128
void SCIPpropSetResprop(SCIP_PROP *prop, SCIP_DECL_PROPRESPROP((*propresprop)))
Definition: prop.c:876
#define SCIP_DECL_CONFLICTINIT(x)
Definition: type_conflict.h:93
SCIP_Real SCIPgetLocalOrigEstimate(SCIP *scip)
Definition: scip.c:13350
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:5573
int nextcodes
Definition: struct_set.h:134
SCIP_RETCODE SCIPsetPropFree(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPFREE((*propfree)))
Definition: scip.c:7711
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
Definition: cons.c:8165
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 *valid)
Definition: cons.c:5862
SCIP_NLPI * SCIPnlpGetNLPI(SCIP_NLP *nlp)
Definition: nlp.c:5945
SCIP_DECL_READERREAD(ReaderTSP::scip_read)
Definition: ReaderTSP.cpp:150
int SCIPgetNConflictConssFoundNode(SCIP *scip)
Definition: scip.c:42995
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:2468
SCIP_Bool SCIPisDualfeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47497
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
Definition: scip.c:31160
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:30782
#define SCIP_DECL_CONSACTIVE(x)
Definition: type_cons.h:671
SCIP_RETCODE SCIPsetConsModifiable(SCIP *scip, SCIP_CONS *cons, SCIP_Bool modifiable)
Definition: scip.c:28012
SCIP_NODE * SCIPtreeGetPrioChild(SCIP_TREE *tree)
Definition: tree.c:7005
SCIP_Real primsol
Definition: struct_lp.h:139
SCIP_Bool SCIPlpIsRelax(SCIP_LP *lp)
Definition: lp.c:16942
SCIP_RETCODE SCIPcutpoolAddRow(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_ROW *row)
Definition: cutpool.c:646
SCIP_Longint SCIPconflictGetNAppliedGlobalLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:3538
SCIP_CLOCK * duallptime
Definition: struct_stat.h:147
SCIP_RETCODE SCIPlinkRelaxSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38634
SCIP_RETCODE SCIPnlpSetStringPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, const char *sval)
Definition: nlp.c:6105
static SCIP_RETCODE tightenBounds(SCIP *scip, SCIP_VAR *var, SCIP_VARTYPE vartype, SCIP_Bool *infeasible)
Definition: scip.c:25407
SCIP_RETCODE SCIPprintNlRow(SCIP *scip, SCIP_NLROW *nlrow, FILE *file)
Definition: scip.c:33028
SCIP_RETCODE SCIPaddConsLocks(SCIP *scip, SCIP_CONS *cons, int nlockspos, int nlocksneg)
Definition: scip.c:28660
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:443
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:814
void SCIPbranchruleSetMaxbounddist(SCIP_BRANCHRULE *branchrule, SCIP_Real maxbounddist)
Definition: branch.c:2008
SCIP_RETCODE SCIPsetReaderRead(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
Definition: scip.c:5350
SCIP_Real SCIPgetOrigObjoffset(SCIP *scip)
Definition: scip.c:11143
void SCIPconshdlrSetGetVars(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars)))
Definition: cons.c:4447
SCIP_RETCODE SCIPnodeAddCons(SCIP_NODE *node, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_CONS *cons)
Definition: tree.c:1565
int SCIPgetNCompr(SCIP *scip)
Definition: scip.c:8485
SCIP_Real SCIPcutoffbounddelta(SCIP *scip)
Definition: scip.c:46499
int SCIPsolGetDepth(SCIP_SOL *sol)
Definition: sol.c:2538
SCIP_CLOCK * reoptupdatetime
Definition: struct_stat.h:161
SCIP_RETCODE SCIPcreateCurrentSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:38033
#define SCIP_Longint
Definition: def.h:134
SCIP_Longint SCIPheurGetNSolsFound(SCIP_HEUR *heur)
Definition: heur.c:1334
SCIP_Bool SCIPallColsInLP(SCIP *scip)
Definition: scip.c:29719
SCIP_RETCODE SCIPsetSetDefaultIntParam(SCIP_SET *set, const char *name, int defaultvalue)
Definition: set.c:3155
SCIP_RETCODE SCIPsetSetDualfeastol(SCIP_SET *set, SCIP_Real dualfeastol)
Definition: set.c:5432
#define SCIP_DECL_PROPEXIT(x)
Definition: type_prop.h:71
SCIP_Bool SCIPsetIsDualfeasZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6495
int SCIPconshdlrGetNAggrVars(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4869
SCIP_RETCODE SCIPsetNodeselInit(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELINIT((*nodeselinit)))
Definition: scip.c:8893
SCIP_VAR ** SCIPnlpGetVars(SCIP_NLP *nlp)
Definition: nlp.c:5788
int SCIPvarGetIndex(SCIP_VAR *var)
Definition: var.c:16959
void SCIPbranchruleSetExit(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXIT((*branchexit)))
Definition: branch.c:1864
SCIP_Real SCIPgetTotalTime(SCIP *scip)
Definition: scip.c:46279
SCIP_Real SCIPchgRelaxfeastol(SCIP *scip, SCIP_Real relaxfeastol)
Definition: scip.c:46631
SCIP_NODE * SCIPgetPrioChild(SCIP *scip)
Definition: scip.c:41601
SCIP_Real SCIPgetRowSolFeasibility(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
Definition: scip.c:31134
SCIP_Longint nactivatednodes
Definition: struct_stat.h:81
SCIP_RETCODE SCIPtableCreate(SCIP_TABLE **table, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, SCIP_Bool active, SCIP_DECL_TABLECOPY((*tablecopy)), SCIP_DECL_TABLEFREE((*tablefree)), SCIP_DECL_TABLEINIT((*tableinit)), SCIP_DECL_TABLEEXIT((*tableexit)), SCIP_DECL_TABLEINITSOL((*tableinitsol)), SCIP_DECL_TABLEEXITSOL((*tableexitsol)), SCIP_DECL_TABLEOUTPUT((*tableoutput)), SCIP_TABLEDATA *tabledata, int position, SCIP_STAGE earlieststage)
Definition: table.c:63
SCIP_Real SCIPgetVarLbDive(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:35642
SCIP_RETCODE SCIPdisjointsetCreate(SCIP_DISJOINTSET **djset, BMS_BLKMEM *blkmem, int ncomponents)
Definition: misc.c:10336
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:593
SCIP_RETCODE SCIPunlinkSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38740
SCIP_RETCODE SCIPdialogAddEntry(SCIP_DIALOG *dialog, SCIP_SET *set, SCIP_DIALOG *subdialog)
Definition: dialog.c:957
SCIP_RETCODE SCIPbranchLP(SCIP *scip, SCIP_RESULT *result)
Definition: scip.c:37794
SCIP_RETCODE SCIPsetProbingLPState(SCIP *scip, SCIP_LPISTATE **lpistate, SCIP_LPINORMS **lpinorms, SCIP_Bool primalfeas, SCIP_Bool dualfeas)
Definition: scip.c:36607
SCIP_NODE * SCIPgetBestChild(SCIP *scip)
Definition: scip.c:41633
SCIP_Longint nprimallpiterations
Definition: struct_stat.h:56
SCIP_Real SCIPfrac(SCIP *scip, SCIP_Real val)
Definition: scip.c:47185
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:5622
SCIP_RETCODE SCIPcheckCopyLimits(SCIP *sourcescip, SCIP_Bool *success)
Definition: scip.c:4156
SCIP_Longint nreprops
Definition: struct_stat.h:87
SCIP_Real SCIPvarGetAvgCutoffs(SCIP_VAR *var, SCIP_STAT *stat, SCIP_BRANCHDIR dir)
Definition: var.c:15669
SCIP_Real lb
Definition: struct_var.h:161
SCIP_Bool SCIPsetIsFeasGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6240
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:2339
SCIP_RETCODE SCIPreoptSaveActiveConss(SCIP_REOPT *reopt, SCIP_PROB *transprob, BMS_BLKMEM *blkmem)
Definition: reopt.c:8178
SCIP_RETCODE SCIPrealarraySetVal(SCIP_REALARRAY *realarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, SCIP_Real val)
Definition: misc.c:3876
int SCIPconshdlrGetNAddConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4919
SCIP_Longint nsbsolsfound
Definition: struct_stat.h:93
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
Definition: var.c:16827
SCIP_TREE * tree
Definition: struct_scip.h:84
SCIP_RETCODE SCIPdivesetCreate(SCIP_DIVESET **divesetptr, 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, unsigned int initialseed, SCIP_Bool backtrack, SCIP_Bool onlylpbranchcands, SCIP_DIVETYPE divetypemask, SCIP_DECL_DIVESETGETSCORE((*divesetgetscore)))
Definition: heur.c:184
declarations for XML parsing
SCIP_OBJSENSE SCIPgetObjsense(SCIP *scip)
Definition: scip.c:11049
SCIP_RETCODE SCIPlpGetBInvARow(SCIP_LP *lp, int r, SCIP_Real *binvrow, SCIP_Real *coef, int *inds, int *ninds)
Definition: lp.c:9682
void SCIPprobInvalidateDualbound(SCIP_PROB *prob)
Definition: prob.c:1574
void SCIPsolUpdateLPConsViolation(SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
Definition: sol.c:2348
void SCIPnodeselSetCopy(SCIP_NODESEL *nodesel, SCIP_DECL_NODESELCOPY((*nodeselcopy)))
Definition: nodesel.c:1092
int SCIPpricerGetNVarsFound(SCIP_PRICER *pricer)
Definition: pricer.c:604
void SCIProwMarkNotRemovableLocal(SCIP_ROW *row, SCIP_STAT *stat)
Definition: lp.c:7684
#define SCIP_VARTYPE_BINARY_CHAR
Definition: def.h:120
SCIP_RETCODE SCIPreleaseDialog(SCIP *scip, SCIP_DIALOG **dialog)
Definition: scip.c:9780
SCIP_RETCODE SCIPsetChgStringParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAM *param, const char *value)
Definition: set.c:3283
void SCIPconshdlrSetTrans(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
Definition: cons.c:4337
void SCIPcomprSetFree(SCIP_COMPR *compr, SCIP_DECL_COMPRFREE((*comprfree)))
Definition: compr.c:340
SCIP_RETCODE SCIPstartDive(SCIP *scip)
Definition: scip.c:35268
SCIP_RETCODE SCIPsetGetLongintParam(SCIP_SET *set, const char *name, SCIP_Longint *value)
Definition: set.c:2980
int SCIPsetInitializeRandomSeed(SCIP_SET *set, int initialseedvalue)
Definition: set.c:6956
SCIP_RETCODE SCIPintarrayClear(SCIP_INTARRAY *intarray)
Definition: misc.c:4195
SCIP_Real SCIPvarGetMultaggrUbLocal(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:8133
SCIP_RETCODE SCIPvarChgName(SCIP_VAR *var, BMS_BLKMEM *blkmem, const char *name)
Definition: var.c:2792
SCIP_RELAXATION * relaxation
Definition: struct_scip.h:82
build flags methods
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:1737
SCIP_RETCODE SCIPincludeExternalCodeInformation(SCIP *scip, const char *name, const char *description)
Definition: scip.c:9628
SCIP_Longint SCIPconcsolverGetNLPIterations(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:508
SCIP_CLOCK * nodeactivationtime
Definition: struct_stat.h:157
SCIP_RETCODE SCIPsetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:38813
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:18324
SCIP_Real SCIPgetNodeLowerbound(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:13445
void SCIPprobSetDeltrans(SCIP_PROB *prob, SCIP_DECL_PROBDELTRANS((*probdeltrans)))
Definition: prob.c:350
SCIP_RETCODE SCIPtransformProb(SCIP *scip)
Definition: scip.c:13935
SCIP_RETCODE SCIPsetNlpiPriority(SCIP *scip, SCIP_NLPI *nlpi, int priority)
Definition: scip.c:9613
void SCIPpropSetExitpre(SCIP_PROP *prop, SCIP_DECL_PROPEXITPRE((*propexitpre)))
Definition: prop.c:835
SCIP_Bool SCIPgetBoolarrayVal(SCIP *scip, SCIP_BOOLARRAY *boolarray, int idx)
Definition: scip.c:48235
SCIP_RETCODE SCIPconsMarkPropagate(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:6910
SCIP_Longint ndualzeroitlps
Definition: struct_stat.h:178
SCIP_Real firstlptime
Definition: struct_stat.h:128
SCIP_RETCODE SCIPconsEnforelax(SCIP_CONS *cons, SCIP_SET *set, SCIP_SOL *sol, SCIP_Bool solinfeasible, SCIP_RESULT *result)
Definition: cons.c:7327
SCIP_RETCODE SCIPsetChgCharParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAM *param, char value)
Definition: set.c:3245
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
Definition: scip.c:47076
SCIP_Bool SCIPdoNotMultaggr(SCIP *scip)
Definition: scip.c:25858
SCIP_DOM glbdom
Definition: struct_var.h:219
SCIP_Real SCIPsetEpsilon(SCIP_SET *set)
Definition: set.c:5658
SCIP_Bool dualfeasible
Definition: struct_lp.h:351
SCIP_RETCODE SCIPnlpGetStringPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, const char **sval)
Definition: nlp.c:6088
SCIP_Real SCIPgetVarConflictScoreCurrentRun(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26489
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:6534
struct SCIP_PricerData SCIP_PRICERDATA
Definition: type_pricer.h:36
SCIP_RETCODE SCIPbranchExtern(SCIP *scip, SCIP_RESULT *result)
Definition: scip.c:37818
SCIP_Real SCIPcolGetFarkasCoef(SCIP_COL *col, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:4038
SCIP_SEPA ** SCIPgetSepas(SCIP *scip)
Definition: scip.c:7536
int SCIPbranchcandGetNPrioPseudoInts(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:883
void SCIPsepaSetInit(SCIP_SEPA *sepa, SCIP_DECL_SEPAINIT((*sepainit)))
Definition: sepa.c:602
SCIP_Real SCIPgetNLPObjval(SCIP *scip)
Definition: scip.c:31687
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46989
SCIP_RETCODE SCIPconsEnable(SCIP_CONS *cons, SCIP_SET *set, SCIP_STAT *stat)
Definition: cons.c:6715
SCIP_Real * SCIPnlrowGetLinearCoefs(SCIP_NLROW *nlrow)
Definition: nlp.c:3265
#define SCIP_DECL_CONSHDLRCOPY(x)
Definition: type_cons.h:92
enum SCIP_Vartype SCIP_VARTYPE
Definition: type_var.h:60
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:6099
SCIP_Longint SCIPconflictGetNAppliedConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:3498
SCIP_Real SCIPgetAvgPseudocostScore(SCIP *scip)
Definition: scip.c:43768
SCIP_Real SCIPgetLPRootObjval(SCIP *scip)
Definition: scip.c:29497
SCIP_DECL_EVENTDELETE(EventhdlrNewSol::scip_delete)
SCIP_DECL_CONSCOPY(ConshdlrSubtour::scip_copy)
SCIP_Real SCIPgetVarSol(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:19832
SCIP_RETCODE SCIPstartDiveNLP(SCIP *scip)
Definition: scip.c:32012
SCIP_Longint SCIPgetNLimSolsFound(SCIP *scip)
Definition: scip.c:43646
enum Reopt_ConsType REOPT_CONSTYPE
Definition: type_reopt.h:67
SCIP_RETCODE SCIPsyncstoreCapture(SCIP_SYNCSTORE *syncstore)
Definition: syncstore.c:112
const char * SCIPnlrowGetName(SCIP_NLROW *nlrow)
Definition: nlp.c:3412
#define SCIP_DECL_PRICERFREE(x)
Definition: type_pricer.h:54
SCIP_VAR * negatedvar
Definition: struct_var.h:236
int nchildren
Definition: struct_tree.h:210
int SCIPgetNOrigImplVars(SCIP *scip)
Definition: scip.c:12333
SCIP_RETCODE SCIPsetProbDeltrans(SCIP *scip, SCIP_DECL_PROBDELTRANS((*probdeltrans)))
Definition: scip.c:10059
SCIP_Longint ninternalnodes
Definition: struct_stat.h:72
SCIP_Bool SCIPconsIsConflict(SCIP_CONS *cons)
Definition: cons.c:8135
SCIP_Bool performpresol
Definition: struct_stat.h:262
SCIP_Real SCIPgetColFarkasCoef(SCIP *scip, SCIP_COL *col)
Definition: scip.c:30225
int SCIPgetNLPCols(SCIP *scip)
Definition: scip.c:29618
SCIP_Real SCIPprobExternObjval(SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_SET *set, SCIP_Real objval)
Definition: prob.c:2069
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
Definition: scip.c:8129
SCIP_RETCODE SCIPsetPricerCopy(SCIP *scip, SCIP_PRICER *pricer, SCIP_DECL_PRICERCOPY((*pricercopy)))
Definition: scip.c:5545
#define nnodes
Definition: gastrans.c:65
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
Definition: var.c:17342
SCIP_Bool SCIPhasPerformedPresolve(SCIP *scip)
Definition: scip.c:1116
SCIP_Longint SCIPconflictGetNBoundexceedingLPConflictLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:8249
int SCIPgetPtrarrayMinIdx(SCIP *scip, SCIP_PTRARRAY *ptrarray)
Definition: scip.c:48398
SCIP_Real SCIPgetVarMultaggrLbGlobal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23860
SCIP_RETCODE SCIPnewProbingNode(SCIP *scip)
Definition: scip.c:35904
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:36775
SCIP_Real SCIPtreeGetLowerbound(SCIP_TREE *tree, SCIP_SET *set)
Definition: tree.c:7155
int SCIPcliqueGetNVars(SCIP_CLIQUE *clique)
Definition: implics.c:3343
void SCIPgmlWriteOpening(FILE *file, SCIP_Bool directed)
Definition: misc.c:671
SCIP_RETCODE SCIPprobAddCons(SCIP_PROB *prob, SCIP_SET *set, SCIP_STAT *stat, SCIP_CONS *cons)
Definition: prob.c:1266
void SCIPvarAdjustUb(SCIP_VAR *var, SCIP_SET *set, SCIP_Real *ub)
Definition: var.c:6169
void SCIPconshdlrSetExitpre(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITPRE((*consexitpre)))
Definition: cons.c:4286
SCIP_RETCODE SCIPconsEnfolp(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool solinfeasible, SCIP_RESULT *result)
Definition: cons.c:7285
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:47399
SCIP_Bool SCIPsetIsUbBetter(SCIP_SET *set, SCIP_Real newub, SCIP_Real oldlb, SCIP_Real oldub)
Definition: set.c:6624
void SCIPprimalAddOrigObjoffset(SCIP_PRIMAL *primal, SCIP_SET *set, SCIP_Real addval)
Definition: primal.c:509
SCIP_Bool SCIPvarIsTransformed(SCIP_VAR *var)
Definition: var.c:16804
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:1434
SCIP_RETCODE SCIPreoptReset(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition: reopt.c:5705
SCIP_Bool SCIPconsIsMarkedPropagate(SCIP_CONS *cons)
Definition: cons.c:8195
SCIP_Bool SCIPisDualfeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47471
int plungedepth
Definition: struct_stat.h:219
SCIP_RETCODE SCIPprimalCreate(SCIP_PRIMAL **primal)
Definition: primal.c:117
SCIP_RETCODE SCIPwriteParams(SCIP *scip, const char *filename, SCIP_Bool comments, SCIP_Bool onlychanged)
Definition: scip.c:4993
SCIP_RETCODE SCIPtightenVarUbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:23662
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:4406
int SCIPgetNPricevarsApplied(SCIP *scip)
Definition: scip.c:42868
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:5049
int nconshdlrs
Definition: struct_set.h:100
SCIP_Bool concurrent_presolvebefore
Definition: struct_set.h:520
SCIP_Bool inrestart
Definition: struct_stat.h:260
SCIP_Longint SCIPconflictGetNPropReconvergenceLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:5507
SCIP_Real SCIPcutpoolGetTime(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:1073
SCIP_VAR ** SCIPnlrowGetLinearVars(SCIP_NLROW *nlrow)
Definition: nlp.c:3255
SCIP_Bool SCIPsetIsDualfeasNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6517
SCIP_Real SCIPgetAvgPseudocost(SCIP *scip, SCIP_Real solvaldelta)
Definition: scip.c:43690
SCIP_Real SCIPsumepsilon(SCIP *scip)
Definition: scip.c:46429
int SCIPcutGetAge(SCIP_CUT *cut)
Definition: cutpool.c:382
#define SCIP_DECL_RELAXEXITSOL(x)
Definition: type_relax.h:93
SCIP_RETCODE SCIPinterruptSolve(SCIP *scip)
Definition: scip.c:17324
SCIP_NLPI ** SCIPgetNlpis(SCIP *scip)
Definition: scip.c:9589
SCIP_RETCODE SCIPconsDisablePropagation(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:6870
void SCIPconsSetLocal(SCIP_CONS *cons, SCIP_Bool local)
Definition: cons.c:6556
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:17783
SCIP_Real SCIPgetUpperbound(SCIP *scip)
Definition: scip.c:43426
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:636
SCIP_NODE * SCIPgetBestLeaf(SCIP *scip)
Definition: scip.c:41665
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:26825
SCIP_RETCODE SCIPtreeRestoreRelaxSol(SCIP_TREE *tree, SCIP_SET *set, SCIP_RELAXATION *relaxation, SCIP_PROB *transprob)
Definition: tree.c:6973
SCIP_RETCODE SCIPstartProbing(SCIP *scip)
Definition: scip.c:35858
SCIP_RETCODE SCIPprobDelVar(SCIP_PROB *prob, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_VAR *var, SCIP_Bool *deleted)
Definition: prob.c:993
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
Definition: misc.c:2874
SCIP_RETCODE SCIPlpGetBInvACol(SCIP_LP *lp, int c, SCIP_Real *coef, int *inds, int *ninds)
Definition: lp.c:9707
#define BMSclearMemoryArray(ptr, num)
Definition: memory.h:112
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_CONSENFORELAX((*consenforelax)), 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:5801
SCIP_DISP ** SCIPgetDisps(SCIP *scip)
Definition: scip.c:9406
SCIP_Real * SCIPnlpGetVarsUbDualsol(SCIP_NLP *nlp)
Definition: nlp.c:5915
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:1616
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:20409
SCIP_RETCODE SCIPdialoghdlrExec(SCIP_DIALOGHDLR *dialoghdlr, SCIP_SET *set)
Definition: dialog.c:376
SCIP_Longint nnodelps
Definition: struct_stat.h:185
SCIP_Bool SCIPisSumLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47210
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
Definition: scip.c:29640
SCIP_Real SCIPconflictGetPropTime(SCIP_CONFLICT *conflict)
Definition: conflict.c:5447
int SCIPgetNSepas(SCIP *scip)
Definition: scip.c:7549
SCIP_Bool SCIPsolIsPartial(SCIP_SOL *sol)
Definition: sol.c:2475
SCIP_RETCODE SCIPgetTransformedConss(SCIP *scip, int nconss, SCIP_CONS **conss, SCIP_CONS **transconss)
Definition: scip.c:28302
void xmlFreeNode(XML_NODE *node)
Definition: xmlparse.c:1262
common defines and data types used in all packages of SCIP
SCIP_Longint nnodes
Definition: struct_stat.h:71
SCIP_RETCODE SCIPsetConshdlrActive(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSACTIVE((*consactive)))
Definition: scip.c:6383
SCIP_RETCODE SCIPreoptSaveGlobalBounds(SCIP_REOPT *reopt, SCIP_PROB *transprob, BMS_BLKMEM *blkmem)
Definition: reopt.c:8140
int SCIPgetNExternBranchCands(SCIP *scip)
Definition: scip.c:37149
int SCIPgetNOrigBinVars(SCIP *scip)
Definition: scip.c:12279
SCIP_RETCODE SCIPparamWrite(SCIP_PARAM *param, SCIP_MESSAGEHDLR *messagehdlr, const char *filename, SCIP_Bool comments, SCIP_Bool onlychanged)
Definition: paramset.c:4658
SCIP_RETCODE SCIPupdateVarBranchPriority(SCIP *scip, SCIP_VAR *var, int branchpriority)
Definition: scip.c:25326
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:1840
SCIP_RETCODE SCIPsetProbDelorig(SCIP *scip, SCIP_DECL_PROBDELORIG((*probdelorig)))
Definition: scip.c:10017
#define SCIP_DECL_DISPOUTPUT(x)
Definition: type_disp.h:126
void SCIPswapInts(int *value1, int *value2)
Definition: misc.c:9613
SCIP_Real SCIPgetPseudoObjval(SCIP *scip)
Definition: scip.c:29458
SCIP_Bool misc_calcintegral
Definition: struct_set.h:361
int SCIPsolGetRunnum(SCIP_SOL *sol)
Definition: sol.c:2518
int nrootintfixingsrun
Definition: struct_stat.h:205
static SCIP_Real getUpperbound(SCIP *scip)
Definition: scip.c:491
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, SCIP_EXPRCURV curvature)
Definition: scip.c:32191
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:419
void SCIPdisableDebugSol(SCIP *scip)
Definition: scip.c:1175
SCIP_Real SCIPnlrowGetConstant(SCIP_NLROW *nlrow)
Definition: nlp.c:3235
void SCIPcolInvalidateStrongbranchData(SCIP_COL *col, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:4167
SCIP_RETCODE SCIPnlpInclude(SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition: nlp.c:5035
SCIP_CONCSOLVER ** SCIPgetConcurrentSolvers(SCIP *scip)
Definition: concurrent.c:118
int SCIPfclose(SCIP_FILE *fp)
Definition: fileio.c:219
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
SCIP_RETCODE SCIPendDive(SCIP *scip)
Definition: scip.c:35317
void SCIPaddNNodes(SCIP *scip, SCIP_Longint nnodes)
Definition: scip.c:42104
SCIP_RETCODE SCIPvarGetProbvarSum(SCIP_VAR **var, SCIP_SET *set, SCIP_Real *scalar, SCIP_Real *constant)
Definition: var.c:12057
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_Bool completely, SCIP_RESULT *result)
Definition: cons.c:3676
SCIP_RETCODE SCIPaddConflict(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons, SCIP_NODE *validnode, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
Definition: scip.c:13049
#define SCIP_DECL_CONFLICTFREE(x)
Definition: type_conflict.h:85
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:2861
SCIP_CUTPOOL * SCIPgetGlobalCutpool(SCIP *scip)
Definition: scip.c:34849
SCIP_NODE * root
Definition: struct_tree.h:175
int SCIPpropGetNDelConss(SCIP_PROP *prop)
Definition: prop.c:1162
#define SCIP_CALL_ABORT(x)
Definition: def.h:329
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
Definition: scip.c:47161
SCIP_RETCODE SCIPprimalFree(SCIP_PRIMAL **primal, BMS_BLKMEM *blkmem)
Definition: primal.c:147
void SCIPprintError(SCIP_RETCODE retcode)
Definition: scip.c:676
SCIP_RETCODE SCIPprimalUpdateRay(SCIP_PRIMAL *primal, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *primalray, BMS_BLKMEM *blkmem)
Definition: primal.c:566
SCIP_RETCODE SCIPsetExitPlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat)
Definition: set.c:4979
SCIP_RETCODE SCIPsetPropInitpre(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINITPRE((*propinitpre)))
Definition: scip.c:7791
internal methods for primal heuristics
SCIP_Real SCIPvarGetPseudoSol(SCIP_VAR *var)
Definition: var.c:17728
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:2405
SCIP_RETCODE SCIPfreeSolve(SCIP *scip, SCIP_Bool restart)
Definition: scip.c:17122
void SCIPfreeDisjointset(SCIP *scip, SCIP_DISJOINTSET **djset)
Definition: scip.c:48672
SCIP_RETCODE SCIPsetGetBoolParam(SCIP_SET *set, const char *name, SCIP_Bool *value)
Definition: set.c:2952
void SCIPrelaxSetExit(SCIP_RELAX *relax, SCIP_DECL_RELAXEXIT((*relaxexit)))
Definition: relax.c:411
static SCIP_RETCODE setupAndSolveFiniteSolSubscip(SCIP *scip, SCIP *subscip, SCIP_VAR **origvars, int norigvars, SCIP_Real *solvals, SCIP_Bool *success)
Definition: scip.c:38248
SCIP_RETCODE SCIPchgRowRhsDive(SCIP *scip, SCIP_ROW *row, SCIP_Real newrhs)
Definition: scip.c:35581
int SCIPgetNEnabledConss(SCIP *scip)
Definition: scip.c:43197
SCIP_DISP ** disps
Definition: struct_set.h:85
SCIP_RETCODE SCIPptrarrayCreate(SCIP_PTRARRAY **ptrarray, BMS_BLKMEM *blkmem)
Definition: misc.c:4704
SCIP_RETCODE SCIPsepastoreClearCuts(SCIP_SEPASTORE *sepastore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_LP *lp)
Definition: sepastore.c:1114
SCIP_RETCODE SCIPcleanupCliques(SCIP *scip, SCIP_Bool *infeasible)
Definition: scip.c:24836
SCIP_REOPTNODE * SCIPgetReoptnode(SCIP *scip, unsigned int id)
Definition: scip.c:16850
SCIP_Longint nrelaxsolsfound
Definition: struct_stat.h:91
SCIP_Real SCIPgetVarFarkasCoef(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:19471
SCIP_Bool SCIPisDualfeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47484
SCIP_RETCODE SCIPsetExitprePlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat)
Definition: set.c:5110
SCIP_RETCODE SCIPgetNlRowNLPActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *activity)
Definition: scip.c:32728
SCIP_ORIGINAL original
Definition: struct_var.h:223
SCIP_RETCODE SCIPsetConflicthdlrPriority(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, int priority)
Definition: scip.c:6853
SCIP_Real SCIPcolGetRedcost(SCIP_COL *col, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:3855
int npresols
Definition: struct_set.h:104
SCIP_RETCODE SCIPchgIntParam(SCIP *scip, SCIP_PARAM *param, int value)
Definition: scip.c:4662
#define SCIP_DECL_CONCSOLVERSYNCWRITE(x)
SCIP_Real SCIPnlrowGetLhs(SCIP_NLROW *nlrow)
Definition: nlp.c:3373
SCIP_LP * lp
Definition: struct_scip.h:80
int firstprimaldepth
Definition: struct_stat.h:253
int SCIPgetNReoptLeaves(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:16837
int SCIPpropGetNAddHoles(SCIP_PROP *prop)
Definition: prop.c:1152
SCIP_Real SCIPheurGetTime(SCIP_HEUR *heur)
Definition: heur.c:1386
SCIP_RETCODE SCIPresetParam(SCIP *scip, const char *name)
Definition: scip.c:5015
SCIP_Bool nlp_disable
Definition: struct_set.h:334
SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol)))
Definition: scip.c:6181
SCIP_VAR * SCIPvarGetTransVar(SCIP_VAR *var)
Definition: var.c:16979
#define SCIP_ALLOC(x)
Definition: def.h:361
SCIP_Longint SCIPgetNNodes(SCIP *scip)
Definition: scip.c:42133
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:2547
SCIP_Real SCIPlpGetColumnObjval(SCIP_LP *lp)
Definition: lp.c:12659
void SCIProwRecalcPseudoActivity(SCIP_ROW *row, SCIP_STAT *stat)
Definition: lp.c:6270
int lastnpresolchgsides
Definition: struct_stat.h:246
SCIP_RETCODE SCIPsetPropExit(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXIT((*propexit)))
Definition: scip.c:7743
SCIP_SEPASTORE * sepastoreprobing
Definition: struct_scip.h:92
int SCIPtreeGetNNodes(SCIP_TREE *tree)
Definition: tree.c:8157
#define SCIPdebugSolEnable(scip)
Definition: debug.h:264
SCIP_Longint SCIPgetNLPs(SCIP *scip)
Definition: scip.c:42314
#define SCIPABORT()
Definition: def.h:322
SCIP_RETCODE SCIPresetRepresentation(SCIP *scip, SCIP_REOPTNODE **representatives, int nrepresentatives)
Definition: scip.c:17015
SCIP_ROW ** SCIPgetCuts(SCIP *scip)
Definition: scip.c:35178
SCIP_Bool SCIPsetIsRelGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6749
SCIP_RETCODE SCIPsetRootDialog(SCIP *scip, SCIP_DIALOG *dialog)
Definition: scip.c:9797
SCIP_LPSOLSTAT lpsolstat
Definition: struct_lp.h:334
SCIP_RETCODE SCIPwriteVarName(SCIP *scip, FILE *file, SCIP_VAR *var, SCIP_Bool type)
Definition: scip.c:17735
#define SCIP_DECL_PRICERREDCOST(x)
Definition: type_pricer.h:130
SCIP_Real SCIPround(SCIP *scip, SCIP_Real val)
Definition: scip.c:47173
SCIP_Longint SCIPgetNInfeasibleLeaves(SCIP *scip)
Definition: scip.c:42232
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:2791
SCIP_Bool SCIPparamIsValidLongint(SCIP_PARAM *param, SCIP_Longint value)
Definition: paramset.c:4263
#define SCIP_DECL_HEUREXITSOL(x)
Definition: type_heur.h:108
SCIP_Bool SCIPsetIsDualfeasLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6407
SCIP_Longint nprobholechgs
Definition: struct_stat.h:107
int SCIPgetVarNStrongbranchs(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:21627
SCIP_RETCODE SCIPgetActiveVars(SCIP *scip, SCIP_VAR **vars, int *nvars, int varssize, int *requiredsize)
Definition: scip.c:19347
SCIP_RETCODE SCIPinitConssLP(BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_SEPASTORE *sepastore, SCIP_CUTPOOL *cutpool, 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:1076
#define SCIP_EVENTTYPE_PRESOLVEROUND
Definition: type_event.h:74
#define SCIP_DECL_NODESELSELECT(x)
Definition: type_nodesel.h:109
SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
Definition: var.c:16853
const char * SCIPlpiGetSolverName(void)
SCIP_RETCODE SCIPchgVarUbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:36084
SCIP_Real SCIPreoptGetSavingtime(SCIP_REOPT *reopt)
Definition: reopt.c:7598
SCIP_RETCODE SCIPnlrowRecalcPseudoActivity(SCIP_NLROW *nlrow, SCIP_SET *set, SCIP_STAT *stat)
Definition: nlp.c:2972
#define SCIP_DECL_CONCSOLVERCREATEINST(x)
SCIP_Real presol_abortfac
Definition: struct_set.h:403
int SCIPminorVersion(void)
Definition: scip.c:578
SCIP_Longint nlimsolsfound
Definition: struct_primal.h:40
SCIP_Real SCIPgetAvgConflictScoreCurrentRun(SCIP *scip)
Definition: scip.c:43890
SCIP_RETCODE SCIPsetIncludeConflicthdlr(SCIP_SET *set, SCIP_CONFLICTHDLR *conflicthdlr)
Definition: set.c:3763
int SCIPdivesetGetNCalls(SCIP_DIVESET *diveset)
Definition: heur.c:385
int SCIPgetNParams(SCIP *scip)
Definition: scip.c:5192
void SCIPsetSortSepas(SCIP_SET *set)
Definition: set.c:4028
void SCIPnodeselSetExitsol(SCIP_NODESEL *nodesel, SCIP_DECL_NODESELEXITSOL((*nodeselexitsol)))
Definition: nodesel.c:1147
void SCIPchildChgNodeselPrio(SCIP_TREE *tree, SCIP_NODE *child, SCIP_Real priority)
Definition: tree.c:2373
void SCIPprintOrigProblemStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44332
SCIP_Longint SCIPgetNFeasibleLeaves(SCIP *scip)
Definition: scip.c:42205
void SCIPupdateDivesetStats(SCIP *scip, SCIP_DIVESET *diveset, int nprobingnodes, int nbacktracks, SCIP_Longint nsolsfound, SCIP_Longint nbestsolsfound, SCIP_Bool leavewassol)
Definition: scip.c:36813
SCIP_Real SCIPvarGetMultaggrLbLocal(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:8067
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:30811
SCIP_RETCODE SCIPsetSetBoolParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_Bool value)
Definition: set.c:3087
int npresolupgdconss
Definition: struct_stat.h:234
const char * SCIPprobGetName(SCIP_PROB *prob)
Definition: prob.c:2296
void SCIPdisableVarHistory(SCIP *scip)
Definition: scip.c:25977
void SCIPstatMark(SCIP_STAT *stat)
Definition: stat.c:171
SCIP_Bool SCIPsetIsFracIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5950
SCIP_RETCODE SCIPstartClock(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip.c:46098
static SCIP_RETCODE displayRelevantStats(SCIP *scip)
Definition: scip.c:15675
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 completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *feasible)
Definition: sol.c:1593
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
Definition: scip.c:38911
double real
int SCIPpresolGetNAddConss(SCIP_PRESOL *presol)
Definition: presol.c:731
SCIP_Real SCIPgetVarAvgInferenceScore(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26690
SCIP_Bool SCIPnlpHasSolution(SCIP_NLP *nlp)
Definition: nlp.c:6012
SCIP_RETCODE SCIPaddObjoffset(SCIP *scip, SCIP_Real addval)
Definition: scip.c:11092
SCIP_Real SCIPgetVarObjDive(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:35613
SCIP_RETCODE SCIPdeactiveCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:29052
SCIP_Bool SCIPisInRestart(SCIP *scip)
Definition: scip.c:17582
union SCIP_Node::@10 data
void SCIPprintBuildOptions(SCIP *scip, FILE *file)
Definition: scip.c:646
SCIP_Bool SCIPisExactSolve(SCIP *scip)
Definition: scip.c:1032
#define SCIP_DECL_BRANCHEXIT(x)
Definition: type_branch.h:76
SCIP_RETCODE SCIPlpEndStrongbranch(SCIP_LP *lp)
Definition: lp.c:4098
#define SCIPdebugFreeSol(set)
Definition: debug.h:246
int lastnpresolaggrvars
Definition: struct_stat.h:238
void SCIPsetFocusnodeLP(SCIP *scip, SCIP_Bool solvelp)
Definition: scip.c:41916
int SCIPconshdlrGetNAddHoles(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4899
SCIP_RETCODE SCIPcopyDigraph(SCIP *scip, SCIP_DIGRAPH **targetdigraph, SCIP_DIGRAPH *sourcedigraph)
Definition: scip.c:48589
void SCIPnlrowSetCurvature(SCIP_NLROW *nlrow, SCIP_EXPRCURV curvature)
Definition: nlp.c:3402
void SCIPconshdlrSetInitlp(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp)))
Definition: cons.c:4348
SCIP_SOL * SCIPeventGetSol(SCIP_EVENT *event)
Definition: event.c:1223
SCIP_RETCODE SCIPchgBoolParam(SCIP *scip, SCIP_PARAM *param, SCIP_Bool value)
Definition: scip.c:4604
SCIP_RETCODE SCIPtreeCreateProbingNode(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
Definition: tree.c:6407
#define SCIP_DECL_TABLEOUTPUT(x)
Definition: type_table.h:108
SCIP_RETCODE SCIPintarrayCreate(SCIP_INTARRAY **intarray, BMS_BLKMEM *blkmem)
Definition: misc.c:3983
void SCIPlpUnmarkDivingObjChanged(SCIP_LP *lp)
Definition: lp.c:17023
SCIP_Real SCIPpropGetTime(SCIP_PROP *prop)
Definition: prop.c:1002
SCIP_RETCODE SCIPsetIncludeDisp(SCIP_SET *set, SCIP_DISP *disp)
Definition: set.c:4635
SCIP_RETCODE SCIPreoptMergeVarHistory(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR **vars, int nvars)
Definition: reopt.c:6517
SCIP_Real SCIPgetLhsLinear(SCIP *scip, SCIP_CONS *cons)
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:4321
SCIP_RETCODE SCIPconsInitlp(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool *infeasible)
Definition: cons.c:7371
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:23039
void SCIPprobMarkPermuted(SCIP_PROB *prob)
Definition: prob.c:2230
SCIP_Bool SCIPisRelLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47700
SCIP_RETCODE SCIPrelaxExec(SCIP_RELAX *relax, SCIP_SET *set, SCIP_STAT *stat, int depth, SCIP_Real *lowerbound, SCIP_RESULT *result)
Definition: relax.c:293
int SCIPpresolGetNChgBds(SCIP_PRESOL *presol)
Definition: presol.c:701
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:17979
SCIP_Longint SCIPgetNRootStrongbranchs(SCIP *scip)
Definition: scip.c:42780
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:5726
SCIP_Bool SCIPpropDoesPresolve(SCIP_PROP *prop)
Definition: prop.c:1232
SCIP_CONCSOLVERTYPE * SCIPfindConcsolverType(SCIP *scip, const char *name)
Definition: scip.c:7987
SCIP_Longint SCIPdivesetGetNProbingNodes(SCIP_DIVESET *diveset)
Definition: heur.c:475
SCIP_Bool SCIPcolIsInLP(SCIP_COL *col)
Definition: lp.c:16317
SCIP_RETCODE SCIPvarNegate(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR **negvar)
Definition: var.c:5627
SCIP_CONCSOLVERTYPE * SCIPsetFindConcsolverType(SCIP_SET *set, const char *name)
Definition: set.c:4215
SCIP_Real SCIPgetFirstLPTime(SCIP *scip)
Definition: scip.c:46396
int SCIPgetNProps(SCIP *scip)
Definition: scip.c:7899
SCIP_RETCODE SCIPsetSubscipsOff(SCIP *scip, SCIP_Bool quiet)
Definition: scip.c:5083
SCIP_Real SCIPconshdlrGetSetupTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4589
int subscipdepth
Definition: struct_stat.h:197
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
Definition: scip.c:47149
SCIP_RETCODE SCIPanalyzeConflict(SCIP *scip, int validdepth, SCIP_Bool *success)
Definition: scip.c:27504
SCIP_RETCODE SCIPsetRelaxInitsol(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXINITSOL((*relaxinitsol)))
Definition: scip.c:7246
int lastnpresolupgdconss
Definition: struct_stat.h:244
SCIP_RETCODE SCIPaddDialogInputLine(SCIP *scip, const char *inputline)
Definition: scip.c:9848
#define SCIP_DECL_TABLEEXITSOL(x)
Definition: type_table.h:99
SCIP_CLIQUE ** SCIPcliquetableGetCliques(SCIP_CLIQUETABLE *cliquetable)
Definition: implics.c:3499
#define SCIP_DECL_SEPAFREE(x)
Definition: type_sepa.h:55
SCIP_RETCODE SCIPsetNodeselStdPriority(SCIP *scip, SCIP_NODESEL *nodesel, int priority)
Definition: scip.c:8992
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_ROW *cut, SCIP_Bool forcecut, SCIP_Bool root, SCIP_Bool *infeasible)
Definition: sepastore.c:394
SCIP_RETCODE SCIPchgVarBranchFactor(SCIP *scip, SCIP_VAR *var, SCIP_Real branchfactor)
Definition: scip.c:25198
SCIP_RETCODE SCIPaddQuadElementsToNlRow(SCIP *scip, SCIP_NLROW *nlrow, int nquadelems, SCIP_QUADELEM *quadelems)
Definition: scip.c:32567
SCIP_RETCODE SCIPprintVar(SCIP *scip, SCIP_VAR *var, FILE *file)
Definition: scip.c:27102
SCIP_RETCODE SCIPsetReaderFree(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERFREE((*readerfree)))
Definition: scip.c:5326
SCIP_RETCODE SCIPvisualInit(SCIP_VISUAL *visual, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: visual.c:109
int SCIPgetNTables(SCIP *scip)
Definition: scip.c:9514
SCIP_RETCODE SCIPconflictstoreGetConflicts(SCIP_CONFLICTSTORE *conflictstore, SCIP_CONS **conflicts, int conflictsize, int *nconflicts)
void SCIPtreeMarkProbingObjChanged(SCIP_TREE *tree)
Definition: tree.c:8374
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
Definition: scip.c:4746
SCIP_Real SCIPgetPrimalRayVal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:41093
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:7203
SCIP_RETCODE SCIPenableReoptimization(SCIP *scip, SCIP_Bool enable)
Definition: scip.c:16604
SCIP_RETCODE SCIPconsSepalp(SCIP_CONS *cons, SCIP_SET *set, SCIP_RESULT *result)
Definition: cons.c:7397
SCIP_RETCODE SCIPevalExprtreeLocalBounds(SCIP *scip, SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *val)
Definition: scip.c:33231
struct SCIP_SepaData SCIP_SEPADATA
Definition: type_sepa.h:38
SCIP_Bool SCIPallowObjProp(SCIP *scip)
Definition: scip.c:25895
const XML_NODE * xmlNextSibl(const XML_NODE *node)
Definition: xmlparse.c:1436
SCIP_EVENTHDLR ** eventhdlrs
Definition: struct_set.h:81
SCIP_Bool SCIPparamIsValidString(SCIP_PARAM *param, const char *value)
Definition: paramset.c:4311
SCIP_Longint ninitlps
Definition: struct_stat.h:186
SCIP_RETCODE SCIPsetPresolExitpre(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXITPRE((*presolexitpre)))
Definition: scip.c:7032
SCIP_Real SCIPgetAvgInferenceScore(SCIP *scip)
Definition: scip.c:44001
SCIP_RETCODE SCIPgetNegatedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **negvar)
Definition: scip.c:19045
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:8781
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:914
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:87
int SCIPreoptGetNTotalRestartsLocal(SCIP_REOPT *reopt)
Definition: reopt.c:4923
SCIP callable library.
SCIP_RETCODE SCIPinitlpCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *infeasible)
Definition: scip.c:28811
SCIP_RETCODE SCIPsetPtrarrayVal(SCIP *scip, SCIP_PTRARRAY *ptrarray, int idx, void *val)
Definition: scip.c:48380
SCIP_Bool SCIPsetIsFeasNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6306
SCIP_RETCODE SCIPexprtreeEval(SCIP_EXPRTREE *tree, SCIP_Real *varvals, SCIP_Real *val)
Definition: expr.c:8723
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:4239
void SCIPconshdlrSetGetDiveBdChgs(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)))
Definition: cons.c:4469
SCIP_Real SCIPgetVarConflictScore(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26458
SCIP_RETCODE SCIPbranchcandUpdateVarBranchPriority(SCIP_BRANCHCAND *branchcand, SCIP_SET *set, SCIP_VAR *var, int branchpriority)
Definition: branch.c:1177
SCIP_Real SCIPvarGetPseudocostVariance(SCIP_VAR *var, SCIP_BRANCHDIR dir, SCIP_Bool onlycurrentrun)
Definition: var.c:14097
int SCIPgetNSepaRounds(SCIP *scip)
Definition: scip.c:42884
SCIP_Longint ndelayedcutoffs
Definition: struct_stat.h:86
void SCIPrelaxSetInit(SCIP_RELAX *relax, SCIP_DECL_RELAXINIT((*relaxinit)))
Definition: relax.c:400
void SCIPsetSortBranchrulesName(SCIP_SET *set)
Definition: set.c:4620
SCIP_Real SCIPgetPseudocostCount(SCIP *scip, SCIP_BRANCHDIR dir, SCIP_Bool onlycurrentrun)
Definition: scip.c:43816
SCIP_CLOCK * lpsoltime
Definition: struct_stat.h:153
SCIP_Bool SCIPcontainsExternBranchCand(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:37316
SCIP_Real SCIPgetRowActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:31071
SCIP_Real SCIPcomputeGap(SCIP_Real eps, SCIP_Real inf, SCIP_Real primalbound, SCIP_Real dualbound)
Definition: misc.c:10307
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
Definition: var.c:16949
static SCIP_RETCODE relabelOrderConsistent(SCIP *const scip, int *labels, int const nlabels, int *nclasses)
Definition: scip.c:24254
SCIP_Real objscale
Definition: struct_prob.h:42
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 completely, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition: primal.c:1581
SCIP_PROP ** props_presol
Definition: struct_set.h:78
SCIP_NODE * SCIPtreeGetPrioSibling(SCIP_TREE *tree)
Definition: tree.c:7031
SCIP_Real SCIPgetLPColumnObjval(SCIP *scip)
Definition: scip.c:29390
SCIP_NODE * focusnode
Definition: struct_tree.h:180
SCIP_Real SCIPgetAvgInferences(SCIP *scip, SCIP_BRANCHDIR dir)
Definition: scip.c:43963
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
Definition: var.c:16817
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip.c:780
SCIP_RETCODE SCIPcreateFiniteSolCopy(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol, SCIP_Bool *success)
Definition: scip.c:38399
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:33291
SCIP_Real SCIPgetRelaxSolVal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:20116
#define SCIP_DECL_PROPINIT(x)
Definition: type_prop.h:63
SCIP_RETCODE SCIPsolFree(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_PRIMAL *primal)
Definition: sol.c:751
SCIP_RELAX * SCIPfindRelax(SCIP *scip, const char *name)
Definition: scip.c:7279
struct SCIP_TableData SCIP_TABLEDATA
Definition: type_table.h:44
internal methods for displaying runtime statistics
int SCIPbranchcandGetNPrioExternImpls(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:546
SCIP_Real scalar
Definition: struct_var.h:176
void SCIPsetSortPricersName(SCIP_SET *set)
Definition: set.c:3587
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:37878
int nimplications
Definition: struct_stat.h:222
SCIP_Longint SCIPgetSolNodenum(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:39207
SCIP_CONFLICTHDLR * SCIPfindConflicthdlr(SCIP *scip, const char *name)
Definition: scip.c:6816
SCIP_RETCODE SCIPrealarrayClear(SCIP_REALARRAY *realarray)
Definition: misc.c:3824
uint64_t SCIP_EVENTTYPE
Definition: type_event.h:134
#define SCIPreallocBufferArray(scip, ptr, num)
Definition: scip.h:22624
void SCIPenableDebugSol(SCIP *scip)
Definition: scip.c:1162
#define SCIP_DECL_CONFLICTEXITSOL(x)
SCIP_RETCODE SCIPconsSetEnforced(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool enforce)
Definition: cons.c:6438
const char * SCIPdivesetGetName(SCIP_DIVESET *diveset)
Definition: heur.c:351
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:7658
SCIP_RETCODE SCIPfreePtrarray(SCIP *scip, SCIP_PTRARRAY **ptrarray)
Definition: scip.c:48315
void SCIPvarMarkDeleteGlobalStructures(SCIP_VAR *var)
Definition: var.c:16919
void SCIPpresolSetExitpre(SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXITPRE((*presolexitpre)))
Definition: presol.c:542
int SCIPdivesetGetMinDepth(SCIP_DIVESET *diveset)
Definition: heur.c:405
SCIP_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming)
Definition: scip.c:5994
int SCIPreoptGetNTotalPrunedNodes(SCIP_REOPT *reopt)
Definition: reopt.c:4983
SCIP_PRICER ** SCIPgetPricers(SCIP *scip)
Definition: scip.c:5694
const char * SCIPgetBuildFlags(void)
SCIP_RETCODE SCIPsetConsInitial(SCIP *scip, SCIP_CONS *cons, SCIP_Bool initial)
Definition: scip.c:27859
SCIP_RETCODE SCIPchgVarName(SCIP *scip, SCIP_VAR *var, const char *name)
Definition: scip.c:18817
SCIP_Longint ndivinglpiterations
Definition: struct_stat.h:65
SCIP_RETCODE SCIPreoptAddRun(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR **origvars, int norigvars, int size)
Definition: reopt.c:5365
OFINS - Objective Function Induced Neighborhood Search - a primal heuristic for reoptimization.
int SCIPpricestoreGetNProbPricings(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:633
SCIP_RETCODE SCIPseparateSolCutpool(SCIP *scip, SCIP_CUTPOOL *cutpool, SCIP_SOL *sol, SCIP_RESULT *result)
Definition: scip.c:35021
SCIP_RETCODE SCIPchgVarObjProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
Definition: scip.c:36213
SCIP_Real SCIPgetVarAvgCutoffScore(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26944
SCIP_RETCODE SCIPprintSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:39325