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-2017 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  SCIP_CALL( SCIPfreeTransform(scip) );
10532  /* for some reason the free transform can generate events caught in the globalbnd eventhander
10533  * which requires the concurrent so it must be freed afterwards this happened o instance fiber
10534  */
10535  SCIP_CALL( SCIPfreeConcurrent(scip) );
10536 
10537  assert(scip->set->stage == SCIP_STAGE_INIT || scip->set->stage == SCIP_STAGE_PROBLEM);
10538  scip->set->misc_transsolsorig = transsolorig;
10539 
10540  if( scip->set->stage == SCIP_STAGE_PROBLEM )
10541  {
10542  int i;
10543 
10544  /* free concsolvers and deinitialize the syncstore */
10545  if( scip->set->nconcsolvers > 0 )
10546  {
10547  assert(SCIPsyncstoreIsInitialized(scip->syncstore));
10548 
10551  }
10552 
10553  /* deactivate all pricers */
10554  for( i = scip->set->nactivepricers-1; i >= 0; --i )
10555  {
10556  SCIP_CALL( SCIPpricerDeactivate(scip->set->pricers[i], scip->set) );
10557  }
10558  assert(scip->set->nactivepricers == 0);
10559 
10560  /* free all debug data */
10562 
10563  /* free original primal solution candidate pool, original problem and problem statistics data structures */
10564  if( scip->set->reopt_enable || scip->reopt != NULL)
10565  {
10566  SCIP_CALL( SCIPreoptFree(&scip->reopt, scip->set, scip->origprimal, scip->mem->probmem) );
10567  }
10568  SCIP_CALL( SCIPconflictstoreFree(&scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->reopt) );
10569  SCIP_CALL( SCIPprimalFree(&scip->origprimal, scip->mem->probmem) );
10570  SCIP_CALL( SCIPprobFree(&scip->origprob, scip->messagehdlr, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
10571  SCIP_CALL( SCIPstatFree(&scip->stat, scip->mem->probmem) );
10572 
10573  /* readers */
10574  for( i = 0; i < scip->set->nreaders; ++i )
10575  {
10577  }
10578 
10579  /* switch stage to INIT */
10580  scip->set->stage = SCIP_STAGE_INIT;
10581  }
10582  assert(scip->set->stage == SCIP_STAGE_INIT);
10583 
10584  return SCIP_OKAY;
10585 }
10586 
10587 
10588 /** permutes parts of the problem data structure
10589  *
10590  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10591  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10592  *
10593  * @pre This method can be called if @p scip is in one of the following stages:
10594  * - \ref SCIP_STAGE_PROBLEM
10595  * - \ref SCIP_STAGE_TRANSFORMED
10596  *
10597  * @todo This need to be changed to use the new random number generator implemented in random.c
10598  */
10600  SCIP* scip, /**< SCIP data structure */
10601  unsigned int randseed, /**< seed value for random generator */
10602  SCIP_Bool permuteconss, /**< should the list of constraints in each constraint handler be permuted? */
10603  SCIP_Bool permutebinvars, /**< should the list of binary variables be permuted? */
10604  SCIP_Bool permuteintvars, /**< should the list of integer variables be permuted? */
10605  SCIP_Bool permuteimplvars, /**< should the list of implicit integer variables be permuted? */
10606  SCIP_Bool permutecontvars /**< should the list of continuous integer variables be permuted? */
10607  )
10608 {
10609  SCIP_VAR** vars;
10610  SCIP_CONSHDLR** conshdlrs;
10611  SCIP_RANDNUMGEN* randnumgen;
10612  SCIP_Bool permuted;
10613  int nconshdlrs;
10614  int nbinvars;
10615  int nintvars;
10616  int nimplvars;
10617  int nvars;
10618  int j;
10619 
10620  assert(scip != NULL);
10621  SCIP_CALL( checkStage(scip, "SCIPpermuteProb", FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
10622 
10623  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, &nbinvars, &nintvars, &nimplvars, NULL) );
10624 
10625  assert(nvars == 0 || vars != NULL);
10626  assert(nvars == nbinvars+nintvars+nimplvars+SCIPgetNContVars(scip));
10627 
10628  conshdlrs = SCIPgetConshdlrs(scip);
10629  nconshdlrs = SCIPgetNConshdlrs(scip);
10630  assert(nconshdlrs == 0 || conshdlrs != NULL);
10631 
10632  /* create a random number generator */
10633  SCIP_CALL( SCIPcreateRandom(scip, &randnumgen, randseed) );
10634 
10635  /* The constraint handler should not be permuted since they are called w.r.t. to certain properties; besides
10636  * that the "conshdlrs" array should stay in the order as it is since this array is used to copy the plugins for
10637  * sub-SCIPs and contains the dependencies between the constraint handlers; for example the linear constraint
10638  * handler stays in front of all constraint handler which can upgrade a linear constraint (such as logicor,
10639  * setppc, and knapsack).
10640  */
10641 
10642  permuted = FALSE;
10643 
10644  /* for each constraint handler, permute its constraints */
10645  if( permuteconss )
10646  {
10647  int i;
10648 
10649  /* we must only permute active constraints */
10650  if( SCIPisTransformed(scip) && !SCIPprobIsPermuted(scip->transprob) )
10651  {
10652  /* loop over all constraint handlers */
10653  for( i = 0; i < nconshdlrs; ++i )
10654  {
10655  SCIP_CONS** conss;
10656  int nconss;
10657 
10658  conss = SCIPconshdlrGetConss(conshdlrs[i]);
10659  nconss = SCIPconshdlrGetNActiveConss(conshdlrs[i]);
10660 
10661  assert(nconss == 0 || conss != NULL);
10662 
10663  SCIPrandomPermuteArray(randnumgen, (void**)conss, 0, nconss);
10664 
10665  /* readjust the mapping of constraints to array positions */
10666  for( j = 0; j < nconss; ++j )
10667  conss[j]->consspos = j;
10668 
10669  permuted = TRUE;
10670  }
10671  }
10672  else if( !SCIPisTransformed(scip) && !SCIPprobIsPermuted(scip->origprob) )
10673  {
10674  SCIP_CONS** conss = scip->origprob->conss;
10675  int nconss = scip->origprob->nconss;
10676 
10677  SCIPrandomPermuteArray(randnumgen, (void**)conss, 0, nconss);
10678 
10679  for( j = 0; j < nconss; ++j )
10680  {
10681  assert(conss[j]->consspos == -1);
10682  conss[j]->addarraypos = j;
10683  }
10684 
10685  permuted = TRUE;
10686  }
10687  }
10688 
10689  /* permute binary variables */
10690  if( permutebinvars && !SCIPprobIsPermuted(scip->origprob) )
10691  {
10692  SCIPrandomPermuteArray(randnumgen, (void**)vars, 0, nbinvars);
10693 
10694  /* readjust the mapping of variables to array positions */
10695  for( j = 0; j < nbinvars; ++j )
10696  vars[j]->probindex = j;
10697 
10698  permuted = TRUE;
10699  }
10700 
10701  /* permute general integer variables */
10702  if( permuteintvars && !SCIPprobIsPermuted(scip->origprob) )
10703  {
10704  SCIPrandomPermuteArray(randnumgen, (void**)vars, nbinvars, nbinvars+nintvars);
10705 
10706  /* readjust the mapping of variables to array positions */
10707  for( j = nbinvars; j < nbinvars+nintvars; ++j )
10708  vars[j]->probindex = j;
10709 
10710  permuted = TRUE;
10711  }
10712 
10713  /* permute general integer variables */
10714  if( permuteimplvars && !SCIPprobIsPermuted(scip->origprob) )
10715  {
10716  SCIPrandomPermuteArray(randnumgen, (void**)vars, nbinvars+nintvars, nbinvars+nintvars+nimplvars);
10717 
10718  /* readjust the mapping of variables to array positions */
10719  for( j = nbinvars+nintvars; j < nbinvars+nintvars+nimplvars; ++j )
10720  vars[j]->probindex = j;
10721 
10722  permuted = TRUE;
10723  }
10724 
10725  /* permute general integer variables */
10726  if( permutecontvars && !SCIPprobIsPermuted(scip->origprob) )
10727  {
10728  SCIPrandomPermuteArray(randnumgen, (void**)vars, nbinvars+nintvars+nimplvars, nvars);
10729 
10730  /* readjust the mapping of variables to array positions */
10731  for( j = nbinvars+nintvars+nimplvars; j < nvars; ++j )
10732  vars[j]->probindex = j;
10733 
10734  permuted = TRUE;
10735  }
10736 
10737  if( permuted && SCIPisTransformed(scip) )
10738  {
10739  assert(!SCIPprobIsPermuted(scip->transprob));
10740 
10741  /* mark tranformed problem as permuted */
10743 
10745  "permute transformed problem using random seed %u\n", randseed);
10746  }
10747  else if( permuted && !SCIPisTransformed(scip) )
10748  {
10749  assert(!SCIPprobIsPermuted(scip->origprob));
10750 
10751  /* mark original problem as permuted */
10753 
10755  "permute original problem using random seed %u\n", randseed);
10756  }
10757 
10758  /* free random number generator */
10759  SCIPfreeRandom(scip, &randnumgen);
10760 
10761  return SCIP_OKAY;
10762 }
10763 
10764 /** gets user problem data
10765  *
10766  * @return a SCIP_PROBDATA pointer, or NULL if no problem data was allocated
10767  *
10768  * @pre This method can be called if @p scip is in one of the following stages:
10769  * - \ref SCIP_STAGE_PROBLEM
10770  * - \ref SCIP_STAGE_TRANSFORMING
10771  * - \ref SCIP_STAGE_TRANSFORMED
10772  * - \ref SCIP_STAGE_INITPRESOLVE
10773  * - \ref SCIP_STAGE_PRESOLVING
10774  * - \ref SCIP_STAGE_EXITPRESOLVE
10775  * - \ref SCIP_STAGE_PRESOLVED
10776  * - \ref SCIP_STAGE_INITSOLVE
10777  * - \ref SCIP_STAGE_SOLVING
10778  * - \ref SCIP_STAGE_SOLVED
10779  * - \ref SCIP_STAGE_EXITSOLVE
10780  * - \ref SCIP_STAGE_FREETRANS
10781  */
10783  SCIP* scip /**< SCIP data structure */
10784  )
10785 {
10786  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetProbData", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
10787 
10788  switch( scip->set->stage )
10789  {
10790  case SCIP_STAGE_PROBLEM:
10791  return SCIPprobGetData(scip->origprob);
10792 
10796  case SCIP_STAGE_PRESOLVING:
10798  case SCIP_STAGE_PRESOLVED:
10799  case SCIP_STAGE_INITSOLVE:
10800  case SCIP_STAGE_SOLVING:
10801  case SCIP_STAGE_SOLVED:
10802  case SCIP_STAGE_EXITSOLVE:
10803  case SCIP_STAGE_FREETRANS:
10804  return SCIPprobGetData(scip->transprob);
10805 
10806  default:
10807  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
10808  SCIPABORT();
10809  return NULL; /*lint !e527*/
10810  } /*lint !e788*/
10811 }
10812 
10813 /** sets user problem data
10814  *
10815  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10816  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10817  *
10818  * @pre This method can be called if @p scip is in one of the following stages:
10819  * - \ref SCIP_STAGE_PROBLEM
10820  * - \ref SCIP_STAGE_TRANSFORMING
10821  * - \ref SCIP_STAGE_TRANSFORMED
10822  * - \ref SCIP_STAGE_INITPRESOLVE
10823  * - \ref SCIP_STAGE_PRESOLVING
10824  * - \ref SCIP_STAGE_EXITPRESOLVE
10825  * - \ref SCIP_STAGE_PRESOLVED
10826  * - \ref SCIP_STAGE_INITSOLVE
10827  * - \ref SCIP_STAGE_SOLVING
10828  * - \ref SCIP_STAGE_SOLVED
10829  * - \ref SCIP_STAGE_EXITSOLVE
10830  * - \ref SCIP_STAGE_FREETRANS
10831  */
10833  SCIP* scip, /**< SCIP data structure */
10834  SCIP_PROBDATA* probdata /**< user problem data to use */
10835  )
10836 {
10837  SCIP_CALL( checkStage(scip, "SCIPsetProbData", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
10838 
10839  switch( scip->set->stage )
10840  {
10841  case SCIP_STAGE_PROBLEM:
10842  SCIPprobSetData(scip->origprob, probdata);
10843  return SCIP_OKAY;
10844 
10848  case SCIP_STAGE_PRESOLVING:
10850  case SCIP_STAGE_PRESOLVED:
10851  case SCIP_STAGE_INITSOLVE:
10852  case SCIP_STAGE_SOLVING:
10853  case SCIP_STAGE_SOLVED:
10854  case SCIP_STAGE_EXITSOLVE:
10855  case SCIP_STAGE_FREETRANS:
10856  SCIPprobSetData(scip->transprob, probdata);
10857  return SCIP_OKAY;
10858 
10859  case SCIP_STAGE_INIT:
10860  case SCIP_STAGE_FREE:
10861  default:
10862  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
10863  return SCIP_INVALIDCALL;
10864  }
10865 }
10866 
10867 /** returns name of the current problem instance
10868  *
10869  * @return name of the current problem instance
10870  *
10871  * @pre This method can be called if @p scip is in one of the following stages:
10872  * - \ref SCIP_STAGE_PROBLEM
10873  * - \ref SCIP_STAGE_TRANSFORMING
10874  * - \ref SCIP_STAGE_TRANSFORMED
10875  * - \ref SCIP_STAGE_INITPRESOLVE
10876  * - \ref SCIP_STAGE_PRESOLVING
10877  * - \ref SCIP_STAGE_EXITPRESOLVE
10878  * - \ref SCIP_STAGE_PRESOLVED
10879  * - \ref SCIP_STAGE_INITSOLVE
10880  * - \ref SCIP_STAGE_SOLVING
10881  * - \ref SCIP_STAGE_SOLVED
10882  * - \ref SCIP_STAGE_EXITSOLVE
10883  * - \ref SCIP_STAGE_FREETRANS
10884  */
10885 const char* SCIPgetProbName(
10886  SCIP* scip /**< SCIP data structure */
10887  )
10888 {
10889  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetProbName", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
10890 
10891  return SCIPprobGetName(scip->origprob);
10892 }
10893 
10894 /** sets name of the current problem instance
10895  *
10896  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10897  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10898  *
10899  * @pre This method can be called if @p scip is in one of the following stages:
10900  * - \ref SCIP_STAGE_PROBLEM
10901  * - \ref SCIP_STAGE_TRANSFORMING
10902  * - \ref SCIP_STAGE_TRANSFORMED
10903  * - \ref SCIP_STAGE_INITPRESOLVE
10904  * - \ref SCIP_STAGE_PRESOLVING
10905  * - \ref SCIP_STAGE_EXITPRESOLVE
10906  * - \ref SCIP_STAGE_PRESOLVED
10907  * - \ref SCIP_STAGE_INITSOLVE
10908  * - \ref SCIP_STAGE_SOLVING
10909  * - \ref SCIP_STAGE_SOLVED
10910  * - \ref SCIP_STAGE_EXITSOLVE
10911  * - \ref SCIP_STAGE_FREETRANS
10912  */
10914  SCIP* scip, /**< SCIP data structure */
10915  const char* name /**< name to be set */
10916  )
10917 {
10918  SCIP_CALL( checkStage(scip, "SCIPsetProbName", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
10919 
10920  return SCIPprobSetName(scip->origprob, name);
10921 }
10922 
10923 /** changes the objective function of the original problem.
10924  *
10925  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10926  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10927  *
10928  * @pre This method can be called if @p scip is in one of the following stages:
10929  * - \ref SCIP_STAGE_PROBLEM
10930  * - \ref SCIP_STAGE_PRESOLVED
10931  *
10932  * @note This method should be only used to change the objective function during two reoptimization runs and is only
10933  * recommended to an experienced user.
10934  *
10935  * @note All variables not given in \p vars array are assumed to have an objective coefficient of zero.
10936  */
10938  SCIP* scip, /**< SCIP data structure */
10939  SCIP_OBJSENSE objsense, /**< new objective function */
10940  SCIP_VAR** vars, /**< original problem variables */
10941  SCIP_Real* coefs, /**< objective coefficients */
10942  int nvars /**< variables in vars array */
10943  )
10944 {
10945  SCIP_VAR** origvars;
10946  int norigvars;
10947  int i;
10948 
10949  SCIP_CALL( checkStage(scip, "SCIPchgReoptObjective", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
10950 
10951  assert(nvars == 0 || vars != NULL);
10952  assert(nvars == 0 || coefs != NULL);
10953 
10954  origvars = scip->origprob->vars;
10955  norigvars = scip->origprob->nvars;
10956 
10957 #ifdef SCIP_MORE_DEBUG
10958  SCIPdebugMsg(scip, "objective function need to be set:\n");
10959  for( i = 0; i < nvars; i++ )
10960  {
10961  if( !SCIPisZero(scip, coefs[i]) )
10962  SCIPdebugMsg(scip, "%s%g <%s> ", SCIPisPositive(scip, coefs[i]) ? "+" : "", coefs[i], SCIPvarGetName(vars[i]));
10963  }
10964  SCIPdebugMsg(scip, "\n");
10965 #endif
10966 
10967  /* Set all coefficients of original variables to 0, since we will add the new objective coefficients later. */
10968  for( i = 0; i < norigvars; i++ )
10969  {
10970  SCIP_CALL( SCIPchgVarObj(scip, origvars[i], 0.0) );
10971  }
10972 
10973  if( scip->set->stage >= SCIP_STAGE_TRANSFORMED )
10974  {
10975  /* In order to avoid numerical troubles, also explicitly set all transformed objective coefficients to 0. */
10976  for( i = 0; i < scip->transprob->nvars; i++ )
10977  {
10978  SCIP_CALL( SCIPchgVarObj(scip, scip->transprob->vars[i], 0.0) );
10979  }
10980  }
10981 
10982  /* reset objective data of original problem */
10983  scip->origprob->objscale = 1.0;
10984  scip->origprob->objsense = objsense;
10985  scip->origprob->objoffset = 0.0;
10986  scip->origprob->objisintegral = FALSE;
10987 
10988  if( scip->set->stage >= SCIP_STAGE_TRANSFORMED )
10989  {
10990  /* reset objective data of transformed problem */
10991  scip->transprob->objscale = 1.0;
10992  scip->transprob->objsense = objsense;
10993  scip->transprob->objoffset = 0.0;
10994  scip->transprob->objisintegral = FALSE;
10995  }
10996 
10997  /* set new objective values */
10998  for( i = 0; i < nvars; ++i )
10999  {
11000  if( !SCIPvarIsOriginal(vars[i]) )
11001  {
11002  SCIPerrorMessage("Cannot handle variable <%s> (status: %d) in SCIPchgReoptObjective().\n",
11003  SCIPvarGetName(vars[i]), SCIPvarGetStatus(vars[i]));
11004  return SCIP_INVALIDDATA;
11005  }
11006 
11007  /* Add coefficients because this gets transferred to the transformed problem (the coefficients were set to 0 above). */
11008  SCIP_CALL( SCIPaddVarObj(scip, vars[i], coefs[i]) );
11009  }
11010 
11011 #ifdef SCIP_MORE_DEBUG
11012  SCIPdebugMsg(scip, "new objective function:\n");
11013  for( i = 0; i < norigvars; i++ )
11014  {
11015  SCIP_Real objval = SCIPvarGetObj(origvars[i]);
11016  if( !SCIPisZero(scip, objval) )
11017  SCIPdebugMsg(scip, "%s%g <%s> ", SCIPisPositive(scip, objval) ? "+" : "", objval, SCIPvarGetName(origvars[i]));
11018  }
11019  SCIPdebugMsg(scip, "\n");
11020 #endif
11021 
11022  return SCIP_OKAY;
11023 }
11024 
11025 /** returns objective sense of original problem
11026  *
11027  * @return objective sense of original problem
11028  *
11029  * @pre This method can be called if @p scip is in one of the following stages:
11030  * - \ref SCIP_STAGE_PROBLEM
11031  * - \ref SCIP_STAGE_TRANSFORMING
11032  * - \ref SCIP_STAGE_TRANSFORMED
11033  * - \ref SCIP_STAGE_INITPRESOLVE
11034  * - \ref SCIP_STAGE_PRESOLVING
11035  * - \ref SCIP_STAGE_EXITPRESOLVE
11036  * - \ref SCIP_STAGE_PRESOLVED
11037  * - \ref SCIP_STAGE_INITSOLVE
11038  * - \ref SCIP_STAGE_SOLVING
11039  * - \ref SCIP_STAGE_SOLVED
11040  * - \ref SCIP_STAGE_EXITSOLVE
11041  * - \ref SCIP_STAGE_FREETRANS
11042  */
11044  SCIP* scip /**< SCIP data structure */
11045  )
11046 {
11047  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetObjsense", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
11048 
11049  return scip->origprob->objsense;
11050 }
11051 
11052 /** sets objective sense of problem
11053  *
11054  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
11055  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11056  *
11057  * @pre This method can be called if @p scip is in one of the following stages:
11058  * - \ref SCIP_STAGE_PROBLEM
11059  */
11061  SCIP* scip, /**< SCIP data structure */
11062  SCIP_OBJSENSE objsense /**< new objective sense */
11063  )
11064 {
11065  SCIP_CALL( checkStage(scip, "SCIPsetObjsense", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
11066 
11067  if( objsense != SCIP_OBJSENSE_MAXIMIZE && objsense != SCIP_OBJSENSE_MINIMIZE )
11068  {
11069  SCIPerrorMessage("invalid objective sense\n");
11070  return SCIP_INVALIDDATA;
11071  }
11072 
11073  SCIPprobSetObjsense(scip->origprob, objsense);
11074 
11075  return SCIP_OKAY;
11076 }
11077 
11078 /** adds offset of objective function
11079  *
11080  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
11081  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11082  *
11083  * @pre This method can be called if @p scip is in one of the following stages:
11084  * - \ref SCIP_STAGE_PRESOLVING
11085  */
11087  SCIP* scip, /**< SCIP data structure */
11088  SCIP_Real addval /**< value to add to objective offset */
11089  )
11090 {
11091  SCIP_CALL( checkStage(scip, "SCIPaddObjoffset", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
11092 
11093  SCIPprobAddObjoffset(scip->transprob, addval);
11094  SCIP_CALL( SCIPprimalUpdateObjoffset(scip->primal, SCIPblkmem(scip), scip->set, scip->stat,
11095  scip->eventqueue, scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
11096 
11097  return SCIP_OKAY;
11098 }
11099 
11100 /** adds offset of objective function to original problem and to all existing solution in original space
11101  *
11102  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
11103  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11104  *
11105  * @pre This method can be called if @p scip is in one of the following stages:
11106  * - \ref SCIP_STAGE_PROBLEM
11107  */
11109  SCIP* scip, /**< SCIP data structure */
11110  SCIP_Real addval /**< value to add to objective offset */
11111  )
11112 {
11113  SCIP_CALL( checkStage(scip, "SCIPaddOrigObjoffset", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
11114 
11115  scip->origprob->objoffset += addval;
11116  SCIPprimalAddOrigObjoffset(scip->origprimal, scip->set, addval);
11117 
11118  return SCIP_OKAY;
11119 }
11120 
11121 /** returns the objective offset of the original problem
11122  *
11123  * @return the objective offset of the original problem
11124  *
11125  * @pre This method can be called if @p scip is in one of the following stages:
11126  * - \ref SCIP_STAGE_PROBLEM
11127  * - \ref SCIP_STAGE_TRANSFORMING
11128  * - \ref SCIP_STAGE_TRANSFORMED
11129  * - \ref SCIP_STAGE_INITPRESOLVE
11130  * - \ref SCIP_STAGE_PRESOLVING
11131  * - \ref SCIP_STAGE_EXITPRESOLVE
11132  * - \ref SCIP_STAGE_PRESOLVED
11133  * - \ref SCIP_STAGE_INITSOLVE
11134  * - \ref SCIP_STAGE_SOLVING
11135  * - \ref SCIP_STAGE_SOLVED
11136  */
11138  SCIP* scip /**< SCIP data structure */
11139  )
11140 {
11141  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetOrigObjoffset", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11142 
11143  return scip->origprob->objoffset;
11144 }
11145 
11146 /** returns the objective scale of the original problem
11147  *
11148  * @return the objective scale of the original problem
11149  *
11150  * @pre This method can be called if @p scip is in one of the following stages:
11151  * - \ref SCIP_STAGE_PROBLEM
11152  * - \ref SCIP_STAGE_TRANSFORMING
11153  * - \ref SCIP_STAGE_TRANSFORMED
11154  * - \ref SCIP_STAGE_INITPRESOLVE
11155  * - \ref SCIP_STAGE_PRESOLVING
11156  * - \ref SCIP_STAGE_EXITPRESOLVE
11157  * - \ref SCIP_STAGE_PRESOLVED
11158  * - \ref SCIP_STAGE_INITSOLVE
11159  * - \ref SCIP_STAGE_SOLVING
11160  * - \ref SCIP_STAGE_SOLVED
11161  */
11163  SCIP* scip /**< SCIP data structure */
11164  )
11165 {
11166  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetOrigObjscale", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11167 
11168  return scip->origprob->objscale;
11169 }
11170 
11171 /** returns the objective offset of the transformed problem
11172  *
11173  * @return the objective offset of the transformed problem
11174  *
11175  * @pre This method can be called if @p scip is in one of the following stages:
11176  * - \ref SCIP_STAGE_TRANSFORMED
11177  * - \ref SCIP_STAGE_INITPRESOLVE
11178  * - \ref SCIP_STAGE_PRESOLVING
11179  * - \ref SCIP_STAGE_EXITPRESOLVE
11180  * - \ref SCIP_STAGE_PRESOLVED
11181  * - \ref SCIP_STAGE_INITSOLVE
11182  * - \ref SCIP_STAGE_SOLVING
11183  * - \ref SCIP_STAGE_SOLVED
11184  */
11186  SCIP* scip /**< SCIP data structure */
11187  )
11188 {
11189  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetTransObjoffset", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11190 
11191  return scip->transprob->objoffset;
11192 }
11193 
11194 /** returns the objective scale of the transformed problem
11195  *
11196  * @return the objective scale of the transformed problem
11197  *
11198  * @pre This method can be called if @p scip is in one of the following stages:
11199  * - \ref SCIP_STAGE_TRANSFORMED
11200  * - \ref SCIP_STAGE_INITPRESOLVE
11201  * - \ref SCIP_STAGE_PRESOLVING
11202  * - \ref SCIP_STAGE_EXITPRESOLVE
11203  * - \ref SCIP_STAGE_PRESOLVED
11204  * - \ref SCIP_STAGE_INITSOLVE
11205  * - \ref SCIP_STAGE_SOLVING
11206  * - \ref SCIP_STAGE_SOLVED
11207  */
11209  SCIP* scip /**< SCIP data structure */
11210  )
11211 {
11212  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetTransObjscale", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11213 
11214  return scip->transprob->objscale;
11215 }
11216 
11217 /** sets limit on objective function, such that only solutions better than this limit are accepted
11218  *
11219  * @note SCIP will only look for solutions with a strictly better objective value, thus, e.g., prune
11220  * all branch-and-bound nodes with dual bound equal or worse to the objective limit.
11221  * However, SCIP will also collect solutions with objective value worse than the objective limit and
11222  * use them to run improvement heuristics on them.
11223  * @note If SCIP can prove that there exists no solution with a strictly better objective value, the solving status
11224  * will normally be infeasible (the objective limit is interpreted as part of the problem).
11225  * The only exception is that by chance, SCIP found a solution with the same objective value and thus
11226  * proved the optimality of this solution, resulting in solution status optimal.
11227  *
11228  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
11229  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11230  *
11231  * @pre This method can be called if @p scip is in one of the following stages:
11232  * - \ref SCIP_STAGE_PROBLEM
11233  * - \ref SCIP_STAGE_TRANSFORMED
11234  * - \ref SCIP_STAGE_INITPRESOLVE
11235  * - \ref SCIP_STAGE_PRESOLVING
11236  * - \ref SCIP_STAGE_EXITPRESOLVE
11237  * - \ref SCIP_STAGE_PRESOLVED
11238  * - \ref SCIP_STAGE_SOLVING
11239  */
11241  SCIP* scip, /**< SCIP data structure */
11242  SCIP_Real objlimit /**< new primal objective limit */
11243  )
11244 {
11245  SCIP_Real oldobjlimit;
11246 
11247  SCIP_CALL( checkStage(scip, "SCIPsetObjlimit", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
11248 
11249  switch( scip->set->stage )
11250  {
11251  case SCIP_STAGE_PROBLEM:
11252  SCIPprobSetObjlim(scip->origprob, objlimit);
11253  break;
11254  case SCIP_STAGE_PRESOLVED:
11255  oldobjlimit = SCIPprobGetObjlim(scip->origprob, scip->set);
11256  assert(oldobjlimit == SCIPprobGetObjlim(scip->transprob, scip->set)); /*lint !e777*/
11257  if( SCIPtransformObj(scip, objlimit) > SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, oldobjlimit) && ! scip->set->reopt_enable)
11258  {
11259  SCIPerrorMessage("cannot relax objective limit from %.15g to %.15g in presolved stage.\n", oldobjlimit, objlimit);
11260  return SCIP_INVALIDDATA;
11261  }
11262  SCIPprobSetObjlim(scip->origprob, objlimit);
11263  SCIPprobSetObjlim(scip->transprob, objlimit);
11264  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
11265  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
11266  break;
11267 
11270  case SCIP_STAGE_PRESOLVING:
11272  case SCIP_STAGE_SOLVING:
11273  oldobjlimit = SCIPprobGetObjlim(scip->origprob, scip->set);
11274  assert(oldobjlimit == SCIPprobGetObjlim(scip->transprob, scip->set)); /*lint !e777*/
11275  if( SCIPtransformObj(scip, objlimit) > SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, oldobjlimit) )
11276  {
11277  SCIPerrorMessage("cannot relax objective limit from %.15g to %.15g after problem was transformed.\n", oldobjlimit, objlimit);
11278  return SCIP_INVALIDDATA;
11279  }
11280  SCIPprobSetObjlim(scip->origprob, objlimit);
11281  SCIPprobSetObjlim(scip->transprob, objlimit);
11282  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
11283  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
11284  break;
11285 
11286  default:
11287  SCIPerrorMessage("method is not callable in SCIP stage <%d>\n", scip->set->stage);
11288  return SCIP_INVALIDCALL;
11289  } /*lint !e788*/
11290 
11291  return SCIP_OKAY;
11292 }
11293 
11294 /** returns current limit on objective function
11295  *
11296  * @return the current objective limit of the original problem
11297  *
11298  * @pre This method can be called if @p scip is in one of the following stages:
11299  * - \ref SCIP_STAGE_PROBLEM
11300  * - \ref SCIP_STAGE_TRANSFORMING
11301  * - \ref SCIP_STAGE_TRANSFORMED
11302  * - \ref SCIP_STAGE_INITPRESOLVE
11303  * - \ref SCIP_STAGE_PRESOLVING
11304  * - \ref SCIP_STAGE_EXITPRESOLVE
11305  * - \ref SCIP_STAGE_PRESOLVED
11306  * - \ref SCIP_STAGE_INITSOLVE
11307  * - \ref SCIP_STAGE_SOLVING
11308  * - \ref SCIP_STAGE_SOLVED
11309  */
11311  SCIP* scip /**< SCIP data structure */
11312  )
11313 {
11314  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetObjlimit", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11315 
11316  return SCIPprobGetObjlim(scip->origprob, scip->set);
11317 }
11318 
11319 /** informs SCIP, that the objective value is always integral in every feasible solution
11320  *
11321  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
11322  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11323  *
11324  * @pre This method can be called if @p scip is in one of the following stages:
11325  * - \ref SCIP_STAGE_PROBLEM
11326  * - \ref SCIP_STAGE_TRANSFORMING
11327  * - \ref SCIP_STAGE_INITPRESOLVE
11328  * - \ref SCIP_STAGE_EXITPRESOLVE
11329  * - \ref SCIP_STAGE_SOLVING
11330  *
11331  * @note This function should be used to inform SCIP that the objective function is integral, helping to improve the
11332  * performance. This is useful when using column generation. If no column generation (pricing) is used, SCIP
11333  * automatically detects whether the objective function is integral or can be scaled to be integral. However, in
11334  * any case, the user has to make sure that no variable is added during the solving process that destroys this
11335  * property.
11336  */
11338  SCIP* scip /**< SCIP data structure */
11339  )
11340 {
11341  SCIP_CALL( checkStage(scip, "SCIPsetObjIntegral", FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
11342 
11343  switch( scip->set->stage )
11344  {
11345  case SCIP_STAGE_PROBLEM:
11347  return SCIP_OKAY;
11348 
11350  case SCIP_STAGE_PRESOLVING:
11351  case SCIP_STAGE_PRESOLVED:
11352  case SCIP_STAGE_SOLVING:
11354  return SCIP_OKAY;
11355 
11356  default:
11357  SCIPerrorMessage("method is not callable in SCIP stage <%d>\n", scip->set->stage);
11358  return SCIP_INVALIDCALL;
11359  } /*lint !e788*/
11360 }
11361 
11362 /** returns whether the objective value is known to be integral in every feasible solution
11363  *
11364  * @return TRUE, if objective value is known to be always integral, otherwise FALSE
11365  *
11366  * @pre This method can be called if @p scip is in one of the following stages:
11367  * - \ref SCIP_STAGE_PROBLEM
11368  * - \ref SCIP_STAGE_TRANSFORMING
11369  * - \ref SCIP_STAGE_INITPRESOLVE
11370  * - \ref SCIP_STAGE_PRESOLVING
11371  * - \ref SCIP_STAGE_EXITPRESOLVE
11372  * - \ref SCIP_STAGE_PRESOLVED
11373  * - \ref SCIP_STAGE_SOLVING
11374  *
11375  * @note If no pricing is performed, SCIP automatically detects whether the objective function is integral or can be
11376  * scaled to be integral, helping to improve performance. This function returns the result. Otherwise
11377  * SCIPsetObjIntegral() can be used to inform SCIP. However, in any case, the user has to make sure that no
11378  * variable is added during the solving process that destroys this property.
11379  */
11381  SCIP* scip /**< SCIP data structure */
11382  )
11383 {
11384  int v;
11385 
11386  SCIP_CALL_ABORT( checkStage(scip, "SCIPisObjIntegral", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
11387 
11388  switch( scip->set->stage )
11389  {
11390  case SCIP_STAGE_PROBLEM:
11391  /* if the user explicitly added the information that there is an integral objective, return TRUE */
11392  if( SCIPprobIsObjIntegral(scip->origprob) )
11393  return TRUE;
11394 
11395  /* if there exist unknown variables, we cannot conclude that the objective value is always integral */
11396  if ( scip->set->nactivepricers != 0 )
11397  return FALSE;
11398 
11399  /* if the objective value offset is fractional, the value itself is possibly fractional */
11400  if ( ! SCIPisIntegral(scip, scip->origprob->objoffset) )
11401  return FALSE;
11402 
11403  /* scan through the variables */
11404  for (v = 0; v < scip->origprob->nvars; ++v)
11405  {
11406  SCIP_Real obj;
11407 
11408  /* get objective value of variable */
11409  obj = SCIPvarGetObj(scip->origprob->vars[v]);
11410 
11411  /* check, if objective value is non-zero */
11412  if ( ! SCIPisZero(scip, obj) )
11413  {
11414  /* if variable's objective value is fractional, the problem's objective value may also be fractional */
11415  if ( ! SCIPisIntegral(scip, obj) )
11416  break;
11417 
11418  /* if variable with non-zero objective value is continuous, the problem's objective value may be fractional */
11420  break;
11421  }
11422  }
11423 
11424  /* we do not store the result, since we assume that the original problem might be changed */
11425  if ( v == scip->origprob->nvars )
11426  return TRUE;
11427  return FALSE;
11428 
11431  case SCIP_STAGE_PRESOLVING:
11433  case SCIP_STAGE_PRESOLVED:
11434  case SCIP_STAGE_SOLVING:
11435  return SCIPprobIsObjIntegral(scip->transprob);
11436 
11437  default:
11438  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11439  SCIPABORT();
11440  return FALSE; /*lint !e527*/
11441  } /*lint !e788*/
11442 }
11443 
11444 /** returns the Euclidean norm of the objective function vector (available only for transformed problem)
11445  *
11446  * @return the Euclidean norm of the transformed objective function vector
11447  *
11448  * @pre This method can be called if @p scip is in one of the following stages:
11449  * - \ref SCIP_STAGE_TRANSFORMED
11450  * - \ref SCIP_STAGE_INITPRESOLVE
11451  * - \ref SCIP_STAGE_PRESOLVING
11452  * - \ref SCIP_STAGE_EXITPRESOLVE
11453  * - \ref SCIP_STAGE_PRESOLVED
11454  * - \ref SCIP_STAGE_INITSOLVE
11455  * - \ref SCIP_STAGE_SOLVING
11456  * - \ref SCIP_STAGE_SOLVED
11457  * - \ref SCIP_STAGE_EXITSOLVE
11458  */
11460  SCIP* scip /**< SCIP data structure */
11461  )
11462 {
11463  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetObjNorm", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11464 
11465  if( scip->lp->objsqrnormunreliable )
11466  SCIPlpRecalculateObjSqrNorm(scip->set, scip->lp);
11467  assert(!scip->lp->objsqrnormunreliable);
11468 
11469  return SCIPlpGetObjNorm(scip->lp);
11470 }
11471 
11472 /** adds variable to the problem
11473  *
11474  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
11475  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11476  *
11477  * @pre This method can be called if @p scip is in one of the following stages:
11478  * - \ref SCIP_STAGE_PROBLEM
11479  * - \ref SCIP_STAGE_TRANSFORMING
11480  * - \ref SCIP_STAGE_INITPRESOLVE
11481  * - \ref SCIP_STAGE_PRESOLVING
11482  * - \ref SCIP_STAGE_EXITPRESOLVE
11483  * - \ref SCIP_STAGE_PRESOLVED
11484  * - \ref SCIP_STAGE_SOLVING
11485  */
11487  SCIP* scip, /**< SCIP data structure */
11488  SCIP_VAR* var /**< variable to add */
11489  )
11490 {
11491  SCIP_CALL( checkStage(scip, "SCIPaddVar", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
11492 
11493  /* avoid inserting the same variable twice */
11494  if( SCIPvarGetProbindex(var) != -1 )
11495  return SCIP_OKAY;
11496 
11497  /* insert the negation variable x instead of the negated variable x' in x' = offset - x */
11499  {
11500  assert(SCIPvarGetNegationVar(var) != NULL);
11502  return SCIP_OKAY;
11503  }
11504 
11505  switch( scip->set->stage )
11506  {
11507  case SCIP_STAGE_PROBLEM:
11509  {
11510  SCIPerrorMessage("cannot add transformed variables to original problem\n");
11511  return SCIP_INVALIDDATA;
11512  }
11513  SCIP_CALL( SCIPprobAddVar(scip->origprob, scip->mem->probmem, scip->set, scip->lp, scip->branchcand,
11514  scip->eventfilter, scip->eventqueue, var) );
11515  return SCIP_OKAY;
11516 
11519  case SCIP_STAGE_PRESOLVING:
11521  case SCIP_STAGE_PRESOLVED:
11522  case SCIP_STAGE_SOLVING:
11523  /* check variable's status */
11525  {
11526  SCIPerrorMessage("cannot add original variables to transformed problem\n");
11527  return SCIP_INVALIDDATA;
11528  }
11530  {
11531  SCIPerrorMessage("cannot add fixed or aggregated variables to transformed problem\n");
11532  return SCIP_INVALIDDATA;
11533  }
11534  SCIP_CALL( SCIPprobAddVar(scip->transprob, scip->mem->probmem, scip->set, scip->lp,
11535  scip->branchcand, scip->eventfilter, scip->eventqueue, var) );
11536  return SCIP_OKAY;
11537 
11538  default:
11539  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11540  return SCIP_INVALIDCALL;
11541  } /*lint !e788*/
11542 }
11543 
11544 /** adds variable to the problem and uses it as pricing candidate to enter the LP
11545  *
11546  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
11547  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11548  *
11549  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
11550  */
11552  SCIP* scip, /**< SCIP data structure */
11553  SCIP_VAR* var, /**< variable to add */
11554  SCIP_Real score /**< pricing score of variable (the larger, the better the variable) */
11555  )
11556 {
11557  SCIP_CALL( checkStage(scip, "SCIPaddPricedVar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
11558 
11559  /* insert the negation variable x instead of the negated variable x' in x' = offset - x */
11561  {
11562  assert(SCIPvarGetNegationVar(var) != NULL);
11563  SCIP_CALL( SCIPaddPricedVar(scip, SCIPvarGetNegationVar(var), score) );
11564  return SCIP_OKAY;
11565  }
11566 
11567  /* add variable to problem if not yet inserted */
11568  if( SCIPvarGetProbindex(var) == -1 )
11569  {
11570  /* check variable's status */
11572  {
11573  SCIPerrorMessage("cannot add original variables to transformed problem\n");
11574  return SCIP_INVALIDDATA;
11575  }
11577  {
11578  SCIPerrorMessage("cannot add fixed or aggregated variables to transformed problem\n");
11579  return SCIP_INVALIDDATA;
11580  }
11581  SCIP_CALL( SCIPprobAddVar(scip->transprob, scip->mem->probmem, scip->set, scip->lp,
11582  scip->branchcand, scip->eventfilter, scip->eventqueue, var) );
11583  }
11584 
11585  /* add variable to pricing storage */
11586  SCIP_CALL( SCIPpricestoreAddVar(scip->pricestore, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, var, score,
11587  (SCIPtreeGetCurrentDepth(scip->tree) == 0)) );
11588 
11589  return SCIP_OKAY;
11590 }
11591 
11592 /** removes variable from the problem
11593  *
11594  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
11595  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11596  *
11597  * @pre This method can be called if @p scip is in one of the following stages:
11598  * - \ref SCIP_STAGE_PROBLEM
11599  * - \ref SCIP_STAGE_TRANSFORMING
11600  * - \ref SCIP_STAGE_TRANSFORMED
11601  * - \ref SCIP_STAGE_PRESOLVING
11602  * - \ref SCIP_STAGE_FREETRANS
11603  */
11605  SCIP* scip, /**< SCIP data structure */
11606  SCIP_VAR* var, /**< variable to delete */
11607  SCIP_Bool* deleted /**< pointer to store whether marking variable to be deleted was successful */
11608  )
11609 {
11610  assert(scip != NULL);
11611  assert(var != NULL);
11612  assert(deleted != NULL);
11613 
11614  SCIP_CALL( checkStage(scip, "SCIPdelVar", FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE) );
11615 
11616  switch( scip->set->stage )
11617  {
11618  case SCIP_STAGE_PROBLEM:
11620  {
11621  SCIPerrorMessage("cannot remove transformed variables from original problem\n");
11622  return SCIP_INVALIDDATA;
11623  }
11624  SCIP_CALL( SCIPprobDelVar(scip->origprob, scip->mem->probmem, scip->set, scip->eventqueue, var, deleted) );
11625 
11626  /* delete the variables from the problems that were marked to be deleted */
11627  SCIP_CALL( SCIPprobPerformVarDeletions(scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp, scip->branchcand) );
11628 
11629  return SCIP_OKAY;
11630 
11633  case SCIP_STAGE_PRESOLVING:
11634  /* check variable's status */
11636  {
11637  SCIPerrorMessage("cannot remove original variables from transformed problem\n");
11638  return SCIP_INVALIDDATA;
11639  }
11641  {
11642  SCIPerrorMessage("cannot remove fixed or aggregated variables from transformed problem\n");
11643  return SCIP_INVALIDDATA;
11644  }
11645 
11646  SCIP_CALL( SCIPprobDelVar(scip->transprob, scip->mem->probmem, scip->set, scip->eventqueue, var, deleted) );
11647 
11648  return SCIP_OKAY;
11649  case SCIP_STAGE_FREETRANS:
11650  /* in FREETRANS stage, we don't need to remove the variable, because the transformed problem is freed anyways */
11651  *deleted = FALSE;
11652 
11653  return SCIP_OKAY;
11654  default:
11655  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11656  return SCIP_INVALIDCALL;
11657  } /*lint !e788*/
11658 }
11659 
11660 /** gets variables of the problem along with the numbers of different variable types; data may become invalid after
11661  * calls to SCIPchgVarType(), SCIPfixVar(), SCIPaggregateVars(), and SCIPmultiaggregateVar()
11662  *
11663  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
11664  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11665  *
11666  * @pre This method can be called if @p scip is in one of the following stages:
11667  * - \ref SCIP_STAGE_PROBLEM
11668  * - \ref SCIP_STAGE_TRANSFORMED
11669  * - \ref SCIP_STAGE_INITPRESOLVE
11670  * - \ref SCIP_STAGE_PRESOLVING
11671  * - \ref SCIP_STAGE_EXITPRESOLVE
11672  * - \ref SCIP_STAGE_PRESOLVED
11673  * - \ref SCIP_STAGE_INITSOLVE
11674  * - \ref SCIP_STAGE_SOLVING
11675  * - \ref SCIP_STAGE_SOLVED
11676  * - \ref SCIP_STAGE_EXITSOLVE
11677  *
11678  * @note Variables in the vars array are ordered: binaries first, then integers, implicit integers and continuous last.
11679  */
11681  SCIP* scip, /**< SCIP data structure */
11682  SCIP_VAR*** vars, /**< pointer to store variables array or NULL if not needed */
11683  int* nvars, /**< pointer to store number of variables or NULL if not needed */
11684  int* nbinvars, /**< pointer to store number of binary variables or NULL if not needed */
11685  int* nintvars, /**< pointer to store number of integer variables or NULL if not needed */
11686  int* nimplvars, /**< pointer to store number of implicit integral vars or NULL if not needed */
11687  int* ncontvars /**< pointer to store number of continuous variables or NULL if not needed */
11688  )
11689 {
11690  SCIP_CALL( checkStage(scip, "SCIPgetVarsData", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11691 
11692  switch( scip->set->stage )
11693  {
11694  case SCIP_STAGE_PROBLEM:
11695  if( vars != NULL )
11696  *vars = scip->origprob->vars;
11697  if( nvars != NULL )
11698  *nvars = scip->origprob->nvars;
11699  if( nbinvars != NULL )
11700  *nbinvars = scip->origprob->nbinvars;
11701  if( nintvars != NULL )
11702  *nintvars = scip->origprob->nintvars;
11703  if( nimplvars != NULL )
11704  *nimplvars = scip->origprob->nimplvars;
11705  if( ncontvars != NULL )
11706  *ncontvars = scip->origprob->ncontvars;
11707  return SCIP_OKAY;
11708 
11711  case SCIP_STAGE_PRESOLVING:
11713  case SCIP_STAGE_PRESOLVED:
11714  case SCIP_STAGE_INITSOLVE:
11715  case SCIP_STAGE_SOLVING:
11716  case SCIP_STAGE_SOLVED:
11717  case SCIP_STAGE_EXITSOLVE:
11718  if( vars != NULL )
11719  *vars = scip->transprob->vars;
11720  if( nvars != NULL )
11721  *nvars = scip->transprob->nvars;
11722  if( nbinvars != NULL )
11723  *nbinvars = scip->transprob->nbinvars;
11724  if( nintvars != NULL )
11725  *nintvars = scip->transprob->nintvars;
11726  if( nimplvars != NULL )
11727  *nimplvars = scip->transprob->nimplvars;
11728  if( ncontvars != NULL )
11729  *ncontvars = scip->transprob->ncontvars;
11730  return SCIP_OKAY;
11731 
11732  default:
11733  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11734  return SCIP_INVALIDCALL;
11735  } /*lint !e788*/
11736 }
11737 
11738 /** gets array with active problem variables
11739  *
11740  * @return array with active problem variables
11741  *
11742  * @pre This method can be called if @p scip is in one of the following stages:
11743  * - \ref SCIP_STAGE_PROBLEM
11744  * - \ref SCIP_STAGE_TRANSFORMED
11745  * - \ref SCIP_STAGE_INITPRESOLVE
11746  * - \ref SCIP_STAGE_PRESOLVING
11747  * - \ref SCIP_STAGE_EXITPRESOLVE
11748  * - \ref SCIP_STAGE_PRESOLVED
11749  * - \ref SCIP_STAGE_INITSOLVE
11750  * - \ref SCIP_STAGE_SOLVING
11751  * - \ref SCIP_STAGE_SOLVED
11752  * - \ref SCIP_STAGE_EXITSOLVE
11753  *
11754  * @note Variables in the array are ordered: binaries first, then integers, implicit integers and continuous last.
11755  *
11756  * @warning If your are using the methods which add or change bound of variables (e.g., SCIPchgVarType(), SCIPfixVar(),
11757  * SCIPaggregateVars(), and SCIPmultiaggregateVar()), it can happen that the internal variable array (which is
11758  * accessed via this method) gets resized and/or resorted. This can invalid the data pointer which is returned
11759  * by this method.
11760  */
11762  SCIP* scip /**< SCIP data structure */
11763  )
11764 {
11765  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11766 
11767  switch( scip->set->stage )
11768  {
11769  case SCIP_STAGE_PROBLEM:
11770  return scip->origprob->vars;
11771 
11774  case SCIP_STAGE_PRESOLVING:
11776  case SCIP_STAGE_PRESOLVED:
11777  case SCIP_STAGE_INITSOLVE:
11778  case SCIP_STAGE_SOLVING:
11779  case SCIP_STAGE_SOLVED:
11780  case SCIP_STAGE_EXITSOLVE:
11781  return scip->transprob->vars;
11782 
11783  default:
11784  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11785  SCIPABORT();
11786  return NULL; /*lint !e527*/
11787  } /*lint !e788*/
11788 }
11789 
11790 /** gets number of active problem variables
11791  *
11792  * @return the number of active problem variables
11793  *
11794  * @pre This method can be called if @p scip is in one of the following stages:
11795  * - \ref SCIP_STAGE_PROBLEM
11796  * - \ref SCIP_STAGE_TRANSFORMED
11797  * - \ref SCIP_STAGE_INITPRESOLVE
11798  * - \ref SCIP_STAGE_PRESOLVING
11799  * - \ref SCIP_STAGE_EXITPRESOLVE
11800  * - \ref SCIP_STAGE_PRESOLVED
11801  * - \ref SCIP_STAGE_INITSOLVE
11802  * - \ref SCIP_STAGE_SOLVING
11803  * - \ref SCIP_STAGE_SOLVED
11804  * - \ref SCIP_STAGE_EXITSOLVE
11805  */
11807  SCIP* scip /**< SCIP data structure */
11808  )
11809 {
11810  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11811 
11812  switch( scip->set->stage )
11813  {
11814  case SCIP_STAGE_PROBLEM:
11815  return scip->origprob->nvars;
11816 
11819  case SCIP_STAGE_PRESOLVING:
11821  case SCIP_STAGE_PRESOLVED:
11822  case SCIP_STAGE_INITSOLVE:
11823  case SCIP_STAGE_SOLVING:
11824  case SCIP_STAGE_SOLVED:
11825  case SCIP_STAGE_EXITSOLVE:
11826  return scip->transprob->nvars;
11827 
11828  default:
11829  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11830  SCIPABORT();
11831  return 0; /*lint !e527*/
11832  } /*lint !e788*/
11833 }
11834 
11835 /** gets number of binary active problem variables
11836  *
11837  * @return the number of binary active problem variables
11838  *
11839  * @pre This method can be called if @p scip is in one of the following stages:
11840  * - \ref SCIP_STAGE_PROBLEM
11841  * - \ref SCIP_STAGE_TRANSFORMED
11842  * - \ref SCIP_STAGE_INITPRESOLVE
11843  * - \ref SCIP_STAGE_PRESOLVING
11844  * - \ref SCIP_STAGE_EXITPRESOLVE
11845  * - \ref SCIP_STAGE_PRESOLVED
11846  * - \ref SCIP_STAGE_INITSOLVE
11847  * - \ref SCIP_STAGE_SOLVING
11848  * - \ref SCIP_STAGE_SOLVED
11849  * - \ref SCIP_STAGE_EXITSOLVE
11850  */
11852  SCIP* scip /**< SCIP data structure */
11853  )
11854 {
11855  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBinVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11856 
11857  switch( scip->set->stage )
11858  {
11859  case SCIP_STAGE_PROBLEM:
11860  return scip->origprob->nbinvars;
11861 
11864  case SCIP_STAGE_PRESOLVING:
11866  case SCIP_STAGE_PRESOLVED:
11867  case SCIP_STAGE_INITSOLVE:
11868  case SCIP_STAGE_SOLVING:
11869  case SCIP_STAGE_SOLVED:
11870  case SCIP_STAGE_EXITSOLVE:
11871  return scip->transprob->nbinvars;
11872 
11873  default:
11874  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11875  SCIPABORT();
11876  return 0; /*lint !e527*/
11877  } /*lint !e788*/
11878 }
11879 
11880 /** gets number of integer active problem variables
11881  *
11882  * @return the number of integer active problem variables
11883  *
11884  * @pre This method can be called if @p scip is in one of the following stages:
11885  * - \ref SCIP_STAGE_PROBLEM
11886  * - \ref SCIP_STAGE_TRANSFORMED
11887  * - \ref SCIP_STAGE_INITPRESOLVE
11888  * - \ref SCIP_STAGE_PRESOLVING
11889  * - \ref SCIP_STAGE_EXITPRESOLVE
11890  * - \ref SCIP_STAGE_PRESOLVED
11891  * - \ref SCIP_STAGE_INITSOLVE
11892  * - \ref SCIP_STAGE_SOLVING
11893  * - \ref SCIP_STAGE_SOLVED
11894  * - \ref SCIP_STAGE_EXITSOLVE
11895  */
11897  SCIP* scip /**< SCIP data structure */
11898  )
11899 {
11900  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNIntVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11901 
11902  switch( scip->set->stage )
11903  {
11904  case SCIP_STAGE_PROBLEM:
11905  return scip->origprob->nintvars;
11906 
11909  case SCIP_STAGE_PRESOLVING:
11911  case SCIP_STAGE_PRESOLVED:
11912  case SCIP_STAGE_INITSOLVE:
11913  case SCIP_STAGE_SOLVING:
11914  case SCIP_STAGE_SOLVED:
11915  case SCIP_STAGE_EXITSOLVE:
11916  return scip->transprob->nintvars;
11917 
11918  default:
11919  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11920  SCIPABORT();
11921  return 0; /*lint !e527*/
11922  } /*lint !e788*/
11923 }
11924 
11925 /** gets number of implicit integer active problem variables
11926  *
11927  * @return the number of implicit integer active problem variables
11928  *
11929  * @pre This method can be called if @p scip is in one of the following stages:
11930  * - \ref SCIP_STAGE_PROBLEM
11931  * - \ref SCIP_STAGE_TRANSFORMED
11932  * - \ref SCIP_STAGE_INITPRESOLVE
11933  * - \ref SCIP_STAGE_PRESOLVING
11934  * - \ref SCIP_STAGE_EXITPRESOLVE
11935  * - \ref SCIP_STAGE_PRESOLVED
11936  * - \ref SCIP_STAGE_INITSOLVE
11937  * - \ref SCIP_STAGE_SOLVING
11938  * - \ref SCIP_STAGE_SOLVED
11939  * - \ref SCIP_STAGE_EXITSOLVE
11940  */
11942  SCIP* scip /**< SCIP data structure */
11943  )
11944 {
11945  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNImplVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11946 
11947  switch( scip->set->stage )
11948  {
11949  case SCIP_STAGE_PROBLEM:
11950  return scip->origprob->nimplvars;
11951 
11954  case SCIP_STAGE_PRESOLVING:
11956  case SCIP_STAGE_PRESOLVED:
11957  case SCIP_STAGE_INITSOLVE:
11958  case SCIP_STAGE_SOLVING:
11959  case SCIP_STAGE_SOLVED:
11960  case SCIP_STAGE_EXITSOLVE:
11961  return scip->transprob->nimplvars;
11962 
11963  default:
11964  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11965  SCIPABORT();
11966  return 0; /*lint !e527*/
11967  } /*lint !e788*/
11968 }
11969 
11970 /** gets number of continuous active problem variables
11971  *
11972  * @return the number of continuous active problem variables
11973  *
11974  * @pre This method can be called if @p scip is in one of the following stages:
11975  * - \ref SCIP_STAGE_PROBLEM
11976  * - \ref SCIP_STAGE_TRANSFORMED
11977  * - \ref SCIP_STAGE_INITPRESOLVE
11978  * - \ref SCIP_STAGE_PRESOLVING
11979  * - \ref SCIP_STAGE_EXITPRESOLVE
11980  * - \ref SCIP_STAGE_PRESOLVED
11981  * - \ref SCIP_STAGE_INITSOLVE
11982  * - \ref SCIP_STAGE_SOLVING
11983  * - \ref SCIP_STAGE_SOLVED
11984  * - \ref SCIP_STAGE_EXITSOLVE
11985  */
11987  SCIP* scip /**< SCIP data structure */
11988  )
11989 {
11990  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNContVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11991 
11992  switch( scip->set->stage )
11993  {
11994  case SCIP_STAGE_PROBLEM:
11995  return scip->origprob->ncontvars;
11996 
11999  case SCIP_STAGE_PRESOLVING:
12001  case SCIP_STAGE_PRESOLVED:
12002  case SCIP_STAGE_INITSOLVE:
12003  case SCIP_STAGE_SOLVING:
12004  case SCIP_STAGE_SOLVED:
12005  case SCIP_STAGE_EXITSOLVE:
12006  return scip->transprob->ncontvars;
12007 
12008  default:
12009  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12010  SCIPABORT();
12011  return 0; /*lint !e527*/
12012  } /*lint !e788*/
12013 }
12014 
12015 
12016 /** gets number of active problem variables with a non-zero objective coefficient
12017  *
12018  * @note In case of the original problem the number of variables is counted. In case of the transformed problem the
12019  * number of variables is just returned since it is stored internally
12020  *
12021  * @return the number of active problem variables with a non-zero objective coefficient
12022  *
12023  * @pre This method can be called if @p scip is in one of the following stages:
12024  * - \ref SCIP_STAGE_PROBLEM
12025  * - \ref SCIP_STAGE_TRANSFORMED
12026  * - \ref SCIP_STAGE_INITPRESOLVE
12027  * - \ref SCIP_STAGE_PRESOLVING
12028  * - \ref SCIP_STAGE_EXITPRESOLVE
12029  * - \ref SCIP_STAGE_PRESOLVED
12030  * - \ref SCIP_STAGE_INITSOLVE
12031  * - \ref SCIP_STAGE_SOLVING
12032  * - \ref SCIP_STAGE_SOLVED
12033  */
12035  SCIP* scip /**< SCIP data structure */
12036  )
12037 {
12038  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNObjVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
12039 
12040  switch( scip->set->stage )
12041  {
12042  case SCIP_STAGE_PROBLEM:
12043  return SCIPprobGetNObjVars(scip->origprob, scip->set);
12044 
12047  case SCIP_STAGE_PRESOLVING:
12049  case SCIP_STAGE_PRESOLVED:
12050  case SCIP_STAGE_INITSOLVE:
12051  case SCIP_STAGE_SOLVING:
12052  case SCIP_STAGE_SOLVED:
12053  return SCIPprobGetNObjVars(scip->transprob, scip->set);
12054 
12055  default:
12056  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12057  SCIPABORT();
12058  return 0; /*lint !e527*/
12059  } /*lint !e788*/
12060 }
12061 
12062 
12063 /** gets array with fixed and aggregated problem variables; data may become invalid after
12064  * calls to SCIPfixVar(), SCIPaggregateVars(), and SCIPmultiaggregateVar()
12065  *
12066  * @return an array with fixed and aggregated problem variables; data may become invalid after
12067  * calls to SCIPfixVar(), SCIPaggregateVars(), and SCIPmultiaggregateVar()
12068  *
12069  * @pre This method can be called if @p scip is in one of the following stages:
12070  * - \ref SCIP_STAGE_PROBLEM
12071  * - \ref SCIP_STAGE_TRANSFORMED
12072  * - \ref SCIP_STAGE_INITPRESOLVE
12073  * - \ref SCIP_STAGE_PRESOLVING
12074  * - \ref SCIP_STAGE_EXITPRESOLVE
12075  * - \ref SCIP_STAGE_PRESOLVED
12076  * - \ref SCIP_STAGE_INITSOLVE
12077  * - \ref SCIP_STAGE_SOLVING
12078  * - \ref SCIP_STAGE_SOLVED
12079  */
12081  SCIP* scip /**< SCIP data structure */
12082  )
12083 {
12084  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFixedVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
12085 
12086  switch( scip->set->stage )
12087  {
12088  case SCIP_STAGE_PROBLEM:
12089  return NULL;
12090 
12093  case SCIP_STAGE_PRESOLVING:
12095  case SCIP_STAGE_PRESOLVED:
12096  case SCIP_STAGE_INITSOLVE:
12097  case SCIP_STAGE_SOLVING:
12098  case SCIP_STAGE_SOLVED:
12099  return scip->transprob->fixedvars;
12100 
12101  default:
12102  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12103  SCIPABORT();
12104  return NULL; /*lint !e527*/
12105  } /*lint !e788*/
12106 }
12107 
12108 /** gets number of fixed or aggregated problem variables
12109  *
12110  * @return the number of fixed or aggregated problem variables
12111  *
12112  * @pre This method can be called if @p scip is in one of the following stages:
12113  * - \ref SCIP_STAGE_PROBLEM
12114  * - \ref SCIP_STAGE_TRANSFORMED
12115  * - \ref SCIP_STAGE_INITPRESOLVE
12116  * - \ref SCIP_STAGE_PRESOLVING
12117  * - \ref SCIP_STAGE_EXITPRESOLVE
12118  * - \ref SCIP_STAGE_PRESOLVED
12119  * - \ref SCIP_STAGE_INITSOLVE
12120  * - \ref SCIP_STAGE_SOLVING
12121  * - \ref SCIP_STAGE_SOLVED
12122  */
12124  SCIP* scip /**< SCIP data structure */
12125  )
12126 {
12127  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNFixedVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
12128 
12129  switch( scip->set->stage )
12130  {
12131  case SCIP_STAGE_PROBLEM:
12132  return 0;
12133 
12136  case SCIP_STAGE_PRESOLVING:
12138  case SCIP_STAGE_PRESOLVED:
12139  case SCIP_STAGE_INITSOLVE:
12140  case SCIP_STAGE_SOLVING:
12141  case SCIP_STAGE_SOLVED:
12142  return scip->transprob->nfixedvars;
12143 
12144  default:
12145  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12146  SCIPABORT();
12147  return 0; /*lint !e527*/
12148  } /*lint !e788*/
12149 }
12150 
12151 /** gets variables of the original problem along with the numbers of different variable types; data may become invalid
12152  * after a call to SCIPchgVarType()
12153  *
12154  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12155  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12156  *
12157  * @pre This method can be called if @p scip is in one of the following stages:
12158  * - \ref SCIP_STAGE_PROBLEM
12159  * - \ref SCIP_STAGE_TRANSFORMING
12160  * - \ref SCIP_STAGE_TRANSFORMED
12161  * - \ref SCIP_STAGE_INITPRESOLVE
12162  * - \ref SCIP_STAGE_PRESOLVING
12163  * - \ref SCIP_STAGE_EXITPRESOLVE
12164  * - \ref SCIP_STAGE_PRESOLVED
12165  * - \ref SCIP_STAGE_INITSOLVE
12166  * - \ref SCIP_STAGE_SOLVING
12167  * - \ref SCIP_STAGE_SOLVED
12168  * - \ref SCIP_STAGE_EXITSOLVE
12169  * - \ref SCIP_STAGE_FREETRANS
12170  */
12172  SCIP* scip, /**< SCIP data structure */
12173  SCIP_VAR*** vars, /**< pointer to store variables array or NULL if not needed */
12174  int* nvars, /**< pointer to store number of variables or NULL if not needed */
12175  int* nbinvars, /**< pointer to store number of binary variables or NULL if not needed */
12176  int* nintvars, /**< pointer to store number of integer variables or NULL if not needed */
12177  int* nimplvars, /**< pointer to store number of implicit integral vars or NULL if not needed */
12178  int* ncontvars /**< pointer to store number of continuous variables or NULL if not needed */
12179  )
12180 {
12181  SCIP_CALL( checkStage(scip, "SCIPgetOrigVarsData", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12182 
12183  if( vars != NULL )
12184  *vars = scip->origprob->vars;
12185  if( nvars != NULL )
12186  *nvars = scip->origprob->nvars;
12187  if( nbinvars != NULL )
12188  *nbinvars = scip->origprob->nbinvars;
12189  if( nintvars != NULL )
12190  *nintvars = scip->origprob->nintvars;
12191  if( nimplvars != NULL )
12192  *nimplvars = scip->origprob->nimplvars;
12193  if( ncontvars != NULL )
12194  *ncontvars = scip->origprob->ncontvars;
12195 
12196  return SCIP_OKAY;
12197 }
12198 
12199 /** gets array with original problem variables; data may become invalid after
12200  * a call to SCIPchgVarType()
12201  *
12202  * @return an array with original problem variables; data may become invalid after
12203  * a call to SCIPchgVarType()
12204  *
12205  * @pre This method can be called if @p scip is in one of the following stages:
12206  * - \ref SCIP_STAGE_PROBLEM
12207  * - \ref SCIP_STAGE_TRANSFORMING
12208  * - \ref SCIP_STAGE_TRANSFORMED
12209  * - \ref SCIP_STAGE_INITPRESOLVE
12210  * - \ref SCIP_STAGE_PRESOLVING
12211  * - \ref SCIP_STAGE_EXITPRESOLVE
12212  * - \ref SCIP_STAGE_PRESOLVED
12213  * - \ref SCIP_STAGE_INITSOLVE
12214  * - \ref SCIP_STAGE_SOLVING
12215  * - \ref SCIP_STAGE_SOLVED
12216  * - \ref SCIP_STAGE_EXITSOLVE
12217  * - \ref SCIP_STAGE_FREETRANS
12218  */
12220  SCIP* scip /**< SCIP data structure */
12221  )
12222 {
12223  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetOrigVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12224 
12225  return scip->origprob->vars;
12226 }
12227 
12228 /** gets number of original problem variables
12229  *
12230  * @return the number of original problem variables
12231  *
12232  * @pre This method can be called if @p scip is in one of the following stages:
12233  * - \ref SCIP_STAGE_PROBLEM
12234  * - \ref SCIP_STAGE_TRANSFORMING
12235  * - \ref SCIP_STAGE_TRANSFORMED
12236  * - \ref SCIP_STAGE_INITPRESOLVE
12237  * - \ref SCIP_STAGE_PRESOLVING
12238  * - \ref SCIP_STAGE_EXITPRESOLVE
12239  * - \ref SCIP_STAGE_PRESOLVED
12240  * - \ref SCIP_STAGE_INITSOLVE
12241  * - \ref SCIP_STAGE_SOLVING
12242  * - \ref SCIP_STAGE_SOLVED
12243  * - \ref SCIP_STAGE_EXITSOLVE
12244  * - \ref SCIP_STAGE_FREETRANS
12245  */
12247  SCIP* scip /**< SCIP data structure */
12248  )
12249 {
12250  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12251 
12252  return scip->origprob->nvars;
12253 }
12254 
12255 /** gets number of binary variables in the original problem
12256  *
12257  * @return the number of binary variables in the original problem
12258  *
12259  * @pre This method can be called if @p scip is in one of the following stages:
12260  * - \ref SCIP_STAGE_PROBLEM
12261  * - \ref SCIP_STAGE_TRANSFORMING
12262  * - \ref SCIP_STAGE_TRANSFORMED
12263  * - \ref SCIP_STAGE_INITPRESOLVE
12264  * - \ref SCIP_STAGE_PRESOLVING
12265  * - \ref SCIP_STAGE_EXITPRESOLVE
12266  * - \ref SCIP_STAGE_PRESOLVED
12267  * - \ref SCIP_STAGE_INITSOLVE
12268  * - \ref SCIP_STAGE_SOLVING
12269  * - \ref SCIP_STAGE_SOLVED
12270  * - \ref SCIP_STAGE_EXITSOLVE
12271  * - \ref SCIP_STAGE_FREETRANS
12272  */
12274  SCIP* scip /**< SCIP data structure */
12275  )
12276 {
12277  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigBinVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12278 
12279  return scip->origprob->nbinvars;
12280 }
12281 
12282 /** gets the number of integer variables in the original problem
12283  *
12284  * @return the number of integer variables in the original problem
12285  *
12286  * @pre This method can be called if @p scip is in one of the following stages:
12287  * - \ref SCIP_STAGE_PROBLEM
12288  * - \ref SCIP_STAGE_TRANSFORMING
12289  * - \ref SCIP_STAGE_TRANSFORMED
12290  * - \ref SCIP_STAGE_INITPRESOLVE
12291  * - \ref SCIP_STAGE_PRESOLVING
12292  * - \ref SCIP_STAGE_EXITPRESOLVE
12293  * - \ref SCIP_STAGE_PRESOLVED
12294  * - \ref SCIP_STAGE_INITSOLVE
12295  * - \ref SCIP_STAGE_SOLVING
12296  * - \ref SCIP_STAGE_SOLVED
12297  * - \ref SCIP_STAGE_EXITSOLVE
12298  * - \ref SCIP_STAGE_FREETRANS
12299  */
12301  SCIP* scip /**< SCIP data structure */
12302  )
12303 {
12304  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigIntVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12305 
12306  return scip->origprob->nintvars;
12307 }
12308 
12309 /** gets number of implicit integer variables in the original problem
12310  *
12311  * @return the number of implicit integer variables in the original problem
12312  *
12313  * @pre This method can be called if @p scip is in one of the following stages:
12314  * - \ref SCIP_STAGE_PROBLEM
12315  * - \ref SCIP_STAGE_TRANSFORMING
12316  * - \ref SCIP_STAGE_TRANSFORMED
12317  * - \ref SCIP_STAGE_INITPRESOLVE
12318  * - \ref SCIP_STAGE_PRESOLVING
12319  * - \ref SCIP_STAGE_EXITPRESOLVE
12320  * - \ref SCIP_STAGE_PRESOLVED
12321  * - \ref SCIP_STAGE_INITSOLVE
12322  * - \ref SCIP_STAGE_SOLVING
12323  * - \ref SCIP_STAGE_SOLVED
12324  * - \ref SCIP_STAGE_EXITSOLVE
12325  * - \ref SCIP_STAGE_FREETRANS
12326  */
12328  SCIP* scip /**< SCIP data structure */
12329  )
12330 {
12331  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigImplVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12332 
12333  return scip->origprob->nimplvars;
12334 }
12335 
12336 /** gets number of continuous variables in the original problem
12337  *
12338  * @return the number of continuous variables in the original problem
12339  *
12340  * @pre This method can be called if @p scip is in one of the following stages:
12341  * - \ref SCIP_STAGE_PROBLEM
12342  * - \ref SCIP_STAGE_TRANSFORMING
12343  * - \ref SCIP_STAGE_TRANSFORMED
12344  * - \ref SCIP_STAGE_INITPRESOLVE
12345  * - \ref SCIP_STAGE_PRESOLVING
12346  * - \ref SCIP_STAGE_EXITPRESOLVE
12347  * - \ref SCIP_STAGE_PRESOLVED
12348  * - \ref SCIP_STAGE_INITSOLVE
12349  * - \ref SCIP_STAGE_SOLVING
12350  * - \ref SCIP_STAGE_SOLVED
12351  * - \ref SCIP_STAGE_EXITSOLVE
12352  * - \ref SCIP_STAGE_FREETRANS
12353  */
12355  SCIP* scip /**< SCIP data structure */
12356  )
12357 {
12358  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigContVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12359 
12360  return scip->origprob->ncontvars;
12361 }
12362 
12363 /** gets number of all problem variables created during creation and solving of problem;
12364  * this includes also variables that were deleted in the meantime
12365  *
12366  * @return the number of all problem variables created during creation and solving of problem;
12367  * this includes also variables that were deleted in the meantime
12368  *
12369  * @pre This method can be called if @p scip is in one of the following stages:
12370  * - \ref SCIP_STAGE_PROBLEM
12371  * - \ref SCIP_STAGE_TRANSFORMING
12372  * - \ref SCIP_STAGE_TRANSFORMED
12373  * - \ref SCIP_STAGE_INITPRESOLVE
12374  * - \ref SCIP_STAGE_PRESOLVING
12375  * - \ref SCIP_STAGE_EXITPRESOLVE
12376  * - \ref SCIP_STAGE_PRESOLVED
12377  * - \ref SCIP_STAGE_INITSOLVE
12378  * - \ref SCIP_STAGE_SOLVING
12379  * - \ref SCIP_STAGE_SOLVED
12380  * - \ref SCIP_STAGE_EXITSOLVE
12381  * - \ref SCIP_STAGE_FREETRANS
12382  */
12384  SCIP* scip /**< SCIP data structure */
12385  )
12386 {
12387  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNTotalVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12388 
12389  assert(scip->stat != NULL);
12390 
12391  switch( scip->set->stage )
12392  {
12393  case SCIP_STAGE_PROBLEM:
12397  case SCIP_STAGE_PRESOLVING:
12399  case SCIP_STAGE_PRESOLVED:
12400  case SCIP_STAGE_INITSOLVE:
12401  case SCIP_STAGE_SOLVING:
12402  case SCIP_STAGE_SOLVED:
12403  case SCIP_STAGE_EXITSOLVE:
12404  case SCIP_STAGE_FREETRANS:
12405  return scip->stat->nvaridx;
12406 
12407  default:
12408  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12409  SCIPABORT();
12410  return 0; /*lint !e527*/
12411  } /*lint !e788*/
12412 
12413 }
12414 
12415 
12416 /** gets variables of the original or transformed problem along with the numbers of different variable types;
12417  * the returned problem space (original or transformed) corresponds to the given solution;
12418  * data may become invalid after calls to SCIPchgVarType(), SCIPfixVar(), SCIPaggregateVars(), and
12419  * SCIPmultiaggregateVar()
12420  *
12421  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12422  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12423  *
12424  * @pre This method can be called if @p scip is in one of the following stages:
12425  * - \ref SCIP_STAGE_PROBLEM
12426  * - \ref SCIP_STAGE_TRANSFORMED
12427  * - \ref SCIP_STAGE_INITPRESOLVE
12428  * - \ref SCIP_STAGE_PRESOLVING
12429  * - \ref SCIP_STAGE_EXITPRESOLVE
12430  * - \ref SCIP_STAGE_PRESOLVED
12431  * - \ref SCIP_STAGE_INITSOLVE
12432  * - \ref SCIP_STAGE_SOLVING
12433  * - \ref SCIP_STAGE_SOLVED
12434  */
12436  SCIP* scip, /**< SCIP data structure */
12437  SCIP_SOL* sol, /**< primal solution that selects the problem space, NULL for current solution */
12438  SCIP_VAR*** vars, /**< pointer to store variables array or NULL if not needed */
12439  int* nvars, /**< pointer to store number of variables or NULL if not needed */
12440  int* nbinvars, /**< pointer to store number of binary variables or NULL if not needed */
12441  int* nintvars, /**< pointer to store number of integer variables or NULL if not needed */
12442  int* nimplvars, /**< pointer to store number of implicit integral vars or NULL if not needed */
12443  int* ncontvars /**< pointer to store number of continuous variables or NULL if not needed */
12444  )
12445 {
12446  SCIP_CALL( checkStage(scip, "SCIPgetSolVarsData", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
12447 
12448  if( scip->set->stage == SCIP_STAGE_PROBLEM || (sol != NULL && SCIPsolIsOriginal(sol)) )
12449  {
12450  if( vars != NULL )
12451  *vars = scip->origprob->vars;
12452  if( nvars != NULL )
12453  *nvars = scip->origprob->nvars;
12454  if( nbinvars != NULL )
12455  *nbinvars = scip->origprob->nbinvars;
12456  if( nintvars != NULL )
12457  *nintvars = scip->origprob->nintvars;
12458  if( nimplvars != NULL )
12459  *nimplvars = scip->origprob->nimplvars;
12460  if( ncontvars != NULL )
12461  *ncontvars = scip->origprob->ncontvars;
12462  }
12463  else
12464  {
12465  if( vars != NULL )
12466  *vars = scip->transprob->vars;
12467  if( nvars != NULL )
12468  *nvars = scip->transprob->nvars;
12469  if( nbinvars != NULL )
12470  *nbinvars = scip->transprob->nbinvars;
12471  if( nintvars != NULL )
12472  *nintvars = scip->transprob->nintvars;
12473  if( nimplvars != NULL )
12474  *nimplvars = scip->transprob->nimplvars;
12475  if( ncontvars != NULL )
12476  *ncontvars = scip->transprob->ncontvars;
12477  }
12478 
12479  return SCIP_OKAY;
12480 }
12481 
12482 /** returns variable of given name in the problem, or NULL if not existing
12483  *
12484  * @return variable of given name in the problem, or NULL if not existing
12485  *
12486  * @pre This method can be called if @p scip is in one of the following stages:
12487  * - \ref SCIP_STAGE_PROBLEM
12488  * - \ref SCIP_STAGE_TRANSFORMING
12489  * - \ref SCIP_STAGE_TRANSFORMED
12490  * - \ref SCIP_STAGE_INITPRESOLVE
12491  * - \ref SCIP_STAGE_PRESOLVING
12492  * - \ref SCIP_STAGE_EXITPRESOLVE
12493  * - \ref SCIP_STAGE_PRESOLVED
12494  * - \ref SCIP_STAGE_INITSOLVE
12495  * - \ref SCIP_STAGE_SOLVING
12496  * - \ref SCIP_STAGE_SOLVED
12497  * - \ref SCIP_STAGE_EXITSOLVE
12498  * - \ref SCIP_STAGE_FREETRANS
12499  */
12501  SCIP* scip, /**< SCIP data structure */
12502  const char* name /**< name of variable to find */
12503  )
12504 {
12505  SCIP_VAR* var;
12506 
12507  assert(name != NULL);
12508 
12509  SCIP_CALL_ABORT( checkStage(scip, "SCIPfindVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12510 
12511  switch( scip->set->stage )
12512  {
12513  case SCIP_STAGE_PROBLEM:
12514  return SCIPprobFindVar(scip->origprob, name);
12515 
12519  case SCIP_STAGE_PRESOLVING:
12521  case SCIP_STAGE_PRESOLVED:
12522  case SCIP_STAGE_INITSOLVE:
12523  case SCIP_STAGE_SOLVING:
12524  case SCIP_STAGE_SOLVED:
12525  case SCIP_STAGE_EXITSOLVE:
12526  case SCIP_STAGE_FREETRANS:
12527  var = SCIPprobFindVar(scip->transprob, name);
12528  if( var == NULL )
12529  return SCIPprobFindVar(scip->origprob, name);
12530  else
12531  return var;
12532 
12533  default:
12534  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12535  SCIPABORT();
12536  return NULL; /*lint !e527*/
12537  } /*lint !e788*/
12538 }
12539 
12540 /** returns TRUE iff all potential variables exist in the problem, and FALSE, if there may be additional variables,
12541  * that will be added in pricing and improve the objective value
12542  *
12543  * @return TRUE, if all potential variables exist in the problem; FALSE, otherwise
12544  *
12545  * @pre This method can be called if @p scip is in one of the following stages:
12546  * - \ref SCIP_STAGE_TRANSFORMING
12547  * - \ref SCIP_STAGE_TRANSFORMED
12548  * - \ref SCIP_STAGE_INITPRESOLVE
12549  * - \ref SCIP_STAGE_PRESOLVING
12550  * - \ref SCIP_STAGE_EXITPRESOLVE
12551  * - \ref SCIP_STAGE_PRESOLVED
12552  * - \ref SCIP_STAGE_INITSOLVE
12553  * - \ref SCIP_STAGE_SOLVING
12554  * - \ref SCIP_STAGE_SOLVED
12555  * - \ref SCIP_STAGE_EXITSOLVE
12556  * - \ref SCIP_STAGE_FREETRANS
12557  */
12559  SCIP* scip /**< SCIP data structure */
12560  )
12561 {
12562  SCIP_CALL_ABORT( checkStage(scip, "SCIPallVarsInProb", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12563 
12564  return (scip->set->nactivepricers == 0);
12565 }
12566 
12567 /** adds constraint to the problem; if constraint is only valid locally, it is added to the local subproblem of the
12568  * current node (and all of its subnodes); otherwise it is added to the global problem;
12569  * if a local constraint is added at the root node, it is automatically upgraded into a global constraint
12570  *
12571  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12572  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12573  *
12574  * @pre This method can be called if @p scip is in one of the following stages:
12575  * - \ref SCIP_STAGE_PROBLEM
12576  * - \ref SCIP_STAGE_TRANSFORMED
12577  * - \ref SCIP_STAGE_INITPRESOLVE
12578  * - \ref SCIP_STAGE_PRESOLVING
12579  * - \ref SCIP_STAGE_EXITPRESOLVE
12580  * - \ref SCIP_STAGE_PRESOLVED
12581  * - \ref SCIP_STAGE_INITSOLVE
12582  * - \ref SCIP_STAGE_SOLVING
12583  * - \ref SCIP_STAGE_EXITSOLVE
12584  */
12586  SCIP* scip, /**< SCIP data structure */
12587  SCIP_CONS* cons /**< constraint to add */
12588  )
12589 {
12590  assert(cons != NULL);
12591 
12592  SCIP_CALL( checkStage(scip, "SCIPaddCons", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
12593 
12594  switch( scip->set->stage )
12595  {
12596  case SCIP_STAGE_PROBLEM:
12597  {
12598  SCIP_CALL( SCIPprobAddCons(scip->origprob, scip->set, scip->stat, cons) );
12599 
12600  if( scip->set->reopt_enable )
12601  {
12602  SCIP_CALL( SCIPreoptAddCons(scip->reopt, scip->set, scip->mem->probmem, cons) );
12603  }
12604  }
12605  return SCIP_OKAY;
12606 
12608  SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
12609  return SCIP_OKAY;
12610 
12612  case SCIP_STAGE_PRESOLVING:
12614  case SCIP_STAGE_PRESOLVED:
12615  case SCIP_STAGE_INITSOLVE:
12616  case SCIP_STAGE_SOLVING:
12617  assert( SCIPtreeGetCurrentDepth(scip->tree) >= 0 || scip->set->stage == SCIP_STAGE_PRESOLVED );
12619  SCIPconsSetLocal(cons, FALSE);
12620  if( SCIPconsIsGlobal(cons) )
12621  {
12622  SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
12623  }
12624  else
12625  {
12627  SCIP_CALL( SCIPnodeAddCons(SCIPtreeGetCurrentNode(scip->tree), scip->mem->probmem, scip->set, scip->stat,
12628  scip->tree, cons) );
12629  }
12630  return SCIP_OKAY;
12631 
12632  case SCIP_STAGE_EXITSOLVE:
12633  SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
12634  return SCIP_OKAY;
12635 
12636  default:
12637  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12638  return SCIP_INVALIDCALL;
12639  } /*lint !e788*/
12640 }
12641 
12642 /** globally removes constraint from all subproblems; removes constraint from the constraint set change data of the
12643  * node, where it was added, or from the problem, if it was a problem constraint
12644  *
12645  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12646  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12647  *
12648  * @pre This method can be called if @p scip is in one of the following stages:
12649  * - \ref SCIP_STAGE_PROBLEM
12650  * - \ref SCIP_STAGE_INITPRESOLVE
12651  * - \ref SCIP_STAGE_PRESOLVING
12652  * - \ref SCIP_STAGE_EXITPRESOLVE
12653  * - \ref SCIP_STAGE_INITSOLVE
12654  * - \ref SCIP_STAGE_SOLVING
12655  * - \ref SCIP_STAGE_EXITSOLVE
12656  */
12658  SCIP* scip, /**< SCIP data structure */
12659  SCIP_CONS* cons /**< constraint to delete */
12660  )
12661 {
12662  assert(cons != NULL);
12663 
12664  SCIP_CALL( checkStage(scip, "SCIPdelCons", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
12665 
12666  switch( scip->set->stage )
12667  {
12668  case SCIP_STAGE_PROBLEM:
12669  assert(cons->addconssetchg == NULL);
12670  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->reopt) );
12671  return SCIP_OKAY;
12672 
12673  /* only added constraints can be removed in (de-)initialization process of presolving, otherwise the reduction
12674  * might be wrong
12675  */
12678  assert(SCIPconsIsAdded(cons));
12679  /*lint -fallthrough*/
12680 
12681  case SCIP_STAGE_PRESOLVING:
12682  case SCIP_STAGE_INITSOLVE:
12683  case SCIP_STAGE_SOLVING:
12684  case SCIP_STAGE_EXITSOLVE:
12685  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->reopt) );
12686  return SCIP_OKAY;
12687 
12688  default:
12689  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12690  return SCIP_INVALIDCALL;
12691  } /*lint !e788*/
12692 }
12693 
12694 /** returns original constraint of given name in the problem, or NULL if not existing
12695  *
12696  * @return original constraint of given name in the problem, or NULL if not existing
12697  *
12698  * @pre This method can be called if @p scip is in one of the following stages:
12699  * - \ref SCIP_STAGE_PROBLEM
12700  * - \ref SCIP_STAGE_TRANSFORMING
12701  * - \ref SCIP_STAGE_TRANSFORMED
12702  * - \ref SCIP_STAGE_INITPRESOLVE
12703  * - \ref SCIP_STAGE_PRESOLVING
12704  * - \ref SCIP_STAGE_EXITPRESOLVE
12705  * - \ref SCIP_STAGE_PRESOLVED
12706  * - \ref SCIP_STAGE_INITSOLVE
12707  * - \ref SCIP_STAGE_SOLVING
12708  * - \ref SCIP_STAGE_SOLVED
12709  * - \ref SCIP_STAGE_EXITSOLVE
12710  * - \ref SCIP_STAGE_FREETRANS
12711  */
12713  SCIP* scip, /**< SCIP data structure */
12714  const char* name /**< name of constraint to find */
12715  )
12716 {
12717  assert(name != NULL);
12718 
12719  SCIP_CALL_ABORT( checkStage(scip, "SCIPfindOrigCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12720 
12721  switch( scip->set->stage )
12722  {
12723  case SCIP_STAGE_PROBLEM:
12727  case SCIP_STAGE_PRESOLVING:
12729  case SCIP_STAGE_PRESOLVED:
12730  case SCIP_STAGE_SOLVING:
12731  case SCIP_STAGE_SOLVED:
12732  case SCIP_STAGE_EXITSOLVE:
12733  case SCIP_STAGE_FREETRANS:
12734  return SCIPprobFindCons(scip->origprob, name);
12735 
12736  default:
12737  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12738  SCIPABORT();
12739  return NULL; /*lint !e527*/
12740  } /*lint !e788*/
12741 }
12742 
12743 /** returns constraint of given name in the problem, or NULL if not existing
12744  *
12745  * @return constraint of given name in the problem, or NULL if not existing
12746  *
12747  * @pre This method can be called if @p scip is in one of the following stages:
12748  * - \ref SCIP_STAGE_PROBLEM
12749  * - \ref SCIP_STAGE_TRANSFORMING
12750  * - \ref SCIP_STAGE_TRANSFORMED
12751  * - \ref SCIP_STAGE_INITPRESOLVE
12752  * - \ref SCIP_STAGE_PRESOLVING
12753  * - \ref SCIP_STAGE_EXITPRESOLVE
12754  * - \ref SCIP_STAGE_PRESOLVED
12755  * - \ref SCIP_STAGE_INITSOLVE
12756  * - \ref SCIP_STAGE_SOLVING
12757  * - \ref SCIP_STAGE_SOLVED
12758  * - \ref SCIP_STAGE_EXITSOLVE
12759  * - \ref SCIP_STAGE_FREETRANS
12760  */
12762  SCIP* scip, /**< SCIP data structure */
12763  const char* name /**< name of constraint to find */
12764  )
12765 {
12766  SCIP_CONS* cons;
12767 
12768  assert(name != NULL);
12769 
12770  SCIP_CALL_ABORT( checkStage(scip, "SCIPfindCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12771 
12772  switch( scip->set->stage )
12773  {
12774  case SCIP_STAGE_PROBLEM:
12775  return SCIPprobFindCons(scip->origprob, name);
12776 
12780  case SCIP_STAGE_PRESOLVING:
12782  case SCIP_STAGE_PRESOLVED:
12783  case SCIP_STAGE_SOLVING:
12784  case SCIP_STAGE_SOLVED:
12785  case SCIP_STAGE_EXITSOLVE:
12786  case SCIP_STAGE_FREETRANS:
12787  cons = SCIPprobFindCons(scip->transprob, name);
12788  if( cons == NULL )
12789  return SCIPprobFindCons(scip->origprob, name);
12790  else
12791  return cons;
12792 
12793  default:
12794  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12795  SCIPABORT();
12796  return NULL; /*lint !e527*/
12797  } /*lint !e788*/
12798 }
12799 
12800 /** gets number of upgraded constraints
12801  *
12802  * @return number of upgraded constraints
12803  *
12804  * @pre This method can be called if @p scip is in one of the following stages:
12805  * - \ref SCIP_STAGE_PROBLEM
12806  * - \ref SCIP_STAGE_TRANSFORMED
12807  * - \ref SCIP_STAGE_INITPRESOLVE
12808  * - \ref SCIP_STAGE_PRESOLVING
12809  * - \ref SCIP_STAGE_PRESOLVED
12810  * - \ref SCIP_STAGE_EXITPRESOLVE
12811  * - \ref SCIP_STAGE_SOLVING
12812  * - \ref SCIP_STAGE_SOLVED
12813  */
12815  SCIP* scip /**< SCIP data structure */
12816  )
12817 {
12818  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNUpgrConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
12819 
12820  switch( scip->set->stage )
12821  {
12822  case SCIP_STAGE_PROBLEM:
12823  return 0;
12824 
12827  case SCIP_STAGE_PRESOLVING:
12829  case SCIP_STAGE_PRESOLVED:
12830  case SCIP_STAGE_SOLVING:
12831  case SCIP_STAGE_SOLVED:
12832  return scip->stat->npresolupgdconss;
12833 
12834  default:
12835  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12836  SCIPABORT();
12837  return 0; /*lint !e527*/
12838  } /*lint !e788*/
12839 }
12840 
12841 /** gets total number of globally valid constraints currently in the problem
12842  *
12843  * @return total number of globally valid constraints currently in the problem
12844  *
12845  * @pre This method can be called if @p scip is in one of the following stages:
12846  * - \ref SCIP_STAGE_PROBLEM
12847  * - \ref SCIP_STAGE_TRANSFORMED
12848  * - \ref SCIP_STAGE_INITPRESOLVE
12849  * - \ref SCIP_STAGE_PRESOLVING
12850  * - \ref SCIP_STAGE_EXITPRESOLVE
12851  * - \ref SCIP_STAGE_PRESOLVED
12852  * - \ref SCIP_STAGE_INITSOLVE
12853  * - \ref SCIP_STAGE_SOLVING
12854  * - \ref SCIP_STAGE_SOLVED
12855  */
12857  SCIP* scip /**< SCIP data structure */
12858  )
12859 {
12860  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
12861 
12862  switch( scip->set->stage )
12863  {
12864  case SCIP_STAGE_PROBLEM:
12865  return scip->origprob->nconss;
12866 
12869  case SCIP_STAGE_PRESOLVING:
12871  case SCIP_STAGE_PRESOLVED:
12872  case SCIP_STAGE_INITSOLVE:
12873  case SCIP_STAGE_SOLVING:
12874  case SCIP_STAGE_SOLVED:
12875  return scip->transprob->nconss;
12876 
12877  default:
12878  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12879  SCIPABORT();
12880  return 0; /*lint !e527*/
12881  } /*lint !e788*/
12882 }
12883 
12884 /** gets array of globally valid constraints currently in the problem
12885  *
12886  * @return array of globally valid constraints currently in the problem
12887  *
12888  * @pre This method can be called if @p scip is in one of the following stages:
12889  * - \ref SCIP_STAGE_PROBLEM
12890  * - \ref SCIP_STAGE_TRANSFORMED
12891  * - \ref SCIP_STAGE_INITPRESOLVE
12892  * - \ref SCIP_STAGE_PRESOLVING
12893  * - \ref SCIP_STAGE_EXITPRESOLVE
12894  * - \ref SCIP_STAGE_PRESOLVED
12895  * - \ref SCIP_STAGE_INITSOLVE
12896  * - \ref SCIP_STAGE_SOLVING
12897  * - \ref SCIP_STAGE_SOLVED
12898  *
12899  * @warning If your are using the method SCIPaddCons(), it can happen that the internal constraint array (which is
12900  * accessed via this method) gets resized. This can invalid the pointer which is returned by this method.
12901  */
12903  SCIP* scip /**< SCIP data structure */
12904  )
12905 {
12906  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
12907 
12908  switch( scip->set->stage )
12909  {
12910  case SCIP_STAGE_PROBLEM:
12911  return scip->origprob->conss;
12912 
12915  case SCIP_STAGE_PRESOLVING:
12917  case SCIP_STAGE_PRESOLVED:
12918  case SCIP_STAGE_INITSOLVE:
12919  case SCIP_STAGE_SOLVING:
12920  case SCIP_STAGE_SOLVED:
12921  return scip->transprob->conss;
12922 
12923  default:
12924  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12925  SCIPABORT();
12926  return NULL; /*lint !e527*/
12927  } /*lint !e788*/
12928 }
12929 
12930 /** gets total number of constraints in the original problem
12931  *
12932  * @return total number of constraints in the original problem
12933  *
12934  * @pre This method can be called if @p scip is in one of the following stages:
12935  * - \ref SCIP_STAGE_PROBLEM
12936  * - \ref SCIP_STAGE_TRANSFORMING
12937  * - \ref SCIP_STAGE_TRANSFORMED
12938  * - \ref SCIP_STAGE_INITPRESOLVE
12939  * - \ref SCIP_STAGE_PRESOLVING
12940  * - \ref SCIP_STAGE_EXITPRESOLVE
12941  * - \ref SCIP_STAGE_PRESOLVED
12942  * - \ref SCIP_STAGE_INITSOLVE
12943  * - \ref SCIP_STAGE_SOLVING
12944  * - \ref SCIP_STAGE_SOLVED
12945  * - \ref SCIP_STAGE_EXITSOLVE
12946  * - \ref SCIP_STAGE_FREETRANS
12947  */
12949  SCIP* scip /**< SCIP data structure */
12950  )
12951 {
12952  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigConss", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12953 
12954  return scip->origprob->nconss;
12955 }
12956 
12957 /** gets array of constraints in the original problem
12958  *
12959  * @return array of constraints in the original problem
12960  *
12961  * @pre This method can be called if @p scip is in one of the following stages:
12962  * - \ref SCIP_STAGE_PROBLEM
12963  * - \ref SCIP_STAGE_TRANSFORMING
12964  * - \ref SCIP_STAGE_TRANSFORMED
12965  * - \ref SCIP_STAGE_INITPRESOLVE
12966  * - \ref SCIP_STAGE_PRESOLVING
12967  * - \ref SCIP_STAGE_EXITPRESOLVE
12968  * - \ref SCIP_STAGE_PRESOLVED
12969  * - \ref SCIP_STAGE_INITSOLVE
12970  * - \ref SCIP_STAGE_SOLVING
12971  * - \ref SCIP_STAGE_SOLVED
12972  * - \ref SCIP_STAGE_EXITSOLVE
12973  * - \ref SCIP_STAGE_FREETRANS
12974  */
12976  SCIP* scip /**< SCIP data structure */
12977  )
12978 {
12979  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetOrigConss", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12980 
12981  return scip->origprob->conss;
12982 }
12983 
12984 /** computes the number of check constraint in the current node (loop over all constraint handler and cumulates the
12985  * number of check constraints)
12986  *
12987  * @return returns the number of check constraints
12988  *
12989  * @pre This method can be called if @p scip is in one of the following stages:
12990  * - \ref SCIP_STAGE_TRANSFORMED
12991  * - \ref SCIP_STAGE_INITPRESOLVE
12992  * - \ref SCIP_STAGE_PRESOLVING
12993  * - \ref SCIP_STAGE_EXITPRESOLVE
12994  * - \ref SCIP_STAGE_PRESOLVED
12995  * - \ref SCIP_STAGE_INITSOLVE
12996  * - \ref SCIP_STAGE_SOLVING
12997  */
12999  SCIP* scip /**< SCIP data structure */
13000  )
13001 {
13002  SCIP_CONSHDLR** conshdlrs;
13003  int nconshdlrs;
13004  int ncheckconss;
13005  int c;
13006 
13007  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCheckConss", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13008 
13009  nconshdlrs = SCIPgetNConshdlrs(scip);
13010  conshdlrs = SCIPgetConshdlrs(scip);
13011  assert(conshdlrs != NULL);
13012 
13013  ncheckconss = 0;
13014 
13015  /* loop over all constraint handler and collect the number of constraints which need to be checked */
13016  for( c = 0; c < nconshdlrs; ++c )
13017  {
13018  assert(conshdlrs[c] != NULL);
13019  ncheckconss += SCIPconshdlrGetNCheckConss(conshdlrs[c]);
13020  }
13021 
13022  return ncheckconss;
13023 
13024 }
13025 
13026 /*
13027  * local subproblem methods
13028  */
13029 
13030 /** adds a conflict to a given node or globally to the problem if @p node == NULL.
13031  *
13032  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13033  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13034  *
13035  * @pre this method can be called in one of the following stages of the SCIP solving process:
13036  * - \ref SCIP_STAGE_INITPRESOLVE
13037  * - \ref SCIP_STAGE_PRESOLVING
13038  * - \ref SCIP_STAGE_EXITPRESOLVE
13039  * - \ref SCIP_STAGE_SOLVING
13040  *
13041  * @note this method will release the constraint
13042  */
13044  SCIP* scip, /**< SCIP data structure */
13045  SCIP_NODE* node, /**< node to add conflict (or NULL if global) */
13046  SCIP_CONS* cons, /**< constraint representing the conflict */
13047  SCIP_NODE* validnode, /**< node at whichaddConf the constraint is valid (or NULL) */
13048  SCIP_CONFTYPE conftype, /**< type of the conflict */
13049  SCIP_Bool iscutoffinvolved /**< is a cutoff bound involved in this conflict */
13050  )
13051 {
13052  SCIP_Real primalbound;
13053 
13054  assert(scip != NULL);
13055  assert(cons != NULL);
13056  assert(scip->conflictstore != NULL);
13057  assert(scip->set->conf_enable);
13058  assert(conftype != SCIP_CONFTYPE_UNKNOWN);
13059  assert(conftype != SCIP_CONFTYPE_BNDEXCEEDING || iscutoffinvolved);
13060 
13061  SCIP_CALL( checkStage(scip, "SCIPaddConflict", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13062 
13063  if( iscutoffinvolved )
13064  primalbound = SCIPgetCutoffbound(scip);
13065  else
13066  primalbound = -SCIPinfinity(scip);
13067 
13068  /* add a global conflict */
13069  if( node == NULL )
13070  {
13071  SCIP_CALL( SCIPaddCons(scip, cons) );
13072  }
13073  /* add a local conflict */
13074  else
13075  {
13076  SCIP_CALL( SCIPaddConsNode(scip, node, cons, validnode) );
13077  }
13078 
13079  if( node == NULL || SCIPnodeGetType(node) != SCIP_NODETYPE_PROBINGNODE )
13080  {
13081  /* add the conflict to the conflict store */
13082  SCIP_CALL( SCIPconflictstoreAddConflict(scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->tree,
13083  scip->transprob, scip->reopt, cons, conftype, iscutoffinvolved, primalbound) );
13084  }
13085 
13086  /* mark constraint to be a conflict */
13087  SCIPconsMarkConflict(cons);
13088 
13089  SCIP_CALL( SCIPreleaseCons(scip, &cons) );
13090 
13091  return SCIP_OKAY;
13092 }
13093 
13094 /** tries to remove conflicts depending on an old cutoff bound if the improvement of the new incumbent is good enough
13095  *
13096  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13097  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13098  *
13099  * @pre this method can be called in one of the following stages of the SCIP solving process:
13100  * - \ref SCIP_STAGE_PRESOLVING
13101  * - \ref SCIP_STAGE_SOLVING
13102  */
13104  SCIP* scip, /**< SCIP data structure */
13105  SCIP_EVENT* event /**< event data */
13106  )
13107 {
13108  assert(scip != NULL);
13109  assert(event != NULL);
13111  assert(SCIPeventGetSol(event) != NULL);
13112 
13113  SCIP_CALL( checkStage(scip, "SCIPclearConflictStore", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13114 
13116  scip->transprob, scip->reopt, scip->primal->cutoffbound) );
13117 
13118  return SCIP_OKAY;
13119 }
13120 
13121 /** adds constraint to the given node (and all of its subnodes), even if it is a global constraint;
13122  * It is sometimes desirable to add the constraint to a more local node (i.e., a node of larger depth) even if
13123  * the constraint is also valid higher in the tree, for example, if one wants to produce a constraint which is
13124  * only active in a small part of the tree although it is valid in a larger part.
13125  * In this case, one should pass the more global node where the constraint is valid as "validnode".
13126  * Note that the same constraint cannot be added twice to the branching tree with different "validnode" parameters.
13127  * If the constraint is valid at the same node as it is inserted (the usual case), one should pass NULL as "validnode".
13128  * If the "validnode" is the root node, it is automatically upgraded into a global constraint, but still only added to
13129  * the given node. If a local constraint is added to the root node, it is added to the global problem instead.
13130  *
13131  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13132  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13133  *
13134  * @pre this method can be called in one of the following stages of the SCIP solving process:
13135  * - \ref SCIP_STAGE_INITPRESOLVE
13136  * - \ref SCIP_STAGE_PRESOLVING
13137  * - \ref SCIP_STAGE_EXITPRESOLVE
13138  * - \ref SCIP_STAGE_SOLVING
13139  */
13141  SCIP* scip, /**< SCIP data structure */
13142  SCIP_NODE* node, /**< node to add constraint to */
13143  SCIP_CONS* cons, /**< constraint to add */
13144  SCIP_NODE* validnode /**< node at which the constraint is valid, or NULL */
13145  )
13146 {
13147  assert(cons != NULL);
13148  assert(node != NULL);
13149 
13150  SCIP_CALL( checkStage(scip, "SCIPaddConsNode", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13151 
13152  if( validnode != NULL )
13153  {
13154  int validdepth;
13155 
13156  validdepth = SCIPnodeGetDepth(validnode);
13157  if( validdepth > SCIPnodeGetDepth(node) )
13158  {
13159  SCIPerrorMessage("cannot add constraint <%s> valid in depth %d to a node of depth %d\n",
13160  SCIPconsGetName(cons), validdepth, SCIPnodeGetDepth(node));
13161  return SCIP_INVALIDDATA;
13162  }
13163  if( cons->validdepth != -1 && cons->validdepth != validdepth )
13164  {
13165  SCIPerrorMessage("constraint <%s> is already marked to be valid in depth %d - cannot mark it to be valid in depth %d\n",
13166  SCIPconsGetName(cons), cons->validdepth, validdepth);
13167  return SCIP_INVALIDDATA;
13168  }
13169  if( validdepth <= SCIPtreeGetEffectiveRootDepth(scip->tree) )
13170  SCIPconsSetLocal(cons, FALSE);
13171  else
13172  cons->validdepth = validdepth;
13173  }
13174 
13176  {
13177  SCIPconsSetLocal(cons, FALSE);
13178  SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
13179  }
13180  else
13181  {
13182  SCIP_CALL( SCIPnodeAddCons(node, scip->mem->probmem, scip->set, scip->stat, scip->tree, cons) );
13183  }
13184 
13185  return SCIP_OKAY;
13186 }
13187 
13188 /** adds constraint locally to the current node (and all of its subnodes), even if it is a global constraint;
13189  * It is sometimes desirable to add the constraint to a more local node (i.e., a node of larger depth) even if
13190  * the constraint is also valid higher in the tree, for example, if one wants to produce a constraint which is
13191  * only active in a small part of the tree although it is valid in a larger part.
13192  *
13193  * If the constraint is valid at the same node as it is inserted (the usual case), one should pass NULL as "validnode".
13194  * If the "validnode" is the root node, it is automatically upgraded into a global constraint, but still only added to
13195  * the given node. If a local constraint is added to the root node, it is added to the global problem instead.
13196  *
13197  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13198  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13199  *
13200  * @pre this method can be called in one of the following stages of the SCIP solving process:
13201  * - \ref SCIP_STAGE_INITPRESOLVE
13202  * - \ref SCIP_STAGE_PRESOLVING
13203  * - \ref SCIP_STAGE_EXITPRESOLVE
13204  * - \ref SCIP_STAGE_SOLVING
13205  *
13206  * @note The same constraint cannot be added twice to the branching tree with different "validnode" parameters. This is
13207  * the case due to internal data structures and performance issues. In such a case you should try to realize your
13208  * issue using the method SCIPdisableCons() and SCIPenableCons() and control these via the event system of SCIP.
13209  */
13211  SCIP* scip, /**< SCIP data structure */
13212  SCIP_CONS* cons, /**< constraint to add */
13213  SCIP_NODE* validnode /**< node at which the constraint is valid, or NULL */
13214  )
13215 {
13216  assert(cons != NULL);
13217 
13218  SCIP_CALL( checkStage(scip, "SCIPaddConsLocal", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13219 
13220  SCIP_CALL( SCIPaddConsNode(scip, SCIPtreeGetCurrentNode(scip->tree), cons, validnode) );
13221 
13222  return SCIP_OKAY;
13223 }
13224 
13225 /** disables constraint's separation, enforcing, and propagation capabilities at the given node (and all subnodes);
13226  * if the method is called at the root node, the constraint is globally deleted from the problem;
13227  * the constraint deletion is being remembered at the given node, s.t. after leaving the node's subtree, the constraint
13228  * is automatically enabled again, and after entering the node's subtree, it is automatically disabled;
13229  * this may improve performance because redundant checks on this constraint are avoided, but it consumes memory;
13230  * alternatively, use SCIPdisableCons()
13231  *
13232  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13233  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13234  *
13235  * @pre this method can be called in one of the following stages of the SCIP solving process:
13236  * - \ref SCIP_STAGE_INITPRESOLVE
13237  * - \ref SCIP_STAGE_PRESOLVING
13238  * - \ref SCIP_STAGE_EXITPRESOLVE
13239  * - \ref SCIP_STAGE_SOLVING
13240  */
13242  SCIP* scip, /**< SCIP data structure */
13243  SCIP_NODE* node, /**< node to disable constraint in */
13244  SCIP_CONS* cons /**< constraint to locally delete */
13245  )
13246 {
13247  assert(cons != NULL);
13248 
13249  SCIP_CALL( checkStage(scip, "SCIPdelConsNode", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13250 
13251  /* only added constraints can be removed in (de-)initialization process of presolving, otherwise the reduction
13252  * might be wrong
13253  */
13254  if( scip->set->stage == SCIP_STAGE_INITPRESOLVE || scip->set->stage == SCIP_STAGE_EXITPRESOLVE )
13255  assert(SCIPconsIsAdded(cons));
13256 
13258  {
13259  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->reopt) );
13260  }
13261  else
13262  {
13263  SCIP_CALL( SCIPnodeDelCons(node, scip->mem->probmem, scip->set, scip->stat, scip->tree, cons) );
13264  }
13265 
13266  return SCIP_OKAY;
13267 }
13268 
13269 /** disables constraint's separation, enforcing, and propagation capabilities at the current node (and all subnodes);
13270  * if the method is called during problem modification or at the root node, the constraint is globally deleted from
13271  * the problem;
13272  * the constraint deletion is being remembered at the current node, s.t. after leaving the current subtree, the
13273  * constraint is automatically enabled again, and after reentering the current node's subtree, it is automatically
13274  * disabled again;
13275  * this may improve performance because redundant checks on this constraint are avoided, but it consumes memory;
13276  * alternatively, use SCIPdisableCons()
13277  *
13278  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13279  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13280  *
13281  * @pre this method can be called in one of the following stages of the SCIP solving process:
13282  * - \ref SCIP_STAGE_PROBLEM
13283  * - \ref SCIP_STAGE_INITPRESOLVE
13284  * - \ref SCIP_STAGE_PRESOLVING
13285  * - \ref SCIP_STAGE_EXITPRESOLVE
13286  * - \ref SCIP_STAGE_SOLVING
13287  *
13288  * @note SCIP stage does not get changed
13289  *
13290  */
13292  SCIP* scip, /**< SCIP data structure */
13293  SCIP_CONS* cons /**< constraint to locally delete */
13294  )
13295 {
13296  SCIP_NODE* node;
13297 
13298  assert(cons != NULL);
13299 
13300  SCIP_CALL( checkStage(scip, "SCIPdelConsLocal", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13301 
13302  switch( scip->set->stage )
13303  {
13304  case SCIP_STAGE_PROBLEM:
13305  assert(cons->addconssetchg == NULL);
13306  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->reopt) );
13307  return SCIP_OKAY;
13308 
13309  /* only added constraints can be removed in (de-)initialization process of presolving, otherwise the reduction
13310  * might be wrong
13311  */
13314  assert(SCIPconsIsAdded(cons));
13315  /*lint -fallthrough*/
13316 
13317  case SCIP_STAGE_PRESOLVING:
13318  case SCIP_STAGE_SOLVING:
13319  node = SCIPtreeGetCurrentNode(scip->tree);
13320 
13322  {
13323  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->reopt) );
13324  }
13325  else
13326  {
13327  SCIP_CALL( SCIPnodeDelCons(node, scip->mem->probmem, scip->set, scip->stat, scip->tree, cons) );
13328  }
13329  return SCIP_OKAY;
13330 
13331  default:
13332  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
13333  return SCIP_INVALIDCALL;
13334  } /*lint !e788*/
13335 }
13336 
13337 /** gets estimate of best primal solution w.r.t. original problem contained in current subtree
13338  *
13339  * @return estimate of best primal solution w.r.t. original problem contained in current subtree
13340  *
13341  * @pre this method can be called in one of the following stages of the SCIP solving process:
13342  * - \ref SCIP_STAGE_SOLVING
13343  */
13345  SCIP* scip /**< SCIP data structure */
13346  )
13347 {
13348  SCIP_NODE* node;
13349 
13350  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLocalOrigEstimate", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13351 
13352  node = SCIPtreeGetCurrentNode(scip->tree);
13353  return node != NULL ? SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPnodeGetEstimate(node)) : SCIP_INVALID;
13354 }
13355 
13356 /** gets estimate of best primal solution w.r.t. transformed problem contained in current subtree
13357  *
13358  * @return estimate of best primal solution w.r.t. transformed problem contained in current subtree
13359  *
13360  * @pre this method can be called in one of the following stages of the SCIP solving process:
13361  * - \ref SCIP_STAGE_SOLVING
13362  */
13364  SCIP* scip /**< SCIP data structure */
13365  )
13366 {
13367  SCIP_NODE* node;
13368 
13369  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLocalTransEstimate", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13370 
13371  node = SCIPtreeGetCurrentNode(scip->tree);
13372 
13373  return node != NULL ? SCIPnodeGetEstimate(node) : SCIP_INVALID;
13374 }
13375 
13376 /** gets dual bound of current node
13377  *
13378  * @return dual bound of current node
13379  *
13380  * @pre this method can be called in one of the following stages of the SCIP solving process:
13381  * - \ref SCIP_STAGE_SOLVING
13382  */
13384  SCIP* scip /**< SCIP data structure */
13385  )
13386 {
13387  SCIP_NODE* node;
13388 
13389  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLocalDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13390 
13391  node = SCIPtreeGetCurrentNode(scip->tree);
13392  return node != NULL ? SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPnodeGetLowerbound(node)) : SCIP_INVALID;
13393 }
13394 
13395 /** gets lower bound of current node in transformed problem
13396  *
13397  * @return lower bound of current node in transformed problem
13398  *
13399  * @pre this method can be called in one of the following stages of the SCIP solving process:
13400  * - \ref SCIP_STAGE_SOLVING
13401  */
13403  SCIP* scip /**< SCIP data structure */
13404  )
13405 {
13406  SCIP_NODE* node;
13407 
13408  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLocalLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13409 
13410  node = SCIPtreeGetCurrentNode(scip->tree);
13411 
13412  return node != NULL ? SCIPnodeGetLowerbound(node) : SCIP_INVALID;
13413 }
13414 
13415 /** gets dual bound of given node
13416  *
13417  * @return dual bound of a given node
13418  *
13419  * @pre this method can be called in one of the following stages of the SCIP solving process:
13420  * - \ref SCIP_STAGE_SOLVING
13421  */
13423  SCIP* scip, /**< SCIP data structure */
13424  SCIP_NODE* node /**< node to get dual bound for */
13425  )
13426 {
13427  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNodeDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13428 
13429  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPnodeGetLowerbound(node));
13430 }
13431 
13432 /** gets lower bound of given node in transformed problem
13433  *
13434  * @return lower bound of given node in transformed problem
13435  *
13436  * @pre this method can be called in one of the following stages of the SCIP solving process:
13437  * - \ref SCIP_STAGE_SOLVING
13438  */
13440  SCIP* scip, /**< SCIP data structure */
13441  SCIP_NODE* node /**< node to get dual bound for */
13442  )
13443 {
13444  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNodeLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13445 
13446  return SCIPnodeGetLowerbound(node);
13447 }
13448 
13449 /** if given value is tighter (larger for minimization, smaller for maximization) than the current node's dual bound (in
13450  * original problem space), sets the current node's dual bound to the new value
13451  *
13452  * @note the given new bound has to be a dual bound, i.e., it has to be valid for the original problem.
13453  *
13454  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13455  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13456  *
13457  * @pre this method can be called in one of the following stages of the SCIP solving process:
13458  * - \ref SCIP_STAGE_PROBLEM
13459  * - \ref SCIP_STAGE_PRESOLVING
13460  * - \ref SCIP_STAGE_PRESOLVED
13461  * - \ref SCIP_STAGE_SOLVING
13462  */
13464  SCIP* scip, /**< SCIP data structure */
13465  SCIP_Real newbound /**< new dual bound for the node (if it's tighter than the old one) */
13466  )
13467 {
13468  SCIP_CALL( checkStage(scip, "SCIPupdateLocalDualbound", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13469 
13470  switch( scip->set->stage )
13471  {
13472  case SCIP_STAGE_PROBLEM:
13473  /* since no root node, for which we could update the dual bound, has been create yet, update the dual bound stored in
13474  * the problem data
13475  */
13476  SCIPprobUpdateDualbound(scip->origprob, newbound);
13477  break;
13478 
13479  case SCIP_STAGE_PRESOLVING:
13480  case SCIP_STAGE_PRESOLVED:
13481  /* since no root node, for which we could update the dual bound, has been create yet, update the dual bound stored in
13482  * the problem data
13483  */
13484  SCIPprobUpdateDualbound(scip->transprob, SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, newbound));
13485  break;
13486 
13487  case SCIP_STAGE_SOLVING:
13489  break;
13490 
13491  default:
13492  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
13493  SCIPABORT();
13494  return SCIP_INVALIDCALL; /*lint !e527*/
13495  } /*lint !e788*/
13496 
13497  return SCIP_OKAY;
13498 }
13499 
13500 /** if given value is larger than the current node's lower bound (in transformed problem), sets the current node's
13501  * lower bound to the new value
13502  *
13503  * @note the given new bound has to be a lower bound, i.e., it has to be valid for the transformed problem.
13504  *
13505  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13506  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13507  *
13508  * @pre this method can be called in one of the following stages of the SCIP solving process:
13509  * - \ref SCIP_STAGE_PRESOLVING
13510  * - \ref SCIP_STAGE_PRESOLVED
13511  * - \ref SCIP_STAGE_SOLVING
13512  */
13514  SCIP* scip, /**< SCIP data structure */
13515  SCIP_Real newbound /**< new lower bound for the node (if it's larger than the old one) */
13516  )
13517 {
13518  SCIP_CALL( checkStage(scip, "SCIPupdateLocalLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13519 
13520  switch( scip->set->stage )
13521  {
13522  case SCIP_STAGE_PRESOLVING:
13523  case SCIP_STAGE_PRESOLVED:
13524  /* since no root node, for which we could update the lower bound, has been created yet, update the dual bound stored
13525  * in the problem data
13526  */
13527  SCIPprobUpdateDualbound(scip->transprob, SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, newbound));
13528  break;
13529 
13530  case SCIP_STAGE_SOLVING:
13532  break;
13533 
13534  default:
13535  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
13536  SCIPABORT();
13537  return SCIP_INVALIDCALL; /*lint !e527*/
13538  } /*lint !e788*/
13539 
13540  return SCIP_OKAY;
13541 }
13542 
13543 /** if given value is tighter (larger for minimization, smaller for maximization) than the node's dual bound,
13544  * sets the node's dual bound to the new value
13545  *
13546  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13547  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13548  *
13549  * @pre this method can be called in one of the following stages of the SCIP solving process:
13550  * - \ref SCIP_STAGE_SOLVING
13551  */
13553  SCIP* scip, /**< SCIP data structure */
13554  SCIP_NODE* node, /**< node to update dual bound for */
13555  SCIP_Real newbound /**< new dual bound for the node (if it's tighter than the old one) */
13556  )
13557 {
13558  SCIP_CALL( checkStage(scip, "SCIPupdateNodeDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13559 
13560  SCIP_CALL( SCIPupdateNodeLowerbound(scip, node, SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, newbound)) );
13561 
13562  return SCIP_OKAY;
13563 }
13564 
13565 /** if given value is larger than the node's lower bound (in transformed problem), sets the node's lower bound
13566  * to the new value
13567  *
13568  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13569  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13570  *
13571  * @pre this method can be called in one of the following stages of the SCIP solving process:
13572  * - \ref SCIP_STAGE_SOLVING
13573  */
13575  SCIP* scip, /**< SCIP data structure */
13576  SCIP_NODE* node, /**< node to update lower bound for */
13577  SCIP_Real newbound /**< new lower bound for the node (if it's larger than the old one) */
13578  )
13579 {
13580  SCIP_CALL( checkStage(scip, "SCIPupdateNodeLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13581 
13582  SCIPnodeUpdateLowerbound(node, scip->stat, scip->set, scip->tree, scip->transprob, scip->origprob, newbound);
13583 
13584  /* if lowerbound exceeds the cutoffbound the node will be marked to be cutoff
13585  *
13586  * If the node is an inner node (,not a child node,) we need to cutoff the node manually if we exceed the
13587  * cutoffbound. This is only relevant if a user updates the lower bound; in the main solving process of SCIP the
13588  * lowerbound is only changed before branching and the given node is always a child node. Therefore, we only check
13589  * for a cutoff here in the user function instead of in SCIPnodeUpdateLowerbound().
13590  */
13591  if( SCIPisGE(scip, newbound, scip->primal->cutoffbound) )
13592  {
13593  SCIP_CALL( SCIPnodeCutoff(node, scip->set, scip->stat, scip->tree, scip->transprob, scip->origprob, scip->reopt,
13594  scip->lp, scip->mem->probmem) );
13595  }
13596 
13597  return SCIP_OKAY;
13598 }
13599 
13600 /** change the node selection priority of the given child
13601  *
13602  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13603  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13604  *
13605  * @pre this method can be called in one of the following stages of the SCIP solving process:
13606  * - \ref SCIP_STAGE_SOLVING
13607  */
13609  SCIP* scip, /**< SCIP data structure */
13610  SCIP_NODE* child, /**< child to update the node selection priority */
13611  SCIP_Real priority /**< node selection priority value */
13612  )
13613 {
13614  SCIP_CALL( checkStage(scip, "SCIPchgChildPrio", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13615 
13616  if( SCIPnodeGetType(child) != SCIP_NODETYPE_CHILD )
13617  return SCIP_INVALIDDATA;
13618 
13619  SCIPchildChgNodeselPrio(scip->tree, child, priority);
13620 
13621  return SCIP_OKAY;
13622 }
13623 
13624 
13625 
13626 /*
13627  * solve methods
13628  */
13629 
13630 /** checks solution for feasibility in original problem without adding it to the solution store; to improve the
13631  * performance we use the following order when checking for violations:
13632  *
13633  * 1. constraint handlers which don't need constraints (e.g. integral constraint handler)
13634  * 2. variable bounds
13635  * 3. original constraints
13636  */
13637 static
13639  SCIP* scip, /**< SCIP data structure */
13640  SCIP_SOL* sol, /**< primal CIP solution */
13641  SCIP_Bool* feasible, /**< stores whether given solution is feasible */
13642  SCIP_Bool printreason, /**< Should the reason for the violation be printed? */
13643  SCIP_Bool completely, /**< Should all violations be checked? */
13644  SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
13645  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
13646  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
13647  SCIP_Bool checkmodifiable /**< have modifiable constraint to be checked? */
13648  )
13649 {
13650  SCIP_RESULT result;
13651  int v;
13652  int c;
13653  int h;
13654 
13655  assert(scip != NULL);
13656  assert(sol != NULL);
13657  assert(feasible != NULL);
13658 
13659  SCIP_CALL( checkStage(scip, "checkSolOrig", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
13660 
13661  *feasible = TRUE;
13662 
13664 
13665  if( !printreason )
13666  completely = FALSE;
13667 
13668  /* check bounds */
13669  if( checkbounds )
13670  {
13671  for( v = 0; v < scip->origprob->nvars; ++v )
13672  {
13673  SCIP_VAR* var;
13674  SCIP_Real solval;
13675  SCIP_Real lb;
13676  SCIP_Real ub;
13677 
13678  var = scip->origprob->vars[v];
13679  solval = SCIPsolGetVal(sol, scip->set, scip->stat, var);
13680 
13681  lb = SCIPvarGetLbOriginal(var);
13682  ub = SCIPvarGetUbOriginal(var);
13683 
13684  SCIPupdateSolBoundViolation(scip, sol, lb - solval, SCIPrelDiff(lb, solval));
13685  SCIPupdateSolBoundViolation(scip, sol, solval - ub, SCIPrelDiff(solval, ub));
13686 
13687  if( SCIPsetIsFeasLT(scip->set, solval, lb) || SCIPsetIsFeasGT(scip->set, solval, ub) )
13688  {
13689  *feasible = FALSE;
13690 
13691  if( printreason )
13692  {
13693  SCIPmessagePrintInfo(scip->messagehdlr, "solution violates original bounds of variable <%s> [%g,%g] solution value <%g>\n",
13694  SCIPvarGetName(var), lb, ub, solval);
13695  }
13696 
13697  if( !completely )
13698  return SCIP_OKAY;
13699  }
13700  }
13701  }
13702 
13703  /* call constraint handlers that don't need constraints */
13704  for( h = 0; h < scip->set->nconshdlrs; ++h )
13705  {
13706  if( !SCIPconshdlrNeedsCons(scip->set->conshdlrs[h]) )
13707  {
13708  SCIP_CALL( SCIPconshdlrCheck(scip->set->conshdlrs[h], scip->mem->probmem, scip->set, scip->stat, sol,
13709  checkintegrality, checklprows, printreason, completely, &result) );
13710 
13711  if( result != SCIP_FEASIBLE )
13712  {
13713  *feasible = FALSE;
13714 
13715  if( !completely )
13716  return SCIP_OKAY;
13717  }
13718  }
13719  }
13720 
13721  /* check original constraints
13722  *
13723  * in general modifiable constraints can not be checked, because the variables to fulfill them might be missing in
13724  * the original problem; however, if the solution comes from a heuristic during presolving modifiable constraints
13725  * have to be checked;
13726  */
13727  for( c = 0; c < scip->origprob->nconss; ++c )
13728  {
13729  if( SCIPconsIsChecked(scip->origprob->conss[c]) && (checkmodifiable || !SCIPconsIsModifiable(scip->origprob->conss[c])) )
13730  {
13731  /* check solution */
13732  SCIP_CALL( SCIPconsCheck(scip->origprob->conss[c], scip->set, sol,
13733  checkintegrality, checklprows, printreason, &result) );
13734 
13735  if( result != SCIP_FEASIBLE )
13736  {
13737  *feasible = FALSE;
13738 
13739  if( !completely )
13740  return SCIP_OKAY;
13741  }
13742  }
13743  }
13744 
13745  return SCIP_OKAY;
13746 }
13747 
13748 /** update integrality violation of a solution */
13750  SCIP* scip, /**< SCIP data structure */
13751  SCIP_SOL* sol, /**< primal CIP solution */
13752  SCIP_Real absviol /**< absolute violation */
13753  )
13754 {
13756  SCIPsolUpdateIntegralityViolation(sol, absviol);
13757 }
13758 
13759 /** update bound violation of a solution */
13761  SCIP* scip, /**< SCIP data structure */
13762  SCIP_SOL* sol, /**< primal CIP solution */
13763  SCIP_Real absviol, /**< absolute violation */
13764  SCIP_Real relviol /**< relative violation */
13765  )
13766 {
13768  SCIPsolUpdateBoundViolation(sol, absviol, relviol);
13769 }
13770 
13771 /** update LP row violation of a solution */
13773  SCIP* scip, /**< SCIP data structure */
13774  SCIP_SOL* sol, /**< primal CIP solution */
13775  SCIP_Real absviol, /**< absolute violation */
13776  SCIP_Real relviol /**< relative violation */
13777  )
13778 {
13780  SCIPsolUpdateLPRowViolation(sol, absviol, relviol);
13781 }
13782 
13783 /** update constraint violation of a solution */
13785  SCIP* scip, /**< SCIP data structure */
13786  SCIP_SOL* sol, /**< primal CIP solution */
13787  SCIP_Real absviol, /**< absolute violation */
13788  SCIP_Real relviol /**< relative violation */
13789  )
13790 {
13792  SCIPsolUpdateConsViolation(sol, absviol, relviol);
13793 }
13794 
13795 /** update LP row and constraint violations of a solution */
13797  SCIP* scip, /**< SCIP data structure */
13798  SCIP_SOL* sol, /**< primal CIP solution */
13799  SCIP_Real absviol, /**< absolute violation */
13800  SCIP_Real relviol /**< relative violation */
13801  )
13802 {
13804  SCIPsolUpdateLPConsViolation(sol, absviol, relviol);
13805 }
13806 
13807 /** allow violation updates */
13809  SCIP* scip /**< SCIP data structure */
13810  )
13811 {
13813 }
13814 
13815 /** disallow violation updates */
13817  SCIP* scip /**< SCIP data structure */
13818  )
13819 {
13821 }
13822 
13823 /** calculates number of nonzeros in problem */
13824 static
13826  SCIP* scip, /**< SCIP data structure */
13827  SCIP_Longint* nchecknonzeros, /**< pointer to store number of non-zeros in all check constraints */
13828  SCIP_Longint* nactivenonzeros, /**< pointer to store number of non-zeros in all active constraints */
13829  SCIP_Bool* approxchecknonzeros,/**< pointer to store if the number of non-zeros in all check constraints
13830  * is only a lowerbound
13831  */
13832  SCIP_Bool* approxactivenonzeros/**< pointer to store if the number of non-zeros in all active constraints
13833  * is only a lowerbound
13834  */
13835  )
13836 {
13837  SCIP_CONS** conss;
13838  SCIP_Bool success;
13839  SCIP_Bool ischeck;
13840  int nconss;
13841  int nvars;
13842  int c;
13843  int h;
13844 
13845  *nchecknonzeros = 0LL;
13846  *nactivenonzeros = 0LL;
13847  *approxchecknonzeros = FALSE;
13848  *approxactivenonzeros = FALSE;
13849 
13850  /* computes number of non-zeros over all active constraints */
13851  for( h = scip->set->nconshdlrs - 1; h >= 0; --h )
13852  {
13853  nconss = SCIPconshdlrGetNActiveConss(scip->set->conshdlrs[h]);
13854 
13855  if( nconss > 0 )
13856  {
13857  conss = SCIPconshdlrGetConss(scip->set->conshdlrs[h]);
13858 
13859  /* calculate all active constraints */
13860  for( c = nconss - 1; c >= 0; --c )
13861  {
13862  SCIP_CALL( SCIPconsGetNVars(conss[c], scip->set, &nvars, &success) );
13863  ischeck = SCIPconsIsChecked(conss[c]);
13864 
13865  if( !success )
13866  {
13867  *approxactivenonzeros = TRUE;
13868  if( ischeck )
13869  *approxchecknonzeros = TRUE;
13870  }
13871  else
13872  {
13873  *nactivenonzeros += nvars;
13874  if( ischeck )
13875  *nchecknonzeros += nvars;
13876  }
13877  }
13878  }
13879 
13880  /* add nonzeros on inactive check constraints */
13881  nconss = SCIPconshdlrGetNCheckConss(scip->set->conshdlrs[h]);
13882  if( nconss > 0 )
13883  {
13884  conss = SCIPconshdlrGetCheckConss(scip->set->conshdlrs[h]);
13885 
13886  for( c = nconss - 1; c >= 0; --c )
13887  {
13888  if( !SCIPconsIsActive(conss[c]) )
13889  {
13890  SCIP_CALL( SCIPconsGetNVars(conss[c], scip->set, &nvars, &success) );
13891 
13892  if( !success )
13893  *approxchecknonzeros = TRUE;
13894  else
13895  *nchecknonzeros += nvars;
13896  }
13897  }
13898  }
13899  }
13900 
13901  return SCIP_OKAY;
13902 }
13903 
13904 
13905 /** initializes solving data structures and transforms problem
13906  *
13907  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13908  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13909  *
13910  * @pre This method can be called if @p scip is in one of the following stages:
13911  * - \ref SCIP_STAGE_PROBLEM
13912  * - \ref SCIP_STAGE_TRANSFORMED
13913  * - \ref SCIP_STAGE_INITPRESOLVE
13914  * - \ref SCIP_STAGE_PRESOLVING
13915  * - \ref SCIP_STAGE_EXITPRESOLVE
13916  * - \ref SCIP_STAGE_PRESOLVED
13917  * - \ref SCIP_STAGE_INITSOLVE
13918  * - \ref SCIP_STAGE_SOLVING
13919  * - \ref SCIP_STAGE_SOLVED
13920  * - \ref SCIP_STAGE_EXITSOLVE
13921  * - \ref SCIP_STAGE_FREETRANS
13922  * - \ref SCIP_STAGE_FREE
13923  *
13924  * @post When calling this method in the \ref SCIP_STAGE_PROBLEM stage, the \SCIP stage is changed to \ref
13925  * SCIP_STAGE_TRANSFORMED; otherwise, the stage is not changed
13926  *
13927  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
13928  */
13930  SCIP* scip /**< SCIP data structure */
13931  )
13932 {
13933  SCIP_Longint oldnsolsfound;
13934  int nfeassols;
13935  int ncandsols;
13936  int h;
13937  int s;
13938 
13939  SCIP_CALL( checkStage(scip, "SCIPtransformProb", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
13940 
13941  /* check, if the problem was already transformed */
13942  if( scip->set->stage >= SCIP_STAGE_TRANSFORMED )
13943  return SCIP_OKAY;
13944 
13945  assert(scip->stat->status == SCIP_STATUS_UNKNOWN);
13946 
13947  /* check, if a node selector exists */
13948  if( SCIPsetGetNodesel(scip->set, scip->stat) == NULL )
13949  {
13950  SCIPerrorMessage("no node selector available\n");
13951  return SCIP_PLUGINNOTFOUND;
13952  }
13953 
13954  /* call garbage collector on original problem and parameter settings memory spaces */
13957 
13958  /* remember number of constraints */
13960 
13961  /* switch stage to TRANSFORMING */
13963 
13964  /* mark statistics before solving */
13965  SCIPstatMark(scip->stat);
13966 
13967  /* init solve data structures */
13971  SCIP_CALL( SCIPlpCreate(&scip->lp, scip->set, scip->messagehdlr, scip->stat, SCIPprobGetName(scip->origprob)) );
13972  SCIP_CALL( SCIPprimalCreate(&scip->primal) );
13973  SCIP_CALL( SCIPtreeCreate(&scip->tree, scip->mem->probmem, scip->set, SCIPsetGetNodesel(scip->set, scip->stat)) );
13974  SCIP_CALL( SCIPrelaxationCreate(&scip->relaxation, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree) );
13975  SCIP_CALL( SCIPconflictCreate(&scip->conflict, scip->mem->probmem, scip->set) );
13976  SCIP_CALL( SCIPcliquetableCreate(&scip->cliquetable, scip->set, scip->mem->probmem) );
13977 
13978  /* copy problem in solve memory */
13979  SCIP_CALL( SCIPprobTransform(scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree,
13980  scip->reopt, scip->lp, scip->branchcand, scip->eventfilter, scip->eventqueue, scip->conflictstore,
13981  &scip->transprob) );
13982 
13983  /* switch stage to TRANSFORMED */
13984  scip->set->stage = SCIP_STAGE_TRANSFORMED;
13985 
13986  /* check, whether objective value is always integral by inspecting the problem, if it is the case adjust the
13987  * cutoff bound if primal solution is already known
13988  */
13989  SCIP_CALL( SCIPprobCheckObjIntegral(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
13990  scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
13991 
13992  /* if possible, scale objective function such that it becomes integral with gcd 1 */
13993  SCIP_CALL( SCIPprobScaleObj(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
13994  scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
13995 
13996  /* check solution of solution candidate storage */
13997  nfeassols = 0;
13998  ncandsols = scip->origprimal->nsols;
13999  oldnsolsfound = 0;
14000 
14001  /* update upper bound and cutoff bound due to objective limit in primal data */
14002  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
14003  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
14004 
14005  if( !scip->set->reopt_enable )
14006  {
14007  oldnsolsfound = scip->primal->nsolsfound;
14008  for( s = scip->origprimal->nsols - 1; s >= 0; --s )
14009  {
14010  SCIP_Bool feasible;
14011  SCIP_SOL* sol;
14012 
14013  sol = scip->origprimal->sols[s];
14014 
14015  /* recompute objective function, since the objective might have changed in the meantime */
14016  SCIPsolRecomputeObj(sol, scip->set, scip->stat, scip->origprob);
14017 
14018  /* SCIPprimalTrySol() can only be called on transformed solutions; therefore check solutions in original problem
14019  * including modifiable constraints
14020  */
14021  SCIP_CALL( checkSolOrig(scip, sol, &feasible,
14023  FALSE, TRUE, TRUE, TRUE, TRUE) );
14024 
14025  if( feasible )
14026  {
14027  SCIP_Real abssolobj;
14028 
14029  abssolobj = REALABS(SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
14030 
14031  /* we do not want to add solutions with objective value +infinity */
14032  if( !SCIPisInfinity(scip, abssolobj) )
14033  {
14034  SCIP_SOL* bestsol = SCIPgetBestSol(scip);
14035  SCIP_Bool stored;
14036 
14037  /* add primal solution to solution storage by copying it */
14038  SCIP_CALL( SCIPprimalAddSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->origprob, scip->transprob,
14039  scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, sol, &stored) );
14040 
14041  if( stored )
14042  {
14043  nfeassols++;
14044 
14045  if( bestsol != SCIPgetBestSol(scip) )
14046  SCIPstoreSolutionGap(scip);
14047  }
14048  }
14049  }
14050 
14051  SCIP_CALL( SCIPsolFree(&sol, scip->mem->probmem, scip->origprimal) );
14052  scip->origprimal->nsols--;
14053  }
14054  }
14055 
14056  assert(scip->origprimal->nsols == 0);
14057 
14058  scip->stat->nexternalsolsfound += scip->primal->nsolsfound - oldnsolsfound;
14059 
14060  if( nfeassols > 0 )
14061  {
14063  "%d/%d feasible solution%s given by solution candidate storage, new primal bound %.6e\n\n",
14064  nfeassols, ncandsols, (nfeassols > 1 ? "s" : ""), SCIPgetSolOrigObj(scip, SCIPgetBestSol(scip)));
14065  }
14066  else if( ncandsols > 0 && !scip->set->reopt_enable )
14067  {
14069  "all %d solutions given by solution candidate storage are infeasible\n\n", ncandsols);
14070  }
14071 
14072  /* print transformed problem statistics */
14074  "transformed problem has %d variables (%d bin, %d int, %d impl, %d cont) and %d constraints\n",
14075  scip->transprob->nvars, scip->transprob->nbinvars, scip->transprob->nintvars, scip->transprob->nimplvars,
14076  scip->transprob->ncontvars, scip->transprob->nconss);
14077 
14078  for( h = 0; h < scip->set->nconshdlrs; ++h )
14079  {
14080  int nactiveconss;
14081 
14082  nactiveconss = SCIPconshdlrGetNActiveConss(scip->set->conshdlrs[h]);
14083  if( nactiveconss > 0 )
14084  {
14086  "%7d constraints of type <%s>\n", nactiveconss, SCIPconshdlrGetName(scip->set->conshdlrs[h]));
14087  }
14088  }
14090 
14091  {
14092  SCIP_Real maxnonzeros;
14093  SCIP_Longint nchecknonzeros;
14094  SCIP_Longint nactivenonzeros;
14095  SCIP_Bool approxchecknonzeros;
14096  SCIP_Bool approxactivenonzeros;
14097 
14098  /* determine number of non-zeros */
14099  maxnonzeros = (SCIP_Real)SCIPgetNConss(scip) * SCIPgetNVars(scip);
14100  maxnonzeros = MAX(maxnonzeros, 1.0);
14101  SCIP_CALL( calcNonZeros(scip, &nchecknonzeros, &nactivenonzeros, &approxchecknonzeros, &approxactivenonzeros) );
14102  scip->stat->nnz = nactivenonzeros;
14103  scip->stat->avgnnz = (SCIPgetNConss(scip) == 0 ? 0.0 : (SCIP_Real) nactivenonzeros / ((SCIP_Real) SCIPgetNConss(scip)));
14104 
14106  "original problem has %s%" SCIP_LONGINT_FORMAT " active (%g%%) nonzeros and %s%" SCIP_LONGINT_FORMAT " (%g%%) check nonzeros\n",
14107  approxactivenonzeros ? "more than " : "", nactivenonzeros, nactivenonzeros/maxnonzeros * 100,
14108  approxchecknonzeros ? "more than " : "", nchecknonzeros, nchecknonzeros/maxnonzeros * 100);
14110  }
14111 
14112  /* call initialization methods of plugins */
14113  SCIP_CALL( SCIPsetInitPlugins(scip->set, scip->mem->probmem, scip->stat) );
14114 
14115  /* in case the permutation seed is different to 0, permute the transformed problem */
14116  if( scip->set->random_permutationseed > 0 )
14117  {
14118  SCIP_Bool permuteconss;
14119  SCIP_Bool permutevars;
14120  int permutationseed;
14121 
14122  permuteconss = scip->set->random_permuteconss;
14123  permutevars = scip->set->random_permutevars;
14124  permutationseed = scip->set->random_permutationseed;
14125 
14126  SCIP_CALL( SCIPpermuteProb(scip, (unsigned int)permutationseed, permuteconss, permutevars, permutevars, permutevars, permutevars) );
14127  }
14128 
14129  if( scip->set->misc_estimexternmem )
14130  {
14131  if( scip->set->limit_memory < SCIP_MEM_NOLIMIT )
14132  {
14133  SCIP_Longint memused = SCIPgetMemUsed(scip);
14134 
14135  /* if the memory limit is set, we take 1% as the minimum external memory storage */
14136  scip->stat->externmemestim = MAX(memused, (SCIP_Longint) (0.01 * scip->set->limit_memory * 1048576.0));
14137  }
14138  else
14139  scip->stat->externmemestim = SCIPgetMemUsed(scip);
14140  SCIPdebugMsg(scip, "external memory usage estimated to %" SCIP_LONGINT_FORMAT " byte\n", scip->stat->externmemestim);
14141  }
14142 
14143  return SCIP_OKAY;
14144 }
14145 
14146 /** initializes presolving */
14147 static
14149  SCIP* scip /**< SCIP data structure */
14150  )
14151 {
14152 #ifndef NDEBUG
14153  size_t nusedbuffers;
14154  size_t nusedcleanbuffers;
14155 #endif
14156 
14157  assert(scip != NULL);
14158  assert(scip->mem != NULL);
14159  assert(scip->set != NULL);
14160  assert(scip->stat != NULL);
14161  assert(scip->transprob != NULL);
14162  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
14163 
14164  /* retransform all existing solutions to original problem space, because the transformed problem space may
14165  * get modified in presolving and the solutions may become invalid for the transformed problem
14166  */
14167  SCIP_CALL( SCIPprimalRetransformSolutions(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
14168  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp) );
14169 
14170  /* reset statistics for presolving and current branch and bound run */
14171  SCIPstatResetPresolving(scip->stat, scip->set, scip->transprob, scip->origprob);
14172 
14173  /* increase number of branch and bound runs */
14174  scip->stat->nruns++;
14175 
14176  /* remember problem size of previous run */
14177  scip->stat->prevrunnvars = scip->transprob->nvars;
14178 
14179  /* switch stage to INITPRESOLVE */
14181 
14182  /* create temporary presolving root node */
14183  SCIP_CALL( SCIPtreeCreatePresolvingRoot(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->messagehdlr,
14184  scip->stat, scip->transprob, scip->origprob, scip->primal, scip->lp, scip->branchcand, scip->conflict,
14185  scip->conflictstore, scip->eventfilter, scip->eventqueue, scip->cliquetable) );
14186 
14187  /* GCG wants to perform presolving during the reading process of a file reader;
14188  * hence the number of used buffers does not need to be zero, however, it should not
14189  * change by calling SCIPsetInitprePlugins()
14190  */
14191 #ifndef NDEBUG
14192  nusedbuffers = BMSgetNUsedBufferMemory(SCIPbuffer(scip));
14193  nusedcleanbuffers = BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip));
14194 #endif
14195 
14196  /* inform plugins that the presolving is abound to begin */
14197  SCIP_CALL( SCIPsetInitprePlugins(scip->set, scip->mem->probmem, scip->stat) );
14198  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
14199  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
14200 
14201  /* delete the variables from the problems that were marked to be deleted */
14202  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp, scip->branchcand) );
14203 
14204  /* switch stage to PRESOLVING */
14205  scip->set->stage = SCIP_STAGE_PRESOLVING;
14206 
14207  return SCIP_OKAY;
14208 }
14209 
14210 /** deinitializes presolving */
14211 static
14213  SCIP* scip, /**< SCIP data structure */
14214  SCIP_Bool solved, /**< is problem already solved? */
14215  SCIP_Bool* infeasible /**< pointer to store if the clique clean up detects an infeasibility */
14216  )
14217 {
14218  SCIP_VAR** vars;
14219  int nvars;
14220  int v;
14221 #ifndef NDEBUG
14222  size_t nusedbuffers;
14223  size_t nusedcleanbuffers;
14224 #endif
14225 
14226  assert(scip != NULL);
14227  assert(scip->mem != NULL);
14228  assert(scip->set != NULL);
14229  assert(scip->stat != NULL);
14230  assert(scip->transprob != NULL);
14231  assert(scip->set->stage == SCIP_STAGE_PRESOLVING);
14232  assert(infeasible != NULL);
14233 
14234  *infeasible = FALSE;
14235 
14236  /* switch stage to EXITPRESOLVE */
14238 
14239  if( !solved )
14240  {
14241  /* flatten all variables */
14242  vars = SCIPgetFixedVars(scip);
14243  nvars = SCIPgetNFixedVars(scip);
14244  assert(nvars == 0 || vars != NULL);
14245 
14246  for( v = nvars - 1; v >= 0; --v )
14247  {
14248  SCIP_VAR* var;
14249 #ifndef NDEBUG
14250  SCIP_VAR** multvars;
14251  int i;
14252 #endif
14253  var = vars[v]; /*lint !e613*/
14254  assert(var != NULL);
14255 
14257  {
14258  /* flattens aggregation graph of multi-aggregated variable in order to avoid exponential recursion later-on */
14259  SCIP_CALL( SCIPvarFlattenAggregationGraph(var, scip->mem->probmem, scip->set) );
14260 
14261 #ifndef NDEBUG
14262  multvars = SCIPvarGetMultaggrVars(var);
14263  for( i = SCIPvarGetMultaggrNVars(var) - 1; i >= 0; --i)
14264  assert(SCIPvarGetStatus(multvars[i]) != SCIP_VARSTATUS_MULTAGGR);
14265 #endif
14266  }
14267  }
14268  }
14269 
14270  /* exitPresolve() might be called during the reading process of a file reader;
14271  * hence the number of used buffers does not need to be zero, however, it should not
14272  * change by calling SCIPsetExitprePlugins() or SCIPprobExitPresolve()
14273  */
14274 #ifndef NDEBUG
14275  nusedbuffers = BMSgetNUsedBufferMemory(SCIPbuffer(scip));
14276  nusedcleanbuffers = BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip));
14277 #endif
14278 
14279  /* inform plugins that the presolving is finished, and perform final modifications */
14280  SCIP_CALL( SCIPsetExitprePlugins(scip->set, scip->mem->probmem, scip->stat) );
14281  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
14282  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
14283 
14284  /* remove empty and single variable cliques from the clique table, and convert all two variable cliques
14285  * into implications
14286  * delete the variables from the problems that were marked to be deleted
14287  */
14288  if( !solved )
14289  {
14290  int nlocalbdchgs = 0;
14291 
14292  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
14293  scip->cliquetable, scip->lp, scip->branchcand) );
14294 
14295  SCIP_CALL( SCIPcliquetableCleanup(scip->cliquetable, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
14296  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, &nlocalbdchgs,
14297  infeasible) );
14298 
14300  "clique table cleanup detected %d bound changes%s\n", nlocalbdchgs, *infeasible ? " and infeasibility" : "");
14301  }
14302 
14303  /* exit presolving */
14304  SCIP_CALL( SCIPprobExitPresolve(scip->transprob, scip->set) );
14305  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
14306  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
14307 
14308  if( !solved )
14309  {
14310  /* check, whether objective value is always integral by inspecting the problem, if it is the case adjust the
14311  * cutoff bound if primal solution is already known
14312  */
14313  SCIP_CALL( SCIPprobCheckObjIntegral(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
14314  scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
14315 
14316  /* if possible, scale objective function such that it becomes integral with gcd 1 */
14317  SCIP_CALL( SCIPprobScaleObj(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
14318  scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
14319 
14320  scip->stat->lastlowerbound = SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, scip->transprob->dualbound);
14321 
14322  /* we need to update the primal dual integral here to update the last{upper/dual}bound values after a restart */
14323  if( scip->set->misc_calcintegral )
14324  {
14326  }
14327  }
14328 
14329  /* free temporary presolving root node */
14330  SCIP_CALL( SCIPtreeFreePresolvingRoot(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->messagehdlr,
14331  scip->stat, scip->transprob, scip->origprob, scip->primal, scip->lp, scip->branchcand, scip->conflict,
14332  scip->conflictstore, scip->eventfilter, scip->eventqueue, scip->cliquetable) );
14333 
14334  /* switch stage to PRESOLVED */
14335  scip->set->stage = SCIP_STAGE_PRESOLVED;
14336 
14337  return SCIP_OKAY;
14338 }
14339 
14340 /** applies one round of presolving with the given presolving timing
14341  *
14342  * This method will always be called with presoltiming fast first. It iterates over all presolvers, propagators, and
14343  * constraint handlers and calls their presolving callbacks with timing fast. If enough reductions are found, it
14344  * returns and the next presolving round will be started (again with timing fast). If the fast presolving does not
14345  * find enough reductions, this methods calls itself recursively with presoltiming medium. Again, it calls the
14346  * presolving callbacks of all presolvers, propagators, and constraint handlers with timing medium. If enough
14347  * reductions are found, it returns and the next presolving round will be started (with timing fast). Otherwise, it is
14348  * called recursively with presoltiming exhaustive. In exhaustive presolving, presolvers, propagators, and constraint
14349  * handlers are called w.r.t. their priority, but this time, we stop as soon as enough reductions were found and do not
14350  * necessarily call all presolving methods. If we stop, we return and another presolving round is started with timing
14351  * fast.
14352  *
14353  * @todo check if we want to do the following (currently disabled):
14354  * In order to avoid calling the same expensive presolving methods again and again (which is possibly ineffective
14355  * for the current instance), we continue the loop for exhaustive presolving where we stopped it the last time. The
14356  * {presol/prop/cons}start pointers are used to this end: they provide the plugins to start the loop with in the
14357  * current presolving round (if we reach exhaustive presolving), and are updated in this case to the next ones to be
14358  * called in the next round. In case we reach the end of the loop in exhaustive presolving, we call the method again
14359  * with exhaustive timing, now starting with the first presolving steps in the loop until we reach the ones we started
14360  * the last call with. This way, we won't stop until all exhaustive presolvers were called without finding enough
14361  * reductions (in sum).
14362  */
14363 static
14365  SCIP* scip, /**< SCIP data structure */
14366  SCIP_PRESOLTIMING* timing, /**< pointer to current presolving timing */
14367  SCIP_Bool* unbounded, /**< pointer to store whether presolving detected unboundedness */
14368  SCIP_Bool* infeasible, /**< pointer to store whether presolving detected infeasibility */
14369  SCIP_Bool lastround, /**< is this the last presolving round due to a presolving round limit? */
14370  int* presolstart, /**< pointer to get the presolver to start exhaustive presolving with in
14371  * the current round and store the one to start with in the next round */
14372  int presolend, /**< last presolver to treat in exhaustive presolving */
14373  int* propstart, /**< pointer to get the propagator to start exhaustive presolving with in
14374  * the current round and store the one to start with in the next round */
14375  int propend, /**< last propagator to treat in exhaustive presolving */
14376  int* consstart, /**< pointer to get the constraint handler to start exhaustive presolving with in
14377  * the current round and store the one to start with in the next round */
14378  int consend /**< last constraint handler to treat in exhaustive presolving */
14379  )
14380 {
14381  SCIP_RESULT result;
14382  SCIP_EVENT event;
14383  SCIP_Bool aborted;
14384  SCIP_Bool lastranpresol;
14385 #if 0
14386  int oldpresolstart = 0;
14387  int oldpropstart = 0;
14388  int oldconsstart = 0;
14389 #endif
14390  int priopresol;
14391  int prioprop;
14392  int i;
14393  int j;
14394  int k;
14395 #ifndef NDEBUG
14396  size_t nusedbuffers;
14397  size_t nusedcleanbuffers;
14398 #endif
14399 
14400  assert(scip != NULL);
14401  assert(scip->set != NULL);
14402  assert(unbounded != NULL);
14403  assert(infeasible != NULL);
14404  assert(presolstart != NULL);
14405  assert(propstart != NULL);
14406  assert(consstart != NULL);
14407 
14408  assert((presolend == scip->set->npresols && propend == scip->set->nprops && consend == scip->set->nconshdlrs)
14409  || (*presolstart == 0 && *propstart == 0 && *consstart == 0));
14410 
14411  *unbounded = FALSE;
14412  *infeasible = FALSE;
14413  aborted = FALSE;
14414 
14415  assert( scip->set->propspresolsorted );
14416 
14417  /* GCG wants to perform presolving during the reading process of a file reader;
14418  * hence the number of used buffers does not need to be zero, however, it should not
14419  * change by calling the presolving callbacks
14420  */
14421 #ifndef NDEBUG
14422  nusedbuffers = BMSgetNUsedBufferMemory(SCIPbuffer(scip));
14423  nusedcleanbuffers = BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip));
14424 #endif
14425 
14426 
14427  if( *timing == SCIP_PRESOLTIMING_EXHAUSTIVE )
14428  {
14429  /* In exhaustive presolving, we continue the loop where we stopped last time to avoid calling the same
14430  * (possibly ineffective) presolving step again and again. If we reach the end of the arrays of presolvers,
14431  * propagators, and constraint handlers without having made enough reductions, we start again from the beginning
14432  */
14433  i = *presolstart;
14434  j = *propstart;
14435  k = *consstart;
14436 #if 0
14437  oldpresolstart = i;
14438  oldpropstart = j;
14439  oldconsstart = k;
14440 #endif
14441  if( i >= presolend && j >= propend && k >= consend )
14442  return SCIP_OKAY;
14443 
14444  if( i == 0 && j == 0 && k == 0 )
14445  ++(scip->stat->npresolroundsext);
14446  }
14447  else
14448  {
14449  /* in fast and medium presolving, we always iterate over all presolvers, propagators, and constraint handlers */
14450  assert(presolend == scip->set->npresols);
14451  assert(propend == scip->set->nprops);
14452  assert(consend == scip->set->nconshdlrs);
14453 
14454  i = 0;
14455  j = 0;
14456  k = 0;
14457 
14458  if( *timing == SCIP_PRESOLTIMING_FAST )
14459  ++(scip->stat->npresolroundsfast);
14460  if( *timing == SCIP_PRESOLTIMING_MEDIUM )
14461  ++(scip->stat->npresolroundsmed);
14462  }
14463 
14464  SCIPdebugMsg(scip, "starting presolving round %d (%d/%d/%d), timing = %u\n",
14466  scip->stat->npresolroundsext, *timing);
14467 
14468  /* call included presolvers with nonnegative priority */
14469  while( !(*unbounded) && !(*infeasible) && !aborted && (i < presolend || j < propend) )
14470  {
14471  if( i < presolend )
14472  priopresol = SCIPpresolGetPriority(scip->set->presols[i]);
14473  else
14474  priopresol = -1;
14475 
14476  if( j < propend )
14477  prioprop = SCIPpropGetPresolPriority(scip->set->props_presol[j]);
14478  else
14479  prioprop = -1;
14480 
14481  /* call next propagator */
14482  if( prioprop >= priopresol )
14483  {
14484  /* only presolving methods which have non-negative priority will be called before constraint handlers */
14485  if( prioprop < 0 )
14486  break;
14487 
14488  SCIPdebugMsg(scip, "executing presolving of propagator <%s>\n", SCIPpropGetName(scip->set->props_presol[j]));
14489  SCIP_CALL( SCIPpropPresol(scip->set->props_presol[j], scip->set, *timing, scip->stat->npresolrounds,
14491  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
14492  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
14493  &scip->stat->npresolchgsides, &result) );
14494  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
14495  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
14496 
14497  lastranpresol = FALSE;
14498  ++j;
14499  }
14500  /* call next presolver */
14501  else
14502  {
14503  /* only presolving methods which have non-negative priority will be called before constraint handlers */
14504  if( priopresol < 0 )
14505  break;
14506 
14507  SCIPdebugMsg(scip, "executing presolver <%s>\n", SCIPpresolGetName(scip->set->presols[i]));
14508  SCIP_CALL( SCIPpresolExec(scip->set->presols[i], scip->set, *timing, scip->stat->npresolrounds,
14510  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
14511  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
14512  &scip->stat->npresolchgsides, &result) );
14513  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
14514  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
14515 
14516  lastranpresol = TRUE;
14517  ++i;
14518  }
14519 
14520  if( result == SCIP_CUTOFF )
14521  {
14522  *infeasible = TRUE;
14523 
14524  if( lastranpresol )
14526  "presolver <%s> detected infeasibility\n", SCIPpresolGetName(scip->set->presols[i-1]));
14527  else
14529  "propagator <%s> detected infeasibility\n", SCIPpropGetName(scip->set->props_presol[j-1]));
14530  }
14531  else if( result == SCIP_UNBOUNDED )
14532  {
14533  *unbounded = TRUE;
14534 
14535  if( lastranpresol )
14537  "presolver <%s> detected unboundedness (or infeasibility)\n", SCIPpresolGetName(scip->set->presols[i-1]));
14538  else
14540  "propagator <%s> detected unboundedness (or infeasibility)\n", SCIPpropGetName(scip->set->props_presol[j-1]));
14541  }
14542 
14543  /* delete the variables from the problems that were marked to be deleted */
14544  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp,
14545  scip->branchcand) );
14546 
14547  SCIPdebugMsg(scip, "presolving callback returned result <%d>\n", result);
14548 
14549  /* if we work off the exhaustive presolvers, we stop immediately if a reduction was found */
14550  if( (*timing == SCIP_PRESOLTIMING_EXHAUSTIVE) && !lastround && !SCIPisPresolveFinished(scip) )
14551  {
14552  assert(*consstart == 0);
14553 
14554  if( lastranpresol )
14555  {
14556  *presolstart = i + 1;
14557  *propstart = j;
14558  }
14559  else
14560  {
14561  *presolstart = i;
14562  *propstart = j + 1;
14563  }
14564  aborted = TRUE;
14565 
14566  break;
14567  }
14568  }
14569 
14570  /* call presolve methods of constraint handlers */
14571  while( k < consend && !(*unbounded) && !(*infeasible) && !aborted )
14572  {
14573  SCIPdebugMsg(scip, "executing presolve method of constraint handler <%s>\n",
14574  SCIPconshdlrGetName(scip->set->conshdlrs[k]));
14575  SCIP_CALL( SCIPconshdlrPresolve(scip->set->conshdlrs[k], scip->mem->probmem, scip->set, scip->stat,
14576  *timing, scip->stat->npresolrounds,
14578  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
14579  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
14580  &scip->stat->npresolchgsides, &result) );
14581  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
14582  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
14583 
14584  ++k;
14585 
14586  if( result == SCIP_CUTOFF )
14587  {
14588  *infeasible = TRUE;
14590  "constraint handler <%s> detected infeasibility\n", SCIPconshdlrGetName(scip->set->conshdlrs[k-1]));
14591  }
14592  else if( result == SCIP_UNBOUNDED )
14593  {
14594  *unbounded = TRUE;
14596  "constraint handler <%s> detected unboundedness (or infeasibility)\n",
14597  SCIPconshdlrGetName(scip->set->conshdlrs[k-1]));
14598  }
14599 
14600  /* delete the variables from the problems that were marked to be deleted */
14601  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp,
14602  scip->branchcand) );
14603 
14604  SCIPdebugMsg(scip, "presolving callback returned with result <%d>\n", result);
14605 
14606  /* if we work off the exhaustive presolvers, we stop immediately if a reduction was found */
14607  if( (*timing == SCIP_PRESOLTIMING_EXHAUSTIVE) && !lastround && !SCIPisPresolveFinished(scip) )
14608  {
14609  *presolstart = i;
14610  *propstart = j;
14611  *consstart = k + 1;
14612  aborted = TRUE;
14613 
14614  break;
14615  }
14616  }
14617 
14618  assert( scip->set->propspresolsorted );
14619 
14620  /* call included presolvers with negative priority */
14621  while( !(*unbounded) && !(*infeasible) && !aborted && (i < presolend || j < propend) )
14622  {
14623  if( i < scip->set->npresols )
14624  priopresol = SCIPpresolGetPriority(scip->set->presols[i]);
14625  else
14626  priopresol = -INT_MAX;
14627 
14628  if( j < scip->set->nprops )
14629  prioprop = SCIPpropGetPresolPriority(scip->set->props_presol[j]);
14630  else
14631  prioprop = -INT_MAX;
14632 
14633  /* choose presolving */
14634  if( prioprop >= priopresol )
14635  {
14636  assert(prioprop <= 0);
14637 
14638  SCIPdebugMsg(scip, "executing presolving of propagator <%s>\n", SCIPpropGetName(scip->set->props_presol[j]));
14639  SCIP_CALL( SCIPpropPresol(scip->set->props_presol[j], scip->set, *timing, scip->stat->npresolrounds,
14641  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
14642  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
14643  &scip->stat->npresolchgsides, &result) );
14644  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
14645  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
14646 
14647  lastranpresol = FALSE;
14648  ++j;
14649  }
14650  else
14651  {
14652  assert(priopresol < 0);
14653 
14654  SCIPdebugMsg(scip, "executing presolver <%s>\n", SCIPpresolGetName(scip->set->presols[i]));
14655  SCIP_CALL( SCIPpresolExec(scip->set->presols[i], scip->set, *timing, scip->stat->npresolrounds,
14657  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
14658  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
14659  &scip->stat->npresolchgsides, &result) );
14660  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
14661  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
14662 
14663  lastranpresol = TRUE;
14664  ++i;
14665  }
14666 
14667  if( result == SCIP_CUTOFF )
14668  {
14669  *infeasible = TRUE;
14670 
14671  if( lastranpresol )
14673  "presolver <%s> detected infeasibility\n", SCIPpresolGetName(scip->set->presols[i-1]));
14674  else
14676  "propagator <%s> detected infeasibility\n", SCIPpropGetName(scip->set->props_presol[j-1]));
14677  }
14678  else if( result == SCIP_UNBOUNDED )
14679  {
14680  *unbounded = TRUE;
14681 
14682  if( lastranpresol )
14684  "presolver <%s> detected unboundedness (or infeasibility)\n", SCIPpresolGetName(scip->set->presols[i-1]));
14685  else
14687  "propagator <%s> detected unboundedness (or infeasibility)\n", SCIPpropGetName(scip->set->props_presol[j-1]));
14688  }
14689 
14690  /* delete the variables from the problems that were marked to be deleted */
14691  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp,
14692  scip->branchcand) );
14693 
14694  SCIPdebugMsg(scip, "presolving callback return with result <%d>\n", result);
14695 
14696  /* if we work off the exhaustive presolvers, we stop immediately if a reduction was found */
14697  if( (*timing == SCIP_PRESOLTIMING_EXHAUSTIVE) && !lastround && !SCIPisPresolveFinished(scip) )
14698  {
14699  assert(k == consend);
14700 
14701  if( lastranpresol )
14702  {
14703  *presolstart = i + 1;
14704  *propstart = j;
14705  }
14706  else
14707  {
14708  *presolstart = i;
14709  *propstart = j + 1;
14710  }
14711  *consstart = k;
14712 
14713  break;
14714  }
14715  }
14716 
14717  /* remove empty and single variable cliques from the clique table */
14718  if( !(*unbounded) && !(*infeasible) )
14719  {
14720  int nlocalbdchgs = 0;
14721 
14722  SCIP_CALL( SCIPcliquetableCleanup(scip->cliquetable, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
14723  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, &nlocalbdchgs,
14724  infeasible) );
14725 
14726  if( nlocalbdchgs > 0 || *infeasible )
14728  "clique table cleanup detected %d bound changes%s\n", nlocalbdchgs, *infeasible ? " and infeasibility" : "");
14729 
14730  scip->stat->npresolfixedvars += nlocalbdchgs;
14731 
14732  if( !*infeasible && scip->set->nheurs > 0 )
14733  {
14734  /* call primal heuristics that are applicable during presolving */
14735  SCIP_Bool foundsol;
14736 
14737  SCIPdebugMsg(scip, "calling primal heuristics during presolving\n");
14738 
14739  /* call primal heuristics */
14740  SCIP_CALL( SCIPprimalHeuristics(scip->set, scip->stat, scip->transprob, scip->primal, NULL, NULL, NULL,
14741  SCIP_HEURTIMING_DURINGPRESOLLOOP, FALSE, &foundsol, unbounded) );
14742 
14743  /* output a message, if a solution was found */
14744  if( foundsol )
14745  {
14746  SCIP_SOL* sol;
14747 
14748  assert(SCIPgetNSols(scip) > 0);
14749  sol = SCIPgetBestSol(scip);
14750  assert(sol != NULL);
14751  assert(SCIPgetSolOrigObj(scip,sol) != SCIP_INVALID); /*lint !e777*/
14752 
14754  "feasible solution found by %s heuristic after %.1f seconds, objective value %.6e\n",
14756  }
14757  }
14758  }
14759 
14760  if( !(*unbounded) && !(*infeasible) )
14761  {
14762  /* call more expensive presolvers */
14763  if( (SCIPisPresolveFinished(scip) || lastround) )
14764  {
14765  if( *timing != SCIP_PRESOLTIMING_FINAL )
14766  {
14767  assert((*timing == SCIP_PRESOLTIMING_FAST) || (*timing == SCIP_PRESOLTIMING_MEDIUM) || (*timing == SCIP_PRESOLTIMING_EXHAUSTIVE));
14768 
14769  SCIPdebugMsg(scip, "not enough reductions in %s presolving, running %s presolving now...\n",
14770  *timing == SCIP_PRESOLTIMING_FAST ? "fast" : *timing == SCIP_PRESOLTIMING_MEDIUM ? "medium" : "exhaustive",
14771  *timing == SCIP_PRESOLTIMING_FAST ? "medium" : *timing == SCIP_PRESOLTIMING_MEDIUM ? "exhaustive" : "final");
14772 
14773  /* increase timing */
14775 
14776  /* computational experiments showed that always starting the loop of exhaustive presolvers from the beginning
14777  * performs better than continuing from the last processed presolver. Therefore, we start from 0, but keep
14778  * the mechanisms to possibly change this back later.
14779  * @todo try starting from the last processed exhaustive presolver
14780  */
14781  *presolstart = 0;
14782  *propstart = 0;
14783  *consstart = 0;
14784 
14785  SCIP_CALL( presolveRound(scip, timing, unbounded, infeasible, lastround, presolstart, presolend,
14786  propstart, propend, consstart, consend) );
14787  }
14788 #if 0
14789  /* run remaining exhaustive presolvers (if we did not start from the beginning anyway) */
14790  else if( (oldpresolstart > 0 || oldpropstart > 0 || oldconsstart > 0) && presolend == scip->set->npresols
14791  && propend == scip->set->nprops && consend == scip->set->nconshdlrs )
14792  {
14793  int newpresolstart = 0;
14794  int newpropstart = 0;
14795  int newconsstart = 0;
14796 
14797  SCIPdebugMsg(scip, "reached end of exhaustive presolving loop, starting from the beginning...\n");
14798 
14799  SCIP_CALL( presolveRound(scip, timing, unbounded, infeasible, lastround, &newpresolstart,
14800  oldpresolstart, &newpropstart, oldpropstart, &newconsstart, oldconsstart) );
14801 
14802  *presolstart = newpresolstart;
14803  *propstart = newpropstart;
14804  *consstart = newconsstart;
14805  }
14806 #endif
14807  }
14808  }
14809 
14810  /* issue PRESOLVEROUND event */
14812  SCIP_CALL( SCIPeventProcess(&event, scip->set, NULL, NULL, NULL, scip->eventfilter) );
14813 
14814  return SCIP_OKAY;
14815 }
14816 
14817 
14818 /** loops through the included presolvers and constraint's presolve methods, until changes are too few */
14819 static
14821  SCIP* scip, /**< SCIP data structure */
14822  SCIP_Bool* unbounded, /**< pointer to store whether presolving detected unboundedness */
14823  SCIP_Bool* infeasible /**< pointer to store whether presolving detected infeasibility */
14824  )
14825 {
14826  SCIP_PRESOLTIMING presoltiming;
14827  SCIP_Bool finished;
14828  SCIP_Bool stopped;
14829  SCIP_Bool lastround;
14830  int presolstart = 0;
14831  int propstart = 0;
14832  int consstart = 0;
14833 #ifndef NDEBUG
14834  size_t nusedbuffers;
14835  size_t nusedcleanbuffers;
14836 #endif
14837 
14838  assert(scip != NULL);
14839  assert(scip->mem != NULL);
14840  assert(scip->primal != NULL);
14841  assert(scip->set != NULL);
14842  assert(scip->stat != NULL);
14843  assert(scip->transprob != NULL);
14844  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED || scip->set->stage == SCIP_STAGE_PRESOLVING);
14845  assert(unbounded != NULL);
14846  assert(infeasible != NULL);
14847 
14848  *unbounded = FALSE;
14849 
14850  /* GCG wants to perform presolving during the reading process of a file reader;
14851  * hence the number of used buffers does not need to be zero, however, it should
14852  * be the same again after presolve is finished
14853  */
14854 #ifndef NDEBUG
14855  nusedbuffers = BMSgetNUsedBufferMemory(SCIPbuffer(scip));
14856  nusedcleanbuffers = BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip));
14857 #endif
14858 
14859 
14860  /* switch status to unknown */
14861  scip->stat->status = SCIP_STATUS_UNKNOWN;
14862 
14863  /* update upper bound and cutoff bound due to objective limit in primal data */
14864  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
14865  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
14866 
14867  /* start presolving timer */
14868  SCIPclockStart(scip->stat->presolvingtime, scip->set);
14870 
14871  /* initialize presolving */
14872  if( scip->set->stage == SCIP_STAGE_TRANSFORMED )
14873  {
14874  SCIP_CALL( initPresolve(scip) );
14875  }
14876  assert(scip->set->stage == SCIP_STAGE_PRESOLVING);
14877 
14878  /* call primal heuristics that are applicable before presolving */
14879  if( scip->set->nheurs > 0 )
14880  {
14881  SCIP_Bool foundsol;
14882 
14883  SCIPdebugMsg(scip, "calling primal heuristics before presolving\n");
14884 
14885  /* call primal heuristics */
14886  SCIP_CALL( SCIPprimalHeuristics(scip->set, scip->stat, scip->transprob, scip->primal, NULL, NULL, NULL,
14887  SCIP_HEURTIMING_BEFOREPRESOL, FALSE, &foundsol, unbounded) );
14888 
14889  /* output a message, if a solution was found */
14890  if( foundsol )
14891  {
14892  SCIP_SOL* sol;
14893 
14894  assert(SCIPgetNSols(scip) > 0);
14895  sol = SCIPgetBestSol(scip);
14896  assert(sol != NULL);
14897  assert(SCIPgetSolOrigObj(scip,sol) != SCIP_INVALID); /*lint !e777*/
14898 
14900  "feasible solution found by %s heuristic after %.1f seconds, objective value %.6e\n",
14902  }
14903  }
14904 
14906 
14907  *infeasible = FALSE;
14908  *unbounded = (*unbounded) || (SCIPgetNSols(scip) > 0 && SCIPisInfinity(scip, -SCIPgetSolOrigObj(scip, SCIPgetBestSol(scip))));
14909 
14910  finished = (scip->set->presol_maxrounds != -1 && scip->stat->npresolrounds >= scip->set->presol_maxrounds)
14911  || (*unbounded) || (scip->set->reopt_enable && scip->stat->nreoptruns >= 1);
14912  stopped = SCIPsolveIsStopped(scip->set, scip->stat, TRUE);
14913 
14914  /* perform presolving rounds */
14915  while( !finished && !stopped )
14916  {
14917  /* store current number of reductions */
14919  scip->stat->lastnpresolaggrvars = scip->stat->npresolaggrvars;
14921  scip->stat->lastnpresolchgbds = scip->stat->npresolchgbds;
14922  scip->stat->lastnpresoladdholes = scip->stat->npresoladdholes;
14923  scip->stat->lastnpresoldelconss = scip->stat->npresoldelconss;
14924  scip->stat->lastnpresoladdconss = scip->stat->npresoladdconss;
14926  scip->stat->lastnpresolchgcoefs = scip->stat->npresolchgcoefs;
14927  scip->stat->lastnpresolchgsides = scip->stat->npresolchgsides;
14928 #ifdef SCIP_DISABLED_CODE
14929  scip->stat->lastnpresolimplications = scip->stat->nimplications;
14930  scip->stat->lastnpresolcliques = SCIPcliquetableGetNCliques(scip->cliquetable);
14931 #endif
14932 
14933  /* set presolving flag */
14934  scip->stat->performpresol = TRUE;
14935 
14936  /* sort propagators */
14937  SCIPsetSortPropsPresol(scip->set);
14938 
14939  /* sort presolvers by priority */
14940  SCIPsetSortPresols(scip->set);
14941 
14942  /* check if this will be the last presolving round (in that case, we want to run all presolvers) */
14943  lastround = (scip->set->presol_maxrounds == -1 ? FALSE : (scip->stat->npresolrounds + 1 >= scip->set->presol_maxrounds));
14944 
14945  presoltiming = SCIP_PRESOLTIMING_FAST;
14946 
14947  /* perform the presolving round by calling the presolvers, propagators, and constraint handlers */
14948  assert(!(*unbounded));
14949  assert(!(*infeasible));
14950  SCIP_CALL( presolveRound(scip, &presoltiming, unbounded, infeasible, lastround,
14951  &presolstart, scip->set->npresols, &propstart, scip->set->nprops, &consstart, scip->set->nconshdlrs) );
14952 
14953  /* check, if we should abort presolving due to not enough changes in the last round */
14954  finished = SCIPisPresolveFinished(scip) || presoltiming == SCIP_PRESOLTIMING_FINAL;
14955 
14956  SCIPdebugMsg(scip, "presolving round %d returned with unbounded = %u, infeasible = %u, finished = %u\n", scip->stat->npresolrounds, *unbounded, *infeasible, finished);
14957 
14958  /* check whether problem is infeasible or unbounded */
14959  finished = finished || *unbounded || *infeasible;
14960 
14961  /* increase round number */
14962  scip->stat->npresolrounds++;
14963 
14964  if( !finished )
14965  {
14966  /* print presolving statistics */
14968  "(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",
14969  scip->stat->npresolrounds, ( presoltiming == SCIP_PRESOLTIMING_FAST ? "fast)" :
14970  (presoltiming == SCIP_PRESOLTIMING_MEDIUM ? "medium)" :
14971  (presoltiming == SCIP_PRESOLTIMING_EXHAUSTIVE ?"exhaustive)" :
14972  "final)")) ),
14973  scip->stat->npresolfixedvars + scip->stat->npresolaggrvars,
14974  scip->stat->npresoldelconss, scip->stat->npresoladdconss,
14975  scip->stat->npresolchgbds, scip->stat->npresolchgsides,
14976  scip->stat->npresolchgcoefs, scip->stat->npresolupgdconss,
14978  }
14979 
14980  /* abort if time limit was reached or user interrupted */
14981  stopped = SCIPsolveIsStopped(scip->set, scip->stat, TRUE);
14982  }
14983 
14984  if( *infeasible || *unbounded )
14985  {
14986  /* first change status of scip, so that all plugins in their exitpre callbacks can ask SCIP for the correct status */
14987  if( *infeasible )
14988  {
14989  /* switch status to OPTIMAL */
14990  if( scip->primal->nlimsolsfound > 0 )
14991  {
14992  scip->stat->status = SCIP_STATUS_OPTIMAL;
14993  }
14994  else /* switch status to INFEASIBLE */
14996  }
14997  else if( scip->primal->nsols >= 1 ) /* switch status to UNBOUNDED */
14999  else /* switch status to INFORUNBD */
15001  }
15002 
15003  /* deinitialize presolving */
15004  if( finished && (!stopped || *unbounded || *infeasible) )
15005  {
15006  SCIP_Real maxnonzeros;
15007  SCIP_Longint nchecknonzeros;
15008  SCIP_Longint nactivenonzeros;
15009  SCIP_Bool approxchecknonzeros;
15010  SCIP_Bool approxactivenonzeros;
15011  SCIP_Bool infeas;
15012 
15013  SCIP_CALL( exitPresolve(scip, *unbounded || *infeasible, &infeas) );
15014  *infeasible = *infeasible || infeas;
15015 
15016  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
15017 
15018  /* resort variables if we are not already done */
15019  if( !(*infeasible) && !(*unbounded) )
15020  {
15021  /* (Re)Sort the variables, which appear in the four categories (binary, integer, implicit, continuous) after
15022  * presolve with respect to their original index (within their categories). Adjust the problem index afterwards
15023  * which is supposed to reflect the position in the variable array. This additional (re)sorting is supposed to
15024  * get more robust against the order presolving fixed variables. (We also reobtain a possible block structure
15025  * induced by the user model)
15026  */
15028  }
15029 
15030  /* determine number of non-zeros */
15031  maxnonzeros = (SCIP_Real)SCIPgetNConss(scip) * SCIPgetNVars(scip);
15032  maxnonzeros = MAX(maxnonzeros, 1.0);
15033  SCIP_CALL( calcNonZeros(scip, &nchecknonzeros, &nactivenonzeros, &approxchecknonzeros, &approxactivenonzeros) );
15034  scip->stat->nnz = nactivenonzeros;
15035 
15038  "presolved problem has %s%" SCIP_LONGINT_FORMAT " active (%g%%) nonzeros and %s%" SCIP_LONGINT_FORMAT " (%g%%) check nonzeros\n",
15039  approxactivenonzeros ? "more than " : "", nactivenonzeros, nactivenonzeros/maxnonzeros * 100,
15040  approxchecknonzeros ? "more than " : "", nchecknonzeros, nchecknonzeros/maxnonzeros * 100);
15042  }
15043  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
15044  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
15045 
15046  /* stop presolving time */
15047  SCIPclockStop(scip->stat->presolvingtime, scip->set);
15049 
15050  /* print presolving statistics */
15052  "presolving (%d rounds: %d fast, %d medium, %d exhaustive):\n", scip->stat->npresolrounds,
15055  " %d deleted vars, %d deleted constraints, %d added constraints, %d tightened bounds, %d added holes, %d changed sides, %d changed coefficients\n",
15059  " %d implications, %d cliques\n", scip->stat->nimplications, SCIPcliquetableGetNCliques(scip->cliquetable));
15060 
15061  /* remember number of constraints */
15063 
15064  return SCIP_OKAY;
15065 }
15066 
15067 /** tries to transform original solutions to the transformed problem space */
15068 static
15070  SCIP* scip /**< SCIP data structure */
15071  )
15072 {
15073  SCIP_SOL** sols;
15074  SCIP_SOL** scipsols;
15075  SCIP_SOL* sol;
15076  SCIP_Real* solvals;
15077  SCIP_Bool* solvalset;
15078  SCIP_Bool added;
15079  SCIP_Longint oldnsolsfound;
15080  int nsols;
15081  int ntransvars;
15082  int naddedsols;
15083  int s;
15084 
15085  nsols = SCIPgetNSols(scip);
15086  oldnsolsfound = scip->primal->nsolsfound;
15087 
15088  /* no solution to transform */
15089  if( nsols == 0 )
15090  return SCIP_OKAY;
15091 
15092  SCIPdebugMsg(scip, "try to transfer %d original solutions into the transformed problem space\n", nsols);
15093 
15094  ntransvars = scip->transprob->nvars;
15095  naddedsols = 0;
15096 
15097  /* It might happen, that the added transferred solution does not equal the corresponding original one, which might
15098  * result in the array of solutions being changed. Thus we temporarily copy the array and traverse it in reverse
15099  * order to ensure that the regarded solution in the copied array was not already freed when new solutions were added
15100  * and the worst solutions were freed.
15101  */
15102  scipsols = SCIPgetSols(scip);
15103  SCIP_CALL( SCIPduplicateBufferArray(scip, &sols, scipsols, nsols) );
15104  SCIP_CALL( SCIPallocBufferArray(scip, &solvals, ntransvars) );
15105  SCIP_CALL( SCIPallocBufferArray(scip, &solvalset, ntransvars) );
15106 
15107  for( s = nsols-1; s >= 0; --s )
15108  {
15109  sol = sols[s];
15110 
15111  /* it might happen that a transferred original solution has a better objective than its original counterpart
15112  * (e.g., because multi-aggregated variables get another value, but the solution is still feasible);
15113  * in this case, it might happen that the solution is not an original one and we just skip this solution
15114  */
15115  if( !SCIPsolIsOriginal(sol) )
15116  continue;
15117 
15118  SCIP_CALL( SCIPprimalTransformSol(scip->primal, sol, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
15119  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, solvals,
15120  solvalset, ntransvars, &added) );
15121 
15122  if( added )
15123  ++naddedsols;
15124  }
15125 
15126  if( naddedsols > 0 )
15127  {
15129  "transformed %d/%d original solutions to the transformed problem space\n",
15130  naddedsols, nsols);
15131 
15132  scip->stat->nexternalsolsfound += scip->primal->nsolsfound - oldnsolsfound;
15133  }
15134 
15135  SCIPfreeBufferArray(scip, &solvalset);
15136  SCIPfreeBufferArray(scip, &solvals);
15137  SCIPfreeBufferArray(scip, &sols);
15138 
15139  return SCIP_OKAY;
15140 }
15141 
15142 /** initializes solution process data structures */
15143 static
15145  SCIP* scip, /**< SCIP data structure */
15146  SCIP_Bool solved /**< is problem already solved? */
15147  )
15148 {
15149  assert(scip != NULL);
15150  assert(scip->mem != NULL);
15151  assert(scip->set != NULL);
15152  assert(scip->stat != NULL);
15153  assert(scip->nlp == NULL);
15154  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
15155 
15156  /**@todo check whether other methodscan be skipped if problem has been solved */
15157  /* if problem has been solved, several time consuming tasks must not be performed */
15158  if( !solved )
15159  {
15160  /* reset statistics for current branch and bound run */
15161  SCIPstatResetCurrentRun(scip->stat, scip->set, scip->transprob, scip->origprob, solved);
15163 
15164  /* LP is empty anyway; mark empty LP to be solved and update validsollp counter */
15165  SCIP_CALL( SCIPlpReset(scip->lp, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->eventfilter) );
15166 
15167  /* update upper bound and cutoff bound due to objective limit in primal data */
15168  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
15169  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
15170  }
15171 
15172  /* switch stage to INITSOLVE */
15173  scip->set->stage = SCIP_STAGE_INITSOLVE;
15174 
15175  /* initialize NLP if there are nonlinearities */
15176  if( scip->transprob->nlpenabled && !scip->set->nlp_disable )
15177  {
15178  SCIPdebugMsg(scip, "constructing empty NLP\n");
15179 
15180  SCIP_CALL( SCIPnlpCreate(&scip->nlp, scip->mem->probmem, scip->set, scip->stat, SCIPprobGetName(scip->transprob), scip->transprob->nvars) );
15181  assert(scip->nlp != NULL);
15182 
15183  SCIP_CALL( SCIPnlpAddVars(scip->nlp, scip->mem->probmem, scip->set, scip->transprob->nvars, scip->transprob->vars) );
15184  }
15185 
15186  /* possibly create visualization output file */
15187  SCIP_CALL( SCIPvisualInit(scip->stat->visual, scip->mem->probmem, scip->set, scip->messagehdlr) );
15188 
15189  /* initialize solution process data structures */
15193  SCIP_CALL( SCIPcutpoolCreate(&scip->cutpool, scip->mem->probmem, scip->set, scip->set->sepa_cutagelimit, TRUE) );
15194  SCIP_CALL( SCIPcutpoolCreate(&scip->delayedcutpool, scip->mem->probmem, scip->set, scip->set->sepa_cutagelimit, FALSE) );
15195  SCIP_CALL( SCIPtreeCreateRoot(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
15196  scip->lp) );
15197 
15198  /* update dual bound of the root node if a valid dual bound is at hand */
15199  if( scip->transprob->dualbound < SCIP_INVALID )
15200  {
15201  SCIP_Real internobjval = SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, scip->transprob->dualbound);
15202 
15203  scip->stat->lastlowerbound = internobjval;
15204 
15205  SCIPnodeUpdateLowerbound(SCIPtreeGetRootNode(scip->tree), scip->stat, scip->set, scip->tree, scip->transprob,
15206  scip->origprob, internobjval);
15207  }
15208 
15209  /* try to transform original solutions to the transformed problem space */
15210  if( scip->set->misc_transorigsols )
15211  {
15212  SCIP_CALL( transformSols(scip) );
15213  }
15214 
15215  /* inform the transformed problem that the branch and bound process starts now */
15216  SCIP_CALL( SCIPprobInitSolve(scip->transprob, scip->set) );
15217 
15218  /* inform plugins that the branch and bound process starts now */
15219  SCIP_CALL( SCIPsetInitsolPlugins(scip->set, scip->mem->probmem, scip->stat) );
15220 
15221  /* remember number of constraints */
15223 
15224  /* if all variables are known, calculate a trivial primal bound by setting all variables to their worst bound */
15225  if( scip->set->nactivepricers == 0 )
15226  {
15227  SCIP_VAR* var;
15228  SCIP_Real obj;
15229  SCIP_Real objbound;
15230  SCIP_Real bd;
15231  int v;
15232 
15233  objbound = 0.0;
15234  for( v = 0; v < scip->transprob->nvars && !SCIPsetIsInfinity(scip->set, objbound); ++v )
15235  {
15236  var = scip->transprob->vars[v];
15237  obj = SCIPvarGetObj(var);
15238  if( !SCIPsetIsZero(scip->set, obj) )
15239  {
15240  bd = SCIPvarGetWorstBoundGlobal(var);
15241  if( SCIPsetIsInfinity(scip->set, REALABS(bd)) )
15242  objbound = SCIPsetInfinity(scip->set);
15243  else
15244  objbound += obj * bd;
15245  }
15246  }
15247 
15248  /* adjust primal bound, such that solution with worst bound may be found */
15249  if( objbound + SCIPsetCutoffbounddelta(scip->set) != objbound ) /*lint !e777*/
15250  objbound += SCIPsetCutoffbounddelta(scip->set);
15251  /* if objbound is very large, adding the cutoffbounddelta may not change the number; in this case, we are using
15252  * SCIPnextafter to ensure that the cutoffbound is really larger than the best possible solution value
15253  */
15254  else
15255  objbound = SCIPnextafter(objbound, SCIP_REAL_MAX);
15256 
15257  /* update cutoff bound */
15258  if( !SCIPsetIsInfinity(scip->set, objbound) && SCIPsetIsLT(scip->set, objbound, scip->primal->cutoffbound) )
15259  {
15260  /* adjust cutoff bound */
15261  SCIP_CALL( SCIPprimalSetCutoffbound(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
15262  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, objbound, FALSE) );
15263  }
15264  }
15265 
15266  /* switch stage to SOLVING */
15267  scip->set->stage = SCIP_STAGE_SOLVING;
15268 
15269  return SCIP_OKAY;
15270 }
15271 
15272 /** frees solution process data structures */
15273 static
15275  SCIP* scip, /**< SCIP data structure */
15276  SCIP_Bool restart /**< was this free solve call triggered by a restart? */
15277  )
15278 {
15279  assert(scip != NULL);
15280  assert(scip->mem != NULL);
15281  assert(scip->set != NULL);
15282  assert(scip->stat != NULL);
15283  assert(scip->set->stage == SCIP_STAGE_SOLVING || scip->set->stage == SCIP_STAGE_SOLVED);
15284 
15285  /* mark that we are currently restarting */
15286  if( restart )
15287  {
15288  scip->stat->inrestart = TRUE;
15289 
15290  /* copy the current dual bound into the problem data structure such that it can be used initialize the new search
15291  * tree
15292  */
15294  }
15295 
15296  /* remove focus from the current focus node */
15297  if( SCIPtreeGetFocusNode(scip->tree) != NULL )
15298  {
15299  SCIP_NODE* node = NULL;
15300  SCIP_Bool cutoff;
15301 
15302  SCIP_CALL( SCIPnodeFocus(&node, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->transprob,
15303  scip->origprob, scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->conflict,
15304  scip->conflictstore, scip->eventfilter, scip->eventqueue, scip->cliquetable, &cutoff, FALSE, TRUE) );
15305  assert(!cutoff);
15306  }
15307 
15308  /* switch stage to EXITSOLVE */
15309  scip->set->stage = SCIP_STAGE_EXITSOLVE;
15310 
15311  /* cleanup the conflict storage */
15312  SCIP_CALL( SCIPconflictstoreClean(scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->reopt) );
15313 
15314  /* inform plugins that the branch and bound process is finished */
15315  SCIP_CALL( SCIPsetExitsolPlugins(scip->set, scip->mem->probmem, scip->stat, restart) );
15316 
15317  /* free the NLP, if there is one, and reset the flags indicating nonlinearity */
15318  if( scip->nlp != NULL )
15319  {
15320  SCIP_CALL( SCIPnlpFree(&scip->nlp, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
15321  }
15322  scip->transprob->nlpenabled = FALSE;
15323 
15324  /* clear the LP, and flush the changes to clear the LP of the solver */
15325  SCIP_CALL( SCIPlpReset(scip->lp, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->eventfilter) );
15327 
15328  /* resets the debug environment */
15329  SCIP_CALL( SCIPdebugReset(scip->set) ); /*lint !e506 !e774*/
15330 
15331  /* clear all row references in internal data structures */
15332  SCIP_CALL( SCIPcutpoolClear(scip->cutpool, scip->mem->probmem, scip->set, scip->lp) );
15333  SCIP_CALL( SCIPcutpoolClear(scip->delayedcutpool, scip->mem->probmem, scip->set, scip->lp) );
15334 
15335  /* we have to clear the tree prior to the problem deinitialization, because the rows stored in the forks and
15336  * subroots have to be released
15337  */
15338  SCIP_CALL( SCIPtreeClear(scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
15339 
15340  /* deinitialize transformed problem */
15341  SCIP_CALL( SCIPprobExitSolve(scip->transprob, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, restart) );
15342 
15343  /* free solution process data structures */
15344  SCIP_CALL( SCIPcutpoolFree(&scip->cutpool, scip->mem->probmem, scip->set, scip->lp) );
15345  SCIP_CALL( SCIPcutpoolFree(&scip->delayedcutpool, scip->mem->probmem, scip->set, scip->lp) );
15349 
15350  /* possibly close visualization output file */
15351  SCIPvisualExit(scip->stat->visual, scip->set, scip->messagehdlr);
15352 
15353  /* reset statistics for current branch and bound run */
15355  SCIPstatResetCurrentRun(scip->stat, scip->set, scip->transprob, scip->origprob, TRUE);
15356  else
15357  SCIPstatResetCurrentRun(scip->stat, scip->set, scip->transprob, scip->origprob, FALSE);
15358 
15359  /* switch stage to TRANSFORMED */
15360  scip->set->stage = SCIP_STAGE_TRANSFORMED;
15361 
15362  /* restart finished */
15363  assert( ! restart || scip->stat->inrestart );
15364  scip->stat->inrestart = FALSE;
15365 
15366  return SCIP_OKAY;
15367 }
15368 
15369 /** frees solution process data structures when reoptimization is used
15370  *
15371  * in contrast to a freeSolve() this method will preserve the transformed problem such that another presolving round
15372  * after changing the problem (modifying the objective function) is not necessary.
15373  */
15374 static
15376  SCIP* scip /**< SCIP data structure */
15377  )
15378 {
15379  assert(scip != NULL);
15380  assert(scip->mem != NULL);
15381  assert(scip->set != NULL);
15382  assert(scip->stat != NULL);
15383  assert(scip->set->stage == SCIP_STAGE_SOLVING || scip->set->stage == SCIP_STAGE_SOLVED);
15384 
15385  /* remove focus from the current focus node */
15386  if( SCIPtreeGetFocusNode(scip->tree) != NULL )
15387  {
15388  SCIP_NODE* node = NULL;
15389  SCIP_Bool cutoff;
15390 
15391  SCIP_CALL( SCIPnodeFocus(&node, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->transprob,
15392  scip->origprob, scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->conflict,
15393  scip->conflictstore, scip->eventfilter, scip->eventqueue, scip->cliquetable, &cutoff, FALSE, TRUE) );
15394  assert(!cutoff);
15395  }
15396 
15397  /* deinitialize conflict store */
15398  SCIP_CALL( SCIPconflictstoreClear(scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->reopt) );
15399 
15400  /* invalidate the dual bound */
15402 
15403  /* switch stage to EXITSOLVE */
15404  scip->set->stage = SCIP_STAGE_EXITSOLVE;
15405 
15406  /* inform plugins that the branch and bound process is finished */
15407  SCIP_CALL( SCIPsetExitsolPlugins(scip->set, scip->mem->probmem, scip->stat, FALSE) );
15408 
15409  /* call exit methods of plugins */
15410  SCIP_CALL( SCIPsetExitPlugins(scip->set, scip->mem->probmem, scip->stat) );
15411 
15412  /* free the NLP, if there is one, and reset the flags indicating nonlinearity */
15413  if( scip->nlp != NULL )
15414  {
15415  SCIP_CALL( SCIPnlpFree(&scip->nlp, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
15416  }
15417  scip->transprob->nlpenabled = FALSE;
15418 
15419  /* clear the LP, and flush the changes to clear the LP of the solver */
15420  SCIP_CALL( SCIPlpReset(scip->lp, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->eventfilter) );
15422 
15423  /* resets the debug environment */
15424  SCIP_CALL( SCIPdebugReset(scip->set) ); /*lint !e506 !e774*/
15425 
15426  /* clear all row references in internal data structures */
15427  SCIP_CALL( SCIPcutpoolClear(scip->cutpool, scip->mem->probmem, scip->set, scip->lp) );
15428  SCIP_CALL( SCIPcutpoolClear(scip->delayedcutpool, scip->mem->probmem, scip->set, scip->lp) );
15429 
15430  /* we have to clear the tree prior to the problem deinitialization, because the rows stored in the forks and
15431  * subroots have to be released
15432  */
15433  SCIP_CALL( SCIPtreeClear(scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
15434 
15435  /* deinitialize transformed problem */
15436  SCIP_CALL( SCIPprobExitSolve(scip->transprob, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, FALSE) );
15437 
15438  /* free solution process data structures */
15440 
15441  SCIP_CALL( SCIPcutpoolFree(&scip->cutpool, scip->mem->probmem, scip->set, scip->lp) );
15442  SCIP_CALL( SCIPcutpoolFree(&scip->delayedcutpool, scip->mem->probmem, scip->set, scip->lp) );
15446 
15447  /* possibly close visualization output file */
15448  SCIPvisualExit(scip->stat->visual, scip->set, scip->messagehdlr);
15449 
15450  /* reset statistics for current branch and bound run */
15451  SCIPstatResetCurrentRun(scip->stat, scip->set, scip->transprob, scip->origprob, FALSE);
15452 
15453  /* switch stage to PRESOLVED */
15454  scip->set->stage = SCIP_STAGE_PRESOLVED;
15455 
15456  /* restart finished */
15457  scip->stat->inrestart = FALSE;
15458 
15459  /* reset solving specific paramters */
15460  if( scip->set->reopt_enable )
15461  {
15462  assert(scip->reopt != NULL);
15463  SCIP_CALL( SCIPreoptReset(scip->reopt, scip->set, scip->mem->probmem) );
15464  }
15465 
15466  /* free the debug solution which might live in transformed primal data structure */
15467  SCIP_CALL( SCIPprimalClear(&scip->primal, scip->mem->probmem) );
15468 
15469  if( scip->set->misc_resetstat )
15470  {
15471  /* reset statistics to the point before the problem was transformed */
15472  SCIPstatReset(scip->stat, scip->set, scip->transprob, scip->origprob);
15473  }
15474  else
15475  {
15476  /* even if statistics are not completely reset, a partial reset of the primal-dual integral is necessary */
15478  }
15479 
15480  /* reset objective limit */
15482 
15483  return SCIP_OKAY;
15484 }
15485 
15486 /** free transformed problem */
15487 static
15489  SCIP* scip /**< SCIP data structure */
15490  )
15491 {
15492  SCIP_Bool reducedfree;
15493 
15494  assert(scip != NULL);
15495  assert(scip->mem != NULL);
15496  assert(scip->stat != NULL);
15497  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED || scip->set->stage == SCIP_STAGE_PRESOLVING ||
15498  (scip->set->stage == SCIP_STAGE_PRESOLVED && scip->set->reopt_enable));
15499 
15500  /* If the following evaluates to true, SCIPfreeReoptSolve() has already called the exit-callbacks of the plugins.
15501  * We can skip calling some of the following methods. This can happen if a new objective function was
15502  * installed but the solve was not started.
15503  */
15504  reducedfree = (scip->set->stage == SCIP_STAGE_PRESOLVED && scip->set->reopt_enable);
15505 
15506  if( !reducedfree )
15507  {
15508  /* call exit methods of plugins */
15509  SCIP_CALL( SCIPsetExitPlugins(scip->set, scip->mem->probmem, scip->stat) );
15510  }
15511 
15512  /* copy best primal solutions to original solution candidate list */
15513  if( !scip->set->reopt_enable && scip->set->limit_maxorigsol > 0 && scip->set->misc_transsolsorig )
15514  {
15515  SCIP_Bool stored;
15516  SCIP_Bool hasinfval;
15517  int maxsols;
15518  int nsols;
15519  int s;
15520 
15521  assert(scip->origprimal->nsols == 0);
15522 
15523  nsols = scip->primal->nsols;
15524  maxsols = scip->set->limit_maxorigsol;
15525  stored = TRUE;
15526  s = 0;
15527 
15528  /* iterate over all solutions as long as the original solution candidate store size limit is not reached */
15529  while( s < nsols && scip->origprimal->nsols < maxsols )
15530  {
15531  SCIP_SOL* sol;
15532 
15533  sol = scip->primal->sols[s];
15534  assert(sol != NULL);
15535 
15536  if( !SCIPsolIsOriginal(sol) )
15537  {
15538  /* retransform solution into the original problem space */
15539  SCIP_CALL( SCIPsolRetransform(sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
15540  }
15541  else
15542  hasinfval = FALSE;
15543 
15544  /* removing infinite fixings is turned off by the corresponding parameter */
15545  if( !scip->set->misc_finitesolstore )
15546  hasinfval = FALSE;
15547 
15548  if( !hasinfval )
15549  {
15550  /* add solution to original candidate solution storage */
15551  SCIP_CALL( SCIPprimalAddOrigSol(scip->origprimal, scip->mem->probmem, scip->set, scip->stat, scip->origprob, sol, &stored) );
15552  }
15553  else
15554  {
15555  SCIP_SOL* newsol;
15556  SCIP_Bool success;
15557 
15558  SCIP_CALL( SCIPcreateFiniteSolCopy(scip, &newsol, sol, &success) );
15559 
15560  /* infinite fixing could be removed */
15561  if( newsol != NULL )
15562  {
15563  /* add solution to original candidate solution storage; we must not use SCIPprimalAddOrigSolFree()
15564  * because we want to create a copy of the solution in the origprimal solution store, but newsol was
15565  * created in the (transformed) primal
15566  */
15567  SCIP_CALL( SCIPprimalAddOrigSol(scip->origprimal, scip->mem->probmem, scip->set, scip->stat, scip->origprob, newsol, &stored) );
15568 
15569  /* free solution in (transformed) primal where it was created */
15570  SCIP_CALL( SCIPsolFree(&newsol, scip->mem->probmem, scip->primal) );
15571  }
15572  }
15573  ++s;
15574  }
15575 
15576  if( scip->origprimal->nsols > 1 )
15577  {
15579  "stored the %d best primal solutions in the original solution candidate list\n", scip->origprimal->nsols);
15580  }
15581  else if( scip->origprimal->nsols == 1 )
15582  {
15584  "stored the best primal solution in the original solution candidate list\n");
15585  }
15586  }
15587 
15588  /* switch stage to FREETRANS */
15589  scip->set->stage = SCIP_STAGE_FREETRANS;
15590 
15591  /* reset solving specific paramters */
15592  if( scip->set->reopt_enable )
15593  {
15594  assert(scip->reopt != NULL);
15595  SCIP_CALL( SCIPreoptReset(scip->reopt, scip->set, scip->mem->probmem) );
15596  }
15597 
15598  /* @todo if a variable was removed from the problem during solving, its locks were not reduced;
15599  * we might want to remove locks also in that case
15600  */
15601  /* remove var locks set to avoid dual reductions */
15602  if( scip->set->reopt_enable || !scip->set->misc_allowdualreds )
15603  {
15604  int v;
15605 
15606  /* unlock all variables */
15607  for(v = 0; v < scip->transprob->nvars; v++)
15608  {
15609  SCIP_CALL( SCIPaddVarLocks(scip, scip->transprob->vars[v], -1, -1) );
15610  }
15611  }
15612 
15613  if( !reducedfree )
15614  {
15615  /* clear the conflict store
15616  *
15617  * since the conflict store can contain transformed constraints we need to remove them. the store will be finally
15618  * freed in SCIPfreeProb().
15619  */
15620  SCIP_CALL( SCIPconflictstoreClear(scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->reopt) );
15621 
15622  }
15623 
15624  /* free transformed problem data structures */
15625  SCIP_CALL( SCIPprobFree(&scip->transprob, scip->messagehdlr, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
15627  SCIP_CALL( SCIPconflictFree(&scip->conflict, scip->mem->probmem) );
15628 
15629  if( !reducedfree )
15630  {
15632  }
15633  SCIP_CALL( SCIPtreeFree(&scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
15634 
15635  /* free the debug solution which might live in transformed primal data structure */
15636  SCIP_CALL( SCIPdebugFreeSol(scip->set) ); /*lint !e506 !e774*/
15637  SCIP_CALL( SCIPprimalFree(&scip->primal, scip->mem->probmem) );
15638 
15639  SCIP_CALL( SCIPlpFree(&scip->lp, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter) );
15641  SCIP_CALL( SCIPeventfilterFree(&scip->eventfilter, scip->mem->probmem, scip->set) );
15643 
15644  if( scip->set->misc_resetstat && !reducedfree )
15645  {
15646  /* reset statistics to the point before the problem was transformed */
15647  SCIPstatReset(scip->stat, scip->set, scip->transprob, scip->origprob);
15648  }
15649  else
15650  {
15651  /* even if statistics are not completely reset, a partial reset of the primal-dual integral is necessary */
15653  }
15654 
15655  /* switch stage to PROBLEM */
15656  scip->set->stage = SCIP_STAGE_PROBLEM;
15657 
15658  /* reset objective limit */
15660 
15661  /* reset original variable's local and global bounds to their original values */
15662  SCIP_CALL( SCIPprobResetBounds(scip->origprob, scip->mem->probmem, scip->set, scip->stat) );
15663 
15664  return SCIP_OKAY;
15665 }
15666 
15667 /** displays most relevant statistics after problem was solved */
15668 static
15670  SCIP* scip /**< SCIP data structure */
15671  )
15672 {
15673  assert(scip != NULL);
15674 
15675  /* display most relevant statistics */
15676  if( scip->set->disp_verblevel >= SCIP_VERBLEVEL_NORMAL )
15677  {
15678  SCIP_Bool objlimitreached = FALSE;
15679 
15680  if( SCIPgetStage(scip) == SCIP_STAGE_SOLVED && scip->primal->nlimsolsfound == 0
15681  && !SCIPisInfinity(scip, getPrimalbound(scip)) )
15682  objlimitreached = TRUE;
15683 
15684  SCIPmessagePrintInfo(scip->messagehdlr, "\n");
15685  SCIPmessagePrintInfo(scip->messagehdlr, "SCIP Status : ");
15686  SCIP_CALL( SCIPprintStage(scip, NULL) );
15687  SCIPmessagePrintInfo(scip->messagehdlr, "\n");
15688  if( scip->set->reopt_enable )
15689  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Time (sec) : %.2f (over %d runs: %.2f)\n", SCIPclockGetTime(scip->stat->solvingtime), scip->stat->nreoptruns, SCIPclockGetTime(scip->stat->solvingtimeoverall));
15690  else
15691  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Time (sec) : %.2f\n", SCIPclockGetTime(scip->stat->solvingtime));
15692  if( scip->stat->nruns > 1 )
15693  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Nodes : %" SCIP_LONGINT_FORMAT " (total of %" SCIP_LONGINT_FORMAT " nodes in %d runs)\n",
15694  scip->stat->nnodes, scip->stat->ntotalnodes, scip->stat->nruns);
15695  else if( scip->set->reopt_enable )
15696  {
15697  SCIP_BRANCHRULE* branchrule;
15698 
15699  branchrule = SCIPfindBranchrule(scip, "nodereopt");
15700  assert(branchrule != NULL);
15701 
15702  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Nodes : %" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " reactivated)\n", scip->stat->nnodes, SCIPbranchruleGetNChildren(branchrule));
15703  }
15704  else
15705  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Nodes : %" SCIP_LONGINT_FORMAT "\n", scip->stat->nnodes);
15706  if( scip->set->stage >= SCIP_STAGE_TRANSFORMED && scip->set->stage <= SCIP_STAGE_EXITSOLVE )
15707  {
15708  if( objlimitreached )
15709  {
15710  SCIPmessagePrintInfo(scip->messagehdlr, "Primal Bound : %+.14e (%" SCIP_LONGINT_FORMAT " solutions)\n",
15711  SCIPinfinity(scip), scip->primal->nsolsfound);
15712  }
15713  else
15714  {
15715  char limsolstring[SCIP_MAXSTRLEN];
15716  if( scip->primal->nsolsfound != scip->primal->nlimsolsfound )
15717  (void) SCIPsnprintf(limsolstring, SCIP_MAXSTRLEN, ", %" SCIP_LONGINT_FORMAT " respecting the objective limit", scip->primal->nlimsolsfound);
15718  else
15719  (void) SCIPsnprintf(limsolstring, SCIP_MAXSTRLEN,"");
15720 
15721  SCIPmessagePrintInfo(scip->messagehdlr, "Primal Bound : %+.14e (%" SCIP_LONGINT_FORMAT " solutions%s)\n",
15722  getPrimalbound(scip), scip->primal->nsolsfound, limsolstring);
15723  }
15724  }
15725  if( scip->set->stage >= SCIP_STAGE_SOLVING && scip->set->stage <= SCIP_STAGE_SOLVED )
15726  {
15727  if( objlimitreached )
15728  {
15729  SCIPmessagePrintInfo(scip->messagehdlr, "Dual Bound : %+.14e\n", SCIPinfinity(scip));
15730  }
15731  else
15732  {
15733  SCIPmessagePrintInfo(scip->messagehdlr, "Dual Bound : %+.14e\n", getDualbound(scip));
15734  }
15735  SCIPmessagePrintInfo(scip->messagehdlr, "Gap : ");
15736  if( SCIPsetIsInfinity(scip->set, SCIPgetGap(scip)) )
15737  SCIPmessagePrintInfo(scip->messagehdlr, "infinite\n");
15738  else
15739  SCIPmessagePrintInfo(scip->messagehdlr, "%.2f %%\n", 100.0*SCIPgetGap(scip));
15740  }
15741 
15742  /* check solution for feasibility in original problem */
15743  if( scip->set->stage >= SCIP_STAGE_TRANSFORMED )
15744  {
15745  SCIP_SOL* sol;
15746 
15747  sol = SCIPgetBestSol(scip);
15748  if( sol != NULL )
15749  {
15750  SCIP_Real checkfeastolfac;
15751  SCIP_Real oldfeastol;
15752  SCIP_Bool dispallviols;
15753  SCIP_Bool feasible;
15754 
15755  oldfeastol = SCIPfeastol(scip);
15756  SCIP_CALL( SCIPgetRealParam(scip, "numerics/checkfeastolfac", &checkfeastolfac) );
15757  SCIP_CALL( SCIPgetBoolParam(scip, "display/allviols", &dispallviols) );
15758 
15759  /* scale feasibility tolerance by set->num_checkfeastolfac */
15760  if( !SCIPisEQ(scip, checkfeastolfac, 1.0) )
15761  {
15762  SCIP_CALL( SCIPchgFeastol(scip, oldfeastol * checkfeastolfac) );
15763  }
15764 
15765  SCIP_CALL( SCIPcheckSolOrig(scip, sol, &feasible, TRUE, dispallviols) );
15766 
15767  /* restore old feasibilty tolerance */
15768  if( !SCIPisEQ(scip, checkfeastolfac, 1.0) )
15769  {
15770  SCIP_CALL( SCIPchgFeastol(scip, oldfeastol) );
15771  }
15772 
15773  if( !feasible )
15774  {
15775  SCIPmessagePrintInfo(scip->messagehdlr, "best solution is not feasible in original problem\n");
15776  }
15777  }
15778  }
15779  }
15780 
15781  return SCIP_OKAY;
15782 }
15783 
15784 /** calls compression based on the reoptimization structure after the presolving */
15785 static
15787  SCIP* scip /**< global SCIP settings */
15788  )
15789 {
15790  SCIP_RESULT result;
15791  int c;
15792  int noldnodes;
15793  int nnewnodes;
15794 
15795  result = SCIP_DIDNOTFIND;
15796 
15797  noldnodes = SCIPreoptGetNNodes(scip->reopt, scip->tree->root);
15798 
15799  /* do not run if there exists only the root node */
15800  if( noldnodes <= 1 )
15801  return SCIP_OKAY;
15802 
15803  /* do not run a tree compression if the problem contains (implicit) integer variables */
15804  if( scip->transprob->nintvars > 0 || scip->transprob->nimplvars > 0 )
15805  return SCIP_OKAY;
15806 
15808  "tree compression:\n");
15810  " given tree has %d nodes.\n", noldnodes);
15811 
15812  /* sort compressions by priority */
15813  SCIPsetSortComprs(scip->set);
15814 
15815  for(c = 0; c < scip->set->ncomprs; c++)
15816  {
15817  assert(result == SCIP_DIDNOTFIND || result == SCIP_DIDNOTRUN);
15818 
15819  /* call tree compression technique */
15820  SCIP_CALL( SCIPcomprExec(scip->set->comprs[c], scip->set, scip->reopt, &result) );
15821 
15822  if( result == SCIP_SUCCESS )
15823  {
15824  nnewnodes = SCIPreoptGetNNodes(scip->reopt, scip->tree->root);
15826  " <%s> compressed the search tree to %d nodes (rate %g).\n", SCIPcomprGetName(scip->set->comprs[c]),
15827  nnewnodes, ((SCIP_Real)nnewnodes)/noldnodes);
15828 
15829  break;
15830  }
15831  }
15832 
15833  if( result != SCIP_SUCCESS )
15834  {
15835  assert(result == SCIP_DIDNOTFIND || result == SCIP_DIDNOTRUN);
15837  " search tree could not be compressed.\n");
15838  }
15839 
15840  return SCIP_OKAY;
15841 }
15842 
15843 /* prepare all plugins and data structures for a reoptimization run */
15844 static
15846  SCIP* scip /**< SCIP data structure */
15847  )
15848 {
15849  SCIP_Bool reoptrestart;
15850 
15851  assert(scip != NULL);
15852  assert(scip->set->reopt_enable);
15853 
15854  /* @ todo: we could check if the problem is feasible, eg, by backtracking */
15855 
15856  /* increase number of reopt_runs */
15857  ++scip->stat->nreoptruns;
15858 
15859  /* inform the reoptimization plugin that a new iteration starts */
15860  SCIP_CALL( SCIPreoptAddRun(scip->reopt, scip->set, scip->mem->probmem, scip->origprob->vars,
15861  scip->origprob->nvars, scip->set->limit_maxsol) );
15862 
15863  /* check whether we need to add globally valid constraints */
15864  if( scip->set->reopt_sepaglbinfsubtrees || scip->set->reopt_sepabestsol )
15865  {
15866  SCIP_CALL( SCIPreoptApplyGlbConss(scip, scip->reopt, scip->set, scip->stat, scip->mem->probmem) );
15867  }
15868 
15869  /* after presolving the problem the first time we remember all global bounds and active constraints. bounds and
15870  * constraints will be restored within SCIPreoptInstallBounds() and SCIPreoptResetActiveConss().
15871  */
15872  if( scip->stat->nreoptruns == 1 )
15873  {
15874  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
15875 
15876  SCIP_CALL( SCIPreoptSaveGlobalBounds(scip->reopt, scip->transprob, scip->mem->probmem) );
15877 
15878  SCIP_CALL( SCIPreoptSaveActiveConss(scip->reopt, scip->transprob, scip->mem->probmem) );
15879  }
15880  /* we are at least in the second run */
15881  else
15882  {
15883  assert(scip->transprob != NULL);
15884 
15885  SCIP_CALL( SCIPreoptMergeVarHistory(scip->reopt, scip->set, scip->stat, scip->origprob->vars, scip->origprob->nvars) );
15886 
15887  SCIP_CALL( SCIPrelaxationCreate(&scip->relaxation, scip->mem->probmem, scip->set, scip->stat, scip->primal,
15888  scip->tree) );
15889 
15890  /* mark statistics before solving */
15891  SCIPstatMark(scip->stat);
15892 
15894 
15895  SCIP_CALL( SCIPreoptResetActiveConss(scip->reopt, scip->set, scip->stat) );
15896 
15897  /* check whether we want to restart the tree search */
15898  SCIP_CALL( SCIPreoptCheckRestart(scip->reopt, scip->set, scip->mem->probmem, NULL, scip->transprob->vars,
15899  scip->transprob->nvars, &reoptrestart) );
15900 
15901  /* call initialization methods of plugins */
15902  SCIP_CALL( SCIPsetInitPlugins(scip->set, scip->mem->probmem, scip->stat) );
15903 
15904  /* install globally valid lower and upper bounds */
15905  SCIP_CALL( SCIPreoptInstallBounds(scip->reopt, scip->set, scip->stat, scip->transprob, scip->lp, scip->branchcand,
15906  scip->eventqueue, scip->cliquetable, scip->mem->probmem) );
15907 
15908  /* check, whether objective value is always integral by inspecting the problem, if it is the case adjust the
15909  * cutoff bound if primal solution is already known
15910  */
15911  SCIP_CALL( SCIPprobCheckObjIntegral(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat,
15912  scip->primal, scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
15913 
15914  /* if possible, scale objective function such that it becomes integral with gcd 1 */
15915  SCIP_CALL( SCIPprobScaleObj(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
15916  scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
15917 
15919  }
15920 
15921  /* try to compress the search tree */
15922  if( scip->set->compr_enable )
15923  {
15924  SCIP_CALL( compressReoptTree(scip) );
15925  }
15926 
15927  return SCIP_OKAY;
15928 }
15929 
15930 /** transforms and presolves problem
15931  *
15932  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15933  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15934  *
15935  * @pre This method can be called if @p scip is in one of the following stages:
15936  * - \ref SCIP_STAGE_PROBLEM
15937  * - \ref SCIP_STAGE_TRANSFORMED
15938  * - \ref SCIP_STAGE_PRESOLVING
15939  * - \ref SCIP_STAGE_PRESOLVED
15940  *
15941  * @post After calling this method \SCIP reaches one of the following stages:
15942  * - \ref SCIP_STAGE_PRESOLVING if the presolving process was interrupted
15943  * - \ref SCIP_STAGE_PRESOLVED if the presolving process was finished and did not solve the problem
15944  * - \ref SCIP_STAGE_SOLVED if the problem was solved during presolving
15945  *
15946  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
15947  */
15949  SCIP* scip /**< SCIP data structure */
15950  )
15951 {
15952  SCIP_Bool unbounded;
15953  SCIP_Bool infeasible;
15954 
15955  SCIP_CALL( checkStage(scip, "SCIPpresolve", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
15956 
15957  /* start solving timer */
15958  SCIPclockStart(scip->stat->solvingtime, scip->set);
15959  SCIPclockStart(scip->stat->solvingtimeoverall, scip->set);
15960 
15961  /* capture the CTRL-C interrupt */
15962  if( scip->set->misc_catchctrlc )
15964 
15965  /* reset the user interrupt flag */
15966  scip->stat->userinterrupt = FALSE;
15967 
15968  switch( scip->set->stage )
15969  {
15970  case SCIP_STAGE_PROBLEM:
15971  /* initialize solving data structures and transform problem */
15972  SCIP_CALL( SCIPtransformProb(scip) );
15973  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
15974 
15975  /*lint -fallthrough*/
15976 
15978  case SCIP_STAGE_PRESOLVING:
15979  /* presolve problem */
15980  SCIP_CALL( presolve(scip, &unbounded, &infeasible) );
15981  assert(scip->set->stage == SCIP_STAGE_PRESOLVED || scip->set->stage == SCIP_STAGE_PRESOLVING);
15982 
15983  if( infeasible || unbounded )
15984  {
15985  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
15986 
15987  /* initialize solving process data structures to be able to switch to SOLVED stage */
15988  SCIP_CALL( initSolve(scip, TRUE) );
15989 
15990  /* switch stage to SOLVED */
15991  scip->set->stage = SCIP_STAGE_SOLVED;
15992 
15993  /* print solution message */
15994  switch( scip->stat->status )/*lint --e{788}*/
15995  {
15996  case SCIP_STATUS_OPTIMAL:
15997  /* remove the root node from the tree, s.t. the lower bound is set to +infinity ???????????? (see initSolve())*/
15998  SCIP_CALL( SCIPtreeClear(scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
15999  break;
16000 
16003  "presolving detected infeasibility\n");
16004  break;
16005 
16006  case SCIP_STATUS_UNBOUNDED:
16008  "presolving detected unboundedness\n");
16009  break;
16010 
16011  case SCIP_STATUS_INFORUNBD:
16013  "presolving detected unboundedness (or infeasibility)\n");
16014  break;
16015 
16016  default:
16017  /* note that this is in an internal SCIP error since the status is corrupted */
16018  SCIPerrorMessage("invalid SCIP status <%d>\n", scip->stat->status);
16019  SCIPABORT();
16020  return SCIP_ERROR; /*lint !e527*/
16021  }
16022  }
16023  else if( scip->set->stage == SCIP_STAGE_PRESOLVED )
16024  {
16025  int h;
16026 
16027  /* print presolved problem statistics */
16029  "presolved problem has %d variables (%d bin, %d int, %d impl, %d cont) and %d constraints\n",
16030  scip->transprob->nvars, scip->transprob->nbinvars, scip->transprob->nintvars, scip->transprob->nimplvars,
16031  scip->transprob->ncontvars, scip->transprob->nconss);
16032 
16033  for( h = 0; h < scip->set->nconshdlrs; ++h )
16034  {
16035  int nactiveconss;
16036 
16037  nactiveconss = SCIPconshdlrGetNActiveConss(scip->set->conshdlrs[h]);
16038  if( nactiveconss > 0 )
16039  {
16041  "%7d constraints of type <%s>\n", nactiveconss, SCIPconshdlrGetName(scip->set->conshdlrs[h]));
16042  }
16043  }
16044 
16045  if( SCIPprobIsObjIntegral(scip->transprob) )
16046  {
16048  "transformed objective value is always integral (scale: %.15g)\n", scip->transprob->objscale);
16049  }
16050  }
16051  else
16052  {
16053  assert(scip->set->stage == SCIP_STAGE_PRESOLVING);
16054  SCIPmessagePrintVerbInfo(scip->messagehdlr, scip->set->disp_verblevel, SCIP_VERBLEVEL_HIGH, "presolving was interrupted.\n");
16055  }
16056 
16057  /* display timing statistics */
16059  "Presolving Time: %.2f\n", SCIPclockGetTime(scip->stat->presolvingtime));
16060  break;
16061 
16062  case SCIP_STAGE_PRESOLVED:
16063  case SCIP_STAGE_SOLVED:
16064  break;
16065 
16066  default:
16067  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
16068  return SCIP_INVALIDCALL;
16069  } /*lint !e788*/
16070 
16071  /* release the CTRL-C interrupt */
16072  if( scip->set->misc_catchctrlc )
16074 
16075  /* stop solving timer */
16076  SCIPclockStop(scip->stat->solvingtime, scip->set);
16077  SCIPclockStop(scip->stat->solvingtimeoverall, scip->set);
16078 
16079  if( scip->set->stage == SCIP_STAGE_SOLVED )
16080  {
16081  /* display most relevant statistics */
16083  }
16084 
16085  return SCIP_OKAY;
16086 }
16087 
16088 /** transforms, presolves, and solves problem
16089  *
16090  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16091  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16092  *
16093  * @pre This method can be called if @p scip is in one of the following stages:
16094  * - \ref SCIP_STAGE_PROBLEM
16095  * - \ref SCIP_STAGE_TRANSFORMED
16096  * - \ref SCIP_STAGE_PRESOLVING
16097  * - \ref SCIP_STAGE_PRESOLVED
16098  * - \ref SCIP_STAGE_SOLVING
16099  * - \ref SCIP_STAGE_SOLVED
16100  *
16101  * @post After calling this method \SCIP reaches one of the following stages depending on if and when the solution
16102  * process was interrupted:
16103  * - \ref SCIP_STAGE_PRESOLVING if the solution process was interrupted during presolving
16104  * - \ref SCIP_STAGE_SOLVING if the solution process was interrupted during the tree search
16105  * - \ref SCIP_STAGE_SOLVED if the solving process was not interrupted
16106  *
16107  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
16108  */
16110  SCIP* scip /**< SCIP data structure */
16111  )
16112 {
16113  SCIP_Bool statsprinted = FALSE;
16114  SCIP_Bool restart;
16115 
16116  SCIP_CALL( checkStage(scip, "SCIPsolve", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16117 
16118  /* if the stage is already SCIP_STAGE_SOLVED do nothing */
16119  if( scip->set->stage == SCIP_STAGE_SOLVED )
16120  return SCIP_OKAY;
16121 
16123  {
16124  SCIPwarningMessage(scip, "SCIPsolve() was called, but problem is already solved\n");
16125  return SCIP_OKAY;
16126  }
16127 
16128  /* check, if a node selector exists */
16129  if( SCIPsetGetNodesel(scip->set, scip->stat) == NULL )
16130  {
16131  SCIPerrorMessage("no node selector available\n");
16132  return SCIP_PLUGINNOTFOUND;
16133  }
16134 
16135  /* check, if an integrality constraint handler exists if there are integral variables */
16136  if( (SCIPgetNBinVars(scip) >= 0 || SCIPgetNIntVars(scip) >= 0) && SCIPfindConshdlr(scip, "integral") == NULL )
16137  {
16138  SCIPwarningMessage(scip, "integrality constraint handler not available\n");
16139  }
16140 
16141  /* initialize presolving flag (may be modified in SCIPpresolve()) */
16142  scip->stat->performpresol = FALSE;
16143 
16144  /* start solving timer */
16145  SCIPclockStart(scip->stat->solvingtime, scip->set);
16146  SCIPclockStart(scip->stat->solvingtimeoverall, scip->set);
16147 
16148  /* capture the CTRL-C interrupt */
16149  if( scip->set->misc_catchctrlc )
16151 
16152  /* reset the user interrupt flag */
16153  scip->stat->userinterrupt = FALSE;
16154 
16155  /* automatic restarting loop */
16156  restart = scip->stat->userrestart;
16157 
16158  do
16159  {
16160  if( restart )
16161  {
16162  /* free the solving process data in order to restart */
16163  assert(scip->set->stage == SCIP_STAGE_SOLVING);
16164  if( scip->stat->userrestart )
16166  "(run %d, node %" SCIP_LONGINT_FORMAT ") performing user restart\n",
16167  scip->stat->nruns, scip->stat->nnodes, scip->stat->nrootintfixingsrun);
16168  else
16170  "(run %d, node %" SCIP_LONGINT_FORMAT ") restarting after %d global fixings of integer variables\n",
16171  scip->stat->nruns, scip->stat->nnodes, scip->stat->nrootintfixingsrun);
16172  /* an extra blank line should be printed separately since the buffer message handler only handles up to one line
16173  * correctly */
16174  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "\n");
16175  /* reset relaxation solution, so that the objective value is recomputed from scratch next time, using the new
16176  * fixings which may be produced during the presolving after the restart */
16178 
16179  SCIP_CALL( freeSolve(scip, TRUE) );
16180  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
16181  }
16182  restart = FALSE;
16183  scip->stat->userrestart = FALSE;
16184 
16185  switch( scip->set->stage )
16186  {
16187  case SCIP_STAGE_PROBLEM:
16189  case SCIP_STAGE_PRESOLVING:
16190  /* initialize solving data structures, transform and problem */
16191 
16192  SCIP_CALL( SCIPpresolve(scip) );
16193  /* remember that we already printed the relevant statistics */
16194  if( scip->set->stage == SCIP_STAGE_SOLVED )
16195  statsprinted = TRUE;
16196 
16197  if( scip->set->stage == SCIP_STAGE_SOLVED || scip->set->stage == SCIP_STAGE_PRESOLVING )
16198  break;
16199  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
16200 
16201  /*lint -fallthrough*/
16202 
16203  case SCIP_STAGE_PRESOLVED:
16204  /* check if reoptimization is enabled and global constraints are saved */
16205  if( scip->set->reopt_enable )
16206  {
16208  }
16209 
16210  /* initialize solving process data structures */
16211  SCIP_CALL( initSolve(scip, FALSE) );
16212  assert(scip->set->stage == SCIP_STAGE_SOLVING);
16214 
16215  /*lint -fallthrough*/
16216 
16217  case SCIP_STAGE_SOLVING:
16218  /* reset display */
16219  SCIPstatResetDisplay(scip->stat);
16220 
16221  /* continue solution process */
16222  SCIP_CALL( SCIPsolveCIP(scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->mem, scip->origprob, scip->transprob,
16223  scip->primal, scip->tree, scip->reopt, scip->lp, scip->relaxation, scip->pricestore, scip->sepastore,
16224  scip->cutpool, scip->delayedcutpool, scip->branchcand, scip->conflict, scip->conflictstore,
16225  scip->eventfilter, scip->eventqueue, scip->cliquetable, &restart) );
16226 
16227  /* detect, whether problem is solved */
16228  if( SCIPtreeGetNNodes(scip->tree) == 0 && SCIPtreeGetCurrentNode(scip->tree) == NULL )
16229  {
16230  assert(scip->stat->status == SCIP_STATUS_OPTIMAL
16231  || scip->stat->status == SCIP_STATUS_INFEASIBLE
16232  || scip->stat->status == SCIP_STATUS_UNBOUNDED
16233  || scip->stat->status == SCIP_STATUS_INFORUNBD);
16234  assert(!restart);
16235 
16236  /* tree is empty, and no current node exists -> problem is solved */
16237  scip->set->stage = SCIP_STAGE_SOLVED;
16238  }
16239  break;
16240 
16241  case SCIP_STAGE_SOLVED:
16242  assert(scip->stat->status == SCIP_STATUS_OPTIMAL
16243  || scip->stat->status == SCIP_STATUS_INFEASIBLE
16244  || scip->stat->status == SCIP_STATUS_UNBOUNDED
16245  || scip->stat->status == SCIP_STATUS_INFORUNBD);
16246 
16247  break;
16248 
16249  default:
16250  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
16251  return SCIP_INVALIDCALL;
16252  } /*lint !e788*/
16253  }
16254  while( restart && !SCIPsolveIsStopped(scip->set, scip->stat, TRUE) );
16255 
16256  /* we have to store all unprocessed nodes if reoptimization is enabled */
16257  if( scip->set->reopt_enable && scip->set->stage != SCIP_STAGE_PRESOLVING
16258  && SCIPsolveIsStopped(scip->set, scip->stat, TRUE) )
16259  {
16260  /* save unprocessed nodes */
16261  if( SCIPgetNNodesLeft(scip) > 0 )
16262  {
16263  SCIP_NODE** leaves;
16264  SCIP_NODE** children;
16265  SCIP_NODE** siblings;
16266  int nleaves;
16267  int nchildren;
16268  int nsiblings;
16269 
16270  /* get all open leave nodes */
16271  SCIP_CALL( SCIPgetLeaves(scip, &leaves, &nleaves) );
16272 
16273  /* get all open children nodes */
16274  SCIP_CALL( SCIPgetChildren(scip, &children, &nchildren) );
16275 
16276  /* get all open sibling nodes */
16277  SCIP_CALL( SCIPgetSiblings(scip, &siblings, &nsiblings) );
16278 
16279  /* add all open node to the reoptimization tree */
16280  SCIP_CALL( SCIPreoptSaveOpenNodes(scip->reopt, scip->set, scip->lp, scip->mem->probmem, leaves, nleaves,
16281  children, nchildren, siblings, nsiblings) );
16282  }
16283  }
16284 
16285  /* release the CTRL-C interrupt */
16286  if( scip->set->misc_catchctrlc )
16288 
16289  if( scip->set->reopt_enable )
16290  {
16291  /* save found solutions */
16292  int nsols;
16293  int s;
16294 
16295  nsols = scip->set->reopt_savesols == -1 ? INT_MAX : MAX(scip->set->reopt_savesols, 1);
16296  nsols = MIN(scip->primal->nsols, nsols);
16297 
16298  for( s = 0; s < nsols; s++ )
16299  {
16300  SCIP_SOL* sol;
16301  SCIP_Bool added;
16302 
16303  sol = scip->primal->sols[s];
16304  assert(sol != NULL);
16305 
16306  if( !SCIPsolIsOriginal(sol) )
16307  {
16308  SCIP_Bool hasinfval;
16309 
16310  /* retransform solution into the original problem space */
16311  SCIP_CALL( SCIPsolRetransform(sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
16312  }
16313 
16314  if( SCIPsolGetNodenum(sol) > 0 || SCIPsolGetHeur(sol) != NULL || (s == 0 && scip->set->reopt_sepabestsol) )
16315  {
16316  /* if the best solution should be separated, we must not store it in the solution tree */
16317  if( s == 0 && scip->set->reopt_sepabestsol )
16318  {
16319  SCIP_CALL( SCIPreoptAddOptSol(scip->reopt, sol, scip->mem->probmem, scip->set, scip->stat, scip->origprimal,
16320  scip->origprob->vars, scip->origprob->nvars) );
16321  }
16322  /* add solution to solution tree */
16323  else
16324  {
16325  SCIPdebugMsg(scip, "try to add solution to the solution tree:\n");
16326  SCIPdebug( SCIP_CALL( SCIPsolPrint(sol, scip->set, scip->messagehdlr, scip->stat, scip->origprob, \
16327  scip->transprob, NULL, FALSE, FALSE) ); );
16328 
16329  SCIP_CALL( SCIPreoptAddSol(scip->reopt, scip->set, scip->stat, scip->origprimal, scip->mem->probmem,
16330  sol, s == 0, &added, scip->origprob->vars, scip->origprob->nvars, scip->stat->nreoptruns) );
16331  }
16332  }
16333  }
16334 
16335  SCIPdebugMsg(scip, "-> saved %d solution.\n", nsols);
16336 
16337  /* store variable history */
16338  if( scip->set->reopt_storevarhistory )
16339  {
16340  SCIP_CALL( SCIPreoptUpdateVarHistory(scip->reopt, scip->set, scip->stat, scip->mem->probmem,
16341  scip->origprob->vars, scip->origprob->nvars) );
16342  }
16343  }
16344 
16345  /* stop solving timer */
16346  SCIPclockStop(scip->stat->solvingtime, scip->set);
16347  SCIPclockStop(scip->stat->solvingtimeoverall, scip->set);
16348 
16349  /* decrease time limit during reoptimization */
16350  if( scip->set->reopt_enable && scip->set->reopt_commontimelimit )
16351  {
16352  SCIP_Real timelimit;
16353  SCIP_Real usedtime;
16354 
16355  SCIP_CALL( SCIPgetRealParam(scip, "limits/time", &timelimit) );
16356  usedtime = SCIPgetSolvingTime(scip);
16357  timelimit = timelimit - usedtime;
16358  timelimit = MAX(0, timelimit);
16359 
16360  SCIP_CALL( SCIPsetRealParam(scip, "limits/time", timelimit) );
16361  }
16362 
16363  if( !statsprinted )
16364  {
16365  /* display most relevant statistics */
16367  }
16368 
16369  return SCIP_OKAY;
16370 }
16371 
16372 /** transforms, presolves, and solves problem using the configured concurrent solvers
16373  *
16374  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16375  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16376  *
16377  * @pre This method can be called if @p scip is in one of the following stages:
16378  * - \ref SCIP_STAGE_PROBLEM
16379  * - \ref SCIP_STAGE_TRANSFORMED
16380  * - \ref SCIP_STAGE_PRESOLVING
16381  * - \ref SCIP_STAGE_PRESOLVED
16382  * - \ref SCIP_STAGE_SOLVING
16383  * - \ref SCIP_STAGE_SOLVED
16384  *
16385  * @post After calling this method \SCIP reaches one of the following stages depending on if and when the solution
16386  * process was interrupted:
16387  * - \ref SCIP_STAGE_PRESOLVING if the solution process was interrupted during presolving
16388  * - \ref SCIP_STAGE_SOLVING if the solution process was interrupted during the tree search
16389  * - \ref SCIP_STAGE_SOLVED if the solving process was not interrupted
16390  *
16391  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
16392  *
16393  * @deprecated Please use SCIPsolveConcurrent() instead.
16394  */
16396  SCIP* scip /**< SCIP data structure */
16397  )
16398 {
16399  SCIP_CALL( checkStage(scip, "SCIPsolveParallel", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16400 
16401  return SCIPsolveConcurrent(scip);
16402 }
16403 
16404 /** transforms, presolves, and solves problem using the configured concurrent solvers
16405  *
16406  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16407  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16408  *
16409  * @pre This method can be called if @p scip is in one of the following stages:
16410  * - \ref SCIP_STAGE_PROBLEM
16411  * - \ref SCIP_STAGE_TRANSFORMED
16412  * - \ref SCIP_STAGE_PRESOLVING
16413  * - \ref SCIP_STAGE_PRESOLVED
16414  * - \ref SCIP_STAGE_SOLVING
16415  * - \ref SCIP_STAGE_SOLVED
16416  *
16417  * @post After calling this method \SCIP reaches one of the following stages depending on if and when the solution
16418  * process was interrupted:
16419  * - \ref SCIP_STAGE_PRESOLVING if the solution process was interrupted during presolving
16420  * - \ref SCIP_STAGE_SOLVING if the solution process was interrupted during the tree search
16421  * - \ref SCIP_STAGE_SOLVED if the solving process was not interrupted
16422  *
16423  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
16424  */
16426  SCIP* scip /**< SCIP data structure */
16427  )
16428 {
16429 #ifdef TPI_NONE
16430  SCIPinfoMessage(scip, NULL, "SCIP was compiled without task processing interface. Parallel solve not possible\n");
16431  return SCIP_OKAY;
16432 #else
16433  SCIP_RETCODE retcode;
16434  int i;
16435  SCIP_RANDNUMGEN* rndgen;
16436  int minnthreads;
16437  int maxnthreads;
16438 
16439  SCIP_CALL( checkStage(scip, "SCIPsolveConcurrent", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16440 
16441  SCIP_CALL( SCIPsetIntParam(scip, "timing/clocktype", SCIP_CLOCKTYPE_WALL) );
16442 
16443  minnthreads = scip->set->parallel_minnthreads;
16444  maxnthreads = scip->set->parallel_maxnthreads;
16445 
16446  if( minnthreads > maxnthreads )
16447  {
16448  SCIPerrorMessage("minimum number of threads greater than maximum number of threads\n");
16449  return SCIP_INVALIDDATA;
16450  }
16451  if( scip->concurrent == NULL )
16452  {
16453  int nconcsolvertypes;
16454  SCIP_CONCSOLVERTYPE** concsolvertypes;
16455  SCIP_Longint nthreads;
16456  SCIP_Real memorylimit;
16457  int* solvertypes;
16458  SCIP_Longint* weights;
16459  SCIP_Real* prios;
16460  int ncandsolvertypes;
16461  SCIP_Real prefpriosum;
16462 
16463  /* check if concurrent solve is configured to presolve the problem
16464  * before setting up the concurrent solvers
16465  */
16466  if( scip->set->concurrent_presolvebefore )
16467  {
16468  /* if yes, then presolve the problem */
16469  SCIP_CALL( SCIPpresolve(scip) );
16470  }
16471  else
16472  {
16473  SCIP_Bool infeas;
16474 
16475  /* if not, transform the problem and switch stage to presolved */
16476  SCIP_CALL( SCIPtransformProb(scip) );
16477  SCIP_CALL( initPresolve(scip) );
16478  SCIP_CALL( exitPresolve(scip, TRUE, &infeas) );
16479  assert(!infeas);
16480  }
16481 
16482  /* the presolving must have run into a limit, so we stop here */
16483  if( scip->set->stage < SCIP_STAGE_PRESOLVED )
16484  {
16486  return SCIP_OKAY;
16487  }
16488 
16489  nthreads = INT_MAX;
16490  /* substract the memory already used by the main SCIP and the estimated memory usage of external software */
16491  memorylimit = scip->set->limit_memory;
16492  if( memorylimit < SCIP_MEM_NOLIMIT )
16493  {
16494  memorylimit -= SCIPgetMemUsed(scip)/1048576.0;
16495  memorylimit -= SCIPgetMemExternEstim(scip)/1048576.0;
16496  /* estimate maximum number of copies that be created based on memory limit */
16497  nthreads = MAX(1, memorylimit / (4.0*SCIPgetMemExternEstim(scip)/1048576.0));
16498  SCIPverbMessage(scip, SCIP_VERBLEVEL_FULL, NULL, "estimated a maximum of %lli threads based on memory limit\n", nthreads);
16499  }
16500  nconcsolvertypes = SCIPgetNConcsolverTypes(scip);
16501  concsolvertypes = SCIPgetConcsolverTypes(scip);
16502 
16503  if( minnthreads > nthreads )
16504  {
16505  SCIP_CALL( initSolve(scip, TRUE) );
16506  scip->stat->status = SCIP_STATUS_MEMLIMIT;
16508  SCIPwarningMessage(scip, "requested minimum number of threads could not be satisfied with given memory limit\n");
16510  return SCIP_OKAY;
16511  }
16512 
16513  if( nthreads == 1 )
16514  {
16515  SCIPwarningMessage(scip, "can only use 1 thread, doing sequential solve instead\n");
16516  SCIP_CALL( SCIPfreeConcurrent(scip) );
16517  return SCIPsolve(scip);
16518  }
16519  nthreads = MIN(nthreads, maxnthreads);
16520  SCIPverbMessage(scip, SCIP_VERBLEVEL_FULL, NULL, "using %lli threads for concurrent solve\n", nthreads);
16521 
16522  /* now set up nthreads many concurrent solvers that will be used for the concurrent solve
16523  * using the preferred priorities of each concurrent solver
16524  */
16525  prefpriosum = 0.0;
16526  for( i = 0; i < nconcsolvertypes; ++i )
16527  prefpriosum += SCIPconcsolverTypeGetPrefPrio(concsolvertypes[i]);
16528 
16529  ncandsolvertypes = 0;
16530  SCIP_CALL( SCIPallocBufferArray(scip, &solvertypes, nthreads + nconcsolvertypes) );
16531  SCIP_CALL( SCIPallocBufferArray(scip, &weights, nthreads + nconcsolvertypes) );
16532  SCIP_CALL( SCIPallocBufferArray(scip, &prios, nthreads + nconcsolvertypes) );
16533  for( i = 0; i < nconcsolvertypes; ++i )
16534  {
16535  int j;
16536  SCIP_Real prio;
16537  prio = nthreads * SCIPconcsolverTypeGetPrefPrio(concsolvertypes[i]) / prefpriosum;
16538  while( prio > 0.0 )
16539  {
16540  j = ncandsolvertypes++;
16541  assert(j < 2*nthreads);
16542  weights[j] = 1;
16543  solvertypes[j] = i;
16544  prios[j] = MIN(1.0, prio);
16545  prio = prio - 1.0;
16546  }
16547  }
16548  /* select nthreads many concurrent solver types to create instances
16549  * according to the preferred prioriteis the user has set
16550  * This basically corresponds to a knapsack problem
16551  * with unit weights and capacity nthreads, where the profits are
16552  * the unrounded fraction of the total number of threads to be used.
16553  */
16554  SCIPselectDownRealInt(prios, solvertypes, nthreads, ncandsolvertypes);
16555 
16556  SCIP_CALL( SCIPcreateRandom(scip, &rndgen, scip->set->concurrent_initseed) );
16557  for( i = 0; i < nthreads; ++i )
16558  {
16559  SCIP_CONCSOLVER* concsolver;
16560 
16561  SCIP_CALL( SCIPconcsolverCreateInstance(scip->set, concsolvertypes[solvertypes[i]], &concsolver) );
16562  if( scip->set->concurrent_changeseeds && SCIPgetNConcurrentSolvers(scip) > 1 )
16563  SCIP_CALL( SCIPconcsolverInitSeeds(concsolver, SCIPrandomGetInt(rndgen, 0, INT_MAX)) );
16564  }
16565  SCIPfreeRandom(scip, &rndgen);
16566  SCIPfreeBufferArray(scip, &prios);
16567  SCIPfreeBufferArray(scip, &weights);
16568  SCIPfreeBufferArray(scip, &solvertypes);
16569 
16570  assert(SCIPgetNConcurrentSolvers(scip) == nthreads);
16571 
16572  SCIP_CALL( SCIPsyncstoreInit(scip) );
16573  }
16574 
16575  if( SCIPgetStage(scip) == SCIP_STAGE_PRESOLVED )
16576  {
16577  /* switch stage to solving */
16578  SCIP_CALL( initSolve(scip, TRUE) );
16579  }
16580 
16581  SCIPclockStart(scip->stat->solvingtime, scip->set);
16582  retcode = SCIPconcurrentSolve(scip);
16583  SCIPclockStop(scip->stat->solvingtime, scip->set);
16585 
16586  return retcode;
16587 #endif
16588 }
16589 
16590 /** include specific heuristics and branching rules for reoptimization
16591  *
16592  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16593  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16594  *
16595  * @pre This method can be called if @p scip is in one of the following stages:
16596  * - \ref SCIP_STAGE_PROBLEM
16597  */
16599  SCIP* scip, /**< SCIP data structure */
16600  SCIP_Bool enable /**< enable reoptimization (TRUE) or disable it (FALSE) */
16601  )
16602 {
16603  assert(scip != NULL);
16604 
16605  /* we want to skip if nothing has changed */
16606  if( (enable && scip->set->reopt_enable && scip->reopt != NULL)
16607  || (!enable && !scip->set->reopt_enable && scip->reopt == NULL) )
16608  return SCIP_OKAY;
16609 
16610  /* check stage and throw an error if we try to disable reoptimization during the solving process.
16611  *
16612  * @note the case that we will disable the reoptimization and have already performed presolving can only happen if
16613  * we are try to solve a general MIP
16614  *
16615  * @note this fix is only for the bugfix release 3.2.1, in the next major release reoptimization can be used for
16616  * general MIPs, too.
16617  */
16618  if( scip->set->stage > SCIP_STAGE_PROBLEM && !(!enable && scip->set->stage == SCIP_STAGE_PRESOLVED) )
16619  {
16620  SCIPerrorMessage("reoptimization cannot be %s after starting the (pre)solving process\n", enable ? "enabled" : "disabled");
16621  return SCIP_INVALIDCALL;
16622  }
16623 
16624  /* if the current stage is SCIP_STAGE_PROBLEM we have to include the heuristics and branching rule */
16625  if( scip->set->stage == SCIP_STAGE_PROBLEM || (!enable && scip->set->stage == SCIP_STAGE_PRESOLVED) )
16626  {
16627  /* initialize all reoptimization data structures */
16628  if( enable && scip->reopt == NULL )
16629  {
16630  /* set enable flag */
16631  scip->set->reopt_enable = enable;
16632 
16633  SCIP_CALL( SCIPreoptCreate(&scip->reopt, scip->set, scip->mem->probmem) );
16635  }
16636  /* disable all reoptimization plugins and free the structure if necessary */
16637  else if( (!enable && scip->reopt != NULL) || (!enable && scip->set->reopt_enable && scip->reopt == NULL) )
16638  {
16639  /* set enable flag */
16640  scip->set->reopt_enable = enable;
16641 
16642  if( scip->reopt != NULL )
16643  {
16644  SCIP_CALL( SCIPreoptFree(&(scip->reopt), scip->set, scip->origprimal, scip->mem->probmem) );
16645  assert(scip->reopt == NULL);
16646  }
16648  }
16649  }
16650  else
16651  {
16652  /* set enable flag */
16653  scip->set->reopt_enable = enable;
16654  }
16655 
16656  return SCIP_OKAY;
16657 }
16658 
16659 /** save bound change based on dual information in the reoptimization tree
16660  *
16661  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16662  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16663  *
16664  * @pre This method can be called if @p scip is in one of the following stages:
16665  * - \ref SCIP_STAGE_SOLVING
16666  * - \ref SCIP_STAGE_SOLVED
16667  */
16669  SCIP* scip, /**< SCIP data structure */
16670  SCIP_NODE* node, /**< node of the search tree */
16671  SCIP_VAR* var, /**< variable whose bound changed */
16672  SCIP_Real newbound, /**< new bound of the variable */
16673  SCIP_Real oldbound /**< old bound of the variable */
16674  )
16675 {
16676  SCIP_CALL( checkStage(scip, "SCIPaddReoptDualBndchg", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16677 
16678  assert(SCIPsetIsFeasLT(scip->set, newbound, oldbound) || SCIPsetIsFeasGT(scip->set, newbound, oldbound));
16679 
16680  SCIP_CALL( SCIPreoptAddDualBndchg(scip->reopt, scip->set, scip->mem->probmem, node, var, newbound, oldbound) );
16681 
16682  return SCIP_OKAY;
16683 }
16684 
16685 /** returns the optimal solution of the last iteration or NULL of none exists */
16687  SCIP* scip /**< SCIP data structure */
16688  )
16689 {
16690  SCIP_SOL* sol;
16691 
16692  assert(scip != NULL);
16693 
16694  sol = NULL;
16695 
16696  if( scip->set->reopt_enable && scip->stat->nreoptruns > 1 )
16697  {
16698  sol = SCIPreoptGetLastBestSol(scip->reopt);
16699  }
16700 
16701  return sol;
16702 }
16703 
16704 /** returns the objective coefficent of a given variable in a previous iteration
16705  *
16706  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16707  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16708  *
16709  * @pre This method can be called if @p scip is in one of the following stages:
16710  * - \ref SCIP_STAGE_PRESOLVING
16711  * - \ref SCIP_STAGE_SOLVING
16712  */
16714  SCIP* scip, /**< SCIP data structure */
16715  SCIP_VAR* var, /**< variable */
16716  int run, /**< number of the run */
16717  SCIP_Real* objcoef /**< pointer to store the objective coefficient */
16718  )
16719 {
16720  assert(scip != NULL);
16721  assert(var != NULL);
16722  assert(0 < run && run <= scip->stat->nreoptruns);
16723 
16724  SCIP_CALL( checkStage(scip, "SCIPgetReoptOldObjCoef", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
16725 
16726  if( SCIPvarIsOriginal(var) )
16727  *objcoef = SCIPreoptGetOldObjCoef(scip->reopt, run, SCIPvarGetIndex(var));
16728  else
16729  {
16730  SCIP_VAR* origvar;
16731  SCIP_Real constant;
16732  SCIP_Real scalar;
16733 
16734  assert(SCIPvarIsActive(var));
16735 
16736  origvar = var;
16737  constant = 0.0;
16738  scalar = 1.0;
16739 
16740  SCIP_CALL( SCIPvarGetOrigvarSum(&origvar, &scalar, &constant) );
16741  assert(origvar != NULL);
16742  assert(SCIPvarIsOriginal(origvar));
16743 
16744  *objcoef = SCIPreoptGetOldObjCoef(scip->reopt, run, SCIPvarGetIndex(origvar));
16745  }
16746  return SCIP_OKAY;
16747 }
16748 
16749 /** return the ids of child nodes stored in the reoptimization tree
16750  *
16751  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16752  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16753  *
16754  * @pre This method can be called if @p scip is in one of the following stages:
16755  * - \ref SCIP_STAGE_PRESOLVED
16756  * - \ref SCIP_STAGE_SOLVING
16757  * - \ref SCIP_STAGE_SOLVED
16758  */
16760  SCIP* scip, /**< SCIP data structure */
16761  SCIP_NODE* node, /**< node of the search tree */
16762  unsigned int* ids, /**< array of ids */
16763  int idssize, /**< allocated memory */
16764  int* nids /**< number of child nodes */
16765  )
16766 {
16767  assert(scip != NULL);
16768 
16769  SCIP_CALL( checkStage(scip, "SCIPgetReoptChildIDs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16770 
16771  (*nids) = 0;
16772 
16773  if( !scip->set->reopt_enable )
16774  return SCIP_OKAY;
16775 
16776  SCIP_CALL( SCIPreoptGetChildIDs(scip->reopt, scip->set, scip->mem->probmem, node, ids, idssize, nids) );
16777 
16778  return SCIP_OKAY;
16779 }
16780 
16781 /** return the ids of all leave nodes store in the reoptimization tree induced by the given node
16782  *
16783  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16784  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16785  *
16786  * @pre This method can be called if @p scip is in one of the following stages:
16787  * - \ref SCIP_STAGE_PRESOLVED
16788  * - \ref SCIP_STAGE_SOLVING
16789  * - \ref SCIP_STAGE_SOLVED
16790  */
16792  SCIP* scip, /**< SCIP data structure */
16793  SCIP_NODE* node, /**< node of the search tree */
16794  unsigned int* ids, /**< array of ids */
16795  int idssize, /**< size of ids array */
16796  int* nids /**< number of child nodes */
16797  )
16798 {
16799  assert(scip != NULL);
16800 
16801  SCIP_CALL( checkStage(scip, "SCIPgetReoptLeaveIDs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16802 
16803  (*nids) = 0;
16804 
16805  if( idssize == 0 || !scip->set->reopt_enable )
16806  return SCIP_OKAY;
16807 
16808  SCIP_CALL( SCIPreoptGetLeaves(scip->reopt, node, ids, idssize, nids) );
16809 
16810  return SCIP_OKAY;
16811 }
16812 
16813 /** returns the number of nodes in the reoptimization tree induced by @p node; if @p node == NULL the method
16814  * returns the number of nodes of the whole reoptimization tree.
16815  */
16817  SCIP* scip, /**< SCIP data structure */
16818  SCIP_NODE* node /**< node of the search tree */
16819  )
16820 {
16821  assert(scip != NULL);
16822  assert(scip->set->reopt_enable);
16823  assert(scip->reopt != NULL);
16824 
16825  return SCIPreoptGetNNodes(scip->reopt, node);
16826 }
16827 
16828 /** returns the number of leaf nodes of the subtree induced by @p node; if @p node == NULL, the method
16829  * returns the number of leaf nodes of the whole reoptimization tree.
16830  */
16832  SCIP* scip, /**< SCIP data structure */
16833  SCIP_NODE* node /**< node of the search tree */
16834  )
16835 {
16836  assert(scip != NULL);
16837  assert(scip->set->reopt_enable);
16838  assert(scip->reopt != NULL);
16839 
16840  return SCIPreoptGetNLeaves(scip->reopt, node);
16841 }
16842 
16843 /** gets the node of the reoptimization tree corresponding to the unique @p id */
16845  SCIP* scip, /**< SCIP data structure */
16846  unsigned int id /**< unique id */
16847  )
16848 {
16849  assert(scip != NULL);
16850  assert(scip->set->reopt_enable);
16851  assert(scip->reopt != NULL);
16852 
16853  return SCIPreoptGetReoptnode(scip->reopt, id);
16854 }
16855 
16856 /** add a variable bound change to a given reoptnode
16857  *
16858  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16859  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16860  *
16861  * @pre This method can be called if @p scip is in one of the following stages:
16862  * - \ref SCIP_STAGE_PRESOLVED
16863  * - \ref SCIP_STAGE_SOLVING
16864  * - \ref SCIP_STAGE_SOLVED
16865  */
16867  SCIP* scip, /**< SCIP data structure */
16868  SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
16869  SCIP_VAR* var, /**< variable pointer */
16870  SCIP_Real bound, /**< variable bound to add */
16871  SCIP_BOUNDTYPE boundtype /**< bound type of the variable value */
16872  )
16873 {
16874  assert(scip != NULL);
16875  assert(reoptnode != NULL);
16876  assert(scip->set->reopt_enable);
16877  assert(scip->reopt != NULL);
16878 
16879  SCIP_CALL( checkStage(scip, "SCIPaddReoptnodeBndchg", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16880 
16881  SCIP_CALL( SCIPreoptnodeAddBndchg(reoptnode, scip->set, scip->mem->probmem, var, bound, boundtype) );
16882 
16883  return SCIP_OKAY;
16884 }
16885 
16886 /** set the @p representation as the new search frontier
16887  *
16888  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16889  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16890  *
16891  * @pre This method can be called if @p scip is in one of the following stages:
16892  * - \ref SCIP_STAGE_PRESOLVED
16893  */
16895  SCIP* scip, /**< SCIP data structure */
16896  SCIP_REOPTNODE** representation, /**< array of representatives */
16897  int nrepresentatives, /**< number of representatives */
16898  SCIP_Bool* success /**< pointer to store the result */
16899  )
16900 {
16901  assert(scip != NULL);
16902  assert(representation != NULL);
16903  assert(nrepresentatives > 0);
16904  assert(scip->set->reopt_enable);
16905  assert(scip->reopt != NULL);
16906 
16907  SCIP_CALL( checkStage(scip, "SCIPsetReoptCompression", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
16908 
16909  SCIP_CALL( SCIPreoptApplyCompression(scip->reopt, scip->set, scip->mem->probmem, representation, nrepresentatives, success) );
16910 
16911  return SCIP_OKAY;
16912 }
16913 
16914 /** add stored constraint to a reoptimization node
16915  *
16916  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16917  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16918  *
16919  * @pre This method can be called if @p scip is in one of the following stages:
16920  * - \ref SCIP_STAGE_PRESOLVED
16921  */
16923  SCIP* scip, /**< SCIP data structure */
16924  SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
16925  SCIP_VAR** vars, /**< array of variables */
16926  SCIP_Real* vals, /**< array of variable bounds */
16927  SCIP_BOUNDTYPE* boundtypes, /**< array of variable boundtypes */
16928  SCIP_Real lhs, /**< lhs of the constraint */
16929  SCIP_Real rhs, /**< rhs of the constraint */
16930  int nvars, /**< number of variables */
16931  REOPT_CONSTYPE constype, /**< type of the constraint */
16932  SCIP_Bool linear /**< the given constraint has a linear representation */
16933  )
16934 {
16935  assert(scip != NULL);
16936  assert(reoptnode != NULL);
16937  assert(vars != NULL);
16938  assert(vals != NULL);
16939  assert(nvars >= 0);
16940 
16941  SCIP_CALL( checkStage(scip, "SCIPaddReoptnodeCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
16942 
16943  SCIP_CALL( SCIPreoptnodeAddCons(reoptnode, scip->set, scip->mem->probmem, vars, vals, boundtypes, lhs, rhs, nvars,
16944  constype, linear) );
16945 
16946  return SCIP_OKAY;
16947 }
16948 
16949 /** return the branching path stored in the reoptree at ID id */
16951  SCIP* scip, /**< SCIP data structure */
16952  SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
16953  SCIP_VAR** vars, /**< array of variables */
16954  SCIP_Real* vals, /**< array of variable bounds */
16955  SCIP_BOUNDTYPE* boundtypes, /**< array of bound types */
16956  int mem, /**< allocated memory */
16957  int* nvars, /**< number of variables */
16958  int* nafterdualvars /**< number of variables directly after the first based on dual information */
16959  )
16960 {
16961  assert(scip != NULL);
16962  assert(vars != NULL);
16963  assert(vals != NULL);
16964  assert(boundtypes != NULL);
16965  assert(scip->set->reopt_enable);
16966  assert(scip->reopt != NULL);
16967 
16968  SCIPreoptnodeGetPath(scip->reopt, reoptnode, vars, vals, boundtypes, mem, nvars, nafterdualvars);
16969 }
16970 
16971 /** initialize a set of empty reoptimization nodes
16972  *
16973  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16974  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16975  *
16976  * @pre This method can be called if @p scip is in one of the following stages:
16977  * - \ref SCIP_STAGE_PRESOLVED
16978  */
16980  SCIP* scip, /**< SCIP data structure */
16981  SCIP_REOPTNODE** representatives, /**< array of representatives */
16982  int nrepresentatives /**< number of representatives */
16983  )
16984 {
16985  int r;
16986 
16987  assert(scip != NULL);
16988  assert(representatives != NULL);
16989 
16990  SCIP_CALL( checkStage(scip, "SCIPinitRepresentation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
16991 
16992  for( r = 0; r < nrepresentatives; r++ )
16993  {
16994  SCIP_CALL( SCIPallocBlockMemory(scip, &representatives[r]) ); /*lint !e866*/
16995  SCIPreoptnodeInit(representatives[r], scip->set);
16996  }
16997 
16998  return SCIP_OKAY;
16999 }
17000 
17001 /** reset a set of initialized reoptimization nodes
17002  *
17003  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17004  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17005  *
17006  * @pre This method can be called if @p scip is in one of the following stages:
17007  * - \ref SCIP_STAGE_PRESOLVED
17008  */
17010  SCIP* scip, /**< SCIP data structure */
17011  SCIP_REOPTNODE** representatives, /**< array of representatives */
17012  int nrepresentatives /**< number of representatives */
17013  )
17014 {
17015  int r;
17016 
17017  assert(scip != NULL);
17018  assert(representatives != NULL);
17019 
17020  SCIP_CALL( checkStage(scip, "SCIPresetRepresentation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
17021 
17022  for( r = 0; r < nrepresentatives; r++ )
17023  {
17024  SCIP_CALL( SCIPreoptnodeReset(scip->reopt, scip->set, scip->mem->probmem, representatives[r]) );
17025  }
17026 
17027  return SCIP_OKAY;
17028 }
17029 
17030 /** free a set of initialized reoptimization nodes
17031  *
17032  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17033  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17034  *
17035  * @pre This method can be called if @p scip is in one of the following stages:
17036  * - \ref SCIP_STAGE_PRESOLVED
17037  */
17039  SCIP* scip, /**< SCIP data structure */
17040  SCIP_REOPTNODE** representatives, /**< array of representatives */
17041  int nrepresentatives /**< number of representatives */
17042  )
17043 {
17044  int r;
17045 
17046  assert(scip != NULL);
17047  assert(representatives != NULL);
17048 
17049  SCIP_CALL( checkStage(scip, "SCIPfreeRepresentation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
17050 
17051  for( r = 0; r < nrepresentatives; r++ )
17052  {
17053  if( representatives[r] != NULL )
17054  {
17055  SCIP_CALL( SCIPreoptnodeDelete(&representatives[r], scip->mem->probmem) );
17056  assert(representatives[r] == NULL);
17057  }
17058  }
17059 
17060  return SCIP_OKAY;
17061 }
17062 
17063 /** reactivate the given @p reoptnode and split them into several nodes if necessary
17064  *
17065  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17066  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17067  *
17068  * @pre This method can be called if @p scip is in one of the following stages:
17069  * - \ref SCIP_STAGE_SOLVING
17070  * - \ref SCIP_STAGE_SOLVED
17071  */
17073  SCIP* scip, /**< SCIP data structure */
17074  SCIP_REOPTNODE* reoptnode, /**< node to reactivate */
17075  unsigned int id, /**< unique id of the reoptimization node */
17076  SCIP_Real estimate, /**< estimate of the child nodes that should be created */
17077  SCIP_NODE** childnodes, /**< array to store the created child nodes */
17078  int* ncreatedchilds, /**< pointer to store number of created child nodes */
17079  int* naddedconss, /**< pointer to store number of generated constraints */
17080  int childnodessize, /**< available size of childnodes array */
17081  SCIP_Bool* success /**< pointer store the result*/
17082  )
17083 {
17084  assert(scip != NULL);
17085  assert(reoptnode != NULL);
17086 
17087  SCIP_CALL( checkStage(scip, "SCIPapplyReopt", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
17088 
17089  SCIP_CALL( SCIPreoptApply(scip->reopt, scip, scip->set, scip->stat, scip->transprob, scip->origprob, scip->tree,
17090  scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, scip->mem->probmem, reoptnode, id, estimate,
17091  childnodes, ncreatedchilds, naddedconss, childnodessize, success) );
17092 
17093  return SCIP_OKAY;
17094 }
17095 
17096 /** frees branch and bound tree and all solution process data; statistics, presolving data and transformed problem is
17097  * preserved
17098  *
17099  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17100  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17101  *
17102  * @pre This method can be called if @p scip is in one of the following stages:
17103  * - \ref SCIP_STAGE_INIT
17104  * - \ref SCIP_STAGE_PROBLEM
17105  * - \ref SCIP_STAGE_TRANSFORMED
17106  * - \ref SCIP_STAGE_PRESOLVING
17107  * - \ref SCIP_STAGE_PRESOLVED
17108  * - \ref SCIP_STAGE_SOLVING
17109  * - \ref SCIP_STAGE_SOLVED
17110  *
17111  * @post If this method is called in \SCIP stage \ref SCIP_STAGE_INIT or \ref SCIP_STAGE_PROBLEM, the stage of
17112  * \SCIP is not changed; otherwise, the \SCIP stage is changed to \ref SCIP_STAGE_TRANSFORMED
17113  *
17114  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
17115  */
17117  SCIP* scip, /**< SCIP data structure */
17118  SCIP_Bool restart /**< should certain data be preserved for improved restarting? */
17119  )
17120 {
17121  SCIP_CALL( checkStage(scip, "SCIPfreeSolve", TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
17122 
17123  switch( scip->set->stage )
17124  {
17125  case SCIP_STAGE_INIT:
17127  case SCIP_STAGE_PROBLEM:
17128  return SCIP_OKAY;
17129 
17130  case SCIP_STAGE_PRESOLVING:
17131  {
17132  SCIP_Bool infeasible;
17133 
17134  assert(scip->stat->status != SCIP_STATUS_INFEASIBLE);
17135  assert(scip->stat->status != SCIP_STATUS_INFORUNBD);
17136  assert(scip->stat->status != SCIP_STATUS_UNBOUNDED);
17137  assert(scip->stat->status != SCIP_STATUS_OPTIMAL);
17138 
17139  /* exit presolving */
17140  SCIP_CALL( exitPresolve(scip, FALSE, &infeasible) );
17141  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
17142  }
17143 
17144  /*lint -fallthrough*/
17145  case SCIP_STAGE_PRESOLVED:
17146  /* switch stage to TRANSFORMED */
17147  scip->set->stage = SCIP_STAGE_TRANSFORMED;
17148  return SCIP_OKAY;
17149 
17150  case SCIP_STAGE_SOLVING:
17151  case SCIP_STAGE_SOLVED:
17152  /* free solution process data structures */
17153  SCIP_CALL( freeSolve(scip, restart) );
17154  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
17155  return SCIP_OKAY;
17156 
17157  default:
17158  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
17159  return SCIP_INVALIDCALL;
17160  } /*lint !e788*/
17161 }
17162 
17163 /** frees branch and bound tree and all solution process data; statistics, presolving data and transformed problem is
17164  * preserved
17165  *
17166  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17167  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17168  *
17169  * @pre This method can be called if @p scip is in one of the following stages:
17170  * - \ref SCIP_STAGE_INIT
17171  * - \ref SCIP_STAGE_PROBLEM
17172  * - \ref SCIP_STAGE_TRANSFORMED
17173  * - \ref SCIP_STAGE_PRESOLVING
17174  * - \ref SCIP_STAGE_PRESOLVED
17175  * - \ref SCIP_STAGE_SOLVING
17176  * - \ref SCIP_STAGE_SOLVED
17177  *
17178  * @post If this method is called in \SCIP stage \ref SCIP_STAGE_INIT, \ref SCIP_STAGE_TRANSFORMED or \ref SCIP_STAGE_PROBLEM,
17179  * the stage of \SCIP is not changed; otherwise, the \SCIP stage is changed to \ref SCIP_STAGE_PRESOLVED.
17180  *
17181  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
17182  */
17184  SCIP* scip /**< SCIP data structure */
17185  )
17186 {
17187  SCIP_CALL( checkStage(scip, "SCIPfreeReoptSolve", TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
17188 
17189  switch( scip->set->stage )
17190  {
17191  case SCIP_STAGE_INIT:
17193  case SCIP_STAGE_PRESOLVED:
17194  case SCIP_STAGE_PROBLEM:
17195  return SCIP_OKAY;
17196 
17197  case SCIP_STAGE_PRESOLVING:
17198  {
17199  SCIP_Bool infeasible;
17200 
17201  assert(scip->stat->status != SCIP_STATUS_INFEASIBLE);
17202  assert(scip->stat->status != SCIP_STATUS_INFORUNBD);
17203  assert(scip->stat->status != SCIP_STATUS_UNBOUNDED);
17204  assert(scip->stat->status != SCIP_STATUS_OPTIMAL);
17205 
17206  /* exit presolving */
17207  SCIP_CALL( exitPresolve(scip, FALSE, &infeasible) );
17208  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
17209 
17210  return SCIP_OKAY;
17211  }
17212 
17213  case SCIP_STAGE_SOLVING:
17214  case SCIP_STAGE_SOLVED:
17215  /* free solution process data structures */
17216  SCIP_CALL( freeReoptSolve(scip) );
17217  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
17218  return SCIP_OKAY;
17219 
17220  default:
17221  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
17222  return SCIP_INVALIDCALL;
17223  } /*lint !e788*/
17224 }
17225 
17226 /** frees all solution process data including presolving and transformed problem, only original problem is kept
17227  *
17228  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17229  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17230  *
17231  * @pre This method can be called if @p scip is in one of the following stages:
17232  * - \ref SCIP_STAGE_INIT
17233  * - \ref SCIP_STAGE_PROBLEM
17234  * - \ref SCIP_STAGE_TRANSFORMED
17235  * - \ref SCIP_STAGE_PRESOLVING
17236  * - \ref SCIP_STAGE_PRESOLVED
17237  * - \ref SCIP_STAGE_SOLVING
17238  * - \ref SCIP_STAGE_SOLVED
17239  *
17240  * @post After calling this method \SCIP reaches one of the following stages:
17241  * - \ref SCIP_STAGE_INIT if the method was called from \SCIP stage \ref SCIP_STAGE_INIT
17242  * - \ref SCIP_STAGE_PROBLEM if the method was called from any other of the allowed stages
17243  *
17244  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
17245  */
17247  SCIP* scip /**< SCIP data structure */
17248  )
17249 {
17250  SCIP_CALL( checkStage(scip, "SCIPfreeTransform", TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
17251 
17252  switch( scip->set->stage )
17253  {
17254  case SCIP_STAGE_INIT:
17255  case SCIP_STAGE_PROBLEM:
17256  return SCIP_OKAY;
17257 
17258  case SCIP_STAGE_PRESOLVING:
17259  {
17260  SCIP_Bool infeasible;
17261 
17262  assert(scip->stat->status != SCIP_STATUS_INFEASIBLE);
17263  assert(scip->stat->status != SCIP_STATUS_INFORUNBD);
17264  assert(scip->stat->status != SCIP_STATUS_UNBOUNDED);
17265  assert(scip->stat->status != SCIP_STATUS_OPTIMAL);
17266 
17267  /* exit presolving */
17268  SCIP_CALL( exitPresolve(scip, FALSE, &infeasible) );
17269  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
17270  }
17271 
17272  /*lint -fallthrough*/
17273  case SCIP_STAGE_PRESOLVED:
17274  case SCIP_STAGE_SOLVING:
17275  case SCIP_STAGE_SOLVED:
17276  /* the solve was already freed, we directly go to freeTransform() */
17277  if( !scip->set->reopt_enable || scip->set->stage != SCIP_STAGE_PRESOLVED )
17278  {
17279  /* free solution process data */
17280  SCIP_CALL( SCIPfreeSolve(scip, FALSE) );
17281  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
17282  }
17283  /*lint -fallthrough*/
17284 
17286  /* free transformed problem data structures */
17287  SCIP_CALL( freeTransform(scip) );
17288  assert(scip->set->stage == SCIP_STAGE_PROBLEM);
17289  return SCIP_OKAY;
17290 
17291  default:
17292  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
17293  return SCIP_INVALIDCALL;
17294  } /*lint !e788*/
17295 }
17296 
17297 /** informs \SCIP that the solving process should be interrupted as soon as possible (e.g., after the current node has
17298  * been solved)
17299  *
17300  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17301  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17302  *
17303  * @pre This method can be called if @p scip is in one of the following stages:
17304  * - \ref SCIP_STAGE_PROBLEM
17305  * - \ref SCIP_STAGE_TRANSFORMING
17306  * - \ref SCIP_STAGE_TRANSFORMED
17307  * - \ref SCIP_STAGE_INITPRESOLVE
17308  * - \ref SCIP_STAGE_PRESOLVING
17309  * - \ref SCIP_STAGE_EXITPRESOLVE
17310  * - \ref SCIP_STAGE_PRESOLVED
17311  * - \ref SCIP_STAGE_SOLVING
17312  * - \ref SCIP_STAGE_SOLVED
17313  * - \ref SCIP_STAGE_EXITSOLVE
17314  * - \ref SCIP_STAGE_FREETRANS
17315  *
17316  * @note the \SCIP stage does not get changed
17317  */
17319  SCIP* scip /**< SCIP data structure */
17320  )
17321 {
17322  SCIP_CALL( checkStage(scip, "SCIPinterruptSolve", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17323 
17324  /* set the userinterrupt flag */
17325  scip->stat->userinterrupt = TRUE;
17326 
17327  return SCIP_OKAY;
17328 }
17329 
17330 /** informs SCIP that the solving process should be restarted as soon as possible (e.g., after the current node has
17331  * been solved)
17332  *
17333  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17334  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17335  *
17336  * @pre This method can be called if @p scip is in one of the following stages:
17337  * - \ref SCIP_STAGE_INITPRESOLVE
17338  * - \ref SCIP_STAGE_PRESOLVING
17339  * - \ref SCIP_STAGE_EXITPRESOLVE
17340  * - \ref SCIP_STAGE_SOLVING
17341  *
17342  * @note the \SCIP stage does not get changed
17343  */
17345  SCIP* scip /**< SCIP data structure */
17346  )
17347 {
17348  SCIP_CALL( checkStage(scip, "SCIPrestartSolve", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17349 
17350  /* set the userrestart flag */
17351  scip->stat->userrestart = TRUE;
17352 
17353  return SCIP_OKAY;
17354 }
17355 
17356 /** returns whether reoptimization is enabled or not */
17358  SCIP* scip /**< SCIP data structure */
17359  )
17360 {
17361  assert(scip != NULL);
17362 
17363  return scip->set->reopt_enable;
17364 }
17365 
17366 /** returns the stored solutions corresponding to a given run */
17368  SCIP* scip, /**< SCIP data structure */
17369  int run, /**< number of the run */
17370  SCIP_SOL** sols, /**< array to store solutions */
17371  int solssize, /**< size of the array */
17372  int* nsols /**< pointer to store number of solutions */
17373  )
17374 {
17375  assert(scip != NULL);
17376  assert(sols != NULL);
17377  assert(solssize > 0);
17378 
17379  if( scip->set->reopt_enable )
17380  {
17381  assert(run > 0 && run <= scip->stat->nreoptruns);
17382  SCIP_CALL( SCIPreoptGetSolsRun(scip->reopt, run, sols, solssize, nsols) );
17383  }
17384  else
17385  {
17386  *nsols = 0;
17387  }
17388 
17389  return SCIP_OKAY;
17390 }
17391 
17392 /** mark all stored solutions as not updated */
17394  SCIP* scip /**< SCIP data structure */
17395  )
17396 {
17397  assert(scip != NULL);
17398  assert(scip->set->reopt_enable);
17399  assert(scip->reopt != NULL);
17400 
17401  if( scip->set->reopt_enable )
17402  {
17403  assert(scip->reopt != NULL);
17405  }
17406 }
17407 
17408 /** check if the reoptimization process should be restarted
17409  *
17410  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17411  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17412  *
17413  * @pre This method can be called if @p scip is in one of the following stages:
17414  * - \ref SCIP_STAGE_TRANSFORMED
17415  * - \ref SCIP_STAGE_SOLVING
17416  */
17418  SCIP* scip, /**< SCIP data structure */
17419  SCIP_NODE* node, /**< current node of the branch and bound tree (or NULL) */
17420  SCIP_Bool* restart /**< pointer to store of the reoptimitation process should be restarted */
17421  )
17422 {
17423  assert(scip != NULL);
17424  assert(scip->set->reopt_enable);
17425  assert(scip->reopt != NULL);
17426 
17427  SCIP_CALL( checkStage(scip, "SCIPcheckReoptRestart", FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17428 
17429  SCIP_CALL( SCIPreoptCheckRestart(scip->reopt, scip->set, scip->mem->probmem, node, scip->transprob->vars,
17430  scip->transprob->nvars, restart) );
17431 
17432  return SCIP_OKAY;
17433 }
17434 
17435 /** return the similarity between two objective functions */
17437  SCIP* scip, /**< SCIP data structure */
17438  int run1, /**< number of run */
17439  int run2 /**< number of run */
17440  )
17441 {
17442  assert(scip != NULL);
17443  assert(run1 > 0 && run1 <= scip->stat->nreoptruns);
17444  assert(run2 > 0 && run2 <= scip->stat->nreoptruns);
17445 
17446  if( (run1 == scip->stat->nreoptruns && run2 == run1-1) || (run2 == scip->stat->nreoptruns && run1 == run2-1) )
17447  return SCIPreoptGetSimToPrevious(scip->reopt);
17448  else
17449  return SCIPreoptGetSimilarity(scip->reopt, scip->set, run1, run2, scip->origprob->vars, scip->origprob->nvars);
17450 }
17451 
17452 /** returns if a node should be reoptimized */
17454  SCIP* scip, /**< SCIP data structure */
17455  SCIP_NODE* node /**< node of the search tree */
17456  )
17457 {
17458  assert(scip != NULL);
17459  assert(node != NULL);
17460 
17461  if( scip->set->reopt_enable )
17462  {
17463  SCIP_REOPTNODE* reoptnode;
17464  unsigned int id;
17465 
17466  assert(scip->reopt != NULL);
17467 
17468  id = SCIPnodeGetReoptID(node);
17469 
17470  if( id == 0 && node != SCIPgetRootNode(scip) )
17471  return FALSE;
17472  else
17473  {
17474  reoptnode = SCIPgetReoptnode(scip, id);
17475  assert(reoptnode != NULL);
17476 
17477  return SCIPreoptnodeGetNChildren(reoptnode) > 0;
17478  }
17479  }
17480  else
17481  return FALSE;
17482 }
17483 
17484 /** deletes the given reoptimization node
17485  *
17486  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17487  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17488  *
17489  * @pre This method can be called if @p scip is in one of the following stages:
17490  * - \ref SCIP_STAGE_TRANSFORMED
17491  * - \ref SCIP_STAGE_SOLVING
17492  */
17494  SCIP* scip, /**< SCIP data structure */
17495  SCIP_REOPTNODE** reoptnode /**< node of the reoptimization tree */
17496  )
17497 {
17498  assert(scip != NULL);
17499  assert(scip->set->reopt_enable);
17500  assert(scip->reopt != NULL);
17501  assert((*reoptnode) != NULL);
17502 
17503  SCIP_CALL( checkStage(scip, "SCIPdeleteReoptnode", FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17504 
17505  SCIP_CALL( SCIPreoptnodeDelete(reoptnode, scip->mem->probmem) );
17506 
17507  return SCIP_OKAY;
17508 }
17509 
17510 /** splits the root into several nodes and moves the child nodes of the root to one of the created nodes
17511  *
17512  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17513  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17514  *
17515  * @pre This method can be called if @p scip is in one of the following stages:
17516  * - \ref SCIP_STAGE_SOLVING
17517  */
17519  SCIP* scip, /**< SCIP data structure */
17520  int* ncreatedchilds, /**< pointer to store the number of created nodes */
17521  int* naddedconss /**< pointer to store the number added constraints */
17522  )
17523 {
17524  assert(scip != NULL);
17525  assert(scip->set->reopt_enable);
17526  assert(scip->reopt != NULL);
17527 
17528  SCIP_CALL( checkStage(scip, "SCIPsplitReoptRoot", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17529 
17530  SCIP_CALL( SCIPreoptSplitRoot(scip->reopt, scip->tree, scip->set, scip->stat, scip->mem->probmem, ncreatedchilds,
17531  naddedconss) );
17532 
17533  return SCIP_OKAY;
17534 }
17535 
17536 /** remove the stored information about bound changes based in dual information
17537  *
17538  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17539  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17540  *
17541  * @pre This method can be called if @p scip is in one of the following stages:
17542  * - \ref SCIP_STAGE_SOLVING
17543  * - \ref SCIP_STAGE_SOLVED
17544  */
17546  SCIP* scip, /**< SCIP data structure */
17547  SCIP_NODE* node /**< node of the search tree */
17548  )
17549 {
17550  assert(scip != NULL);
17551  assert(scip->set->reopt_enable);
17552  assert(node != NULL);
17553 
17554  SCIP_CALL( checkStage(scip, "SCIPresetReoptnodeDualcons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
17555 
17556  SCIP_CALL( SCIPreoptResetDualBndchgs(scip->reopt, node, scip->mem->probmem) );
17557 
17558  return SCIP_OKAY;
17559 }
17560 
17561 /** returns whether we are in the restarting phase
17562  *
17563  * @return TRUE, if we are in the restarting phase; FALSE, otherwise
17564  *
17565  * @pre This method can be called if @p scip is in one of the following stages:
17566  * - \ref SCIP_STAGE_INITPRESOLVE
17567  * - \ref SCIP_STAGE_PRESOLVING
17568  * - \ref SCIP_STAGE_EXITPRESOLVE
17569  * - \ref SCIP_STAGE_PRESOLVED
17570  * - \ref SCIP_STAGE_INITSOLVE
17571  * - \ref SCIP_STAGE_SOLVING
17572  * - \ref SCIP_STAGE_SOLVED
17573  * - \ref SCIP_STAGE_EXITSOLVE
17574  * - \ref SCIP_STAGE_FREETRANS
17575  */
17577  SCIP* scip /**< SCIP data structure */
17578  )
17579 {
17580  SCIP_CALL_ABORT( checkStage(scip, "SCIPisInRestart", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17581 
17582  /* return the restart status */
17583  return scip->stat->inrestart;
17584 }
17585 
17586 
17587 /*
17588  * variable methods
17589  */
17590 
17591 /** creates and captures problem variable; if variable is of integral type, fractional bounds are automatically rounded;
17592  * an integer variable with bounds zero and one is automatically converted into a binary variable;
17593  *
17594  * @warning When doing column generation and the original problem is a maximization problem, notice that SCIP will
17595  * transform the problem into a minimization problem by multiplying the objective function by -1. Thus, the
17596  * original objective function value of variables created during the solving process has to be multiplied by
17597  * -1, too.
17598  *
17599  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17600  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17601  *
17602  * @pre This method can be called if @p scip is in one of the following stages:
17603  * - \ref SCIP_STAGE_PROBLEM
17604  * - \ref SCIP_STAGE_TRANSFORMING
17605  * - \ref SCIP_STAGE_INITPRESOLVE
17606  * - \ref SCIP_STAGE_PRESOLVING
17607  * - \ref SCIP_STAGE_EXITPRESOLVE
17608  * - \ref SCIP_STAGE_PRESOLVED
17609  * - \ref SCIP_STAGE_SOLVING
17610  *
17611  * @note the variable gets captured, hence at one point you have to release it using the method SCIPreleaseVar()
17612  */
17614  SCIP* scip, /**< SCIP data structure */
17615  SCIP_VAR** var, /**< pointer to variable object */
17616  const char* name, /**< name of variable, or NULL for automatic name creation */
17617  SCIP_Real lb, /**< lower bound of variable */
17618  SCIP_Real ub, /**< upper bound of variable */
17619  SCIP_Real obj, /**< objective function value */
17620  SCIP_VARTYPE vartype, /**< type of variable */
17621  SCIP_Bool initial, /**< should var's column be present in the initial root LP? */
17622  SCIP_Bool removable, /**< is var's column removable from the LP (due to aging or cleanup)? */
17623  SCIP_DECL_VARDELORIG ((*vardelorig)), /**< frees user data of original variable, or NULL */
17624  SCIP_DECL_VARTRANS ((*vartrans)), /**< creates transformed user data by transforming original user data, or NULL */
17625  SCIP_DECL_VARDELTRANS ((*vardeltrans)), /**< frees user data of transformed variable, or NULL */
17626  SCIP_DECL_VARCOPY ((*varcopy)), /**< copies variable data if wanted to subscip, or NULL */
17627  SCIP_VARDATA* vardata /**< user data for this specific variable */
17628  )
17629 {
17630  assert(var != NULL);
17631  assert(lb <= ub);
17632 
17633  SCIP_CALL( checkStage(scip, "SCIPcreateVar", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17634 
17635  /* forbid infinite objective function values */
17636  if( SCIPisInfinity(scip, REALABS(obj)) )
17637  {
17638  SCIPerrorMessage("invalid objective function value: value is infinite\n");
17639  return SCIP_INVALIDDATA;
17640  }
17641 
17642  switch( scip->set->stage )
17643  {
17644  case SCIP_STAGE_PROBLEM:
17645  SCIP_CALL( SCIPvarCreateOriginal(var, scip->mem->probmem, scip->set, scip->stat,
17646  name, lb, ub, obj, vartype, initial, removable, vardelorig, vartrans, vardeltrans, varcopy, vardata) );
17647  break;
17648 
17651  case SCIP_STAGE_PRESOLVING:
17653  case SCIP_STAGE_PRESOLVED:
17654  case SCIP_STAGE_SOLVING:
17655  SCIP_CALL( SCIPvarCreateTransformed(var, scip->mem->probmem, scip->set, scip->stat,
17656  name, lb, ub, obj, vartype, initial, removable, vardelorig, vartrans, vardeltrans, varcopy, vardata) );
17657  break;
17658 
17659  default:
17660  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
17661  return SCIP_INVALIDCALL;
17662  } /*lint !e788*/
17663 
17664  return SCIP_OKAY;
17665 }
17666 
17667 /** creates and captures problem variable with optional callbacks and variable data set to NULL, which can be set
17668  * afterwards using SCIPvarSetDelorigData(), SCIPvarSetTransData(),
17669  * SCIPvarSetDeltransData(), SCIPvarSetCopy(), and SCIPvarSetData(); sets variable flags initial=TRUE
17670  * and removable = FALSE, which can be adjusted by using SCIPvarSetInitial() and SCIPvarSetRemovable(), resp.;
17671  * if variable is of integral type, fractional bounds are automatically rounded;
17672  * an integer variable with bounds zero and one is automatically converted into a binary variable;
17673  *
17674  * @warning When doing column generation and the original problem is a maximization problem, notice that SCIP will
17675  * transform the problem into a minimization problem by multiplying the objective function by -1. Thus, the
17676  * original objective function value of variables created during the solving process has to be multiplied by
17677  * -1, too.
17678  *
17679  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17680  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17681  *
17682  * @pre This method can be called if @p scip is in one of the following stages:
17683  * - \ref SCIP_STAGE_PROBLEM
17684  * - \ref SCIP_STAGE_TRANSFORMING
17685  * - \ref SCIP_STAGE_INITPRESOLVE
17686  * - \ref SCIP_STAGE_PRESOLVING
17687  * - \ref SCIP_STAGE_EXITPRESOLVE
17688  * - \ref SCIP_STAGE_PRESOLVED
17689  * - \ref SCIP_STAGE_SOLVING
17690  *
17691  * @note the variable gets captured, hence at one point you have to release it using the method SCIPreleaseVar()
17692  */
17694  SCIP* scip, /**< SCIP data structure */
17695  SCIP_VAR** var, /**< pointer to variable object */
17696  const char* name, /**< name of variable, or NULL for automatic name creation */
17697  SCIP_Real lb, /**< lower bound of variable */
17698  SCIP_Real ub, /**< upper bound of variable */
17699  SCIP_Real obj, /**< objective function value */
17700  SCIP_VARTYPE vartype /**< type of variable */
17701  )
17702 {
17703  SCIP_CALL( checkStage(scip, "SCIPcreateVarBasic", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17704 
17705  SCIP_CALL( SCIPcreateVar(scip, var, name, lb, ub, obj, vartype, TRUE, FALSE, NULL, NULL, NULL, NULL, NULL) );
17706 
17707  return SCIP_OKAY;
17708 }
17709 
17710 /** outputs the variable name to the file stream
17711  *
17712  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17713  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17714  *
17715  * @pre This method can be called if @p scip is in one of the following stages:
17716  * - \ref SCIP_STAGE_PROBLEM
17717  * - \ref SCIP_STAGE_TRANSFORMING
17718  * - \ref SCIP_STAGE_TRANSFORMED
17719  * - \ref SCIP_STAGE_INITPRESOLVE
17720  * - \ref SCIP_STAGE_PRESOLVING
17721  * - \ref SCIP_STAGE_EXITPRESOLVE
17722  * - \ref SCIP_STAGE_PRESOLVED
17723  * - \ref SCIP_STAGE_INITSOLVE
17724  * - \ref SCIP_STAGE_SOLVING
17725  * - \ref SCIP_STAGE_SOLVED
17726  * - \ref SCIP_STAGE_EXITSOLVE
17727  * - \ref SCIP_STAGE_FREETRANS
17728  */
17730  SCIP* scip, /**< SCIP data structure */
17731  FILE* file, /**< output file, or NULL for stdout */
17732  SCIP_VAR* var, /**< variable to output */
17733  SCIP_Bool type /**< should the variable type be also posted */
17734  )
17735 {
17736  assert(scip != NULL);
17737  assert(var != NULL);
17738 
17739  SCIP_CALL( checkStage(scip, "SCIPwriteVarName", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17740 
17741  /* print variable name */
17742  if( SCIPvarIsNegated(var) )
17743  {
17744  SCIP_VAR* negatedvar;
17745 
17746  SCIP_CALL( SCIPgetNegatedVar(scip, var, &negatedvar) );
17747  SCIPinfoMessage(scip, file, "<~%s>", SCIPvarGetName(negatedvar));
17748  }
17749  else
17750  {
17751  SCIPinfoMessage(scip, file, "<%s>", SCIPvarGetName(var));
17752  }
17753 
17754  if( type )
17755  {
17756  /* print variable type */
17757  SCIPinfoMessage(scip, file, "[%c]",
17761  }
17762 
17763  return SCIP_OKAY;
17764 }
17765 
17766 /** print the given list of variables to output stream separated by the given delimiter character;
17767  *
17768  * i. e. the variables x1, x2, ..., xn with given delimiter ',' are written as: <x1>, <x2>, ..., <xn>;
17769  *
17770  * the method SCIPparseVarsList() can parse such a string
17771  *
17772  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17773  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17774  *
17775  * @pre This method can be called if @p scip is in one of the following stages:
17776  * - \ref SCIP_STAGE_PROBLEM
17777  * - \ref SCIP_STAGE_TRANSFORMING
17778  * - \ref SCIP_STAGE_TRANSFORMED
17779  * - \ref SCIP_STAGE_INITPRESOLVE
17780  * - \ref SCIP_STAGE_PRESOLVING
17781  * - \ref SCIP_STAGE_EXITPRESOLVE
17782  * - \ref SCIP_STAGE_PRESOLVED
17783  * - \ref SCIP_STAGE_INITSOLVE
17784  * - \ref SCIP_STAGE_SOLVING
17785  * - \ref SCIP_STAGE_SOLVED
17786  * - \ref SCIP_STAGE_EXITSOLVE
17787  * - \ref SCIP_STAGE_FREETRANS
17788  *
17789  * @note The printing process is done via the message handler system.
17790  */
17792  SCIP* scip, /**< SCIP data structure */
17793  FILE* file, /**< output file, or NULL for stdout */
17794  SCIP_VAR** vars, /**< variable array to output */
17795  int nvars, /**< number of variables */
17796  SCIP_Bool type, /**< should the variable type be also posted */
17797  char delimiter /**< character which is used for delimitation */
17798  )
17799 {
17800  int v;
17801 
17802  SCIP_CALL( checkStage(scip, "SCIPwriteVarsList", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17803 
17804  for( v = 0; v < nvars; ++v )
17805  {
17806  if( v > 0 )
17807  {
17808  SCIPinfoMessage(scip, file, "%c", delimiter);
17809  }
17810 
17811  /* print variable name */
17812  SCIP_CALL( SCIPwriteVarName(scip, file, vars[v], type) );
17813  }
17814 
17815  return SCIP_OKAY;
17816 }
17817 
17818 /** print the given variables and coefficients as linear sum in the following form
17819  * c1 <x1> + c2 <x2> ... + cn <xn>
17820  *
17821  * This string can be parsed by the method SCIPparseVarsLinearsum().
17822  *
17823  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17824  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17825  *
17826  * @pre This method can be called if @p scip is in one of the following stages:
17827  * - \ref SCIP_STAGE_PROBLEM
17828  * - \ref SCIP_STAGE_TRANSFORMING
17829  * - \ref SCIP_STAGE_TRANSFORMED
17830  * - \ref SCIP_STAGE_INITPRESOLVE
17831  * - \ref SCIP_STAGE_PRESOLVING
17832  * - \ref SCIP_STAGE_EXITPRESOLVE
17833  * - \ref SCIP_STAGE_PRESOLVED
17834  * - \ref SCIP_STAGE_INITSOLVE
17835  * - \ref SCIP_STAGE_SOLVING
17836  * - \ref SCIP_STAGE_SOLVED
17837  * - \ref SCIP_STAGE_EXITSOLVE
17838  * - \ref SCIP_STAGE_FREETRANS
17839  *
17840  * @note The printing process is done via the message handler system.
17841  */
17843  SCIP* scip, /**< SCIP data structure */
17844  FILE* file, /**< output file, or NULL for stdout */
17845  SCIP_VAR** vars, /**< variable array to output */
17846  SCIP_Real* vals, /**< array of coefficients or NULL if all coefficients are 1.0 */
17847  int nvars, /**< number of variables */
17848  SCIP_Bool type /**< should the variable type be also posted */
17849  )
17850 {
17851  int v;
17852 
17853  SCIP_CALL( checkStage(scip, "SCIPwriteVarsLinearsum", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17854 
17855  for( v = 0; v < nvars; ++v )
17856  {
17857  if( vals != NULL )
17858  {
17859  if( vals[v] == 1.0 )
17860  {
17861  if( v > 0 )
17862  SCIPinfoMessage(scip, file, " +");
17863  }
17864  else if( vals[v] == -1.0 )
17865  SCIPinfoMessage(scip, file, " -");
17866  else
17867  SCIPinfoMessage(scip, file, " %+.15g", vals[v]);
17868  }
17869  else if( nvars > 0 )
17870  SCIPinfoMessage(scip, file, " +");
17871 
17872  /* print variable name */
17873  SCIP_CALL( SCIPwriteVarName(scip, file, vars[v], type) );
17874  }
17875 
17876  return SCIP_OKAY;
17877 }
17878 
17879 /** print the given monomials as polynomial in the following form
17880  * c1 <x11>^e11 <x12>^e12 ... <x1n>^e1n + c2 <x21>^e21 <x22>^e22 ... + ... + cn <xn1>^en1 ...
17881  *
17882  * This string can be parsed by the method SCIPparseVarsPolynomial().
17883  *
17884  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17885  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17886  *
17887  * @pre This method can be called if @p scip is in one of the following stages:
17888  * - \ref SCIP_STAGE_PROBLEM
17889  * - \ref SCIP_STAGE_TRANSFORMING
17890  * - \ref SCIP_STAGE_TRANSFORMED
17891  * - \ref SCIP_STAGE_INITPRESOLVE
17892  * - \ref SCIP_STAGE_PRESOLVING
17893  * - \ref SCIP_STAGE_EXITPRESOLVE
17894  * - \ref SCIP_STAGE_PRESOLVED
17895  * - \ref SCIP_STAGE_INITSOLVE
17896  * - \ref SCIP_STAGE_SOLVING
17897  * - \ref SCIP_STAGE_SOLVED
17898  * - \ref SCIP_STAGE_EXITSOLVE
17899  * - \ref SCIP_STAGE_FREETRANS
17900  *
17901  * @note The printing process is done via the message handler system.
17902  */
17904  SCIP* scip, /**< SCIP data structure */
17905  FILE* file, /**< output file, or NULL for stdout */
17906  SCIP_VAR*** monomialvars, /**< arrays with variables for each monomial */
17907  SCIP_Real** monomialexps, /**< arrays with variable exponents, or NULL if always 1.0 */
17908  SCIP_Real* monomialcoefs, /**< array with monomial coefficients */
17909  int* monomialnvars, /**< array with number of variables for each monomial */
17910  int nmonomials, /**< number of monomials */
17911  SCIP_Bool type /**< should the variable type be also posted */
17912  )
17913 {
17914  int i;
17915  int v;
17916 
17917  assert(scip != NULL);
17918  assert(monomialvars != NULL || nmonomials == 0);
17919  assert(monomialcoefs != NULL || nmonomials == 0);
17920  assert(monomialnvars != NULL || nmonomials == 0);
17921 
17922  SCIP_CALL( checkStage(scip, "SCIPwriteVarsPolynomial", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17923 
17924  if( nmonomials == 0 )
17925  {
17926  SCIPinfoMessage(scip, file, " 0 ");
17927  return SCIP_OKAY;
17928  }
17929 
17930  for( i = 0; i < nmonomials; ++i )
17931  {
17932  if( monomialcoefs[i] == 1.0 ) /*lint !e613*/
17933  {
17934  if( i > 0 )
17935  SCIPinfoMessage(scip, file, " +");
17936  }
17937  else if( monomialcoefs[i] == -1.0 ) /*lint !e613*/
17938  SCIPinfoMessage(scip, file, " -");
17939  else
17940  SCIPinfoMessage(scip, file, " %+.15g", monomialcoefs[i]); /*lint !e613*/
17941 
17942  assert(monomialvars[i] != NULL || monomialnvars[i] == 0); /*lint !e613*/
17943 
17944  for( v = 0; v < monomialnvars[i]; ++v ) /*lint !e613*/
17945  {
17946  SCIP_CALL( SCIPwriteVarName(scip, file, monomialvars[i][v], type) ); /*lint !e613*/
17947  if( monomialexps != NULL && monomialexps[i] != NULL && monomialexps[i][v] != 1.0 )
17948  {
17949  SCIPinfoMessage(scip, file, "^%.15g", monomialexps[i][v]);
17950  }
17951  }
17952  }
17953 
17954  return SCIP_OKAY;
17955 }
17956 
17957 /** parses variable information (in cip format) out of a string; if the parsing process was successful a variable is
17958  * created and captured; if variable is of integral type, fractional bounds are automatically rounded; an integer
17959  * variable with bounds zero and one is automatically converted into a binary variable
17960  *
17961  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17962  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17963  *
17964  * @pre This method can be called if @p scip is in one of the following stages:
17965  * - \ref SCIP_STAGE_PROBLEM
17966  * - \ref SCIP_STAGE_TRANSFORMING
17967  * - \ref SCIP_STAGE_INITPRESOLVE
17968  * - \ref SCIP_STAGE_PRESOLVING
17969  * - \ref SCIP_STAGE_EXITPRESOLVE
17970  * - \ref SCIP_STAGE_PRESOLVED
17971  * - \ref SCIP_STAGE_SOLVING
17972  */
17974  SCIP* scip, /**< SCIP data structure */
17975  SCIP_VAR** var, /**< pointer to store the problem variable */
17976  const char* str, /**< string to parse */
17977  SCIP_Bool initial, /**< should var's column be present in the initial root LP? */
17978  SCIP_Bool removable, /**< is var's column removable from the LP (due to aging or cleanup)? */
17979  SCIP_DECL_VARCOPY ((*varcopy)), /**< copies variable data if wanted to subscip, or NULL */
17980  SCIP_DECL_VARDELORIG ((*vardelorig)), /**< frees user data of original variable */
17981  SCIP_DECL_VARTRANS ((*vartrans)), /**< creates transformed user data by transforming original user data */
17982  SCIP_DECL_VARDELTRANS ((*vardeltrans)), /**< frees user data of transformed variable */
17983  SCIP_VARDATA* vardata, /**< user data for this specific variable */
17984  char** endptr, /**< pointer to store the final string position if successful */
17985  SCIP_Bool* success /**< pointer store if the paring process was successful */
17986  )
17987 {
17988  assert(var != NULL);
17989 
17990  SCIP_CALL( checkStage(scip, "SCIPparseVar", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17991 
17992  switch( scip->set->stage )
17993  {
17994  case SCIP_STAGE_PROBLEM:
17995  SCIP_CALL( SCIPvarParseOriginal(var, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
17996  str, initial, removable, varcopy, vardelorig, vartrans, vardeltrans, vardata, endptr, success) );
17997  break;
17998 
18001  case SCIP_STAGE_PRESOLVING:
18003  case SCIP_STAGE_PRESOLVED:
18004  case SCIP_STAGE_SOLVING:
18005  SCIP_CALL( SCIPvarParseTransformed(var, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
18006  str, initial, removable, varcopy, vardelorig, vartrans, vardeltrans, vardata, endptr, success) );
18007  break;
18008 
18009  default:
18010  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
18011  return SCIP_INVALIDCALL;
18012  } /*lint !e788*/
18013 
18014  return SCIP_OKAY;
18015 }
18016 
18017 /** parses the given string for a variable name and stores the variable in the corresponding pointer if such a variable
18018  * exits and returns the position where the parsing stopped
18019  *
18020  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18021  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18022  *
18023  * @pre This method can be called if @p scip is in one of the following stages:
18024  * - \ref SCIP_STAGE_PROBLEM
18025  * - \ref SCIP_STAGE_TRANSFORMING
18026  * - \ref SCIP_STAGE_INITPRESOLVE
18027  * - \ref SCIP_STAGE_PRESOLVING
18028  * - \ref SCIP_STAGE_EXITPRESOLVE
18029  * - \ref SCIP_STAGE_PRESOLVED
18030  * - \ref SCIP_STAGE_SOLVING
18031  */
18033  SCIP* scip, /**< SCIP data structure */
18034  const char* str, /**< string to parse */
18035  SCIP_VAR** var, /**< pointer to store the problem variable, or NULL if it does not exit */
18036  char** endptr /**< pointer to store the final string position if successful */
18037  )
18038 {
18039  char varname[SCIP_MAXSTRLEN];
18040 
18041  assert(str != NULL);
18042  assert(var != NULL);
18043  assert(endptr != NULL);
18044 
18045  SCIP_CALL( checkStage(scip, "SCIPparseVarName", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18046 
18047  SCIPstrCopySection(str, '<', '>', varname, SCIP_MAXSTRLEN, endptr);
18048  assert(*endptr != NULL);
18049 
18050  if( *varname == '\0' )
18051  {
18052  SCIPerrorMessage("invalid variable name string given: could not find '<'\n");
18053  return SCIP_INVALIDDATA;
18054  }
18055 
18056  /* check if we have a negated variable */
18057  if( *varname == '~' )
18058  {
18059  SCIPdebugMsg(scip, "parsed negated variable name <%s>\n", &varname[1]);
18060 
18061  /* search for the variable and ignore '~' */
18062  (*var) = SCIPfindVar(scip, &varname[1]);
18063 
18064  if( *var != NULL )
18065  {
18066  SCIP_CALL( SCIPgetNegatedVar(scip, *var, var) );
18067  }
18068  }
18069  else
18070  {
18071  SCIPdebugMsg(scip, "parsed variable name <%s>\n", varname);
18072 
18073  /* search for the variable */
18074  (*var) = SCIPfindVar(scip, varname);
18075  }
18076 
18077  str = *endptr;
18078 
18079  /* skip additional variable type marker */
18080  if( *str == '[' && (str[1] == SCIP_VARTYPE_BINARY_CHAR || str[1] == SCIP_VARTYPE_INTEGER_CHAR ||
18081  str[1] == SCIP_VARTYPE_IMPLINT_CHAR || str[1] == SCIP_VARTYPE_CONTINUOUS_CHAR ) && str[2] == ']' )
18082  (*endptr) += 3;
18083 
18084  return SCIP_OKAY;
18085 }
18086 
18087 /** parse the given string as variable list (here ',' is the delimiter)) (<x1>, <x2>, ..., <xn>) (see
18088  * SCIPwriteVarsList() ); if it was successful, the pointer success is set to TRUE
18089  *
18090  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18091  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18092  *
18093  * @pre This method can be called if @p scip is in one of the following stages:
18094  * - \ref SCIP_STAGE_PROBLEM
18095  * - \ref SCIP_STAGE_TRANSFORMING
18096  * - \ref SCIP_STAGE_INITPRESOLVE
18097  * - \ref SCIP_STAGE_PRESOLVING
18098  * - \ref SCIP_STAGE_EXITPRESOLVE
18099  * - \ref SCIP_STAGE_PRESOLVED
18100  * - \ref SCIP_STAGE_SOLVING
18101  *
18102  * @note The pointer success in only set to FALSE in the case that a variable with a parsed variable name does not exist.
18103  *
18104  * @note If the number of (parsed) variables is greater than the available slots in the variable array, nothing happens
18105  * except that the required size is stored in the corresponding integer; the reason for this approach is that we
18106  * cannot reallocate memory, since we do not know how the memory has been allocated (e.g., by a C++ 'new' or SCIP
18107  * memory functions).
18108  */
18110  SCIP* scip, /**< SCIP data structure */
18111  const char* str, /**< string to parse */
18112  SCIP_VAR** vars, /**< array to store the parsed variable */
18113  int* nvars, /**< pointer to store number of parsed variables */
18114  int varssize, /**< size of the variable array */
18115  int* requiredsize, /**< pointer to store the required array size for the active variables */
18116  char** endptr, /**< pointer to store the final string position if successful */
18117  char delimiter, /**< character which is used for delimitation */
18118  SCIP_Bool* success /**< pointer to store the whether the parsing was successful or not */
18119  )
18120 {
18121  SCIP_VAR** tmpvars;
18122  SCIP_VAR* var;
18123  int ntmpvars = 0;
18124  int v;
18125 
18126  assert( nvars != NULL );
18127  assert( requiredsize != NULL );
18128  assert( endptr != NULL );
18129  assert( success != NULL );
18130 
18131  SCIP_CALL( checkStage(scip, "SCIPparseVarsList", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18132 
18133  /* allocate buffer memory for temporary storing the parsed variables */
18134  SCIP_CALL( SCIPallocBufferArray(scip, &tmpvars, varssize) );
18135 
18136  (*success) = TRUE;
18137 
18138  do
18139  {
18140  *endptr = (char*)str;
18141 
18142  /* parse variable name */
18143  SCIP_CALL( SCIPparseVarName(scip, str, &var, endptr) );
18144 
18145  if( var == NULL )
18146  {
18147  SCIPdebugMsg(scip, "variable with name <%s> does not exist\n", SCIPvarGetName(var));
18148  (*success) = FALSE;
18149  break;
18150  }
18151 
18152  /* store the variable in the tmp array */
18153  if( ntmpvars < varssize )
18154  tmpvars[ntmpvars] = var;
18155 
18156  ntmpvars++;
18157 
18158  str = *endptr;
18159 
18160  while( isspace((unsigned char)*str) )
18161  str++;
18162  }
18163  while( *str == delimiter );
18164 
18165  *endptr = (char*)str;
18166 
18167  /* if all variable name searches were successful and the variable array has enough slots, copy the collected variables */
18168  if( (*success) && ntmpvars <= varssize )
18169  {
18170  for( v = 0; v < ntmpvars; ++v )
18171  vars[v] = tmpvars[v];
18172 
18173  (*nvars) = ntmpvars;
18174  }
18175  else
18176  (*nvars) = 0;
18177 
18178  (*requiredsize) = ntmpvars;
18179 
18180  /* free buffer arrays */
18181  SCIPfreeBufferArray(scip, &tmpvars);
18182 
18183  return SCIP_OKAY;
18184 }
18185 
18186 /** parse the given string as linear sum of variables and coefficients (c1 <x1> + c2 <x2> + ... + cn <xn>)
18187  * (see SCIPwriteVarsLinearsum() ); if it was successful, the pointer success is set to TRUE
18188  *
18189  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18190  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18191  *
18192  * @pre This method can be called if @p scip is in one of the following stages:
18193  * - \ref SCIP_STAGE_PROBLEM
18194  * - \ref SCIP_STAGE_TRANSFORMING
18195  * - \ref SCIP_STAGE_INITPRESOLVE
18196  * - \ref SCIP_STAGE_PRESOLVING
18197  * - \ref SCIP_STAGE_EXITPRESOLVE
18198  * - \ref SCIP_STAGE_PRESOLVED
18199  * - \ref SCIP_STAGE_SOLVING
18200  *
18201  * @note The pointer success in only set to FALSE in the case that a variable with a parsed variable name does not exist.
18202  *
18203  * @note If the number of (parsed) variables is greater than the available slots in the variable array, nothing happens
18204  * except that the required size is stored in the corresponding integer; the reason for this approach is that we
18205  * cannot reallocate memory, since we do not know how the memory has been allocated (e.g., by a C++ 'new' or SCIP
18206  * memory functions).
18207  */
18209  SCIP* scip, /**< SCIP data structure */
18210  const char* str, /**< string to parse */
18211  SCIP_VAR** vars, /**< array to store the parsed variables */
18212  SCIP_Real* vals, /**< array to store the parsed coefficients */
18213  int* nvars, /**< pointer to store number of parsed variables */
18214  int varssize, /**< size of the variable array */
18215  int* requiredsize, /**< pointer to store the required array size for the active variables */
18216  char** endptr, /**< pointer to store the final string position if successful */
18217  SCIP_Bool* success /**< pointer to store the whether the parsing was successful or not */
18218  )
18219 {
18220  SCIP_VAR*** monomialvars;
18221  SCIP_Real** monomialexps;
18222  SCIP_Real* monomialcoefs;
18223  int* monomialnvars;
18224  int nmonomials;
18225 
18226  SCIP_CALL( checkStage(scip, "SCIPparseVarsLinearsum", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18227 
18228  assert(scip != NULL);
18229  assert(str != NULL);
18230  assert(vars != NULL || varssize == 0);
18231  assert(vals != NULL || varssize == 0);
18232  assert(nvars != NULL);
18233  assert(requiredsize != NULL);
18234  assert(endptr != NULL);
18235  assert(success != NULL);
18236 
18237  *requiredsize = 0;
18238 
18239  SCIP_CALL( SCIPparseVarsPolynomial(scip, str, &monomialvars, &monomialexps, &monomialcoefs, &monomialnvars, &nmonomials, endptr, success) );
18240 
18241  if( !*success )
18242  {
18243  assert(nmonomials == 0); /* SCIPparseVarsPolynomial should have freed all buffers, so no need to call free here */
18244  return SCIP_OKAY;
18245  }
18246 
18247  /* check if linear sum is just "0" */
18248  if( nmonomials == 1 && monomialnvars[0] == 0 && monomialcoefs[0] == 0.0 )
18249  {
18250  *nvars = 0;
18251  *requiredsize = 0;
18252 
18253  SCIPfreeParseVarsPolynomialData(scip, &monomialvars, &monomialexps, &monomialcoefs, &monomialnvars, nmonomials);
18254 
18255  return SCIP_OKAY;
18256  }
18257 
18258  *nvars = nmonomials;
18259  *requiredsize = nmonomials;
18260 
18261  /* if we have enough slots in the variables array, copy variables over */
18262  if( varssize >= nmonomials )
18263  {
18264  int v;
18265 
18266  for( v = 0; v < nmonomials; ++v )
18267  {
18268  if( monomialnvars[v] == 0 )
18269  {
18270  SCIPerrorMessage("constant in linear sum\n");
18271  *success = FALSE;
18272  break;
18273  }
18274  if( monomialnvars[v] > 1 || monomialexps[v][0] != 1.0 )
18275  {
18276  SCIPerrorMessage("nonlinear monomial in linear sum\n");
18277  *success = FALSE;
18278  break;
18279  }
18280  assert(monomialnvars[v] == 1);
18281  assert(monomialvars[v][0] != NULL);
18282  assert(monomialexps[v][0] == 1.0);
18283 
18284  vars[v] = monomialvars[v][0]; /*lint !e613*/
18285  vals[v] = monomialcoefs[v]; /*lint !e613*/
18286  }
18287  }
18288 
18289  SCIPfreeParseVarsPolynomialData(scip, &monomialvars, &monomialexps, &monomialcoefs, &monomialnvars, nmonomials);
18290 
18291  return SCIP_OKAY;
18292 }
18293 
18294 /** parse the given string as polynomial of variables and coefficients
18295  * (c1 <x11>^e11 <x12>^e12 ... <x1n>^e1n + c2 <x21>^e21 <x22>^e22 ... + ... + cn <xn1>^en1 ...)
18296  * (see SCIPwriteVarsPolynomial()); if it was successful, the pointer success is set to TRUE
18297  *
18298  * The user has to call SCIPfreeParseVarsPolynomialData(scip, monomialvars, monomialexps,
18299  * monomialcoefs, monomialnvars, *nmonomials) short after SCIPparseVarsPolynomial to free all the
18300  * allocated memory again. Do not keep the arrays created by SCIPparseVarsPolynomial around, since
18301  * they use buffer memory that is intended for short term use only.
18302  *
18303  * Parsing is stopped at the end of string (indicated by the \\0-character) or when no more monomials
18304  * are recognized.
18305  *
18306  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18307  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18308  *
18309  * @pre This method can be called if @p scip is in one of the following stages:
18310  * - \ref SCIP_STAGE_PROBLEM
18311  * - \ref SCIP_STAGE_TRANSFORMING
18312  * - \ref SCIP_STAGE_INITPRESOLVE
18313  * - \ref SCIP_STAGE_PRESOLVING
18314  * - \ref SCIP_STAGE_EXITPRESOLVE
18315  * - \ref SCIP_STAGE_PRESOLVED
18316  * - \ref SCIP_STAGE_SOLVING
18317  */
18319  SCIP* scip, /**< SCIP data structure */
18320  const char* str, /**< string to parse */
18321  SCIP_VAR**** monomialvars, /**< pointer to store arrays with variables for each monomial */
18322  SCIP_Real*** monomialexps, /**< pointer to store arrays with variable exponents */
18323  SCIP_Real** monomialcoefs, /**< pointer to store array with monomial coefficients */
18324  int** monomialnvars, /**< pointer to store array with number of variables for each monomial */
18325  int* nmonomials, /**< pointer to store number of parsed monomials */
18326  char** endptr, /**< pointer to store the final string position if successful */
18327  SCIP_Bool* success /**< pointer to store the whether the parsing was successful or not */
18328  )
18329 {
18330  typedef enum
18331  {
18332  SCIPPARSEPOLYNOMIAL_STATE_BEGIN, /* we are at the beginning of a monomial */
18333  SCIPPARSEPOLYNOMIAL_STATE_INTERMED, /* we are in between the factors of a monomial */
18334  SCIPPARSEPOLYNOMIAL_STATE_COEF, /* we parse the coefficient of a monomial */
18335  SCIPPARSEPOLYNOMIAL_STATE_VARS, /* we parse monomial variables */
18336  SCIPPARSEPOLYNOMIAL_STATE_EXPONENT, /* we parse the exponent of a variable */
18337  SCIPPARSEPOLYNOMIAL_STATE_END, /* we are at the end the polynomial */
18338  SCIPPARSEPOLYNOMIAL_STATE_ERROR /* a parsing error occured */
18339  } SCIPPARSEPOLYNOMIAL_STATES;
18340 
18341  SCIPPARSEPOLYNOMIAL_STATES state;
18342  int monomialssize;
18343 
18344  /* data of currently parsed monomial */
18345  int varssize;
18346  int nvars;
18347  SCIP_VAR** vars;
18348  SCIP_Real* exponents;
18349  SCIP_Real coef;
18350 
18351  assert(scip != NULL);
18352  assert(str != NULL);
18353  assert(monomialvars != NULL);
18354  assert(monomialexps != NULL);
18355  assert(monomialnvars != NULL);
18356  assert(monomialcoefs != NULL);
18357  assert(nmonomials != NULL);
18358  assert(endptr != NULL);
18359  assert(success != NULL);
18360 
18361  SCIP_CALL( checkStage(scip, "SCIPparseVarsPolynomial", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18362 
18363  *success = FALSE;
18364  *nmonomials = 0;
18365  monomialssize = 0;
18366  *monomialvars = NULL;
18367  *monomialexps = NULL;
18368  *monomialcoefs = NULL;
18369  *monomialnvars = NULL;
18370 
18371  /* initialize state machine */
18372  state = SCIPPARSEPOLYNOMIAL_STATE_BEGIN;
18373  varssize = 0;
18374  nvars = 0;
18375  vars = NULL;
18376  exponents = NULL;
18377  coef = SCIP_INVALID;
18378 
18379  SCIPdebugMsg(scip, "parsing polynomial from '%s'\n", str);
18380 
18381  while( *str && state != SCIPPARSEPOLYNOMIAL_STATE_END && state != SCIPPARSEPOLYNOMIAL_STATE_ERROR )
18382  {
18383  /* skip white space */
18384  while( isspace((unsigned char)*str) )
18385  str++;
18386 
18387  assert(state != SCIPPARSEPOLYNOMIAL_STATE_END);
18388 
18389  switch( state )
18390  {
18391  case SCIPPARSEPOLYNOMIAL_STATE_BEGIN:
18392  {
18393  if( coef != SCIP_INVALID ) /*lint !e777*/
18394  {
18395  SCIPdebugMsg(scip, "push monomial with coefficient <%g> and <%d> vars\n", coef, nvars);
18396  /* push previous monomial */
18397  if( monomialssize <= *nmonomials )
18398  {
18399  monomialssize = SCIPcalcMemGrowSize(scip, *nmonomials+1);
18400 
18401  SCIP_CALL( SCIPreallocBufferArray(scip, monomialvars, monomialssize) );
18402  SCIP_CALL( SCIPreallocBufferArray(scip, monomialexps, monomialssize) );
18403  SCIP_CALL( SCIPreallocBufferArray(scip, monomialnvars, monomialssize) );
18404  SCIP_CALL( SCIPreallocBufferArray(scip, monomialcoefs, monomialssize) );
18405  }
18406 
18407  if( nvars > 0 )
18408  {
18409  SCIP_CALL( SCIPduplicateBufferArray(scip, &(*monomialvars)[*nmonomials], vars, nvars) ); /*lint !e866*/
18410  SCIP_CALL( SCIPduplicateBufferArray(scip, &(*monomialexps)[*nmonomials], exponents, nvars) ); /*lint !e866*/
18411  }
18412  else
18413  {
18414  (*monomialvars)[*nmonomials] = NULL;
18415  (*monomialexps)[*nmonomials] = NULL;
18416  }
18417  (*monomialcoefs)[*nmonomials] = coef;
18418  (*monomialnvars)[*nmonomials] = nvars;
18419  ++*nmonomials;
18420 
18421  nvars = 0;
18422  coef = SCIP_INVALID;
18423  }
18424 
18425  if( *str == '<' )
18426  {
18427  /* there seem to come a variable at the beginning of a monomial
18428  * so assume the coefficient is 1.0
18429  */
18430  state = SCIPPARSEPOLYNOMIAL_STATE_VARS;
18431  coef = 1.0;
18432  break;
18433  }
18434  if( *str == '-' || *str == '+' || isdigit(*str) )
18435  {
18436  state = SCIPPARSEPOLYNOMIAL_STATE_COEF;
18437  break;
18438  }
18439 
18440  state = SCIPPARSEPOLYNOMIAL_STATE_END;
18441 
18442  break;
18443  }
18444 
18445  case SCIPPARSEPOLYNOMIAL_STATE_INTERMED:
18446  {
18447  if( *str == '<' )
18448  {
18449  /* there seem to come another variable */
18450  state = SCIPPARSEPOLYNOMIAL_STATE_VARS;
18451  break;
18452  }
18453 
18454  if( *str == '-' || *str == '+' || isdigit(*str) )
18455  {
18456  /* there seem to come a coefficient, which means the next monomial */
18457  state = SCIPPARSEPOLYNOMIAL_STATE_BEGIN;
18458  break;
18459  }
18460 
18461  /* since we cannot detect the symbols we stop parsing the polynomial */
18462  state = SCIPPARSEPOLYNOMIAL_STATE_END;
18463  break;
18464  }
18465 
18466  case SCIPPARSEPOLYNOMIAL_STATE_COEF:
18467  {
18468  if( *str == '+' && !isdigit(str[1]) )
18469  {
18470  /* only a plus sign, without number */
18471  coef = 1.0;
18472  ++str;
18473  }
18474  else if( *str == '-' && !isdigit(str[1]) )
18475  {
18476  /* only a minus sign, without number */
18477  coef = -1.0;
18478  ++str;
18479  }
18480  else if( SCIPstrToRealValue(str, &coef, endptr) )
18481  {
18482  str = *endptr;
18483  }
18484  else
18485  {
18486  SCIPerrorMessage("could not parse number in the beginning of '%s'\n", str);
18487  state = SCIPPARSEPOLYNOMIAL_STATE_ERROR;
18488  break;
18489  }
18490 
18491  /* after the coefficient we go into the intermediate state, i.e., expecting next variables */
18492  state = SCIPPARSEPOLYNOMIAL_STATE_INTERMED;
18493 
18494  break;
18495  }
18496 
18497  case SCIPPARSEPOLYNOMIAL_STATE_VARS:
18498  {
18499  SCIP_VAR* var;
18500 
18501  assert(*str == '<');
18502 
18503  /* parse variable name */
18504  SCIP_CALL( SCIPparseVarName(scip, str, &var, endptr) );
18505 
18506  /* check if variable name was parsed */
18507  if( *endptr == str )
18508  {
18509  state = SCIPPARSEPOLYNOMIAL_STATE_END;
18510  break;
18511  }
18512 
18513  if( var == NULL )
18514  {
18515  SCIPerrorMessage("did not find variable in the beginning of %s\n", str);
18516  state = SCIPPARSEPOLYNOMIAL_STATE_ERROR;
18517  break;
18518  }
18519 
18520  /* add variable to vars array */
18521  if( nvars + 1 > varssize )
18522  {
18523  varssize = SCIPcalcMemGrowSize(scip, nvars+1);
18524  SCIP_CALL( SCIPreallocBufferArray(scip, &vars, varssize) );
18525  SCIP_CALL( SCIPreallocBufferArray(scip, &exponents, varssize) );
18526  }
18527  assert(vars != NULL);
18528  assert(exponents != NULL);
18529 
18530  vars[nvars] = var;
18531  exponents[nvars] = 1.0;
18532  ++nvars;
18533 
18534  str = *endptr;
18535 
18536  if( *str == '^' )
18537  state = SCIPPARSEPOLYNOMIAL_STATE_EXPONENT;
18538  else
18539  state = SCIPPARSEPOLYNOMIAL_STATE_INTERMED;
18540 
18541  break;
18542  }
18543 
18544  case SCIPPARSEPOLYNOMIAL_STATE_EXPONENT:
18545  {
18546  assert(*str == '^');
18547  assert(nvars > 0); /* we should be in a monomial that has already a variable */
18548  assert(exponents != NULL);
18549  ++str;
18550 
18551  if( !SCIPstrToRealValue(str, &exponents[nvars-1], endptr) )
18552  {
18553  SCIPerrorMessage("could not parse number in the beginning of '%s'\n", str);
18554  state = SCIPPARSEPOLYNOMIAL_STATE_ERROR;
18555  break;
18556  }
18557  str = *endptr;
18558 
18559  /* after the exponent we go into the intermediate state, i.e., expecting next variables */
18560  state = SCIPPARSEPOLYNOMIAL_STATE_INTERMED;
18561  break;
18562  }
18563 
18564  case SCIPPARSEPOLYNOMIAL_STATE_END:
18565  case SCIPPARSEPOLYNOMIAL_STATE_ERROR:
18566  default:
18567  SCIPerrorMessage("unexpected state\n");
18568  return SCIP_READERROR;
18569  }
18570  }
18571 
18572  /* set end pointer */
18573  *endptr = (char*)str;
18574 
18575  /* check state at end of string */
18576  switch( state )
18577  {
18578  case SCIPPARSEPOLYNOMIAL_STATE_BEGIN:
18579  case SCIPPARSEPOLYNOMIAL_STATE_END:
18580  case SCIPPARSEPOLYNOMIAL_STATE_INTERMED:
18581  {
18582  if( coef != SCIP_INVALID ) /*lint !e777*/
18583  {
18584  /* push last monomial */
18585  SCIPdebugMsg(scip, "push monomial with coefficient <%g> and <%d> vars\n", coef, nvars);
18586  if( monomialssize <= *nmonomials )
18587  {
18588  monomialssize = *nmonomials+1;
18589  SCIP_CALL( SCIPreallocBufferArray(scip, monomialvars, monomialssize) );
18590  SCIP_CALL( SCIPreallocBufferArray(scip, monomialexps, monomialssize) );
18591  SCIP_CALL( SCIPreallocBufferArray(scip, monomialnvars, monomialssize) );
18592  SCIP_CALL( SCIPreallocBufferArray(scip, monomialcoefs, monomialssize) );
18593  }
18594 
18595  if( nvars > 0 )
18596  {
18597  /* shrink vars and exponents array to needed size and take over ownership */
18598  SCIP_CALL( SCIPreallocBufferArray(scip, &vars, nvars) );
18599  SCIP_CALL( SCIPreallocBufferArray(scip, &exponents, nvars) );
18600  (*monomialvars)[*nmonomials] = vars;
18601  (*monomialexps)[*nmonomials] = exponents;
18602  vars = NULL;
18603  exponents = NULL;
18604  }
18605  else
18606  {
18607  (*monomialvars)[*nmonomials] = NULL;
18608  (*monomialexps)[*nmonomials] = NULL;
18609  }
18610  (*monomialcoefs)[*nmonomials] = coef;
18611  (*monomialnvars)[*nmonomials] = nvars;
18612  ++*nmonomials;
18613  }
18614 
18615  *success = TRUE;
18616  break;
18617  }
18618 
18619  case SCIPPARSEPOLYNOMIAL_STATE_COEF:
18620  case SCIPPARSEPOLYNOMIAL_STATE_VARS:
18621  case SCIPPARSEPOLYNOMIAL_STATE_EXPONENT:
18622  {
18623  SCIPerrorMessage("unexpected parsing state at end of polynomial string\n");
18624  }
18625  /*lint -fallthrough*/
18626  case SCIPPARSEPOLYNOMIAL_STATE_ERROR:
18627  assert(!*success);
18628  break;
18629  }
18630 
18631  /* free memory to store current monomial, if still existing */
18632  SCIPfreeBufferArrayNull(scip, &vars);
18633  SCIPfreeBufferArrayNull(scip, &exponents);
18634 
18635  if( *success && *nmonomials > 0 )
18636  {
18637  /* shrink arrays to required size, so we do not need to keep monomialssize around */
18638  assert(*nmonomials <= monomialssize);
18639  SCIP_CALL( SCIPreallocBufferArray(scip, monomialvars, *nmonomials) );
18640  SCIP_CALL( SCIPreallocBufferArray(scip, monomialexps, *nmonomials) );
18641  SCIP_CALL( SCIPreallocBufferArray(scip, monomialnvars, *nmonomials) );
18642  SCIP_CALL( SCIPreallocBufferArray(scip, monomialcoefs, *nmonomials) );
18643 
18644  /* SCIPwriteVarsPolynomial(scip, NULL, *monomialvars, *monomialexps, *monomialcoefs, *monomialnvars, *nmonomials, FALSE); */
18645  }
18646  else
18647  {
18648  /* in case of error, cleanup all data here */
18649  SCIPfreeParseVarsPolynomialData(scip, monomialvars, monomialexps, monomialcoefs, monomialnvars, *nmonomials);
18650  *nmonomials = 0;
18651  }
18652 
18653  return SCIP_OKAY;
18654 }
18655 
18656 /** frees memory allocated when parsing a polynomial from a string
18657  *
18658  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18659  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18660  *
18661  * @pre This method can be called if @p scip is in one of the following stages:
18662  * - \ref SCIP_STAGE_PROBLEM
18663  * - \ref SCIP_STAGE_TRANSFORMING
18664  * - \ref SCIP_STAGE_INITPRESOLVE
18665  * - \ref SCIP_STAGE_PRESOLVING
18666  * - \ref SCIP_STAGE_EXITPRESOLVE
18667  * - \ref SCIP_STAGE_PRESOLVED
18668  * - \ref SCIP_STAGE_SOLVING
18669  */
18671  SCIP* scip, /**< SCIP data structure */
18672  SCIP_VAR**** monomialvars, /**< pointer to store arrays with variables for each monomial */
18673  SCIP_Real*** monomialexps, /**< pointer to store arrays with variable exponents */
18674  SCIP_Real** monomialcoefs, /**< pointer to store array with monomial coefficients */
18675  int** monomialnvars, /**< pointer to store array with number of variables for each monomial */
18676  int nmonomials /**< pointer to store number of parsed monomials */
18677  )
18678 {
18679  int i;
18680 
18681  assert(scip != NULL);
18682  assert(monomialvars != NULL);
18683  assert(monomialexps != NULL);
18684  assert(monomialcoefs != NULL);
18685  assert(monomialnvars != NULL);
18686  assert((*monomialvars != NULL) == (nmonomials > 0));
18687  assert((*monomialexps != NULL) == (nmonomials > 0));
18688  assert((*monomialcoefs != NULL) == (nmonomials > 0));
18689  assert((*monomialnvars != NULL) == (nmonomials > 0));
18690 
18691  SCIP_CALL_ABORT( checkStage(scip, "SCIPfreeParseVarsPolynomialData", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18692 
18693  if( nmonomials == 0 )
18694  return;
18695 
18696  for( i = nmonomials - 1; i >= 0; --i )
18697  {
18698  SCIPfreeBufferArrayNull(scip, &(*monomialvars)[i]);
18699  SCIPfreeBufferArrayNull(scip, &(*monomialexps)[i]);
18700  }
18701 
18702  SCIPfreeBufferArray(scip, monomialvars);
18703  SCIPfreeBufferArray(scip, monomialexps);
18704  SCIPfreeBufferArray(scip, monomialcoefs);
18705  SCIPfreeBufferArray(scip, monomialnvars);
18706 }
18707 
18708 /** increases usage counter of variable
18709  *
18710  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18711  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18712  *
18713  * @pre This method can be called if @p scip is in one of the following stages:
18714  * - \ref SCIP_STAGE_PROBLEM
18715  * - \ref SCIP_STAGE_TRANSFORMING
18716  * - \ref SCIP_STAGE_TRANSFORMED
18717  * - \ref SCIP_STAGE_INITPRESOLVE
18718  * - \ref SCIP_STAGE_PRESOLVING
18719  * - \ref SCIP_STAGE_EXITPRESOLVE
18720  * - \ref SCIP_STAGE_PRESOLVED
18721  * - \ref SCIP_STAGE_INITSOLVE
18722  * - \ref SCIP_STAGE_SOLVING
18723  * - \ref SCIP_STAGE_SOLVED
18724  * - \ref SCIP_STAGE_EXITSOLVE
18725  */
18727  SCIP* scip, /**< SCIP data structure */
18728  SCIP_VAR* var /**< variable to capture */
18729  )
18730 {
18731  SCIP_CALL( checkStage(scip, "SCIPcaptureVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
18732  assert(var->scip == scip);
18733 
18734  SCIPvarCapture(var);
18735 
18736  return SCIP_OKAY;
18737 }
18738 
18739 /** decreases usage counter of variable, if the usage pointer reaches zero the variable gets freed
18740  *
18741  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18742  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18743  *
18744  * @pre This method can be called if @p scip is in one of the following stages:
18745  * - \ref SCIP_STAGE_PROBLEM
18746  * - \ref SCIP_STAGE_TRANSFORMING
18747  * - \ref SCIP_STAGE_TRANSFORMED
18748  * - \ref SCIP_STAGE_INITPRESOLVE
18749  * - \ref SCIP_STAGE_PRESOLVING
18750  * - \ref SCIP_STAGE_EXITPRESOLVE
18751  * - \ref SCIP_STAGE_PRESOLVED
18752  * - \ref SCIP_STAGE_INITSOLVE
18753  * - \ref SCIP_STAGE_SOLVING
18754  * - \ref SCIP_STAGE_SOLVED
18755  * - \ref SCIP_STAGE_EXITSOLVE
18756  * - \ref SCIP_STAGE_FREETRANS
18757  *
18758  * @note the pointer of the variable will be NULLed
18759  */
18761  SCIP* scip, /**< SCIP data structure */
18762  SCIP_VAR** var /**< pointer to variable */
18763  )
18764 {
18765  assert(var != NULL);
18766  assert(*var != NULL);
18767  assert((*var)->scip == scip);
18768 
18769  SCIP_CALL( checkStage(scip, "SCIPreleaseVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
18770 
18771  switch( scip->set->stage )
18772  {
18773  case SCIP_STAGE_PROBLEM:
18774  SCIP_CALL( SCIPvarRelease(var, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
18775  return SCIP_OKAY;
18776 
18780  case SCIP_STAGE_PRESOLVING:
18782  case SCIP_STAGE_PRESOLVED:
18783  case SCIP_STAGE_INITSOLVE:
18784  case SCIP_STAGE_SOLVING:
18785  case SCIP_STAGE_SOLVED:
18786  case SCIP_STAGE_EXITSOLVE:
18787  case SCIP_STAGE_FREETRANS:
18788  if( !SCIPvarIsTransformed(*var) && (*var)->nuses == 1 )
18789  {
18790  SCIPerrorMessage("cannot release last use of original variable while the transformed problem exists\n");
18791  return SCIP_INVALIDCALL;
18792  }
18793  SCIP_CALL( SCIPvarRelease(var, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
18794  return SCIP_OKAY;
18795 
18796  default:
18797  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
18798  return SCIP_INVALIDCALL;
18799  } /*lint !e788*/
18800 }
18801 
18802 /** changes the name of a variable
18803  *
18804  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18805  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18806  *
18807  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_PROBLEM
18808  *
18809  * @note to get the current name of a variable, use SCIPvarGetName() from pub_var.h
18810  */
18812  SCIP* scip, /**< SCIP data structure */
18813  SCIP_VAR* var, /**< variable */
18814  const char* name /**< new name of constraint */
18815  )
18816 {
18817  SCIP_CALL( checkStage(scip, "SCIPchgVarName", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
18818  assert( var->scip == scip );
18819 
18820  if( SCIPgetStage(scip) != SCIP_STAGE_PROBLEM )
18821  {
18822  SCIPerrorMessage("variable names can only be changed in problem creation stage\n");
18823  SCIPABORT();
18824  return SCIP_INVALIDCALL; /*lint !e527*/
18825  }
18826 
18827  /* remove variable's name from the namespace if the variable was already added */
18828  if( SCIPvarGetProbindex(var) != -1 )
18829  {
18830  SCIP_CALL( SCIPprobRemoveVarName(scip->origprob, var) );
18831  }
18832 
18833  /* change variable name */
18834  SCIP_CALL( SCIPvarChgName(var, SCIPblkmem(scip), name) );
18835 
18836  /* add variable's name to the namespace if the variable was already added */
18837  if( SCIPvarGetProbindex(var) != -1 )
18838  {
18839  SCIP_CALL( SCIPprobAddVarName(scip->origprob, var) );
18840  }
18841 
18842  return SCIP_OKAY;
18843 }
18844 
18845 /** gets and captures transformed variable of a given variable; if the variable is not yet transformed,
18846  * a new transformed variable for this variable is created
18847  *
18848  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18849  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18850  *
18851  * @pre This method can be called if @p scip is in one of the following stages:
18852  * - \ref SCIP_STAGE_TRANSFORMING
18853  * - \ref SCIP_STAGE_TRANSFORMED
18854  * - \ref SCIP_STAGE_INITPRESOLVE
18855  * - \ref SCIP_STAGE_PRESOLVING
18856  * - \ref SCIP_STAGE_EXITPRESOLVE
18857  * - \ref SCIP_STAGE_PRESOLVED
18858  * - \ref SCIP_STAGE_INITSOLVE
18859  * - \ref SCIP_STAGE_SOLVING
18860  */
18862  SCIP* scip, /**< SCIP data structure */
18863  SCIP_VAR* var, /**< variable to get/create transformed variable for */
18864  SCIP_VAR** transvar /**< pointer to store the transformed variable */
18865  )
18866 {
18867  assert(transvar != NULL);
18868 
18869  SCIP_CALL( checkStage(scip, "SCIPtransformVar", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18870 
18871  if( SCIPvarIsTransformed(var) )
18872  {
18873  *transvar = var;
18874  SCIPvarCapture(*transvar);
18875  }
18876  else
18877  {
18878  SCIP_CALL( SCIPvarTransform(var, scip->mem->probmem, scip->set, scip->stat, scip->origprob->objsense, transvar) );
18879  }
18880 
18881  return SCIP_OKAY;
18882 }
18883 
18884 /** gets and captures transformed variables for an array of variables;
18885  * if a variable of the array is not yet transformed, a new transformed variable for this variable is created;
18886  * it is possible to call this method with vars == transvars
18887  *
18888  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18889  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18890  *
18891  * @pre This method can be called if @p scip is in one of the following stages:
18892  * - \ref SCIP_STAGE_TRANSFORMING
18893  * - \ref SCIP_STAGE_TRANSFORMED
18894  * - \ref SCIP_STAGE_INITPRESOLVE
18895  * - \ref SCIP_STAGE_PRESOLVING
18896  * - \ref SCIP_STAGE_EXITPRESOLVE
18897  * - \ref SCIP_STAGE_PRESOLVED
18898  * - \ref SCIP_STAGE_INITSOLVE
18899  * - \ref SCIP_STAGE_SOLVING
18900  */
18902  SCIP* scip, /**< SCIP data structure */
18903  int nvars, /**< number of variables to get/create transformed variables for */
18904  SCIP_VAR** vars, /**< array with variables to get/create transformed variables for */
18905  SCIP_VAR** transvars /**< array to store the transformed variables */
18906  )
18907 {
18908  int v;
18909 
18910  assert(nvars == 0 || vars != NULL);
18911  assert(nvars == 0 || transvars != NULL);
18912 
18913  SCIP_CALL( checkStage(scip, "SCIPtransformVars", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18914 
18915  for( v = 0; v < nvars; ++v )
18916  {
18917  if( SCIPvarIsTransformed(vars[v]) )
18918  {
18919  transvars[v] = vars[v];
18920  SCIPvarCapture(transvars[v]);
18921  }
18922  else
18923  {
18924  SCIP_CALL( SCIPvarTransform(vars[v], scip->mem->probmem, scip->set, scip->stat, scip->origprob->objsense,
18925  &transvars[v]) );
18926  }
18927  }
18928 
18929  return SCIP_OKAY;
18930 }
18931 
18932 /** gets corresponding transformed variable of a given variable;
18933  * returns NULL as transvar, if transformed variable is not yet existing
18934  *
18935  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18936  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18937  *
18938  * @pre This method can be called if @p scip is in one of the following stages:
18939  * - \ref SCIP_STAGE_TRANSFORMING
18940  * - \ref SCIP_STAGE_TRANSFORMED
18941  * - \ref SCIP_STAGE_INITPRESOLVE
18942  * - \ref SCIP_STAGE_PRESOLVING
18943  * - \ref SCIP_STAGE_EXITPRESOLVE
18944  * - \ref SCIP_STAGE_PRESOLVED
18945  * - \ref SCIP_STAGE_INITSOLVE
18946  * - \ref SCIP_STAGE_SOLVING
18947  * - \ref SCIP_STAGE_SOLVED
18948  * - \ref SCIP_STAGE_EXITSOLVE
18949  * - \ref SCIP_STAGE_FREETRANS
18950  */
18952  SCIP* scip, /**< SCIP data structure */
18953  SCIP_VAR* var, /**< variable to get transformed variable for */
18954  SCIP_VAR** transvar /**< pointer to store the transformed variable */
18955  )
18956 {
18957  assert(transvar != NULL);
18958 
18959  SCIP_CALL( checkStage(scip, "SCIPgetTransformedVar", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
18960 
18961  if( SCIPvarIsTransformed(var) )
18962  *transvar = var;
18963  else
18964  {
18965  SCIP_CALL( SCIPvarGetTransformed(var, scip->mem->probmem, scip->set, scip->stat, transvar) );
18966  }
18967 
18968  return SCIP_OKAY;
18969 }
18970 
18971 /** gets corresponding transformed variables for an array of variables;
18972  * stores NULL in a transvars slot, if the transformed variable is not yet existing;
18973  * it is possible to call this method with vars == transvars, but remember that variables that are not
18974  * yet transformed will be replaced with NULL
18975  *
18976  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18977  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18978  *
18979  * @pre This method can be called if @p scip is in one of the following stages:
18980  * - \ref SCIP_STAGE_TRANSFORMING
18981  * - \ref SCIP_STAGE_TRANSFORMED
18982  * - \ref SCIP_STAGE_INITPRESOLVE
18983  * - \ref SCIP_STAGE_PRESOLVING
18984  * - \ref SCIP_STAGE_EXITPRESOLVE
18985  * - \ref SCIP_STAGE_PRESOLVED
18986  * - \ref SCIP_STAGE_INITSOLVE
18987  * - \ref SCIP_STAGE_SOLVING
18988  * - \ref SCIP_STAGE_SOLVED
18989  * - \ref SCIP_STAGE_EXITSOLVE
18990  * - \ref SCIP_STAGE_FREETRANS
18991  */
18993  SCIP* scip, /**< SCIP data structure */
18994  int nvars, /**< number of variables to get transformed variables for */
18995  SCIP_VAR** vars, /**< array with variables to get transformed variables for */
18996  SCIP_VAR** transvars /**< array to store the transformed variables */
18997  )
18998 {
18999  int v;
19000 
19001  assert(nvars == 0 || vars != NULL);
19002  assert(nvars == 0 || transvars != NULL);
19003 
19004  SCIP_CALL( checkStage(scip, "SCIPgetTransformedVars", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
19005 
19006  for( v = 0; v < nvars; ++v )
19007  {
19008  if( SCIPvarIsTransformed(vars[v]) )
19009  transvars[v] = vars[v];
19010  else
19011  {
19012  SCIP_CALL( SCIPvarGetTransformed(vars[v], scip->mem->probmem, scip->set, scip->stat, &transvars[v]) );
19013  }
19014  }
19015 
19016  return SCIP_OKAY;
19017 }
19018 
19019 /** gets negated variable x' = lb + ub - x of variable x; negated variable is created, if not yet existing;
19020  * in difference to \ref SCIPcreateVar, the negated variable must not be released (unless captured explicitly)
19021  *
19022  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19023  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19024  *
19025  * @pre This method can be called if @p scip is in one of the following stages:
19026  * - \ref SCIP_STAGE_PROBLEM
19027  * - \ref SCIP_STAGE_TRANSFORMING
19028  * - \ref SCIP_STAGE_TRANSFORMED
19029  * - \ref SCIP_STAGE_INITPRESOLVE
19030  * - \ref SCIP_STAGE_PRESOLVING
19031  * - \ref SCIP_STAGE_EXITPRESOLVE
19032  * - \ref SCIP_STAGE_PRESOLVED
19033  * - \ref SCIP_STAGE_INITSOLVE
19034  * - \ref SCIP_STAGE_SOLVING
19035  * - \ref SCIP_STAGE_SOLVED
19036  * - \ref SCIP_STAGE_EXITSOLVE
19037  * - \ref SCIP_STAGE_FREETRANS
19038  */
19040  SCIP* scip, /**< SCIP data structure */
19041  SCIP_VAR* var, /**< variable to get negated variable for */
19042  SCIP_VAR** negvar /**< pointer to store the negated variable */
19043  )
19044 {
19045  SCIP_CALL( checkStage(scip, "SCIPgetNegatedVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
19046  assert( var->scip == scip );
19047 
19048  SCIP_CALL( SCIPvarNegate(var, scip->mem->probmem, scip->set, scip->stat, negvar) );
19049 
19050  return SCIP_OKAY;
19051 }
19052 
19053 /** gets negated variables x' = lb + ub - x of variables x; negated variables are created, if not yet existing
19054  *
19055  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19056  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19057  *
19058  * @pre This method can be called if @p scip is in one of the following stages:
19059  * - \ref SCIP_STAGE_PROBLEM
19060  * - \ref SCIP_STAGE_TRANSFORMING
19061  * - \ref SCIP_STAGE_TRANSFORMED
19062  * - \ref SCIP_STAGE_INITPRESOLVE
19063  * - \ref SCIP_STAGE_PRESOLVING
19064  * - \ref SCIP_STAGE_EXITPRESOLVE
19065  * - \ref SCIP_STAGE_PRESOLVED
19066  * - \ref SCIP_STAGE_INITSOLVE
19067  * - \ref SCIP_STAGE_SOLVING
19068  * - \ref SCIP_STAGE_SOLVED
19069  * - \ref SCIP_STAGE_EXITSOLVE
19070  * - \ref SCIP_STAGE_FREETRANS
19071  */
19073  SCIP* scip, /**< SCIP data structure */
19074  int nvars, /**< number of variables to get negated variables for */
19075  SCIP_VAR** vars, /**< array of variables to get negated variables for */
19076  SCIP_VAR** negvars /**< array to store the negated variables */
19077  )
19078 {
19079  int v;
19080 
19081  SCIP_CALL( checkStage(scip, "SCIPgetNegatedVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
19082 
19083  for( v = 0; v < nvars; ++v )
19084  {
19085  SCIP_CALL( SCIPvarNegate(vars[v], scip->mem->probmem, scip->set, scip->stat, &(negvars[v])) );
19086  }
19087 
19088  return SCIP_OKAY;
19089 }
19090 
19091 /** gets a binary variable that is equal to the given binary variable, and that is either active, fixed, or
19092  * multi-aggregated, or the negated variable of an active, fixed, or multi-aggregated variable
19093  *
19094  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19095  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19096  *
19097  * @pre This method can be called if @p scip is in one of the following stages:
19098  * - \ref SCIP_STAGE_PROBLEM
19099  * - \ref SCIP_STAGE_TRANSFORMED
19100  * - \ref SCIP_STAGE_INITPRESOLVE
19101  * - \ref SCIP_STAGE_PRESOLVING
19102  * - \ref SCIP_STAGE_EXITPRESOLVE
19103  * - \ref SCIP_STAGE_PRESOLVED
19104  * - \ref SCIP_STAGE_INITSOLVE
19105  * - \ref SCIP_STAGE_SOLVING
19106  * - \ref SCIP_STAGE_SOLVED
19107  * - \ref SCIP_STAGE_EXITSOLVE
19108  */
19110  SCIP* scip, /**< SCIP data structure */
19111  SCIP_VAR* var, /**< binary variable to get binary representative for */
19112  SCIP_VAR** repvar, /**< pointer to store the binary representative */
19113  SCIP_Bool* negated /**< pointer to store whether the negation of an active variable was returned */
19114  )
19115 {
19116  assert(scip != NULL);
19117  assert(var != NULL);
19118  assert(repvar != NULL);
19119  assert(negated != NULL);
19120  assert(var->scip == scip);
19121 
19122  SCIP_CALL( checkStage(scip, "SCIPgetBinvarRepresentative", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
19123 
19124  /* get the active representative of the given variable */
19125  *repvar = var;
19126  *negated = FALSE;
19127  SCIP_CALL( SCIPvarGetProbvarBinary(repvar, negated) );
19128 
19129  /* negate the representative, if it corresponds to the negation of the given variable */
19130  if( *negated )
19131  {
19132  SCIP_CALL( SCIPgetNegatedVar(scip, *repvar, repvar) );
19133  }
19134 
19135  return SCIP_OKAY;
19136 }
19137 
19138 /** gets binary variables that are equal to the given binary variables, and which are either active, fixed, or
19139  * multi-aggregated, or the negated variables of active, fixed, or multi-aggregated variables
19140  *
19141  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19142  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19143  *
19144  * @pre This method can be called if @p scip is in one of the following stages:
19145  * - \ref SCIP_STAGE_PROBLEM
19146  * - \ref SCIP_STAGE_TRANSFORMED
19147  * - \ref SCIP_STAGE_INITPRESOLVE
19148  * - \ref SCIP_STAGE_PRESOLVING
19149  * - \ref SCIP_STAGE_EXITPRESOLVE
19150  * - \ref SCIP_STAGE_PRESOLVED
19151  * - \ref SCIP_STAGE_INITSOLVE
19152  * - \ref SCIP_STAGE_SOLVING
19153  * - \ref SCIP_STAGE_SOLVED
19154  * - \ref SCIP_STAGE_EXITSOLVE
19155  */
19157  SCIP* scip, /**< SCIP data structure */
19158  int nvars, /**< number of binary variables to get representatives for */
19159  SCIP_VAR** vars, /**< binary variables to get binary representatives for */
19160  SCIP_VAR** repvars, /**< array to store the binary representatives */
19161  SCIP_Bool* negated /**< array to store whether the negation of an active variable was returned */
19162  )
19163 {
19164  int v;
19165 
19166  assert(scip != NULL);
19167  assert(vars != NULL || nvars == 0);
19168  assert(repvars != NULL || nvars == 0);
19169  assert(negated != NULL || nvars == 0);
19170 
19171  SCIP_CALL( checkStage(scip, "SCIPgetBinvarRepresentatives", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
19172 
19173  if( nvars == 0 )
19174  return SCIP_OKAY;
19175 
19176  /* get the active representative of the given variable */
19177  BMScopyMemoryArray(repvars, vars, nvars);
19178  BMSclearMemoryArray(negated, nvars);
19179  SCIP_CALL( SCIPvarsGetProbvarBinary(&repvars, &negated, nvars) );
19180 
19181  /* negate the representatives, if they correspond to the negation of the given variables */
19182  for( v = nvars - 1; v >= 0; --v )
19183  if( negated[v] )
19184  {
19185  SCIP_CALL( SCIPgetNegatedVar(scip, repvars[v], &(repvars[v])) );
19186  }
19187 
19188  return SCIP_OKAY;
19189 }
19190 
19191 /** flattens aggregation graph of multi-aggregated variable in order to avoid exponential recursion later on
19192  *
19193  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19194  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19195  *
19196  * @pre This method can be called if @p scip is in one of the following stages:
19197  * - \ref SCIP_STAGE_INITPRESOLVE
19198  * - \ref SCIP_STAGE_PRESOLVING
19199  * - \ref SCIP_STAGE_EXITPRESOLVE
19200  * - \ref SCIP_STAGE_PRESOLVED
19201  * - \ref SCIP_STAGE_INITSOLVE
19202  * - \ref SCIP_STAGE_SOLVING
19203  * - \ref SCIP_STAGE_SOLVED
19204  */
19206  SCIP* scip, /**< SCIP data structure */
19207  SCIP_VAR* var /**< problem variable */
19208  )
19209 {
19210  assert( scip != NULL );
19211  assert( var != NULL );
19212  SCIP_CALL( checkStage(scip, "SCIPflattenVarAggregationGraph", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
19213 
19214  SCIP_CALL( SCIPvarFlattenAggregationGraph(var, scip->mem->probmem, scip->set) );
19215  return SCIP_OKAY;
19216 }
19217 
19218 /** Transforms a given linear sum of variables, that is a_1*x_1 + ... + a_n*x_n + c into a corresponding linear sum of
19219  * active variables, that is b_1*y_1 + ... + b_m*y_m + d.
19220  *
19221  * If the number of needed active variables is greater than the available slots in the variable array, nothing happens
19222  * except that the required size is stored in the corresponding variable (requiredsize). Otherwise, the active variable
19223  * representation is stored in the variable array, scalar array and constant.
19224  *
19225  * The reason for this approach is that we cannot reallocate memory, since we do not know how the memory has been
19226  * allocated (e.g., by a C++ 'new' or SCIP functions).
19227  *
19228  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19229  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19230  *
19231  * @pre This method can be called if @p scip is in one of the following stages:
19232  * - \ref SCIP_STAGE_TRANSFORMED
19233  * - \ref SCIP_STAGE_INITPRESOLVE
19234  * - \ref SCIP_STAGE_PRESOLVING
19235  * - \ref SCIP_STAGE_EXITPRESOLVE
19236  * - \ref SCIP_STAGE_PRESOLVED
19237  * - \ref SCIP_STAGE_INITSOLVE
19238  * - \ref SCIP_STAGE_SOLVING
19239  * - \ref SCIP_STAGE_SOLVED
19240  * - \ref SCIP_STAGE_EXITSOLVE
19241  * - \ref SCIP_STAGE_FREETRANS
19242  *
19243  * @note The resulting linear sum is stored into the given variable array, scalar array, and constant. That means the
19244  * given entries are overwritten.
19245  *
19246  * @note That method can be used to convert a single variables into variable space of active variables. Therefore call
19247  * the method with the linear sum 1.0*x + 0.0.
19248  */
19250  SCIP* scip, /**< SCIP data structure */
19251  SCIP_VAR** vars, /**< variable array x_1, ..., x_n in the linear sum which will be
19252  * overwritten by the variable array y_1, ..., y_m in the linear sum
19253  * w.r.t. active variables */
19254  SCIP_Real* scalars, /**< scalars a_1, ..., a_n in linear sum which will be overwritten to the
19255  * scalars b_1, ..., b_m in the linear sum of the active variables */
19256  int* nvars, /**< pointer to number of variables in the linear sum which will be
19257  * overwritten by the number of variables in the linear sum corresponding
19258  * to the active variables */
19259  int varssize, /**< available slots in vars and scalars array which is needed to check if
19260  * the array are large enough for the linear sum w.r.t. active
19261  * variables */
19262  SCIP_Real* constant, /**< pointer to constant c in linear sum a_1*x_1 + ... + a_n*x_n + c which
19263  * will chnage to constant d in the linear sum b_1*y_1 + ... + b_m*y_m +
19264  * d w.r.t. the active variables */
19265  int* requiredsize, /**< pointer to store the required array size for the linear sum w.r.t. the
19266  * active variables */
19267  SCIP_Bool mergemultiples /**< should multiple occurrences of a var be replaced by a single coeff? */
19268  )
19269 {
19270  assert( scip != NULL );
19271  assert( nvars != NULL );
19272  assert( vars != NULL || *nvars == 0 );
19273  assert( scalars != NULL || *nvars == 0 );
19274  assert( constant != NULL );
19275  assert( requiredsize != NULL );
19276  assert( *nvars <= varssize );
19277 
19278  SCIP_CALL( checkStage(scip, "SCIPgetProbvarLinearSum", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
19279  SCIP_CALL( SCIPvarGetActiveRepresentatives(scip->set, vars, scalars, nvars, varssize, constant, requiredsize, mergemultiples) );
19280 
19281  return SCIP_OKAY;
19282 }
19283 
19284 /** transforms given variable, scalar and constant to the corresponding active, fixed, or
19285  * multi-aggregated variable, scalar and constant; if the variable resolves to a fixed variable,
19286  * "scalar" will be 0.0 and the value of the sum will be stored in "constant"; a multi-aggregation
19287  * with only one active variable (this can happen due to fixings after the multi-aggregation),
19288  * is treated like an aggregation; if the multi-aggregation constant is infinite, "scalar" will be 0.0
19289  *
19290  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19291  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19292  *
19293  * @pre This method can be called if @p scip is in one of the following stages:
19294  * - \ref SCIP_STAGE_TRANSFORMED
19295  * - \ref SCIP_STAGE_INITPRESOLVE
19296  * - \ref SCIP_STAGE_PRESOLVING
19297  * - \ref SCIP_STAGE_EXITPRESOLVE
19298  * - \ref SCIP_STAGE_PRESOLVED
19299  * - \ref SCIP_STAGE_INITSOLVE
19300  * - \ref SCIP_STAGE_SOLVING
19301  * - \ref SCIP_STAGE_SOLVED
19302  * - \ref SCIP_STAGE_EXITSOLVE
19303  * - \ref SCIP_STAGE_FREETRANS
19304  */
19306  SCIP* scip, /**< SCIP data structure */
19307  SCIP_VAR** var, /**< pointer to problem variable x in sum a*x + c */
19308  SCIP_Real* scalar, /**< pointer to scalar a in sum a*x + c */
19309  SCIP_Real* constant /**< pointer to constant c in sum a*x + c */
19310  )
19311 {
19312  assert(scip != NULL);
19313  assert(var != NULL);
19314  assert(scalar != NULL);
19315  assert(constant != NULL);
19316 
19317  SCIP_CALL( checkStage(scip, "SCIPgetProbvarSum", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
19318  SCIP_CALL( SCIPvarGetProbvarSum(var, scip->set, scalar, constant) );
19319 
19320  return SCIP_OKAY;
19321 }
19322 
19323 /** return for given variables all their active counterparts; all active variables will be pairwise different
19324  * @note It does not hold that the first output variable is the active variable for the first input variable.
19325  *
19326  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19327  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19328  *
19329  * @pre This method can be called if @p scip is in one of the following stages:
19330  * - \ref SCIP_STAGE_TRANSFORMED
19331  * - \ref SCIP_STAGE_INITPRESOLVE
19332  * - \ref SCIP_STAGE_PRESOLVING
19333  * - \ref SCIP_STAGE_EXITPRESOLVE
19334  * - \ref SCIP_STAGE_PRESOLVED
19335  * - \ref SCIP_STAGE_INITSOLVE
19336  * - \ref SCIP_STAGE_SOLVING
19337  * - \ref SCIP_STAGE_SOLVED
19338  * - \ref SCIP_STAGE_EXITSOLVE
19339  * - \ref SCIP_STAGE_FREETRANS
19340  */
19342  SCIP* scip, /**< SCIP data structure */
19343  SCIP_VAR** vars, /**< variable array with given variables and as output all active
19344  * variables, if enough slots exist
19345  */
19346  int* nvars, /**< number of given variables, and as output number of active variables,
19347  * if enough slots exist
19348  */
19349  int varssize, /**< available slots in vars array */
19350  int* requiredsize /**< pointer to store the required array size for the active variables */
19351  )
19352 {
19353  assert(scip != NULL);
19354  assert(nvars != NULL);
19355  assert(vars != NULL || *nvars == 0);
19356  assert(varssize >= *nvars);
19357  assert(requiredsize != NULL);
19358 
19359  SCIP_CALL( checkStage(scip, "SCIPgetActiveVars", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
19360  SCIP_CALL( SCIPvarsGetActiveVars(scip->set, vars, nvars, varssize, requiredsize) );
19361 
19362  return SCIP_OKAY;
19363 }
19364 
19365 /** returns the reduced costs of the variable in the current node's LP relaxation;
19366  * the current node has to have a feasible LP.
19367  *
19368  * returns SCIP_INVALID if the variable is active but not in the current LP;
19369  * returns 0 if the variable has been aggregated out or fixed in presolving.
19370  *
19371  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
19372  *
19373  * @note The return value of this method should be used carefully if the dual feasibility check was explictely disabled.
19374  */
19376  SCIP* scip, /**< SCIP data structure */
19377  SCIP_VAR* var /**< variable to get reduced costs, should be a column in current node LP */
19378  )
19379 {
19380  assert( scip != NULL );
19381  assert( var != NULL );
19382  assert( var->scip == scip );
19383 
19384  switch( SCIPvarGetStatus(var) )
19385  {
19387  if( var->data.original.transvar == NULL )
19388  return SCIP_INVALID;
19389  return SCIPgetVarRedcost(scip, var->data.original.transvar);
19390 
19391  case SCIP_VARSTATUS_COLUMN:
19392  return SCIPgetColRedcost(scip, SCIPvarGetCol(var));
19393 
19394  case SCIP_VARSTATUS_LOOSE:
19395  return SCIP_INVALID;
19396 
19397  case SCIP_VARSTATUS_FIXED:
19401  return 0.0;
19402 
19403  default:
19404  SCIPerrorMessage("unknown variable status\n");
19405  SCIPABORT();
19406  return 0.0; /*lint !e527*/
19407  }
19408 }
19409 
19410 /** returns the implied reduced costs of the variable in the current node's LP relaxation;
19411  * the current node has to have a feasible LP.
19412  *
19413  * returns SCIP_INVALID if the variable is active but not in the current LP;
19414  * returns 0 if the variable has been aggregated out or fixed in presolving.
19415  *
19416  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
19417  *
19418  * @note The return value of this method should be used carefully if the dual feasibility check was explictely disabled.
19419  */
19421  SCIP* scip, /**< SCIP data structure */
19422  SCIP_VAR* var, /**< variable to get reduced costs, should be a column in current node LP */
19423  SCIP_Bool varfixing /**< FALSE if for x == 0, TRUE for x == 1 */
19424  )
19425 {
19426  assert( scip != NULL );
19427  assert( var != NULL );
19428  assert( var->scip == scip );
19429 
19430  switch( SCIPvarGetStatus(var) )
19431  {
19433  if( var->data.original.transvar == NULL )
19434  return SCIP_INVALID;
19435  return SCIPgetVarImplRedcost(scip, var->data.original.transvar, varfixing);
19436 
19437  case SCIP_VARSTATUS_COLUMN:
19438  return SCIPvarGetImplRedcost(var, scip->set, varfixing, scip->stat, scip->transprob, scip->lp);
19439 
19440  case SCIP_VARSTATUS_LOOSE:
19441  return SCIP_INVALID;
19442 
19443  case SCIP_VARSTATUS_FIXED:
19447  return 0.0;
19448 
19449  default:
19450  SCIPerrorMessage("unknown variable status\n");
19451  SCIPABORT();
19452  return 0.0; /*lint !e527*/
19453  }
19454 }
19455 
19456 
19457 /** returns the Farkas coefficient of the variable in the current node's LP relaxation;
19458  * the current node has to have an infeasible LP.
19459  *
19460  * returns SCIP_INVALID if the variable is active but not in the current LP;
19461  * returns 0 if the variable has been aggregated out or fixed in presolving.
19462  *
19463  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
19464  */
19466  SCIP* scip, /**< SCIP data structure */
19467  SCIP_VAR* var /**< variable to get reduced costs, should be a column in current node LP */
19468  )
19469 {
19470  assert(scip != NULL);
19471  assert(var != NULL);
19472  assert(var->scip == scip);
19473 
19474  switch( SCIPvarGetStatus(var) )
19475  {
19477  if( var->data.original.transvar == NULL )
19478  return SCIP_INVALID;
19479  return SCIPgetVarFarkasCoef(scip,var->data.original.transvar);
19480 
19481  case SCIP_VARSTATUS_COLUMN:
19482  return SCIPgetColFarkasCoef(scip,SCIPvarGetCol(var));
19483 
19484  case SCIP_VARSTATUS_LOOSE:
19485  return SCIP_INVALID;
19486 
19487  case SCIP_VARSTATUS_FIXED:
19491  return 0.0;
19492 
19493  default:
19494  SCIPerrorMessage("unknown variable status\n");
19495  SCIPABORT();
19496  return 0.0; /*lint !e527*/
19497  }
19498 }
19499 
19500 /** returns lower bound of variable directly before or after the bound change given by the bound change index
19501  * was applied
19502  */
19504  SCIP* scip, /**< SCIP data structure */
19505  SCIP_VAR* var, /**< problem variable */
19506  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node */
19507  SCIP_Bool after /**< should the bound change with given index be included? */
19508  )
19509 {
19510  SCIP_VARSTATUS varstatus;
19511  assert(var != NULL);
19512 
19513  varstatus = SCIPvarGetStatus(var);
19514 
19515  if( varstatus == SCIP_VARSTATUS_COLUMN || varstatus == SCIP_VARSTATUS_LOOSE )
19516  {
19517  if( bdchgidx == NULL )
19518  return SCIPvarGetLbLocal(var);
19519  else
19520  {
19521  SCIP_BDCHGINFO* bdchginfo;
19522 
19523  bdchginfo = SCIPvarGetLbchgInfo(var, bdchgidx, after);
19524  if( bdchginfo != NULL )
19525  return SCIPbdchginfoGetNewbound(bdchginfo);
19526  else
19527  return var->glbdom.lb;
19528  }
19529  }
19530 
19531  /* get bounds of attached variables */
19532  switch( varstatus )
19533  {
19535  assert(var->data.original.transvar != NULL);
19536  return SCIPgetVarLbAtIndex(scip, var->data.original.transvar, bdchgidx, after);
19537 
19538  case SCIP_VARSTATUS_FIXED:
19539  return var->glbdom.lb;
19540 
19541  case SCIP_VARSTATUS_AGGREGATED: /* x = a*y + c -> y = (x-c)/a */
19542  assert(var->data.aggregate.var != NULL);
19543  if( var->data.aggregate.scalar > 0.0 )
19544  {
19545  SCIP_Real lb;
19546 
19547  lb = SCIPgetVarLbAtIndex(scip, var->data.aggregate.var, bdchgidx, after);
19548 
19549  /* a > 0 -> get lower bound of y */
19550  if( SCIPisInfinity(scip, -lb) )
19551  return -SCIPinfinity(scip);
19552  else if( SCIPisInfinity(scip, lb) )
19553  return SCIPinfinity(scip);
19554  else
19555  return var->data.aggregate.scalar * lb + var->data.aggregate.constant;
19556  }
19557  else if( var->data.aggregate.scalar < 0.0 )
19558  {
19559  SCIP_Real ub;
19560 
19561  ub = SCIPgetVarUbAtIndex(scip, var->data.aggregate.var, bdchgidx, after);
19562 
19563  /* a < 0 -> get upper bound of y */
19564  if( SCIPisInfinity(scip, -ub) )
19565  return SCIPinfinity(scip);
19566  else if( SCIPisInfinity(scip, ub) )
19567  return -SCIPinfinity(scip);
19568  else
19569  return var->data.aggregate.scalar * ub + var->data.aggregate.constant;
19570  }
19571  else
19572  {
19573  SCIPerrorMessage("scalar is zero in aggregation\n");
19574  SCIPABORT();
19575  return SCIP_INVALID; /*lint !e527*/
19576  }
19577 
19579  /* handle multi-aggregated variables depending on one variable only (possibly caused by SCIPvarFlattenAggregationGraph()) */
19580  if ( var->data.multaggr.nvars == 1 )
19581  {
19582  assert(var->data.multaggr.vars != NULL);
19583  assert(var->data.multaggr.scalars != NULL);
19584  assert(var->data.multaggr.vars[0] != NULL);
19585 
19586  if( var->data.multaggr.scalars[0] > 0.0 )
19587  {
19588  SCIP_Real lb;
19589 
19590  lb = SCIPgetVarLbAtIndex(scip, var->data.multaggr.vars[0], bdchgidx, after);
19591 
19592  /* a > 0 -> get lower bound of y */
19593  if( SCIPisInfinity(scip, -lb) )
19594  return -SCIPinfinity(scip);
19595  else if( SCIPisInfinity(scip, lb) )
19596  return SCIPinfinity(scip);
19597  else
19598  return var->data.multaggr.scalars[0] * lb + var->data.multaggr.constant;
19599  }
19600  else if( var->data.multaggr.scalars[0] < 0.0 )
19601  {
19602  SCIP_Real ub;
19603 
19604  ub = SCIPgetVarUbAtIndex(scip, var->data.multaggr.vars[0], bdchgidx, after);
19605 
19606  /* a < 0 -> get upper bound of y */
19607  if( SCIPisInfinity(scip, -ub) )
19608  return SCIPinfinity(scip);
19609  else if( SCIPisInfinity(scip, ub) )
19610  return -SCIPinfinity(scip);
19611  else
19612  return var->data.multaggr.scalars[0] * ub + var->data.multaggr.constant;
19613  }
19614  else
19615  {
19616  SCIPerrorMessage("scalar is zero in multi-aggregation\n");
19617  SCIPABORT();
19618  return SCIP_INVALID; /*lint !e527*/
19619  }
19620  }
19621  SCIPerrorMessage("cannot get the bounds of a multi-aggregated variable.\n");
19622  SCIPABORT();
19623  return SCIP_INVALID; /*lint !e527*/
19624 
19625  case SCIP_VARSTATUS_NEGATED: /* x' = offset - x -> x = offset - x' */
19626  assert(var->negatedvar != NULL);
19628  assert(var->negatedvar->negatedvar == var);
19629  return var->data.negate.constant - SCIPgetVarUbAtIndex(scip, var->negatedvar, bdchgidx, after);
19630 
19631  case SCIP_VARSTATUS_COLUMN: /* for lint */
19632  case SCIP_VARSTATUS_LOOSE: /* for lint */
19633  default:
19634  SCIPerrorMessage("unknown variable status\n");
19635  SCIPABORT();
19636  return SCIP_INVALID; /*lint !e527*/
19637  }
19638 }
19639 
19640 /** returns upper bound of variable directly before or after the bound change given by the bound change index
19641  * was applied
19642  */
19644  SCIP* scip, /**< SCIP data structure */
19645  SCIP_VAR* var, /**< problem variable */
19646  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node */
19647  SCIP_Bool after /**< should the bound change with given index be included? */
19648  )
19649 {
19650  SCIP_VARSTATUS varstatus;
19651  assert(var != NULL);
19652 
19653  varstatus = SCIPvarGetStatus(var);
19654 
19655  if( varstatus == SCIP_VARSTATUS_COLUMN || varstatus == SCIP_VARSTATUS_LOOSE )
19656  {
19657  if( bdchgidx == NULL )
19658  return SCIPvarGetUbLocal(var);
19659  else
19660  {
19661  SCIP_BDCHGINFO* bdchginfo;
19662 
19663  bdchginfo = SCIPvarGetUbchgInfo(var, bdchgidx, after);
19664  if( bdchginfo != NULL )
19665  return SCIPbdchginfoGetNewbound(bdchginfo);
19666  else
19667  return var->glbdom.ub;
19668  }
19669  }
19670 
19671  /* get bounds of attached variables */
19672  switch( varstatus )
19673  {
19675  assert(var->data.original.transvar != NULL);
19676  return SCIPgetVarUbAtIndex(scip, var->data.original.transvar, bdchgidx, after);
19677 
19678  case SCIP_VARSTATUS_FIXED:
19679  return var->glbdom.ub;
19680 
19681  case SCIP_VARSTATUS_AGGREGATED: /* x = a*y + c -> y = (x-c)/a */
19682  assert(var->data.aggregate.var != NULL);
19683  if( var->data.aggregate.scalar > 0.0 )
19684  {
19685  SCIP_Real ub;
19686 
19687  ub = SCIPgetVarUbAtIndex(scip, var->data.aggregate.var, bdchgidx, after);
19688 
19689  /* a > 0 -> get lower bound of y */
19690  if( SCIPisInfinity(scip, -ub) )
19691  return -SCIPinfinity(scip);
19692  else if( SCIPisInfinity(scip, ub) )
19693  return SCIPinfinity(scip);
19694  else
19695  return var->data.aggregate.scalar * ub + var->data.aggregate.constant;
19696  }
19697  else if( var->data.aggregate.scalar < 0.0 )
19698  {
19699  SCIP_Real lb;
19700 
19701  lb = SCIPgetVarLbAtIndex(scip, var->data.aggregate.var, bdchgidx, after);
19702 
19703  /* a < 0 -> get upper bound of y */
19704  if ( SCIPisInfinity(scip, -lb) )
19705  return SCIPinfinity(scip);
19706  else if ( SCIPisInfinity(scip, lb) )
19707  return -SCIPinfinity(scip);
19708  else
19709  return var->data.aggregate.scalar * lb + var->data.aggregate.constant;
19710  }
19711  else
19712  {
19713  SCIPerrorMessage("scalar is zero in aggregation\n");
19714  SCIPABORT();
19715  return SCIP_INVALID; /*lint !e527*/
19716  }
19717 
19719  /* handle multi-aggregated variables depending on one variable only (possibly caused by SCIPvarFlattenAggregationGraph()) */
19720  if ( var->data.multaggr.nvars == 1 )
19721  {
19722  assert(var->data.multaggr.vars != NULL);
19723  assert(var->data.multaggr.scalars != NULL);
19724  assert(var->data.multaggr.vars[0] != NULL);
19725 
19726  if( var->data.multaggr.scalars[0] > 0.0 )
19727  {
19728  SCIP_Real ub;
19729 
19730  ub = SCIPgetVarUbAtIndex(scip, var->data.multaggr.vars[0], bdchgidx, after);
19731 
19732  /* a > 0 -> get lower bound of y */
19733  if ( SCIPisInfinity(scip, -ub) )
19734  return -SCIPinfinity(scip);
19735  else if ( SCIPisInfinity(scip, ub) )
19736  return SCIPinfinity(scip);
19737  else
19738  return var->data.multaggr.scalars[0] * ub + var->data.multaggr.constant;
19739  }
19740  else if( var->data.multaggr.scalars[0] < 0.0 )
19741  {
19742  SCIP_Real lb;
19743 
19744  lb = SCIPgetVarLbAtIndex(scip, var->data.multaggr.vars[0], bdchgidx, after);
19745 
19746  /* a < 0 -> get upper bound of y */
19747  if ( SCIPisInfinity(scip, -lb) )
19748  return SCIPinfinity(scip);
19749  else if ( SCIPisInfinity(scip, lb) )
19750  return -SCIPinfinity(scip);
19751  else
19752  return var->data.multaggr.scalars[0] * lb + var->data.multaggr.constant;
19753  }
19754  else
19755  {
19756  SCIPerrorMessage("scalar is zero in multi-aggregation\n");
19757  SCIPABORT();
19758  return SCIP_INVALID; /*lint !e527*/
19759  }
19760  }
19761  SCIPerrorMessage("cannot get the bounds of a multiple aggregated variable.\n");
19762  SCIPABORT();
19763  return SCIP_INVALID; /*lint !e527*/
19764 
19765  case SCIP_VARSTATUS_NEGATED: /* x' = offset - x -> x = offset - x' */
19766  assert(var->negatedvar != NULL);
19768  assert(var->negatedvar->negatedvar == var);
19769  return var->data.negate.constant - SCIPgetVarLbAtIndex(scip, var->negatedvar, bdchgidx, after);
19770 
19771  case SCIP_VARSTATUS_COLUMN: /* for lint */
19772  case SCIP_VARSTATUS_LOOSE: /* for lint */
19773  default:
19774  SCIPerrorMessage("unknown variable status\n");
19775  SCIPABORT();
19776  return SCIP_INVALID; /*lint !e527*/
19777  }
19778 }
19779 
19780 /** returns lower or upper bound of variable directly before or after the bound change given by the bound change index
19781  * was applied
19782  */
19784  SCIP* scip, /**< SCIP data structure */
19785  SCIP_VAR* var, /**< problem variable */
19786  SCIP_BOUNDTYPE boundtype, /**< type of bound: lower or upper bound */
19787  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node */
19788  SCIP_Bool after /**< should the bound change with given index be included? */
19789  )
19790 {
19791  if( boundtype == SCIP_BOUNDTYPE_LOWER )
19792  return SCIPgetVarLbAtIndex(scip, var, bdchgidx, after);
19793  else
19794  {
19795  assert(boundtype == SCIP_BOUNDTYPE_UPPER);
19796  return SCIPgetVarUbAtIndex(scip, var, bdchgidx, after);
19797  }
19798 }
19799 
19800 /** returns whether the binary variable was fixed at the time given by the bound change index */
19802  SCIP* scip, /**< SCIP data structure */
19803  SCIP_VAR* var, /**< problem variable */
19804  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node */
19805  SCIP_Bool after /**< should the bound change with given index be included? */
19806  )
19807 {
19808  assert(var != NULL);
19809  assert(SCIPvarIsBinary(var));
19810 
19811  /* check the current bounds first in order to decide at which bound change information we have to look
19812  * (which is expensive because we have to follow the aggregation tree to the active variable)
19813  */
19814  return ((SCIPvarGetLbLocal(var) > 0.5 && SCIPgetVarLbAtIndex(scip, var, bdchgidx, after) > 0.5)
19815  || (SCIPvarGetUbLocal(var) < 0.5 && SCIPgetVarUbAtIndex(scip, var, bdchgidx, after) < 0.5));
19816 }
19817 
19818 /** gets solution value for variable in current node
19819  *
19820  * @return solution value for variable in current node
19821  *
19822  * @pre This method can be called if @p scip is in one of the following stages:
19823  * - \ref SCIP_STAGE_PRESOLVED
19824  * - \ref SCIP_STAGE_SOLVING
19825  */
19827  SCIP* scip, /**< SCIP data structure */
19828  SCIP_VAR* var /**< variable to get solution value for */
19829  )
19830 {
19831  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19832  assert( var->scip == scip );
19833 
19834  return SCIPvarGetSol(var, SCIPtreeHasCurrentNodeLP(scip->tree));
19835 }
19836 
19837 /** gets solution values of multiple variables in current node
19838  *
19839  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19840  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19841  *
19842  * @pre This method can be called if @p scip is in one of the following stages:
19843  * - \ref SCIP_STAGE_PRESOLVED
19844  * - \ref SCIP_STAGE_SOLVING
19845  */
19847  SCIP* scip, /**< SCIP data structure */
19848  int nvars, /**< number of variables to get solution value for */
19849  SCIP_VAR** vars, /**< array with variables to get value for */
19850  SCIP_Real* vals /**< array to store solution values of variables */
19851  )
19852 {
19853  int v;
19854 
19855  assert(nvars == 0 || vars != NULL);
19856  assert(nvars == 0 || vals != NULL);
19857 
19858  SCIP_CALL( checkStage(scip, "SCIPgetVarSols", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19859 
19860  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
19861  {
19862  for( v = 0; v < nvars; ++v )
19863  vals[v] = SCIPvarGetLPSol(vars[v]);
19864  }
19865  else
19866  {
19867  for( v = 0; v < nvars; ++v )
19868  vals[v] = SCIPvarGetPseudoSol(vars[v]);
19869  }
19870 
19871  return SCIP_OKAY;
19872 }
19873 
19874 /** sets the solution value of all variables in the global relaxation solution to zero
19875  *
19876  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19877  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19878  *
19879  * @pre This method can be called if @p scip is in one of the following stages:
19880  * - \ref SCIP_STAGE_PRESOLVED
19881  * - \ref SCIP_STAGE_SOLVING
19882  */
19884  SCIP* scip /**< SCIP data structure */
19885  )
19886 {
19887  SCIP_VAR** vars;
19888  int nvars;
19889  int v;
19890 
19891  assert(scip != NULL);
19892 
19893  SCIP_CALL( checkStage(scip, "SCIPclearRelaxSolVals", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19894 
19895  /* the relaxation solution is already cleared */
19896  if( SCIPrelaxationIsSolZero(scip->relaxation) )
19897  return SCIP_OKAY;
19898 
19899  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, NULL, NULL, NULL, NULL) );
19900 
19901  for( v = 0; v < nvars; v++ )
19902  {
19903  SCIP_CALL( SCIPvarSetRelaxSol(vars[v], scip->set, scip->relaxation, 0.0, FALSE) );
19904  }
19905 
19906  SCIPrelaxationSetSolObj(scip->relaxation, 0.0);
19908 
19909  return SCIP_OKAY;
19910 }
19911 
19912 /** sets the value of the given variable in the global relaxation solution;
19913  * this solution can be filled by the relaxation handlers and can be used by heuristics and for separation;
19914  * You can use SCIPclearRelaxSolVals() to set all values to zero, initially;
19915  * after setting all solution values, you have to call SCIPmarkRelaxSolValid()
19916  * to inform SCIP that the stored solution is valid
19917  *
19918  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19919  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19920  *
19921  * @pre This method can be called if @p scip is in one of the following stages:
19922  * - \ref SCIP_STAGE_PRESOLVED
19923  * - \ref SCIP_STAGE_SOLVING
19924  *
19925  * @note This method incrementally updates the objective value of the relaxation solution. If the whole solution
19926  * should be updated, using SCIPsetRelaxSolVals() instead or calling SCIPclearRelaxSolVals() before setting
19927  * the first value to reset the solution and the objective value to 0 may help the numerics.
19928  */
19930  SCIP* scip, /**< SCIP data structure */
19931  SCIP_VAR* var, /**< variable to set value for */
19932  SCIP_Real val /**< solution value of variable */
19933  )
19934 {
19935  assert(scip != NULL);
19936 
19937  SCIP_CALL( checkStage(scip, "SCIPsetRelaxSolVal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19938 
19939  SCIP_CALL( SCIPvarSetRelaxSol(var, scip->set, scip->relaxation, val, TRUE) );
19940 
19941  if( val != 0.0 )
19944 
19945  return SCIP_OKAY;
19946 }
19947 
19948 /** sets the values of the given variables in the global relaxation solution and informs SCIP about the validity
19949  * and whether the solution can be enforced via linear cuts;
19950  * this solution can be filled by the relaxation handlers and can be used by heuristics and for separation;
19951  * the solution is automatically cleared, s.t. all other variables get value 0.0
19952  *
19953  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19954  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19955  *
19956  * @pre This method can be called if @p scip is in one of the following stages:
19957  * - \ref SCIP_STAGE_PRESOLVED
19958  * - \ref SCIP_STAGE_SOLVING
19959  */
19961  SCIP* scip, /**< SCIP data structure */
19962  int nvars, /**< number of variables to set relaxation solution value for */
19963  SCIP_VAR** vars, /**< array with variables to set value for */
19964  SCIP_Real* vals, /**< array with solution values of variables */
19965  SCIP_Bool includeslp /**< does the relaxator contain all cuts in the LP? */
19966  )
19967 {
19968  int v;
19969 
19970  assert(scip != NULL);
19971  assert(nvars == 0 || vars != NULL);
19972  assert(nvars == 0 || vals != NULL);
19973 
19974  SCIP_CALL( checkStage(scip, "SCIPsetRelaxSolVals", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19975 
19977 
19978  for( v = 0; v < nvars; v++ )
19979  {
19980  SCIP_CALL( SCIPvarSetRelaxSol(vars[v], scip->set, scip->relaxation, vals[v], TRUE) );
19981  }
19982 
19984  SCIPrelaxationSetSolValid(scip->relaxation, TRUE, includeslp);
19985 
19986  return SCIP_OKAY;
19987 }
19988 
19989 /** sets the values of the variables in the global relaxation solution to the values in the given primal solution
19990  * and informs SCIP about the validity and whether the solution can be enforced via linear cuts;
19991  * the relaxation solution can be filled by the relaxation handlers and might be used by heuristics and for separation
19992  *
19993  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19994  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19995  *
19996  * @pre This method can be called if @p scip is in one of the following stages:
19997  * - \ref SCIP_STAGE_PRESOLVED
19998  * - \ref SCIP_STAGE_SOLVING
19999  */
20001  SCIP* scip, /**< SCIP data structure */
20002  SCIP_SOL* sol, /**< primal relaxation solution */
20003  SCIP_Bool includeslp /**< does the relaxator contain all cuts in the LP? */
20004  )
20005 {
20006  SCIP_VAR** vars;
20007  SCIP_Real* vals;
20008  int nvars;
20009  int v;
20010 
20011  assert(scip != NULL);
20012 
20013  SCIP_CALL( checkStage(scip, "SCIPsetRelaxSolValsSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20014 
20015  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, NULL, NULL, NULL, NULL) );
20016 
20017  /* alloc buffer array for solution values of the variables and get the values */
20018  SCIP_CALL( SCIPallocBufferArray(scip, &vals, nvars) );
20019  SCIP_CALL( SCIPgetSolVals(scip, sol, nvars, vars, vals) );
20020 
20022 
20023  for( v = 0; v < nvars; v++ )
20024  {
20025  SCIP_CALL( SCIPvarSetRelaxSol(vars[v], scip->set, scip->relaxation, vals[v], FALSE) );
20026  }
20027 
20028  SCIPrelaxationSetSolObj(scip->relaxation, SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
20029 
20031  SCIPrelaxationSetSolValid(scip->relaxation, TRUE, includeslp);
20032 
20033  SCIPfreeBufferArray(scip, &vals);
20034 
20035  return SCIP_OKAY;
20036 }
20037 
20038 /** returns whether the relaxation solution is valid
20039  *
20040  * @return TRUE, if the relaxation solution is valid; FALSE, otherwise
20041  *
20042  * @pre This method can be called if @p scip is in one of the following stages:
20043  * - \ref SCIP_STAGE_PRESOLVED
20044  * - \ref SCIP_STAGE_SOLVING
20045  */
20047  SCIP* scip /**< SCIP data structure */
20048  )
20049 {
20050  assert(scip != NULL);
20051 
20052  SCIP_CALL_ABORT( checkStage(scip, "SCIPisRelaxSolValid", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20053 
20054  return SCIPrelaxationIsSolValid(scip->relaxation);
20055 }
20056 
20057 /** informs SCIP that the relaxation solution is valid and whether the relaxation can be enforced through linear cuts
20058  *
20059  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20060  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20061  *
20062  * @pre This method can be called if @p scip is in one of the following stages:
20063  * - \ref SCIP_STAGE_PRESOLVED
20064  * - \ref SCIP_STAGE_SOLVING
20065  */
20067  SCIP* scip, /**< SCIP data structure */
20068  SCIP_Bool includeslp /**< does the relaxator contain all cuts in the LP? */
20069  )
20070 {
20071  assert(scip != NULL);
20072 
20073  SCIP_CALL( checkStage(scip, "SCIPmarkRelaxSolValid", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20074 
20075  SCIPrelaxationSetSolValid(scip->relaxation, TRUE, includeslp);
20076 
20077  return SCIP_OKAY;
20078 }
20079 
20080 /** informs SCIP, that the relaxation solution is invalid
20081  *
20082  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20083  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20084  *
20085  * @pre This method can be called if @p scip is in one of the following stages:
20086  * - \ref SCIP_STAGE_PRESOLVED
20087  * - \ref SCIP_STAGE_SOLVING
20088  */
20090  SCIP* scip /**< SCIP data structure */
20091  )
20092 {
20093  assert(scip != NULL);
20094 
20095  SCIP_CALL( checkStage(scip, "SCIPmarkRelaxSolInvalid", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20096 
20098 
20099  return SCIP_OKAY;
20100 }
20101 
20102 /** gets the relaxation solution value of the given variable
20103  *
20104  * @return the relaxation solution value of the given variable
20105  *
20106  * @pre This method can be called if @p scip is in one of the following stages:
20107  * - \ref SCIP_STAGE_PRESOLVED
20108  * - \ref SCIP_STAGE_SOLVING
20109  */
20111  SCIP* scip, /**< SCIP data structure */
20112  SCIP_VAR* var /**< variable to get value for */
20113  )
20114 {
20115  assert(scip != NULL);
20116  assert(var != NULL);
20117  assert(var->scip == scip);
20118 
20119  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRelaxSolVal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20120 
20121  if( !SCIPrelaxationIsSolValid(scip->relaxation) )
20122  {
20123  SCIPerrorMessage("Relaxation Solution is not valid!\n");
20124  SCIPABORT();
20125  return SCIP_INVALID; /*lint !e527*/
20126  }
20127 
20128  return SCIPvarGetRelaxSol(var, scip->set);
20129 }
20130 
20131 /** gets the relaxation solution objective value
20132  *
20133  * @return the objective value of the relaxation solution
20134  *
20135  * @pre This method can be called if @p scip is in one of the following stages:
20136  * - \ref SCIP_STAGE_PRESOLVED
20137  * - \ref SCIP_STAGE_SOLVING
20138  */
20140  SCIP* scip /**< SCIP data structure */
20141  )
20142 {
20143  assert(scip != NULL);
20144 
20145  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRelaxSolObj", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20146 
20147  if( !SCIPrelaxationIsSolValid(scip->relaxation) )
20148  {
20149  SCIPerrorMessage("Relaxation Solution is not valid!\n");
20150  SCIPABORT();
20151  return SCIP_INVALID; /*lint !e527*/
20152  }
20153 
20154  return SCIPrelaxationGetSolObj(scip->relaxation);
20155 }
20156 
20157 /** start strong branching - call before any strong branching
20158  *
20159  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20160  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20161  *
20162  * @pre This method can be called if @p scip is in one of the following stages:
20163  * - \ref SCIP_STAGE_PRESOLVED
20164  * - \ref SCIP_STAGE_SOLVING
20165  *
20166  * @note if propagation is enabled, strong branching is not done directly on the LP, but probing nodes are created
20167  * which allow to perform propagation but also creates some overhead
20168  */
20170  SCIP* scip, /**< SCIP data structure */
20171  SCIP_Bool enablepropagation /**< should propagation be done before solving the strong branching LP? */
20172  )
20173 {
20174  assert( scip != NULL );
20175  SCIP_CALL( checkStage(scip, "SCIPstartStrongbranch", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20176 
20177  assert(!SCIPinProbing(scip));
20178 
20179  SCIPdebugMsg(scip, "starting strong branching mode%s: lpcount=%" SCIP_LONGINT_FORMAT "\n", enablepropagation ? " with propagation" : "", scip->stat->lpcount - scip->stat->nsbdivinglps);
20180 
20181  /* start probing mode to allow propagation before solving the strong branching LPs; if no propagation should be done,
20182  * start the strong branching mode in the LP interface
20183  */
20184  if( enablepropagation )
20185  {
20186  if( SCIPtreeProbing(scip->tree) )
20187  {
20188  SCIPerrorMessage("cannot start strong branching with propagation while in probing mode\n");
20189  return SCIP_INVALIDCALL;
20190  }
20191 
20192  if( scip->lp != NULL && SCIPlpDiving(scip->lp) )
20193  {
20194  SCIPerrorMessage("cannot start strong branching with propagation while in diving mode\n");
20195  return SCIP_INVALIDCALL;
20196  }
20197 
20198  /* other then in SCIPstartProbing(), we do not disable collecting variable statistics during strong branching;
20199  * we cannot disable it, because the pseudo costs would not be updated, otherwise,
20200  * and reliability branching would end up doing strong branching all the time
20201  */
20202  SCIP_CALL( SCIPtreeStartProbing(scip->tree, scip->mem->probmem, scip->set, scip->lp, scip->relaxation, scip->transprob, TRUE) );
20203 
20204  /* inform the LP that the current probing mode is used for strong branching */
20206 
20207  }
20208  else
20209  {
20211  }
20212 
20213  /* reset local strong branching info */
20215 
20216  return SCIP_OKAY;
20217 }
20218 
20219 /** end strong branching - call after any strong branching
20220  *
20221  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20222  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20223  *
20224  * @pre This method can be called if @p scip is in one of the following stages:
20225  * - \ref SCIP_STAGE_PRESOLVED
20226  * - \ref SCIP_STAGE_SOLVING
20227  */
20229  SCIP* scip /**< SCIP data structure */
20230  )
20231 {
20232  assert( scip != NULL );
20233 
20234  SCIP_CALL( checkStage(scip, "SCIPendStrongbranch", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20235 
20236  /* depending on whether the strong branching mode was started with propagation enabled or not, we end the strong
20237  * branching probing mode or the LP strong branching mode
20238  */
20239  if( SCIPtreeProbing(scip->tree) )
20240  {
20241  SCIP_NODE* node;
20242  SCIP_DOMCHG* domchg;
20243  SCIP_VAR** boundchgvars;
20244  SCIP_Real* bounds;
20245  SCIP_BOUNDTYPE* boundtypes;
20246  int nboundchgs;
20247  int nbnds;
20248  int i;
20249 
20250  /* collect all bound changes deducted during probing, which were applied at the probing root and apply them to the
20251  * focusnode
20252  */
20253  node = SCIPgetCurrentNode(scip);
20254  assert(SCIPnodeGetType(node) == SCIP_NODETYPE_PROBINGNODE);
20255  assert(SCIPgetProbingDepth(scip) == 0);
20256 
20257  domchg = SCIPnodeGetDomchg(node);
20258  nboundchgs = SCIPdomchgGetNBoundchgs(domchg);
20259 
20260  SCIP_CALL( SCIPallocBufferArray(scip, &boundchgvars, nboundchgs) );
20261  SCIP_CALL( SCIPallocBufferArray(scip, &bounds, nboundchgs) );
20262  SCIP_CALL( SCIPallocBufferArray(scip, &boundtypes, nboundchgs) );
20263 
20264  for( i = 0, nbnds = 0; i < nboundchgs; ++i )
20265  {
20266  SCIP_BOUNDCHG* boundchg;
20267 
20268  boundchg = SCIPdomchgGetBoundchg(domchg, i);
20269 
20270  /* ignore redundant bound changes */
20271  if( SCIPboundchgIsRedundant(boundchg) )
20272  continue;
20273 
20274  boundchgvars[nbnds] = SCIPboundchgGetVar(boundchg);
20275  bounds[nbnds] = SCIPboundchgGetNewbound(boundchg);
20276  boundtypes[nbnds] = SCIPboundchgGetBoundtype(boundchg);
20277  ++nbnds;
20278  }
20279 
20280  SCIPdebugMsg(scip, "ending strong branching with probing: %d bound changes collected\n", nbnds);
20281 
20282  /* inform the LP that the probing mode is not used for strong branching anymore */
20284 
20285  /* switch back from probing to normal operation mode and restore variables and constraints to focus node */
20286  SCIP_CALL( SCIPtreeEndProbing(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
20287  scip->transprob, scip->origprob, scip->lp, scip->relaxation, scip->primal,
20288  scip->branchcand, scip->eventqueue, scip->eventfilter, scip->cliquetable) );
20289 
20290  /* apply the collected bound changes */
20291  for( i = 0; i < nbnds; ++i )
20292  {
20293  if( boundtypes[i] == SCIP_BOUNDTYPE_LOWER )
20294  {
20295  SCIPdebugMsg(scip, "apply probing lower bound change <%s> >= %.9g\n", SCIPvarGetName(boundchgvars[i]), bounds[i]);
20296  SCIP_CALL( SCIPchgVarLb(scip, boundchgvars[i], bounds[i]) );
20297  }
20298  else
20299  {
20300  SCIPdebugMsg(scip, "apply probing upper bound change <%s> <= %.9g\n", SCIPvarGetName(boundchgvars[i]), bounds[i]);
20301  SCIP_CALL( SCIPchgVarUb(scip, boundchgvars[i], bounds[i]) );
20302  }
20303  }
20304 
20305  SCIPfreeBufferArray(scip, &boundtypes);
20306  SCIPfreeBufferArray(scip, &bounds);
20307  SCIPfreeBufferArray(scip, &boundchgvars);
20308  }
20309  else
20310  {
20311  SCIPdebugMsg(scip, "ending strong branching\n");
20312 
20314  }
20315 
20316  return SCIP_OKAY;
20317 }
20318 
20319 /** analyze the strong branching for the given variable; that includes conflict analysis for infeasible branches and
20320  * storing of root reduced cost information
20321  */
20322 static
20324  SCIP* scip, /**< SCIP data structure */
20325  SCIP_VAR* var, /**< variable to analyze */
20326  SCIP_Bool* downinf, /**< pointer to store whether the downwards branch is infeasible, or NULL */
20327  SCIP_Bool* upinf, /**< pointer to store whether the upwards branch is infeasible, or NULL */
20328  SCIP_Bool* downconflict, /**< pointer to store whether a conflict constraint was created for an
20329  * infeasible downwards branch, or NULL */
20330  SCIP_Bool* upconflict /**< pointer to store whether a conflict constraint was created for an
20331  * infeasible upwards branch, or NULL */
20332  )
20333 {
20334  SCIP_COL* col;
20335  SCIP_Bool downcutoff;
20336  SCIP_Bool upcutoff;
20337 
20338  col = SCIPvarGetCol(var);
20339  assert(col != NULL);
20340 
20341  downcutoff = col->sbdownvalid && SCIPsetIsGE(scip->set, col->sbdown, scip->lp->cutoffbound);
20342  upcutoff = col->sbupvalid && SCIPsetIsGE(scip->set, col->sbup, scip->lp->cutoffbound);
20343 
20344  if( downinf != NULL )
20345  *downinf = downcutoff;
20346  if( upinf != NULL )
20347  *upinf = upcutoff;
20348 
20349  /* analyze infeasible strong branching sub problems:
20350  * because the strong branching's bound change is necessary for infeasibility, it cannot be undone;
20351  * therefore, infeasible strong branchings on non-binary variables will not produce a valid conflict constraint
20352  */
20353  if( scip->set->conf_enable && scip->set->conf_usesb && scip->set->nconflicthdlrs > 0
20354  && SCIPvarIsBinary(var) && SCIPtreeGetCurrentDepth(scip->tree) > 0 )
20355  {
20356  if( (downcutoff && SCIPsetFeasCeil(scip->set, col->primsol-1.0) >= col->lb - 0.5)
20357  || (upcutoff && SCIPsetFeasFloor(scip->set, col->primsol+1.0) <= col->ub + 0.5) )
20358  {
20359  assert(downconflict != NULL);
20360  assert(upconflict != NULL);
20361  SCIP_CALL( SCIPconflictAnalyzeStrongbranch(scip->conflict, scip->conflictstore, scip->mem->probmem, scip->set, scip->stat,
20362  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, col, downconflict, upconflict) );
20363  }
20364  }
20365 
20366  /* the strong branching results can be used to strengthen the root reduced cost information which is used for example
20367  * to propagate against the cutoff bound
20368  *
20369  * @note Ignore the results if the LP solution of the down (up) branch LP is smaller which should not happened by
20370  * theory but can arise due to numerical issues.
20371  */
20372  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 && SCIPvarIsBinary(var) && SCIPlpIsDualReliable(scip->lp) )
20373  {
20374  SCIP_Real lpobjval;
20375 
20376  assert(SCIPgetLPSolstat(scip) == SCIP_LPSOLSTAT_OPTIMAL);
20377 
20378  lpobjval = SCIPlpGetObjval(scip->lp, scip->set, scip->transprob);
20379 
20380  if( col->sbdownvalid && SCIPsetFeasCeil(scip->set, col->primsol-1.0) >= col->lb - 0.5 && lpobjval < col->sbdown )
20381  SCIPvarUpdateBestRootSol(var, scip->set, SCIPvarGetUbGlobal(var), -(col->sbdown - lpobjval), lpobjval);
20382  if( col->sbupvalid && SCIPsetFeasFloor(scip->set, col->primsol+1.0) <= col->ub + 0.5 && lpobjval < col->sbup )
20383  SCIPvarUpdateBestRootSol(var, scip->set, SCIPvarGetLbGlobal(var), col->sbup - lpobjval, lpobjval);
20384  }
20385 
20386  return SCIP_OKAY;
20387 }
20388 
20389 /** gets strong branching information on column variable with fractional value
20390  *
20391  * Before calling this method, the strong branching mode must have been activated by calling SCIPstartStrongbranch();
20392  * after strong branching was done for all candidate variables, the strong branching mode must be ended by
20393  * SCIPendStrongbranch(). Since this method does not apply domain propagation before strongbranching,
20394  * propagation should not be enabled in the SCIPstartStrongbranch() call.
20395  *
20396  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20397  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20398  *
20399  * @pre This method can be called if @p scip is in one of the following stages:
20400  * - \ref SCIP_STAGE_PRESOLVED
20401  * - \ref SCIP_STAGE_SOLVING
20402  */
20404  SCIP* scip, /**< SCIP data structure */
20405  SCIP_VAR* var, /**< variable to get strong branching values for */
20406  int itlim, /**< iteration limit for strong branchings */
20407  SCIP_Real* down, /**< stores dual bound after branching column down */
20408  SCIP_Real* up, /**< stores dual bound after branching column up */
20409  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
20410  * otherwise, it can only be used as an estimate value */
20411  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
20412  * otherwise, it can only be used as an estimate value */
20413  SCIP_Bool* downinf, /**< pointer to store whether the downwards branch is infeasible, or NULL */
20414  SCIP_Bool* upinf, /**< pointer to store whether the upwards branch is infeasible, or NULL */
20415  SCIP_Bool* downconflict, /**< pointer to store whether a conflict constraint was created for an
20416  * infeasible downwards branch, or NULL */
20417  SCIP_Bool* upconflict, /**< pointer to store whether a conflict constraint was created for an
20418  * infeasible upwards branch, or NULL */
20419  SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred or the
20420  * solving process should be stopped (e.g., due to a time limit) */
20421  )
20422 {
20423  SCIP_COL* col;
20424 
20425  assert(scip != NULL);
20426  assert(var != NULL);
20427  assert(lperror != NULL);
20428  assert(!SCIPtreeProbing(scip->tree)); /* we should not be in strong branching with propagation mode */
20429  assert(var->scip == scip);
20430 
20431  SCIP_CALL( checkStage(scip, "SCIPgetVarStrongbranchFrac", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20432 
20433  if( downvalid != NULL )
20434  *downvalid = FALSE;
20435  if( upvalid != NULL )
20436  *upvalid = FALSE;
20437  if( downinf != NULL )
20438  *downinf = FALSE;
20439  if( upinf != NULL )
20440  *upinf = FALSE;
20441  if( downconflict != NULL )
20442  *downconflict = FALSE;
20443  if( upconflict != NULL )
20444  *upconflict = FALSE;
20445 
20447  {
20448  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
20449  return SCIP_INVALIDDATA;
20450  }
20451 
20452  col = SCIPvarGetCol(var);
20453  assert(col != NULL);
20454 
20455  if( !SCIPcolIsInLP(col) )
20456  {
20457  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
20458  return SCIP_INVALIDDATA;
20459  }
20460 
20461  /* check if the solving process should be aborted */
20462  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
20463  {
20464  /* mark this as if the LP failed */
20465  *lperror = TRUE;
20466  return SCIP_OKAY;
20467  }
20468 
20469  /* call strong branching for column with fractional value */
20470  SCIP_CALL( SCIPcolGetStrongbranch(col, FALSE, scip->set, scip->stat, scip->transprob, scip->lp, itlim,
20471  down, up, downvalid, upvalid, lperror) );
20472 
20473  /* check, if the branchings are infeasible; in exact solving mode, we cannot trust the strong branching enough to
20474  * declare the sub nodes infeasible
20475  */
20476  if( !(*lperror) && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->set->misc_exactsolve )
20477  {
20478  SCIP_CALL( analyzeStrongbranch(scip, var, downinf, upinf, downconflict, upconflict) );
20479  }
20480 
20481  return SCIP_OKAY;
20482 }
20483 
20484 /** create, solve, and evaluate a single strong branching child (for strong branching with propagation) */
20485 static
20487  SCIP* scip, /**< SCIP data structure */
20488  SCIP_VAR* var, /**< variable to get strong branching values for */
20489  SCIP_Bool down, /**< do we regard the down child? */
20490  SCIP_Bool firstchild, /**< is this the first of the two strong branching children? */
20491  SCIP_Bool propagate, /**< should domain propagation be performed? */
20492  SCIP_Real newbound, /**< new bound to apply at the strong branching child */
20493  int itlim, /**< iteration limit for strong branchings */
20494  int maxproprounds, /**< maximum number of propagation rounds (-1: no limit, -2: parameter
20495  * settings) */
20496  SCIP_Real* value, /**< stores dual bound for strong branching child */
20497  SCIP_Bool* valid, /**< stores whether the returned value is a valid dual bound, or NULL;
20498  * otherwise, it can only be used as an estimate value */
20499  SCIP_Longint* ndomreductions, /**< pointer to store the number of domain reductions found, or NULL */
20500  SCIP_Bool* conflict, /**< pointer to store whether a conflict constraint was created for an
20501  * infeasible strong branching child, or NULL */
20502  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred or the
20503  * solving process should be stopped (e.g., due to a time limit) */
20504  SCIP_VAR** vars, /**< active problem variables */
20505  int nvars, /**< number of active problem variables */
20506  SCIP_Real* newlbs, /**< array to store valid lower bounds for all active variables, or NULL */
20507  SCIP_Real* newubs, /**< array to store valid upper bounds for all active variables, or NULL */
20508  SCIP_Bool* foundsol, /**< pointer to store whether a primal solution was found during strong branching */
20509  SCIP_Bool* cutoff /**< pointer to store whether the strong branching child is infeasible */
20510  )
20511 {
20512  SCIP_Longint ndomreds;
20513 
20514  assert(value != NULL);
20515  assert(foundsol != NULL);
20516  assert(cutoff != NULL);
20517  assert(valid != NULL ? !(*valid) : TRUE);
20518 
20519  *foundsol = FALSE;
20520 
20521  /* check whether the strong branching child is already infeasible due to the bound change */
20522  if( down )
20523  {
20524  /* the down branch is infeasible due to the branching bound change; since this means that solval is not within the
20525  * bounds, this should only happen if previous strong branching calls on other variables detected bound changes which
20526  * are valid for and were already applied at the probing root
20527  */
20528  if( newbound < SCIPvarGetLbLocal(var) - 0.5 )
20529  {
20530  *value = SCIPinfinity(scip);
20531 
20532  if( valid != NULL )
20533  *valid = TRUE;
20534 
20535  /* bound changes are applied in SCIPendStrongbranch(), which can be seen as a conflict constraint */
20536  if( conflict != NULL )
20537  *conflict = TRUE;
20538 
20539  *cutoff = TRUE;
20540 
20541  return SCIP_OKAY;
20542  }
20543  }
20544  else
20545  {
20546  /* the up branch is infeasible due to the branching bound change; since this means that solval is not within the
20547  * bounds, this should only happen if previous strong branching calls on other variables detected bound changes which
20548  * are valid for and were already applied at the probing root
20549  */
20550  if( newbound > SCIPvarGetUbLocal(var) + 0.5 )
20551  {
20552  *value = SCIPinfinity(scip);
20553 
20554  if( valid != NULL )
20555  *valid = TRUE;
20556 
20557  /* bound changes are applied in SCIPendStrongbranch(), which can be seen as a conflict constraint */
20558  if( conflict != NULL )
20559  *conflict = TRUE;
20560 
20561  *cutoff = TRUE;
20562 
20563  return SCIP_OKAY;
20564  }
20565  }
20566 
20567  /* we need to ensure that we can create at least one new probing node without exceeding the maximal tree depth */
20569  {
20570  /* create a new probing node for the strong branching child and apply the new bound for the variable */
20571  SCIP_CALL( SCIPnewProbingNode(scip) );
20572 
20573  if( down )
20574  {
20575  assert(SCIPisGE(scip, newbound, SCIPvarGetLbLocal(var)));
20576  if( SCIPisLT(scip, newbound, SCIPvarGetUbLocal(var)) )
20577  {
20578  SCIP_CALL( SCIPchgVarUbProbing(scip, var, newbound) );
20579  }
20580  }
20581  else
20582  {
20583  assert(SCIPisLE(scip, newbound, SCIPvarGetUbLocal(var)));
20584  if( SCIPisGT(scip, newbound, SCIPvarGetLbLocal(var)) )
20585  {
20586  SCIP_CALL( SCIPchgVarLbProbing(scip, var, newbound) );
20587  }
20588  }
20589  }
20590  else
20591  {
20592  if( valid != NULL )
20593  *valid = FALSE;
20594 
20595  if( cutoff != NULL ) /*lint !e774*/
20596  *cutoff = FALSE;
20597 
20598  if( conflict != NULL )
20599  *conflict = FALSE;
20600 
20601  return SCIP_OKAY;
20602  }
20603 
20604  /* propagate domains at the probing node */
20605  if( propagate )
20606  {
20607  /* start time measuring */
20608  SCIPclockStart(scip->stat->strongpropclock, scip->set);
20609 
20610  ndomreds = 0;
20611  SCIP_CALL( SCIPpropagateProbing(scip, maxproprounds, cutoff, &ndomreds) );
20612 
20613  /* store number of domain reductions in strong branching */
20614  if( down )
20615  SCIPstatAdd(scip->stat, scip->set, nsbdowndomchgs, ndomreds);
20616  else
20617  SCIPstatAdd(scip->stat, scip->set, nsbupdomchgs, ndomreds);
20618 
20619  if( ndomreductions != NULL )
20620  *ndomreductions = ndomreds;
20621 
20622  /* stop time measuring */
20623  SCIPclockStop(scip->stat->strongpropclock, scip->set);
20624 
20625  if( *cutoff )
20626  {
20627  *value = SCIPinfinity(scip);
20628 
20629  if( valid != NULL )
20630  *valid = TRUE;
20631 
20632  SCIPdebugMsg(scip, "%s branch of var <%s> detected infeasible during propagation\n",
20633  down ? "down" : "up", SCIPvarGetName(var));
20634  }
20635  }
20636 
20637  /* if propagation did not already detect infeasibility, solve the probing LP */
20638  if( !(*cutoff) )
20639  {
20640  SCIP_CALL( SCIPsolveProbingLP(scip, itlim, lperror, cutoff) );
20641  assert(SCIPisLPRelax(scip));
20642 
20643  if( *cutoff )
20644  {
20645  assert(!(*lperror));
20646 
20647  *value = SCIPinfinity(scip);
20648 
20649  if( valid != NULL )
20650  *valid = TRUE;
20651 
20652  SCIPdebugMsg(scip, "%s branch of var <%s> detected infeasible in LP solving: status=%d\n",
20653  down ? "down" : "up", SCIPvarGetName(var), SCIPgetLPSolstat(scip));
20654  }
20655  else if( !(*lperror) )
20656  {
20657  /* save the lp solution status */
20658  scip->stat->lastsblpsolstats[down ? 0 : 1] = SCIPgetLPSolstat(scip);
20659 
20660  switch( SCIPgetLPSolstat(scip) )
20661  {
20663  {
20664  SCIP_Longint oldnbestsolsfound = scip->primal->nbestsolsfound;
20665  *value = SCIPgetLPObjval(scip);
20666  assert(SCIPisLT(scip, *value, SCIPgetCutoffbound(scip)));
20667 
20668  SCIPdebugMsg(scip, "probing LP solved to optimality, objective value: %16.9g\n", *value);
20669 
20670  if( valid != NULL )
20671  *valid = TRUE;
20672 
20673  /* check the strong branching LP solution for feasibility */
20674  if( scip->set->branch_checksbsol )
20675  {
20676  SCIP_SOL* sol;
20677  SCIP_Bool rounded = TRUE;
20678 
20679  /* start clock for strong branching solutions */
20680  SCIPclockStart(scip->stat->sbsoltime, scip->set);
20681 
20682  SCIP_CALL( SCIPcreateLPSol(scip, &sol, NULL) );
20683 
20684  /* try to round the strong branching solution */
20685  if( scip->set->branch_roundsbsol )
20686  {
20687  SCIP_CALL( SCIProundSol(scip, sol, &rounded) );
20688  }
20689 
20690  /* check the solution for feasibility if rounding worked well (or was not tried) */
20691  if( rounded )
20692  {
20693  SCIP_CALL( SCIPtrySolFree(scip, &sol, FALSE, FALSE, FALSE, TRUE, FALSE, foundsol) );
20694  }
20695  else
20696  {
20697  SCIP_CALL( SCIPfreeSol(scip, &sol) );
20698  }
20699 
20700  if( *foundsol )
20701  {
20702  SCIPdebugMsg(scip, "found new solution in strong branching\n");
20703 
20704  scip->stat->nsbsolsfound++;
20705 
20706  if( scip->primal->nbestsolsfound != oldnbestsolsfound )
20707  {
20708  scip->stat->nsbbestsolsfound++;
20709  }
20710 
20711  if( SCIPisGE(scip, *value, SCIPgetCutoffbound(scip)) )
20712  *cutoff = TRUE;
20713  }
20714 
20715  /* stop clock for strong branching solutions */
20716  SCIPclockStop(scip->stat->sbsoltime, scip->set);
20717  }
20718 
20719  break;
20720  }
20722  ++scip->stat->nsbtimesiterlimhit;
20723  /*lint -fallthrough*/
20725  {
20726  /* use LP value as estimate */
20727  SCIP_LPI* lpi;
20728  SCIP_Real objval;
20729  SCIP_Real looseobjval;
20730 
20731  SCIPdebugMsg(scip, "probing LP hit %s limit\n", SCIPgetLPSolstat(scip) == SCIP_LPSOLSTAT_ITERLIMIT ? "iteration" : "time");
20732 
20733  /* we access the LPI directly, because when a time limit was hit, we cannot access objective value and dual
20734  * feasibility using the SCIPlp... methods; we should try to avoid direct calls to the LPI, but this is rather
20735  * uncritical here, because we are immediately after the SCIPsolveProbingLP() call, because we access the LPI
20736  * read-only, and we check SCIPlpiWasSolved() first
20737  */
20738  SCIP_CALL( SCIPgetLPI(scip, &lpi) );
20739 
20740  if( SCIPlpiWasSolved(lpi) )
20741  {
20742  SCIP_CALL( SCIPlpiGetObjval(lpi, &objval) );
20743  looseobjval = SCIPlpGetLooseObjval(scip->lp, scip->set, scip->transprob);
20744 
20745  /* the infinity value in the LPI should not be smaller than SCIP's infinity value */
20746  assert(!SCIPlpiIsInfinity(lpi, objval) || SCIPisInfinity(scip, objval));
20747 
20748  /* we use SCIP's infinity value here because a value larger than this is counted as infeasible by SCIP */
20749  if( SCIPisInfinity(scip, objval) )
20750  *value = SCIPinfinity(scip);
20751  else if( SCIPisInfinity(scip, -looseobjval) )
20752  *value = -SCIPinfinity(scip);
20753  else
20754  *value = objval + looseobjval;
20755 
20756  if( SCIPlpiIsDualFeasible(lpi) )
20757  {
20758  if( valid != NULL )
20759  *valid = TRUE;
20760 
20761  if( SCIPisGE(scip, *value, SCIPgetCutoffbound(scip)) )
20762  *cutoff = TRUE;
20763  }
20764  }
20765  break;
20766  }
20767  case SCIP_LPSOLSTAT_ERROR:
20769  *lperror = TRUE;
20770  break;
20771  case SCIP_LPSOLSTAT_NOTSOLVED: /* should only be the case for *cutoff = TRUE or *lperror = TRUE */
20772  case SCIP_LPSOLSTAT_OBJLIMIT: /* in this case, *cutoff should be TRUE and we should not get here */
20773  case SCIP_LPSOLSTAT_INFEASIBLE: /* in this case, *cutoff should be TRUE and we should not get here */
20774  default:
20775  SCIPerrorMessage("invalid LP solution status <%d>\n", SCIPgetLPSolstat(scip));
20776  return SCIP_INVALIDDATA;
20777  } /*lint !e788*/
20778  }
20779 
20780  /* If columns are missing in the LP, the cutoff flag may be wrong. Therefore, we need to set it and the valid pointer
20781  * to false here.
20782  */
20783  if( (*cutoff) && !SCIPallColsInLP(scip) )
20784  {
20785  *cutoff = FALSE;
20786  }
20787 
20788 #ifndef NDEBUG
20789  if( *lperror )
20790  {
20791  SCIPdebugMsg(scip, "error during strong branching probing LP solving: status=%d\n", SCIPgetLPSolstat(scip));
20792  }
20793 #endif
20794  }
20795 
20796 
20797  /* if the subproblem was feasible, we store the local bounds of the variables after propagation and (possibly)
20798  * conflict analysis
20799  * @todo do this after propagation? should be able to get valid bounds more often, but they might be weaker
20800  */
20801  if( !(*cutoff) && newlbs != NULL)
20802  {
20803  int v;
20804 
20805  assert(newubs != NULL);
20806 
20807  /* initialize the newlbs and newubs to the current local bounds */
20808  if( firstchild )
20809  {
20810  for( v = 0; v < nvars; ++v )
20811  {
20812  newlbs[v] = SCIPvarGetLbLocal(vars[v]);
20813  newubs[v] = SCIPvarGetUbLocal(vars[v]);
20814  }
20815  }
20816  /* update newlbs and newubs: take the weaker of the already stored bounds and the current local bounds */
20817  else
20818  {
20819  for( v = 0; v < nvars; ++v )
20820  {
20821  SCIP_Real lb = SCIPvarGetLbLocal(vars[v]);
20822  SCIP_Real ub = SCIPvarGetUbLocal(vars[v]);
20823 
20824  newlbs[v] = MIN(newlbs[v], lb);
20825  newubs[v] = MAX(newubs[v], ub);
20826  }
20827  }
20828  }
20829 
20830  /* revert all changes at the probing node */
20831  SCIP_CALL( SCIPbacktrackProbing(scip, 0) );
20832 
20833  return SCIP_OKAY;
20834 }
20835 
20836 /** gets strong branching information with previous domain propagation on column variable
20837  *
20838  * Before calling this method, the strong branching mode must have been activated by calling SCIPstartStrongbranch();
20839  * after strong branching was done for all candidate variables, the strong branching mode must be ended by
20840  * SCIPendStrongbranch(). Since this method applies domain propagation before strongbranching, propagation has to be be
20841  * enabled in the SCIPstartStrongbranch() call.
20842  *
20843  * Before solving the strong branching LP, domain propagation can be performed. The number of propagation rounds
20844  * can be specified by the parameter @p maxproprounds.
20845  *
20846  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20847  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20848  *
20849  * @pre This method can be called if @p scip is in one of the following stages:
20850  * - \ref SCIP_STAGE_PRESOLVED
20851  * - \ref SCIP_STAGE_SOLVING
20852  *
20853  * @warning When using this method, LP banching candidates and solution values must be copied beforehand, because
20854  * they are updated w.r.t. the strong branching LP solution.
20855  */
20857  SCIP* scip, /**< SCIP data structure */
20858  SCIP_VAR* var, /**< variable to get strong branching values for */
20859  SCIP_Real solval, /**< value of the variable in the current LP solution */
20860  SCIP_Real lpobjval, /**< LP objective value of the current LP solution */
20861  int itlim, /**< iteration limit for strong branchings */
20862  int maxproprounds, /**< maximum number of propagation rounds (-1: no limit, -2: parameter
20863  * settings) */
20864  SCIP_Real* down, /**< stores dual bound after branching column down */
20865  SCIP_Real* up, /**< stores dual bound after branching column up */
20866  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
20867  * otherwise, it can only be used as an estimate value */
20868  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
20869  * otherwise, it can only be used as an estimate value */
20870  SCIP_Longint* ndomredsdown, /**< pointer to store the number of domain reductions down, or NULL */
20871  SCIP_Longint* ndomredsup, /**< pointer to store the number of domain reductions up, or NULL */
20872  SCIP_Bool* downinf, /**< pointer to store whether the downwards branch is infeasible, or NULL */
20873  SCIP_Bool* upinf, /**< pointer to store whether the upwards branch is infeasible, or NULL */
20874  SCIP_Bool* downconflict, /**< pointer to store whether a conflict constraint was created for an
20875  * infeasible downwards branch, or NULL */
20876  SCIP_Bool* upconflict, /**< pointer to store whether a conflict constraint was created for an
20877  * infeasible upwards branch, or NULL */
20878  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred or the
20879  * solving process should be stopped (e.g., due to a time limit) */
20880  SCIP_Real* newlbs, /**< array to store valid lower bounds for all active variables, or NULL */
20881  SCIP_Real* newubs /**< array to store valid upper bounds for all active variables, or NULL */
20882  )
20883 {
20884  SCIP_COL* col;
20885  SCIP_VAR** vars;
20886  SCIP_Longint oldniters;
20887  SCIP_Real newub;
20888  SCIP_Real newlb;
20889  SCIP_Bool propagate;
20890  SCIP_Bool cutoff;
20891  SCIP_Bool downchild;
20892  SCIP_Bool firstchild;
20893  SCIP_Bool foundsol;
20894  SCIP_Bool downvalidlocal;
20895  SCIP_Bool upvalidlocal;
20896  SCIP_Bool allcolsinlp;
20897  SCIP_Bool enabledconflict;
20898  int oldnconflicts;
20899  int nvars;
20900 
20901  assert(scip != NULL);
20902  assert(var != NULL);
20903  assert(SCIPvarIsIntegral(var));
20904  assert(down != NULL);
20905  assert(up != NULL);
20906  assert(lperror != NULL);
20907  assert((newlbs != NULL) == (newubs != NULL));
20908  assert(SCIPinProbing(scip));
20909  assert(var->scip == scip);
20910 
20911  SCIP_CALL( checkStage(scip, "SCIPgetVarStrongbranchWithPropagation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20912 
20913  /* check whether propagation should be performed */
20914  propagate = (maxproprounds != 0);
20915 
20916  /* Check, if all existing columns are in LP.
20917  * If this is not the case, we may still return that the up and down dual bounds are valid, because the branching
20918  * rule should not apply them otherwise.
20919  * However, we must not set the downinf or upinf pointers to TRUE based on the dual bound, because we cannot
20920  * guarantee that this node can be cut off.
20921  */
20922  allcolsinlp = SCIPallColsInLP(scip);
20923 
20924  /* if maxproprounds is -2, change it to 0, which for the following calls means using the parameter settings */
20925  if( maxproprounds == -2 )
20926  maxproprounds = 0;
20927 
20928  *down = lpobjval;
20929  *up = lpobjval;
20930  if( downvalid != NULL )
20931  *downvalid = FALSE;
20932  if( upvalid != NULL )
20933  *upvalid = FALSE;
20934  if( downinf != NULL )
20935  *downinf = FALSE;
20936  if( upinf != NULL )
20937  *upinf = FALSE;
20938  if( downconflict != NULL )
20939  *downconflict = FALSE;
20940  if( upconflict != NULL )
20941  *upconflict = FALSE;
20942  if( ndomredsdown != NULL )
20943  *ndomredsdown = 0;
20944  if( ndomredsup != NULL )
20945  *ndomredsup = 0;
20946 
20947  *lperror = FALSE;
20948 
20949  vars = SCIPgetVars(scip);
20950  nvars = SCIPgetNVars(scip);
20951 
20953 
20954  /* check if the solving process should be aborted */
20955  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
20956  {
20957  /* mark this as if the LP failed */
20958  *lperror = TRUE;
20959  return SCIP_OKAY;
20960  }
20961 
20963  {
20964  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
20965  return SCIP_INVALIDDATA;
20966  }
20967 
20968  col = SCIPvarGetCol(var);
20969  assert(col != NULL);
20970 
20971  if( !SCIPcolIsInLP(col) )
20972  {
20973  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
20974  return SCIP_INVALIDDATA;
20975  }
20976 
20977  newlb = SCIPfeasFloor(scip, solval + 1.0);
20978  newub = SCIPfeasCeil(scip, solval - 1.0);
20979 
20980  SCIPdebugMsg(scip, "strong branching on var <%s>: solval=%g, lb=%g, ub=%g\n", SCIPvarGetName(var), solval,
20982 
20983  /* the up branch is infeasible due to the branching bound change; since this means that solval is not within the
20984  * bounds, this should only happen if previous strong branching calls on other variables detected bound changes which
20985  * are valid for and were already applied at the probing root
20986  */
20987  if( newlb > SCIPvarGetUbLocal(var) + 0.5 )
20988  {
20989  *up = SCIPinfinity(scip);
20990 
20991  if( upinf != NULL )
20992  *upinf = TRUE;
20993 
20994  if( upvalid != NULL )
20995  *upvalid = TRUE;
20996 
20997  /* bound changes are applied in SCIPendStrongbranch(), which can be seen as a conflict constraint */
20998  if( upconflict != NULL )
20999  *upconflict = TRUE;
21000 
21001  SCIPcolSetStrongbranchData(col, scip->set, scip->stat, scip->lp, lpobjval, solval,
21002  *down, *up, FALSE, TRUE, 0LL, INT_MAX);
21003 
21004  /* we do not regard the down branch; its valid pointer stays set to FALSE */
21005  return SCIP_OKAY;
21006  }
21007 
21008  /* the down branch is infeasible due to the branching bound change; since this means that solval is not within the
21009  * bounds, this should only happen if previous strong branching calls on other variables detected bound changes which
21010  * are valid for and were already applied at the probing root
21011  */
21012  if( newub < SCIPvarGetLbLocal(var) - 0.5 )
21013  {
21014  *down = SCIPinfinity(scip);
21015 
21016  if( downinf != NULL )
21017  *downinf = TRUE;
21018 
21019  if( downvalid != NULL )
21020  *downvalid = TRUE;
21021 
21022  /* bound changes are applied in SCIPendStrongbranch(), which can be seen as a conflict constraint */
21023  if( downconflict != NULL )
21024  *downconflict = TRUE;
21025 
21026  SCIPcolSetStrongbranchData(col, scip->set, scip->stat, scip->lp, lpobjval, solval,
21027  *down, *up, TRUE, FALSE, 0LL, INT_MAX);
21028 
21029  /* we do not regard the up branch; its valid pointer stays set to FALSE */
21030  return SCIP_OKAY;
21031  }
21032 
21033  /* We now do strong branching by creating the two potential child nodes as probing nodes and solving them one after
21034  * the other. We will stop when the first child is detected infeasible, saving the effort we would need for the
21035  * second child. Since empirically, the up child tends to be infeasible more often, we do strongbranching first on
21036  * the up branch.
21037  */
21038  oldniters = scip->stat->nsbdivinglpiterations;
21039  firstchild = TRUE;
21040  cutoff = FALSE;
21041 
21042  /* switch conflict analysis according to usesb parameter */
21043  enabledconflict = scip->set->conf_enable;
21044  scip->set->conf_enable = (scip->set->conf_enable && scip->set->conf_usesb);
21045 
21046  /* @todo: decide the branch to look at first based on the cutoffs in previous calls? */
21047  switch( scip->set->branch_firstsbchild )
21048  {
21049  case 'u':
21050  downchild = FALSE;
21051  break;
21052  case 'd':
21053  downchild = TRUE;
21054  break;
21055  case 'a':
21056  downchild = SCIPvarGetNLocksDown(var) > SCIPvarGetNLocksUp(var);
21057  break;
21058  case 'h':
21060  break;
21061  default:
21062  SCIPerrorMessage("Error: Unknown parameter value <%c> for branching/firstsbchild parameter:\n",scip->set->branch_firstsbchild);
21063  SCIPABORT();
21064  scip->set->conf_enable = enabledconflict;
21065  return SCIP_PARAMETERWRONGVAL; /*lint !e527*/
21066  }
21067 
21068  downvalidlocal = FALSE;
21069  upvalidlocal = FALSE;
21070 
21071  do
21072  {
21073  oldnconflicts = SCIPconflictGetNConflicts(scip->conflict);
21074 
21075  if( downchild )
21076  {
21077  SCIP_CALL( performStrongbranchWithPropagation(scip, var, downchild, firstchild, propagate, newub, itlim, maxproprounds,
21078  down, &downvalidlocal, ndomredsdown, downconflict, lperror, vars, nvars, newlbs, newubs, &foundsol, &cutoff) );
21079 
21080  /* check whether a new solutions rendered the previous child infeasible */
21081  if( foundsol && !firstchild && allcolsinlp )
21082  {
21083  if( SCIPisGE(scip, *up, SCIPgetCutoffbound(scip)) )
21084  {
21085  if( upinf != NULL )
21086  *upinf = TRUE;
21087  }
21088  }
21089 
21090  /* check for infeasibility */
21091  if( cutoff )
21092  {
21093  if( downinf != NULL )
21094  *downinf = TRUE;
21095 
21096  if( downconflict != NULL &&
21097  (SCIPvarGetLbLocal(var) > newub + 0.5 || SCIPconflictGetNConflicts(scip->conflict) > oldnconflicts) )
21098  {
21099  *downconflict = TRUE;
21100  }
21101 
21102  if( !scip->set->branch_forceall )
21103  {
21104  /* if this is the first call, we do not regard the up branch, its valid pointer is initially set to FALSE */
21105  break;
21106  }
21107  }
21108  }
21109  else
21110  {
21111  SCIP_CALL( performStrongbranchWithPropagation(scip, var, downchild, firstchild, propagate, newlb, itlim, maxproprounds,
21112  up, &upvalidlocal, ndomredsup, upconflict, lperror, vars, nvars, newlbs, newubs, &foundsol, &cutoff) );
21113 
21114  /* check whether a new solutions rendered the previous child infeasible */
21115  if( foundsol && !firstchild && allcolsinlp )
21116  {
21117  if( SCIPisGE(scip, *down, SCIPgetCutoffbound(scip)) )
21118  {
21119  if( downinf != NULL )
21120  *downinf = TRUE;
21121  }
21122  }
21123 
21124  /* check for infeasibility */
21125  if( cutoff )
21126  {
21127  if( upinf != NULL )
21128  *upinf = TRUE;
21129 
21130  assert(upinf == NULL || (*upinf) == TRUE);
21131 
21132  if( upconflict != NULL &&
21133  (SCIPvarGetUbLocal(var) < newlb - 0.5 || SCIPconflictGetNConflicts(scip->conflict) > oldnconflicts) )
21134  {
21135  *upconflict = TRUE;
21136  }
21137 
21138  if( !scip->set->branch_forceall )
21139  {
21140  /* if this is the first call, we do not regard the down branch, its valid pointer is initially set to FALSE */
21141  break;
21142  }
21143  }
21144  }
21145 
21146  downchild = !downchild;
21147  firstchild = !firstchild;
21148  }
21149  while( !firstchild );
21150 
21151 
21152  /* set strong branching information in column */
21153  if( *lperror )
21154  {
21155  SCIPcolInvalidateStrongbranchData(col, scip->set, scip->stat, scip->lp);
21156  }
21157  else
21158  {
21159  SCIPcolSetStrongbranchData(col, scip->set, scip->stat, scip->lp, lpobjval, solval,
21160  *down, *up, downvalidlocal, upvalidlocal, scip->stat->nsbdivinglpiterations - oldniters, itlim);
21161  }
21162 
21163  if( downvalid != NULL )
21164  *downvalid = downvalidlocal;
21165  if( upvalid != NULL )
21166  *upvalid = upvalidlocal;
21167 
21168  scip->set->conf_enable = enabledconflict;
21169 
21170  return SCIP_OKAY;
21171 }
21172 
21173 /** gets strong branching information on column variable x with integral LP solution value (val); that is, the down branch
21174  * is (val -1.0) and the up brach ins (val +1.0)
21175  *
21176  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21177  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21178  *
21179  * @pre This method can be called if @p scip is in one of the following stages:
21180  * - \ref SCIP_STAGE_PRESOLVED
21181  * - \ref SCIP_STAGE_SOLVING
21182  *
21183  * @note If the integral LP solution value is the lower or upper bound of the variable, the corresponding branch will be
21184  * marked as infeasible. That is, the valid pointer and the infeasible pointer are set to TRUE.
21185  */
21187  SCIP* scip, /**< SCIP data structure */
21188  SCIP_VAR* var, /**< variable to get strong branching values for */
21189  int itlim, /**< iteration limit for strong branchings */
21190  SCIP_Real* down, /**< stores dual bound after branching column down */
21191  SCIP_Real* up, /**< stores dual bound after branching column up */
21192  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
21193  * otherwise, it can only be used as an estimate value */
21194  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
21195  * otherwise, it can only be used as an estimate value */
21196  SCIP_Bool* downinf, /**< pointer to store whether the downwards branch is infeasible, or NULL */
21197  SCIP_Bool* upinf, /**< pointer to store whether the upwards branch is infeasible, or NULL */
21198  SCIP_Bool* downconflict, /**< pointer to store whether a conflict constraint was created for an
21199  * infeasible downwards branch, or NULL */
21200  SCIP_Bool* upconflict, /**< pointer to store whether a conflict constraint was created for an
21201  * infeasible upwards branch, or NULL */
21202  SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred or the
21203  * solving process should be stopped (e.g., due to a time limit) */
21204  )
21205 {
21206  SCIP_COL* col;
21207 
21208  SCIP_CALL( checkStage(scip, "SCIPgetVarStrongbranchInt", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21209 
21210  assert(lperror != NULL);
21211  assert(var->scip == scip);
21212 
21213  if( downvalid != NULL )
21214  *downvalid = FALSE;
21215  if( upvalid != NULL )
21216  *upvalid = FALSE;
21217  if( downinf != NULL )
21218  *downinf = FALSE;
21219  if( upinf != NULL )
21220  *upinf = FALSE;
21221  if( downconflict != NULL )
21222  *downconflict = FALSE;
21223  if( upconflict != NULL )
21224  *upconflict = FALSE;
21225 
21227  {
21228  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
21229  return SCIP_INVALIDDATA;
21230  }
21231 
21232  col = SCIPvarGetCol(var);
21233  assert(col != NULL);
21234 
21235  if( !SCIPcolIsInLP(col) )
21236  {
21237  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
21238  return SCIP_INVALIDDATA;
21239  }
21240 
21241  /* check if the solving process should be aborted */
21242  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
21243  {
21244  /* mark this as if the LP failed */
21245  *lperror = TRUE;
21246  return SCIP_OKAY;
21247  }
21248 
21249  /* call strong branching for column */
21250  SCIP_CALL( SCIPcolGetStrongbranch(col, TRUE, scip->set, scip->stat, scip->transprob, scip->lp, itlim,
21251  down, up, downvalid, upvalid, lperror) );
21252 
21253  /* check, if the branchings are infeasible; in exact solving mode, we cannot trust the strong branching enough to
21254  * declare the sub nodes infeasible
21255  */
21256  if( !(*lperror) && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->set->misc_exactsolve )
21257  {
21258  SCIP_CALL( analyzeStrongbranch(scip, var, downinf, upinf, downconflict, upconflict) );
21259  }
21260 
21261  return SCIP_OKAY;
21262 }
21263 
21264 /** gets strong branching information on column variables with fractional values
21265  *
21266  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21267  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21268  *
21269  * @pre This method can be called if @p scip is in one of the following stages:
21270  * - \ref SCIP_STAGE_PRESOLVED
21271  * - \ref SCIP_STAGE_SOLVING
21272  */
21274  SCIP* scip, /**< SCIP data structure */
21275  SCIP_VAR** vars, /**< variables to get strong branching values for */
21276  int nvars, /**< number of variables */
21277  int itlim, /**< iteration limit for strong branchings */
21278  SCIP_Real* down, /**< stores dual bounds after branching variables down */
21279  SCIP_Real* up, /**< stores dual bounds after branching variables up */
21280  SCIP_Bool* downvalid, /**< stores whether the returned down values are valid dual bounds, or NULL;
21281  * otherwise, they can only be used as an estimate value */
21282  SCIP_Bool* upvalid, /**< stores whether the returned up values are valid dual bounds, or NULL;
21283  * otherwise, they can only be used as an estimate value */
21284  SCIP_Bool* downinf, /**< array to store whether the downward branches are infeasible, or NULL */
21285  SCIP_Bool* upinf, /**< array to store whether the upward branches are infeasible, or NULL */
21286  SCIP_Bool* downconflict, /**< array to store whether conflict constraints were created for
21287  * infeasible downward branches, or NULL */
21288  SCIP_Bool* upconflict, /**< array to store whether conflict constraints were created for
21289  * infeasible upward branches, or NULL */
21290  SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred or the
21291  * solving process should be stopped (e.g., due to a time limit) */
21292  )
21293 {
21294  SCIP_COL** cols;
21295  int j;
21296 
21297  SCIP_CALL( checkStage(scip, "SCIPgetVarsStrongbranchesFrac", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21298 
21299  assert( lperror != NULL );
21300  assert( vars != NULL );
21301 
21302  /* set up data */
21303  cols = NULL;
21304  SCIP_CALL( SCIPallocBufferArray(scip, &cols, nvars) );
21305  assert(cols != NULL);
21306  for( j = 0; j < nvars; ++j )
21307  {
21308  SCIP_VAR* var;
21309  SCIP_COL* col;
21310 
21311  if( downvalid != NULL )
21312  downvalid[j] = FALSE;
21313  if( upvalid != NULL )
21314  upvalid[j] = FALSE;
21315  if( downinf != NULL )
21316  downinf[j] = FALSE;
21317  if( upinf != NULL )
21318  upinf[j] = FALSE;
21319  if( downconflict != NULL )
21320  downconflict[j] = FALSE;
21321  if( upconflict != NULL )
21322  upconflict[j] = FALSE;
21323 
21324  var = vars[j];
21325  assert( var != NULL );
21327  {
21328  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
21329  SCIPfreeBufferArray(scip, &cols);
21330  return SCIP_INVALIDDATA;
21331  }
21332 
21333  col = SCIPvarGetCol(var);
21334  assert(col != NULL);
21335  cols[j] = col;
21336 
21337  if( !SCIPcolIsInLP(col) )
21338  {
21339  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
21340  SCIPfreeBufferArray(scip, &cols);
21341  return SCIP_INVALIDDATA;
21342  }
21343  }
21344 
21345  /* check if the solving process should be aborted */
21346  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
21347  {
21348  /* mark this as if the LP failed */
21349  *lperror = TRUE;
21350  }
21351  else
21352  {
21353  /* call strong branching for columns with fractional value */
21354  SCIP_CALL( SCIPcolGetStrongbranches(cols, nvars, FALSE, scip->set, scip->stat, scip->transprob, scip->lp, itlim,
21355  down, up, downvalid, upvalid, lperror) );
21356 
21357  /* check, if the branchings are infeasible; in exact solving mode, we cannot trust the strong branching enough to
21358  * declare the sub nodes infeasible
21359  */
21360  if( !(*lperror) && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->set->misc_exactsolve )
21361  {
21362  for( j = 0; j < nvars; ++j )
21363  {
21364  SCIP_CALL( analyzeStrongbranch(scip, vars[j], (downinf != NULL) ? (&(downinf[j])) : NULL,
21365  (upinf != NULL) ? (&(upinf[j])) : NULL, (downconflict != NULL) ? (&(downconflict[j])) : NULL,
21366  (upconflict != NULL) ? (&(upconflict[j])) : NULL) );
21367  }
21368  }
21369  }
21370  SCIPfreeBufferArray(scip, &cols);
21371 
21372  return SCIP_OKAY;
21373 }
21374 
21375 /** gets strong branching information on column variables with integral values
21376  *
21377  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21378  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21379  *
21380  * @pre This method can be called if @p scip is in one of the following stages:
21381  * - \ref SCIP_STAGE_PRESOLVED
21382  * - \ref SCIP_STAGE_SOLVING
21383  */
21385  SCIP* scip, /**< SCIP data structure */
21386  SCIP_VAR** vars, /**< variables to get strong branching values for */
21387  int nvars, /**< number of variables */
21388  int itlim, /**< iteration limit for strong branchings */
21389  SCIP_Real* down, /**< stores dual bounds after branching variables down */
21390  SCIP_Real* up, /**< stores dual bounds after branching variables up */
21391  SCIP_Bool* downvalid, /**< stores whether the returned down values are valid dual bounds, or NULL;
21392  * otherwise, they can only be used as an estimate value */
21393  SCIP_Bool* upvalid, /**< stores whether the returned up values are valid dual bounds, or NULL;
21394  * otherwise, they can only be used as an estimate value */
21395  SCIP_Bool* downinf, /**< array to store whether the downward branches are infeasible, or NULL */
21396  SCIP_Bool* upinf, /**< array to store whether the upward branches are infeasible, or NULL */
21397  SCIP_Bool* downconflict, /**< array to store whether conflict constraints were created for
21398  * infeasible downward branches, or NULL */
21399  SCIP_Bool* upconflict, /**< array to store whether conflict constraints were created for
21400  * infeasible upward branches, or NULL */
21401  SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred or the
21402  * solving process should be stopped (e.g., due to a time limit) */
21403  )
21404 {
21405  SCIP_COL** cols;
21406  int j;
21407 
21408  assert(lperror != NULL);
21409 
21410  SCIP_CALL( checkStage(scip, "SCIPgetVarsStrongbranchesInt", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21411 
21412  assert( vars != NULL );
21413 
21414  /* set up data */
21415  cols = NULL;
21416  SCIP_CALL( SCIPallocBufferArray(scip, &cols, nvars) );
21417  assert(cols != NULL);
21418  for( j = 0; j < nvars; ++j )
21419  {
21420  SCIP_VAR* var;
21421  SCIP_COL* col;
21422 
21423  if( downvalid != NULL )
21424  downvalid[j] = FALSE;
21425  if( upvalid != NULL )
21426  upvalid[j] = FALSE;
21427  if( downinf != NULL )
21428  downinf[j] = FALSE;
21429  if( upinf != NULL )
21430  upinf[j] = FALSE;
21431  if( downconflict != NULL )
21432  downconflict[j] = FALSE;
21433  if( upconflict != NULL )
21434  upconflict[j] = FALSE;
21435 
21436  var = vars[j];
21437  assert( var != NULL );
21439  {
21440  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
21441  SCIPfreeBufferArray(scip, &cols);
21442  return SCIP_INVALIDDATA;
21443  }
21444 
21445  col = SCIPvarGetCol(var);
21446  assert(col != NULL);
21447  cols[j] = col;
21448 
21449  if( !SCIPcolIsInLP(col) )
21450  {
21451  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
21452  SCIPfreeBufferArray(scip, &cols);
21453  return SCIP_INVALIDDATA;
21454  }
21455  }
21456 
21457  /* check if the solving process should be aborted */
21458  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
21459  {
21460  /* mark this as if the LP failed */
21461  *lperror = TRUE;
21462  }
21463  else
21464  {
21465  /* call strong branching for columns */
21466  SCIP_CALL( SCIPcolGetStrongbranches(cols, nvars, TRUE, scip->set, scip->stat, scip->transprob, scip->lp, itlim,
21467  down, up, downvalid, upvalid, lperror) );
21468 
21469  /* check, if the branchings are infeasible; in exact solving mode, we cannot trust the strong branching enough to
21470  * declare the sub nodes infeasible
21471  */
21472  if( !(*lperror) && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->set->misc_exactsolve )
21473  {
21474  for( j = 0; j < nvars; ++j )
21475  {
21476  SCIP_CALL( analyzeStrongbranch(scip, vars[j], (downinf != NULL) ? (&(downinf[j])) : NULL,
21477  (upinf != NULL) ? (&(upinf[j])) : NULL, (downconflict != NULL) ? (&(downconflict[j])) : NULL,
21478  (upconflict != NULL) ? (&(upconflict[j])) : NULL) );
21479 
21480  }
21481  }
21482  }
21483  SCIPfreeBufferArray(scip, &cols);
21484 
21485  return SCIP_OKAY;
21486 }
21487 
21488 /** get LP solution status of last strong branching call (currently only works for strong branching with propagation) */
21490  SCIP* scip, /**< SCIP data structure */
21491  SCIP_BRANCHDIR branchdir /**< branching direction for which LP solution status is requested */
21492  )
21493 {
21494  assert(NULL != scip);
21495  assert(branchdir == SCIP_BRANCHDIR_DOWNWARDS || branchdir == SCIP_BRANCHDIR_UPWARDS);
21496 
21497  return scip->stat->lastsblpsolstats[branchdir == SCIP_BRANCHDIR_DOWNWARDS ? 0 : 1];
21498 }
21499 
21500 /** gets strong branching information on COLUMN variable of the last SCIPgetVarStrongbranch() call;
21501  * returns values of SCIP_INVALID, if strong branching was not yet called on the given variable;
21502  * keep in mind, that the returned old values may have nothing to do with the current LP solution
21503  *
21504  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21505  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21506  *
21507  * @pre This method can be called if @p scip is in one of the following stages:
21508  * - \ref SCIP_STAGE_SOLVING
21509  * - \ref SCIP_STAGE_SOLVED
21510  */
21512  SCIP* scip, /**< SCIP data structure */
21513  SCIP_VAR* var, /**< variable to get last strong branching values for */
21514  SCIP_Real* down, /**< stores dual bound after branching column down */
21515  SCIP_Real* up, /**< stores dual bound after branching column up */
21516  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
21517  * otherwise, it can only be used as an estimate value */
21518  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
21519  * otherwise, it can only be used as an estimate value */
21520  SCIP_Real* solval, /**< stores LP solution value of variable at the last strong branching call, or NULL */
21521  SCIP_Real* lpobjval /**< stores LP objective value at last strong branching call, or NULL */
21522  )
21523 {
21524  SCIP_CALL( checkStage(scip, "SCIPgetVarStrongbranchLast", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
21525 
21527  {
21528  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable\n");
21529  return SCIP_INVALIDDATA;
21530  }
21531 
21532  SCIPcolGetStrongbranchLast(SCIPvarGetCol(var), down, up, downvalid, upvalid, solval, lpobjval);
21533 
21534  return SCIP_OKAY;
21535 }
21536 
21537 /** gets node number of the last node in current branch and bound run, where strong branching was used on the
21538  * given variable, or -1 if strong branching was never applied to the variable in current run
21539  *
21540  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21541  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21542  *
21543  * @pre This method can be called if @p scip is in one of the following stages:
21544  * - \ref SCIP_STAGE_TRANSFORMING
21545  * - \ref SCIP_STAGE_TRANSFORMED
21546  * - \ref SCIP_STAGE_INITPRESOLVE
21547  * - \ref SCIP_STAGE_PRESOLVING
21548  * - \ref SCIP_STAGE_EXITPRESOLVE
21549  * - \ref SCIP_STAGE_PRESOLVED
21550  * - \ref SCIP_STAGE_INITSOLVE
21551  * - \ref SCIP_STAGE_SOLVING
21552  * - \ref SCIP_STAGE_SOLVED
21553  * - \ref SCIP_STAGE_EXITSOLVE
21554  */
21556  SCIP* scip, /**< SCIP data structure */
21557  SCIP_VAR* var /**< variable to get last strong branching node for */
21558  )
21559 {
21560  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarStrongbranchNode", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
21561 
21562  assert( var->scip == scip );
21563 
21565  return -1;
21566 
21568 }
21569 
21570 /** if strong branching was already applied on the variable at the current node, returns the number of LPs solved after
21571  * the LP where the strong branching on this variable was applied;
21572  * if strong branching was not yet applied on the variable at the current node, returns INT_MAX
21573  *
21574  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21575  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21576  *
21577  * @pre This method can be called if @p scip is in one of the following stages:
21578  * - \ref SCIP_STAGE_TRANSFORMING
21579  * - \ref SCIP_STAGE_TRANSFORMED
21580  * - \ref SCIP_STAGE_INITPRESOLVE
21581  * - \ref SCIP_STAGE_PRESOLVING
21582  * - \ref SCIP_STAGE_EXITPRESOLVE
21583  * - \ref SCIP_STAGE_PRESOLVED
21584  * - \ref SCIP_STAGE_INITSOLVE
21585  * - \ref SCIP_STAGE_SOLVING
21586  * - \ref SCIP_STAGE_SOLVED
21587  * - \ref SCIP_STAGE_EXITSOLVE
21588  */
21590  SCIP* scip, /**< SCIP data structure */
21591  SCIP_VAR* var /**< variable to get strong branching LP age for */
21592  )
21593 {
21594  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarStrongbranchLPAge", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
21595 
21596  assert( var->scip == scip );
21597 
21599  return SCIP_LONGINT_MAX;
21600 
21601  return SCIPcolGetStrongbranchLPAge(SCIPvarGetCol(var), scip->stat);
21602 }
21603 
21604 /** gets number of times, strong branching was applied in current run on the given variable
21605  *
21606  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21607  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21608  *
21609  * @pre This method can be called if @p scip is in one of the following stages:
21610  * - \ref SCIP_STAGE_TRANSFORMING
21611  * - \ref SCIP_STAGE_TRANSFORMED
21612  * - \ref SCIP_STAGE_INITPRESOLVE
21613  * - \ref SCIP_STAGE_PRESOLVING
21614  * - \ref SCIP_STAGE_EXITPRESOLVE
21615  * - \ref SCIP_STAGE_PRESOLVED
21616  * - \ref SCIP_STAGE_INITSOLVE
21617  * - \ref SCIP_STAGE_SOLVING
21618  * - \ref SCIP_STAGE_SOLVED
21619  * - \ref SCIP_STAGE_EXITSOLVE
21620  */
21622  SCIP* scip, /**< SCIP data structure */
21623  SCIP_VAR* var /**< variable to get last strong branching node for */
21624  )
21625 {
21626  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarNStrongbranchs", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
21627 
21628  assert( var->scip == scip );
21629 
21631  return 0;
21632 
21634 }
21635 
21636 /** adds given values to lock numbers of variable for rounding
21637  *
21638  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21639  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21640  *
21641  * @pre This method can be called if @p scip is in one of the following stages:
21642  * - \ref SCIP_STAGE_PROBLEM
21643  * - \ref SCIP_STAGE_TRANSFORMING
21644  * - \ref SCIP_STAGE_TRANSFORMED
21645  * - \ref SCIP_STAGE_INITPRESOLVE
21646  * - \ref SCIP_STAGE_PRESOLVING
21647  * - \ref SCIP_STAGE_EXITPRESOLVE
21648  * - \ref SCIP_STAGE_PRESOLVED
21649  * - \ref SCIP_STAGE_INITSOLVE
21650  * - \ref SCIP_STAGE_SOLVING
21651  * - \ref SCIP_STAGE_EXITSOLVE
21652  * - \ref SCIP_STAGE_FREETRANS
21653  */
21655  SCIP* scip, /**< SCIP data structure */
21656  SCIP_VAR* var, /**< problem variable */
21657  int nlocksdown, /**< modification in number of rounding down locks */
21658  int nlocksup /**< modification in number of rounding up locks */
21659  )
21660 {
21661  SCIP_CALL( checkStage(scip, "SCIPaddVarLocks", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE) );
21662 
21663  assert( var->scip == scip );
21664 
21665  switch( scip->set->stage )
21666  {
21667  case SCIP_STAGE_PROBLEM:
21668  assert(!SCIPvarIsTransformed(var));
21669  /*lint -fallthrough*/
21673  case SCIP_STAGE_PRESOLVING:
21675  case SCIP_STAGE_PRESOLVED:
21676  case SCIP_STAGE_INITSOLVE:
21677  case SCIP_STAGE_SOLVING:
21678  case SCIP_STAGE_EXITSOLVE:
21679  case SCIP_STAGE_FREETRANS:
21680  SCIP_CALL( SCIPvarAddLocks(var, scip->mem->probmem, scip->set, scip->eventqueue, nlocksdown, nlocksup) );
21681  return SCIP_OKAY;
21682 
21683  default:
21684  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21685  return SCIP_INVALIDCALL;
21686  } /*lint !e788*/
21687 }
21688 
21689 /** locks rounding of variable with respect to the lock status of the constraint and its negation;
21690  * this method should be called whenever the lock status of a variable in a constraint changes, for example if
21691  * the coefficient of the variable changed its sign or if the left or right hand sides of the constraint were
21692  * added or removed
21693  *
21694  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21695  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21696  *
21697  * @pre This method can be called if @p scip is in one of the following stages:
21698  * - \ref SCIP_STAGE_PROBLEM
21699  * - \ref SCIP_STAGE_TRANSFORMING
21700  * - \ref SCIP_STAGE_INITPRESOLVE
21701  * - \ref SCIP_STAGE_PRESOLVING
21702  * - \ref SCIP_STAGE_EXITPRESOLVE
21703  * - \ref SCIP_STAGE_INITSOLVE
21704  * - \ref SCIP_STAGE_SOLVING
21705  * - \ref SCIP_STAGE_EXITSOLVE
21706  * - \ref SCIP_STAGE_FREETRANS
21707  */
21709  SCIP* scip, /**< SCIP data structure */
21710  SCIP_VAR* var, /**< problem variable */
21711  SCIP_CONS* cons, /**< constraint */
21712  SCIP_Bool lockdown, /**< should the rounding be locked in downwards direction? */
21713  SCIP_Bool lockup /**< should the rounding be locked in upwards direction? */
21714  )
21715 {
21716  int nlocksdown;
21717  int nlocksup;
21718 
21719  SCIP_CALL( checkStage(scip, "SCIPlockVarCons", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE) );
21720 
21721  assert( var->scip == scip );
21722 
21723  nlocksdown = 0;
21724  nlocksup = 0;
21725  if( SCIPconsIsLockedPos(cons) )
21726  {
21727  if( lockdown )
21728  nlocksdown++;
21729  if( lockup )
21730  nlocksup++;
21731  }
21732  if( SCIPconsIsLockedNeg(cons) )
21733  {
21734  if( lockdown )
21735  nlocksup++;
21736  if( lockup )
21737  nlocksdown++;
21738  }
21739 
21740  switch( scip->set->stage )
21741  {
21742  case SCIP_STAGE_PROBLEM:
21743  assert(!SCIPvarIsTransformed(var));
21744  /*lint -fallthrough*/
21748  case SCIP_STAGE_PRESOLVING:
21750  case SCIP_STAGE_INITSOLVE:
21751  case SCIP_STAGE_SOLVING:
21752  case SCIP_STAGE_EXITSOLVE:
21753  case SCIP_STAGE_FREETRANS:
21754  SCIP_CALL( SCIPvarAddLocks(var, scip->mem->probmem, scip->set, scip->eventqueue, nlocksdown, nlocksup) );
21755  return SCIP_OKAY;
21756 
21757  default:
21758  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21759  return SCIP_INVALIDCALL;
21760  } /*lint !e788*/
21761 }
21762 
21763 /** unlocks rounding of variable with respect to the lock status of the constraint and its negation;
21764  * this method should be called whenever the lock status of a variable in a constraint changes, for example if
21765  * the coefficient of the variable changed its sign or if the left or right hand sides of the constraint were
21766  * added or removed
21767  *
21768  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21769  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21770  *
21771  * @pre This method can be called if @p scip is in one of the following stages:
21772  * - \ref SCIP_STAGE_PROBLEM
21773  * - \ref SCIP_STAGE_TRANSFORMING
21774  * - \ref SCIP_STAGE_INITPRESOLVE
21775  * - \ref SCIP_STAGE_PRESOLVING
21776  * - \ref SCIP_STAGE_EXITPRESOLVE
21777  * - \ref SCIP_STAGE_INITSOLVE
21778  * - \ref SCIP_STAGE_SOLVING
21779  * - \ref SCIP_STAGE_EXITSOLVE
21780  * - \ref SCIP_STAGE_FREETRANS
21781  */
21783  SCIP* scip, /**< SCIP data structure */
21784  SCIP_VAR* var, /**< problem variable */
21785  SCIP_CONS* cons, /**< constraint */
21786  SCIP_Bool lockdown, /**< should the rounding be unlocked in downwards direction? */
21787  SCIP_Bool lockup /**< should the rounding be unlocked in upwards direction? */
21788  )
21789 {
21790  int nlocksdown;
21791  int nlocksup;
21792 
21793  SCIP_CALL( checkStage(scip, "SCIPunlockVarCons", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE) );
21794 
21795  assert( var->scip == scip );
21796 
21797  nlocksdown = 0;
21798  nlocksup = 0;
21799  if( SCIPconsIsLockedPos(cons) )
21800  {
21801  if( lockdown )
21802  nlocksdown++;
21803  if( lockup )
21804  nlocksup++;
21805  }
21806  if( SCIPconsIsLockedNeg(cons) )
21807  {
21808  if( lockdown )
21809  nlocksup++;
21810  if( lockup )
21811  nlocksdown++;
21812  }
21813 
21814  switch( scip->set->stage )
21815  {
21816  case SCIP_STAGE_PROBLEM:
21817  assert(!SCIPvarIsTransformed(var));
21818  /*lint -fallthrough*/
21821  case SCIP_STAGE_PRESOLVING:
21823  case SCIP_STAGE_INITSOLVE:
21824  case SCIP_STAGE_SOLVING:
21825  case SCIP_STAGE_EXITSOLVE:
21826  case SCIP_STAGE_FREETRANS:
21827  SCIP_CALL( SCIPvarAddLocks(var, scip->mem->probmem, scip->set, scip->eventqueue, -nlocksdown, -nlocksup) );
21828  return SCIP_OKAY;
21829 
21830  default:
21831  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21832  return SCIP_INVALIDCALL;
21833  } /*lint !e788*/
21834 }
21835 
21836 /** changes variable's objective value
21837  *
21838  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21839  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21840  *
21841  * @pre This method can be called if @p scip is in one of the following stages:
21842  * - \ref SCIP_STAGE_PROBLEM
21843  * - \ref SCIP_STAGE_TRANSFORMING
21844  * - \ref SCIP_STAGE_PRESOLVING
21845  * - \ref SCIP_STAGE_PRESOLVED
21846  */
21848  SCIP* scip, /**< SCIP data structure */
21849  SCIP_VAR* var, /**< variable to change the objective value for */
21850  SCIP_Real newobj /**< new objective value */
21851  )
21852 {
21853  SCIP_CALL( checkStage(scip, "SCIPchgVarObj", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
21854 
21855  assert( var->scip == scip );
21856 
21857  /* forbid infinite objective values */
21858  if( SCIPisInfinity(scip, REALABS(newobj)) )
21859  {
21860  SCIPerrorMessage("invalid objective value: objective value is infinite\n");
21861  return SCIP_INVALIDDATA;
21862  }
21863 
21864  switch( scip->set->stage )
21865  {
21866  case SCIP_STAGE_PROBLEM:
21867  assert(!SCIPvarIsTransformed(var));
21868  SCIP_CALL( SCIPvarChgObj(var, scip->mem->probmem, scip->set, scip->origprob, scip->primal, scip->lp, scip->eventqueue, newobj) );
21869  return SCIP_OKAY;
21870 
21873  case SCIP_STAGE_PRESOLVING:
21874  case SCIP_STAGE_PRESOLVED:
21875  SCIP_CALL( SCIPvarChgObj(var, scip->mem->probmem, scip->set, scip->transprob, scip->primal, scip->lp, scip->eventqueue, newobj) );
21876  return SCIP_OKAY;
21877 
21878  default:
21879  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21880  return SCIP_INVALIDCALL;
21881  } /*lint !e788*/
21882 }
21883 
21884 /** adds value to variable's objective value
21885  *
21886  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21887  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21888  *
21889  * @pre This method can be called if @p scip is in one of the following stages:
21890  * - \ref SCIP_STAGE_PROBLEM
21891  * - \ref SCIP_STAGE_TRANSFORMING
21892  * - \ref SCIP_STAGE_PRESOLVING
21893  * - \ref SCIP_STAGE_EXITPRESOLVE
21894  * - \ref SCIP_STAGE_PRESOLVED
21895  */
21897  SCIP* scip, /**< SCIP data structure */
21898  SCIP_VAR* var, /**< variable to change the objective value for */
21899  SCIP_Real addobj /**< additional objective value */
21900  )
21901 {
21902  SCIP_CALL( checkStage(scip, "SCIPaddVarObj", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
21903 
21904  assert( var->scip == scip );
21905 
21906  switch( scip->set->stage )
21907  {
21908  case SCIP_STAGE_PROBLEM:
21909  assert(!SCIPvarIsTransformed(var));
21910  SCIP_CALL( SCIPvarAddObj(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob, scip->primal,
21911  scip->tree, scip->reopt, scip->lp, scip->eventqueue, addobj) );
21912  return SCIP_OKAY;
21913 
21915  case SCIP_STAGE_PRESOLVING:
21917  case SCIP_STAGE_PRESOLVED:
21918  SCIP_CALL( SCIPvarAddObj(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob, scip->primal,
21919  scip->tree, scip->reopt, scip->lp, scip->eventqueue, addobj) );
21920  return SCIP_OKAY;
21921 
21922  default:
21923  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21924  return SCIP_INVALIDCALL;
21925  } /*lint !e788*/
21926 }
21927 
21928 /** returns the adjusted (i.e. rounded, if the given variable is of integral type) lower bound value;
21929  * does not change the bounds of the variable
21930  *
21931  * @return adjusted lower bound for the given variable; the bound of the variable is not changed
21932  *
21933  * @pre This method can be called if @p scip is in one of the following stages:
21934  * - \ref SCIP_STAGE_PROBLEM
21935  * - \ref SCIP_STAGE_TRANSFORMING
21936  * - \ref SCIP_STAGE_TRANSFORMED
21937  * - \ref SCIP_STAGE_INITPRESOLVE
21938  * - \ref SCIP_STAGE_PRESOLVING
21939  * - \ref SCIP_STAGE_EXITPRESOLVE
21940  * - \ref SCIP_STAGE_PRESOLVED
21941  * - \ref SCIP_STAGE_INITSOLVE
21942  * - \ref SCIP_STAGE_SOLVING
21943  * - \ref SCIP_STAGE_SOLVED
21944  * - \ref SCIP_STAGE_EXITSOLVE
21945  * - \ref SCIP_STAGE_FREETRANS
21946  */
21948  SCIP* scip, /**< SCIP data structure */
21949  SCIP_VAR* var, /**< variable to adjust the bound for */
21950  SCIP_Real lb /**< lower bound value to adjust */
21951  )
21952 {
21953  SCIP_CALL_ABORT( checkStage(scip, "SCIPadjustedVarLb", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
21954 
21955  SCIPvarAdjustLb(var, scip->set, &lb);
21956 
21957  return lb;
21958 }
21959 
21960 /** returns the adjusted (i.e. rounded, if the given variable is of integral type) upper bound value;
21961  * does not change the bounds of the variable
21962  *
21963  * @return adjusted upper bound for the given variable; the bound of the variable is not changed
21964  *
21965  * @pre This method can be called if @p scip is in one of the following stages:
21966  * - \ref SCIP_STAGE_PROBLEM
21967  * - \ref SCIP_STAGE_TRANSFORMING
21968  * - \ref SCIP_STAGE_TRANSFORMED
21969  * - \ref SCIP_STAGE_INITPRESOLVE
21970  * - \ref SCIP_STAGE_PRESOLVING
21971  * - \ref SCIP_STAGE_EXITPRESOLVE
21972  * - \ref SCIP_STAGE_PRESOLVED
21973  * - \ref SCIP_STAGE_INITSOLVE
21974  * - \ref SCIP_STAGE_SOLVING
21975  * - \ref SCIP_STAGE_SOLVED
21976  * - \ref SCIP_STAGE_EXITSOLVE
21977  * - \ref SCIP_STAGE_FREETRANS
21978  */
21980  SCIP* scip, /**< SCIP data structure */
21981  SCIP_VAR* var, /**< variable to adjust the bound for */
21982  SCIP_Real ub /**< upper bound value to adjust */
21983  )
21984 {
21985  SCIP_CALL_ABORT( checkStage(scip, "SCIPadjustedVarUb", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
21986 
21987  SCIPvarAdjustUb(var, scip->set, &ub);
21988 
21989  return ub;
21990 }
21991 
21992 /** depending on SCIP's stage, changes lower bound of variable in the problem, in preprocessing, or in current node;
21993  * if possible, adjusts bound to integral value; doesn't store any inference information in the bound change, such
21994  * that in conflict analysis, this change is treated like a branching decision
21995  *
21996  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
21997  * SCIPgetVars()) gets resorted.
21998  *
21999  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22000  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22001  *
22002  * @pre This method can be called if @p scip is in one of the following stages:
22003  * - \ref SCIP_STAGE_PROBLEM
22004  * - \ref SCIP_STAGE_TRANSFORMING
22005  * - \ref SCIP_STAGE_PRESOLVING
22006  * - \ref SCIP_STAGE_SOLVING
22007  *
22008  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22009  */
22011  SCIP* scip, /**< SCIP data structure */
22012  SCIP_VAR* var, /**< variable to change the bound for */
22013  SCIP_Real newbound /**< new value for bound */
22014  )
22015 {
22016  SCIP_CALL( checkStage(scip, "SCIPchgVarLb", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22017 
22018  SCIPvarAdjustLb(var, scip->set, &newbound);
22019 
22020  /* ignore tightenings of lower bounds to +infinity during solving process */
22021  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22022  {
22023 #ifndef NDEBUG
22024  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
22025  SCIPvarGetLbLocal(var));
22026 #endif
22027  return SCIP_OKAY;
22028  }
22029 
22030  switch( scip->set->stage )
22031  {
22032  case SCIP_STAGE_PROBLEM:
22033  assert(!SCIPvarIsTransformed(var));
22034  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22035  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22036  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22037  scip->branchcand, scip->eventqueue, newbound) );
22038  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
22039  break;
22040 
22042  case SCIP_STAGE_PRESOLVED:
22043  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22044  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22045  break;
22046 
22047  case SCIP_STAGE_PRESOLVING:
22048  if( !SCIPinProbing(scip) )
22049  {
22050  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22051  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22052 
22053  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22054  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
22055  var, newbound, SCIP_BOUNDTYPE_LOWER, FALSE) );
22056 
22058  {
22059  SCIP_Bool infeasible;
22060 
22061  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, &infeasible) );
22062  assert(!infeasible);
22063  }
22064  break;
22065  }
22066  /*lint -fallthrough*/
22067  case SCIP_STAGE_SOLVING:
22069  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
22070  scip->cliquetable, var, newbound,
22072  break;
22073 
22074  default:
22075  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22076  return SCIP_INVALIDCALL;
22077  } /*lint !e788*/
22078 
22079  return SCIP_OKAY;
22080 }
22081 
22082 /** depending on SCIP's stage, changes upper bound of variable in the problem, in preprocessing, or in current node;
22083  * if possible, adjusts bound to integral value; doesn't store any inference information in the bound change, such
22084  * that in conflict analysis, this change is treated like a branching decision
22085  *
22086  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22087  * SCIPgetVars()) gets resorted.
22088  *
22089  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22090  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22091  *
22092  * @pre This method can be called if @p scip is in one of the following stages:
22093  * - \ref SCIP_STAGE_PROBLEM
22094  * - \ref SCIP_STAGE_TRANSFORMING
22095  * - \ref SCIP_STAGE_PRESOLVING
22096  * - \ref SCIP_STAGE_SOLVING
22097  *
22098  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22099  */
22101  SCIP* scip, /**< SCIP data structure */
22102  SCIP_VAR* var, /**< variable to change the bound for */
22103  SCIP_Real newbound /**< new value for bound */
22104  )
22105 {
22106  SCIP_CALL( checkStage(scip, "SCIPchgVarUb", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22107 
22108  SCIPvarAdjustUb(var, scip->set, &newbound);
22109 
22110  /* ignore tightenings of upper bounds to -infinity during solving process */
22111  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22112  {
22113 #ifndef NDEBUG
22114  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
22115  SCIPvarGetUbLocal(var));
22116 #endif
22117  return SCIP_OKAY;
22118  }
22119 
22120  switch( scip->set->stage )
22121  {
22122  case SCIP_STAGE_PROBLEM:
22123  assert(!SCIPvarIsTransformed(var));
22124  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22125  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22126  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22127  scip->branchcand, scip->eventqueue, newbound) );
22128  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
22129  break;
22130 
22132  case SCIP_STAGE_PRESOLVED:
22133  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22134  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22135  break;
22136 
22137  case SCIP_STAGE_PRESOLVING:
22138  if( !SCIPinProbing(scip) )
22139  {
22140  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22141  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22142 
22143  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22144  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
22145  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, FALSE) );
22146 
22148  {
22149  SCIP_Bool infeasible;
22150 
22151  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, &infeasible) );
22152  assert(!infeasible);
22153  }
22154  break;
22155  }
22156  /*lint -fallthrough*/
22157  case SCIP_STAGE_SOLVING:
22159  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
22160  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, FALSE) );
22161  break;
22162 
22163  default:
22164  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22165  return SCIP_INVALIDCALL;
22166  } /*lint !e788*/
22167 
22168  return SCIP_OKAY;
22169 }
22170 
22171 /** changes lower bound of variable in the given node; if possible, adjust bound to integral value; doesn't store any
22172  * inference information in the bound change, such that in conflict analysis, this change is treated like a branching
22173  * decision
22174  *
22175  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22176  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22177  *
22178  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
22179  */
22181  SCIP* scip, /**< SCIP data structure */
22182  SCIP_NODE* node, /**< node to change bound at, or NULL for current node */
22183  SCIP_VAR* var, /**< variable to change the bound for */
22184  SCIP_Real newbound /**< new value for bound */
22185  )
22186 {
22187  SCIP_CALL( checkStage(scip, "SCIPchgVarLbNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22188 
22189  if( node == NULL )
22190  {
22191  SCIP_CALL( SCIPchgVarLb(scip, var, newbound) );
22192  }
22193  else
22194  {
22195  SCIPvarAdjustLb(var, scip->set, &newbound);
22196 
22197  /* ignore tightenings of lower bounds to +infinity during solving process */
22198  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22199  {
22200 #ifndef NDEBUG
22201  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
22202  SCIPvarGetLbLocal(var));
22203 #endif
22204  return SCIP_OKAY;
22205  }
22206 
22207  SCIP_CALL( SCIPnodeAddBoundchg(node, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
22208  scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22210  }
22211 
22212  return SCIP_OKAY;
22213 }
22214 
22215 /** changes upper bound of variable in the given node; if possible, adjust bound to integral value; doesn't store any
22216  * inference information in the bound change, such that in conflict analysis, this change is treated like a branching
22217  * decision
22218  *
22219  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22220  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22221  *
22222  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
22223  */
22225  SCIP* scip, /**< SCIP data structure */
22226  SCIP_NODE* node, /**< node to change bound at, or NULL for current node */
22227  SCIP_VAR* var, /**< variable to change the bound for */
22228  SCIP_Real newbound /**< new value for bound */
22229  )
22230 {
22231  SCIP_CALL( checkStage(scip, "SCIPchgVarUbNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22232 
22233  if( node == NULL )
22234  {
22235  SCIP_CALL( SCIPchgVarUb(scip, var, newbound) );
22236  }
22237  else
22238  {
22239  SCIPvarAdjustUb(var, scip->set, &newbound);
22240 
22241  /* ignore tightenings of upper bounds to -infinity during solving process */
22242  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22243  {
22244 #ifndef NDEBUG
22245  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
22246  SCIPvarGetUbLocal(var));
22247 #endif
22248  return SCIP_OKAY;
22249  }
22250 
22251  SCIP_CALL( SCIPnodeAddBoundchg(node, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
22252  scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22254  }
22255 
22256  return SCIP_OKAY;
22257 }
22258 
22259 /** changes global lower bound of variable; if possible, adjust bound to integral value; also tightens the local bound,
22260  * if the global bound is better than the local bound
22261  *
22262  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22263  * SCIPgetVars()) gets resorted.
22264  *
22265  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22266  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22267  *
22268  * @pre This method can be called if @p scip is in one of the following stages:
22269  * - \ref SCIP_STAGE_PROBLEM
22270  * - \ref SCIP_STAGE_TRANSFORMING
22271  * - \ref SCIP_STAGE_PRESOLVING
22272  * - \ref SCIP_STAGE_SOLVING
22273  *
22274  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22275  */
22277  SCIP* scip, /**< SCIP data structure */
22278  SCIP_VAR* var, /**< variable to change the bound for */
22279  SCIP_Real newbound /**< new value for bound */
22280  )
22281 {
22282  SCIP_CALL( checkStage(scip, "SCIPchgVarLbGlobal", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22283 
22284  SCIPvarAdjustLb(var, scip->set, &newbound);
22285 
22286  /* ignore tightenings of lower bounds to +infinity during solving process */
22287  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22288  {
22289 #ifndef NDEBUG
22290  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
22291  SCIPvarGetLbLocal(var));
22292 #endif
22293  return SCIP_OKAY;
22294  }
22295 
22296  switch( scip->set->stage )
22297  {
22298  case SCIP_STAGE_PROBLEM:
22299  assert(!SCIPvarIsTransformed(var));
22300  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22301  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22302  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22303  scip->branchcand, scip->eventqueue, newbound) );
22304  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
22305  break;
22306 
22308  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22309  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22310  break;
22311 
22312  case SCIP_STAGE_PRESOLVING:
22313  if( !SCIPinProbing(scip) )
22314  {
22315  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22316  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22317 
22318  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22319  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22321 
22323  {
22324  SCIP_Bool infeasible;
22325 
22326  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, &infeasible) );
22327  assert(!infeasible);
22328  }
22329  break;
22330  }
22331  /*lint -fallthrough*/
22332  case SCIP_STAGE_SOLVING:
22333  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22334  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22336  break;
22337 
22338  default:
22339  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22340  return SCIP_INVALIDCALL;
22341  } /*lint !e788*/
22342 
22343  return SCIP_OKAY;
22344 }
22345 
22346 /** changes global upper bound of variable; if possible, adjust bound to integral value; also tightens the local bound,
22347  * if the global bound is better than the local bound
22348  *
22349  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22350  * SCIPgetVars()) gets resorted.
22351  *
22352  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22353  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22354  *
22355  * @pre This method can be called if @p scip is in one of the following stages:
22356  * - \ref SCIP_STAGE_PROBLEM
22357  * - \ref SCIP_STAGE_TRANSFORMING
22358  * - \ref SCIP_STAGE_PRESOLVING
22359  * - \ref SCIP_STAGE_SOLVING
22360  *
22361  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22362  */
22364  SCIP* scip, /**< SCIP data structure */
22365  SCIP_VAR* var, /**< variable to change the bound for */
22366  SCIP_Real newbound /**< new value for bound */
22367  )
22368 {
22369  SCIP_CALL( checkStage(scip, "SCIPchgVarUbGlobal", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22370 
22371  SCIPvarAdjustUb(var, scip->set, &newbound);
22372 
22373  /* ignore tightenings of upper bounds to -infinity during solving process */
22374  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22375  {
22376 #ifndef NDEBUG
22377  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
22378  SCIPvarGetUbLocal(var));
22379 #endif
22380  return SCIP_OKAY;
22381  }
22382 
22383  switch( scip->set->stage )
22384  {
22385  case SCIP_STAGE_PROBLEM:
22386  assert(!SCIPvarIsTransformed(var));
22387  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22388  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22389  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22390  scip->branchcand, scip->eventqueue, newbound) );
22391  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
22392  break;
22393 
22395  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22396  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22397  break;
22398 
22399  case SCIP_STAGE_PRESOLVING:
22400  if( !SCIPinProbing(scip) )
22401  {
22402  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22403  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22404 
22405  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22406  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22408 
22410  {
22411  SCIP_Bool infeasible;
22412 
22413  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, &infeasible) );
22414  assert(!infeasible);
22415  }
22416  break;
22417  }
22418  /*lint -fallthrough*/
22419  case SCIP_STAGE_SOLVING:
22420  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22421  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22423  break;
22424 
22425  default:
22426  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22427  return SCIP_INVALIDCALL;
22428  } /*lint !e788*/
22429 
22430  return SCIP_OKAY;
22431 }
22432 
22433 /** changes lazy lower bound of the variable, this is only possible if the variable is not in the LP yet
22434  *
22435  * lazy bounds are bounds, that are enforced by constraints and the objective function; hence, these bounds do not need
22436  * to be put into the LP explicitly.
22437  *
22438  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22439  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22440  *
22441  * @pre This method can be called if @p scip is in one of the following stages:
22442  * - \ref SCIP_STAGE_PROBLEM
22443  * - \ref SCIP_STAGE_TRANSFORMING
22444  * - \ref SCIP_STAGE_TRANSFORMED
22445  * - \ref SCIP_STAGE_PRESOLVING
22446  * - \ref SCIP_STAGE_SOLVING
22447  *
22448  * @note lazy bounds are useful for branch-and-price since the corresponding variable bounds are not part of the LP
22449  */
22451  SCIP* scip, /**< SCIP data structure */
22452  SCIP_VAR* var, /**< problem variable */
22453  SCIP_Real lazylb /**< the lazy lower bound to be set */
22454  )
22455 {
22456  assert(scip != NULL);
22457  assert(var != NULL);
22458 
22459  SCIP_CALL( checkStage(scip, "SCIPchgVarLbLazy", FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22460 
22461  SCIP_CALL( SCIPvarChgLbLazy(var, scip->set, lazylb) );
22462 
22463  return SCIP_OKAY;
22464 }
22465 
22466 /** changes lazy upper bound of the variable, this is only possible if the variable is not in the LP yet
22467  *
22468  * lazy bounds are bounds, that are enforced by constraints and the objective function; hence, these bounds do not need
22469  * to be put into the LP explicitly.
22470  *
22471  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22472  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22473  *
22474  * @pre This method can be called if @p scip is in one of the following stages:
22475  * - \ref SCIP_STAGE_PROBLEM
22476  * - \ref SCIP_STAGE_TRANSFORMING
22477  * - \ref SCIP_STAGE_TRANSFORMED
22478  * - \ref SCIP_STAGE_PRESOLVING
22479  * - \ref SCIP_STAGE_SOLVING
22480  *
22481  * @note lazy bounds are useful for branch-and-price since the corresponding variable bounds are not part of the LP
22482  */
22484  SCIP* scip, /**< SCIP data structure */
22485  SCIP_VAR* var, /**< problem variable */
22486  SCIP_Real lazyub /**< the lazy lower bound to be set */
22487  )
22488 {
22489  assert(scip != NULL);
22490  assert(var != NULL);
22491 
22492  SCIP_CALL( checkStage(scip, "SCIPchgVarUbLazy", FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22493 
22494  SCIP_CALL( SCIPvarChgUbLazy(var, scip->set, lazyub) );
22495 
22496  return SCIP_OKAY;
22497 }
22498 
22499 /** changes lower bound of variable in preprocessing or in the current node, if the new bound is tighter
22500  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
22501  * doesn't store any inference information in the bound change, such that in conflict analysis, this change
22502  * is treated like a branching decision
22503  *
22504  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22505  * SCIPgetVars()) gets resorted.
22506  *
22507  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22508  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22509  *
22510  * @pre This method can be called if @p scip is in one of the following stages:
22511  * - \ref SCIP_STAGE_PROBLEM
22512  * - \ref SCIP_STAGE_PRESOLVING
22513  * - \ref SCIP_STAGE_SOLVING
22514  *
22515  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22516  */
22518  SCIP* scip, /**< SCIP data structure */
22519  SCIP_VAR* var, /**< variable to change the bound for */
22520  SCIP_Real newbound, /**< new value for bound */
22521  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
22522  SCIP_Bool* infeasible, /**< pointer to store whether the new domain is empty */
22523  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
22524  )
22525 {
22526  SCIP_Real lb;
22527  SCIP_Real ub;
22528 
22529  assert(infeasible != NULL);
22530  /** @todo if needed provide pending local/global bound changes that will be flushed after leaving diving mode (as in struct_tree.h) */
22531  assert(!SCIPinDive(scip));
22532 
22533  SCIP_CALL( checkStage(scip, "SCIPtightenVarLb", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22534 
22535  *infeasible = FALSE;
22536  if( tightened != NULL )
22537  *tightened = FALSE;
22538 
22539  SCIPvarAdjustLb(var, scip->set, &newbound);
22540 
22541  /* ignore tightenings of lower bounds to +infinity during solving process */
22542  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22543  {
22544 #ifndef NDEBUG
22545  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
22546  SCIPvarGetLbLocal(var));
22547 #endif
22548  return SCIP_OKAY;
22549  }
22550 
22551  /* get current bounds */
22552  lb = SCIPcomputeVarLbLocal(scip, var);
22553  ub = SCIPcomputeVarUbLocal(scip, var);
22554  assert(SCIPsetIsLE(scip->set, lb, ub));
22555 
22556  if( SCIPsetIsFeasGT(scip->set, newbound, ub) )
22557  {
22558  *infeasible = TRUE;
22559  return SCIP_OKAY;
22560  }
22561  newbound = MIN(newbound, ub);
22562 
22563  if( (force && SCIPsetIsLE(scip->set, newbound, lb)) || (!force && !SCIPsetIsLbBetter(scip->set, newbound, lb, ub)) )
22564  return SCIP_OKAY;
22565 
22566  switch( scip->set->stage )
22567  {
22568  case SCIP_STAGE_PROBLEM:
22569  assert(!SCIPvarIsTransformed(var));
22570  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22571  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22572  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22573  scip->branchcand, scip->eventqueue, newbound) );
22574  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
22575  break;
22577  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22578  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22579  break;
22580  case SCIP_STAGE_PRESOLVING:
22581  if( !SCIPinProbing(scip) )
22582  {
22583  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22584  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22585 
22586  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22587  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22589 
22591  {
22592  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
22593  assert(!(*infeasible));
22594  }
22595  break;
22596  }
22597  /*lint -fallthrough*/
22598  case SCIP_STAGE_SOLVING:
22600  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
22601  var, newbound, SCIP_BOUNDTYPE_LOWER, FALSE) );
22602  break;
22603 
22604  default:
22605  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22606  return SCIP_INVALIDCALL;
22607  } /*lint !e788*/
22608 
22609  if( tightened != NULL )
22610  *tightened = TRUE;
22611 
22612  return SCIP_OKAY;
22613 }
22614 
22615 /** changes upper bound of variable in preprocessing or in the current node, if the new bound is tighter
22616  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
22617  * doesn't store any inference information in the bound change, such that in conflict analysis, this change
22618  * is treated like a branching decision
22619  *
22620  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22621  * SCIPgetVars()) gets resorted.
22622  *
22623  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22624  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22625  *
22626  * @pre This method can be called if @p scip is in one of the following stages:
22627  * - \ref SCIP_STAGE_PROBLEM
22628  * - \ref SCIP_STAGE_PRESOLVING
22629  * - \ref SCIP_STAGE_SOLVING
22630  *
22631  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22632  */
22634  SCIP* scip, /**< SCIP data structure */
22635  SCIP_VAR* var, /**< variable to change the bound for */
22636  SCIP_Real newbound, /**< new value for bound */
22637  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
22638  SCIP_Bool* infeasible, /**< pointer to store whether the new domain is empty */
22639  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
22640  )
22641 {
22642  SCIP_Real lb;
22643  SCIP_Real ub;
22644 
22645  assert(infeasible != NULL);
22646  /** @todo if needed provide pending local/global bound changes that will be flushed after leaving diving mode (as in struct_tree.h) */
22647  assert(!SCIPinDive(scip));
22648 
22649  SCIP_CALL( checkStage(scip, "SCIPtightenVarUb", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22650 
22651  *infeasible = FALSE;
22652  if( tightened != NULL )
22653  *tightened = FALSE;
22654 
22655  SCIPvarAdjustUb(var, scip->set, &newbound);
22656 
22657  /* ignore tightenings of upper bounds to -infinity during solving process */
22658  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22659  {
22660 #ifndef NDEBUG
22661  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
22662  SCIPvarGetUbLocal(var));
22663 #endif
22664  return SCIP_OKAY;
22665  }
22666 
22667  /* get current bounds */
22668  lb = SCIPcomputeVarLbLocal(scip, var);
22669  ub = SCIPcomputeVarUbLocal(scip, var);
22670  assert(SCIPsetIsLE(scip->set, lb, ub));
22671 
22672  if( SCIPsetIsFeasLT(scip->set, newbound, lb) )
22673  {
22674  *infeasible = TRUE;
22675  return SCIP_OKAY;
22676  }
22677  newbound = MAX(newbound, lb);
22678 
22679  if( (force && SCIPsetIsGE(scip->set, newbound, ub)) || (!force && !SCIPsetIsUbBetter(scip->set, newbound, lb, ub)) )
22680  return SCIP_OKAY;
22681 
22682  switch( scip->set->stage )
22683  {
22684  case SCIP_STAGE_PROBLEM:
22685  assert(!SCIPvarIsTransformed(var));
22686  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22687  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22688  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22689  scip->branchcand, scip->eventqueue, newbound) );
22690  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
22691  break;
22693  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22694  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22695  break;
22696  case SCIP_STAGE_PRESOLVING:
22697  if( !SCIPinProbing(scip) )
22698  {
22699  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22700  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22701 
22702  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22703  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22705 
22707  {
22708  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
22709  assert(!(*infeasible));
22710  }
22711  break;
22712  }
22713  /*lint -fallthrough*/
22714  case SCIP_STAGE_SOLVING:
22716  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
22717  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, FALSE) );
22718  break;
22719 
22720  default:
22721  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22722  return SCIP_INVALIDCALL;
22723  } /*lint !e788*/
22724 
22725  if( tightened != NULL )
22726  *tightened = TRUE;
22727 
22728  return SCIP_OKAY;
22729 }
22730 
22731 /** fixes variable in preprocessing or in the current node, if the new bound is tighter (w.r.t. bound strengthening
22732  * epsilon) than the current bound; if possible, adjusts bound to integral value; the given inference constraint is
22733  * stored, such that the conflict analysis is able to find out the reason for the deduction of the bound change
22734  *
22735  * @note In presolving stage when not in probing mode the variable will be fixed directly, otherwise this method
22736  * changes first the lowerbound by calling SCIPinferVarLbCons and second the upperbound by calling
22737  * SCIPinferVarUbCons
22738  *
22739  * @note If SCIP is in presolving stage, it can happen that the internal variable array (which get be accessed via
22740  * SCIPgetVars()) gets resorted.
22741  *
22742  * @note During presolving, an integer variable which bound changes to {0,1} is upgraded to a binary variable.
22743  */
22745  SCIP* scip, /**< SCIP data structure */
22746  SCIP_VAR* var, /**< variable to change the bound for */
22747  SCIP_Real fixedval, /**< new value for fixation */
22748  SCIP_CONS* infercons, /**< constraint that deduced the bound change */
22749  int inferinfo, /**< user information for inference to help resolving the conflict */
22750  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
22751  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
22752  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
22753  )
22754 {
22755  assert(scip != NULL);
22756  assert(var != NULL);
22757  assert(infeasible != NULL);
22758 
22759  SCIP_CALL( checkStage(scip, "SCIPinferVarFixCons", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22760 
22761  if( tightened != NULL )
22762  *tightened = FALSE;
22763 
22764  /* in presolving case we take the shortcut to directly fix the variables */
22765  if( SCIPgetStage(scip) == SCIP_STAGE_PRESOLVING && SCIPtreeGetCurrentDepth(scip->tree) == 0 )
22766  {
22767  SCIP_Bool fixed;
22768 
22769  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
22770  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
22771  fixedval, infeasible, &fixed) );
22772 
22773  if( tightened != NULL )
22774  *tightened = fixed;
22775  }
22776  /* otherwise we use the lb and ub methods */
22777  else
22778  {
22779  SCIP_Bool lbtightened;
22780 
22781  SCIP_CALL( SCIPinferVarLbCons(scip, var, fixedval, infercons, inferinfo, force, infeasible, &lbtightened) );
22782 
22783  if( ! (*infeasible) )
22784  {
22785  SCIP_CALL( SCIPinferVarUbCons(scip, var, fixedval, infercons, inferinfo, force, infeasible, tightened) );
22786 
22787  if( tightened != NULL )
22788  *tightened |= lbtightened;
22789  }
22790  }
22791 
22792  return SCIP_OKAY;
22793 }
22794 
22795 /** changes lower bound of variable in preprocessing or in the current node, if the new bound is tighter
22796  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
22797  * the given inference constraint is stored, such that the conflict analysis is able to find out the reason
22798  * for the deduction of the bound change
22799  *
22800  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22801  * SCIPgetVars()) gets resorted.
22802  *
22803  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22804  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22805  *
22806  * @pre This method can be called if @p scip is in one of the following stages:
22807  * - \ref SCIP_STAGE_PROBLEM
22808  * - \ref SCIP_STAGE_PRESOLVING
22809  * - \ref SCIP_STAGE_SOLVING
22810  *
22811  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22812  */
22814  SCIP* scip, /**< SCIP data structure */
22815  SCIP_VAR* var, /**< variable to change the bound for */
22816  SCIP_Real newbound, /**< new value for bound */
22817  SCIP_CONS* infercons, /**< constraint that deduced the bound change */
22818  int inferinfo, /**< user information for inference to help resolving the conflict */
22819  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
22820  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
22821  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
22822  )
22823 {
22824  SCIP_Real lb;
22825  SCIP_Real ub;
22826 
22827  assert(infeasible != NULL);
22828 
22829  SCIP_CALL( checkStage(scip, "SCIPinferVarLbCons", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22830 
22831  *infeasible = FALSE;
22832  if( tightened != NULL )
22833  *tightened = FALSE;
22834 
22835  SCIPvarAdjustLb(var, scip->set, &newbound);
22836 
22837  /* ignore tightenings of lower bounds to +infinity during solving process */
22838  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22839  {
22840 #ifndef NDEBUG
22841  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
22842  SCIPvarGetLbLocal(var));
22843 #endif
22844  return SCIP_OKAY;
22845  }
22846 
22847  /* get current bounds */
22848  lb = SCIPvarGetLbLocal(var);
22849  ub = SCIPvarGetUbLocal(var);
22850  assert(SCIPsetIsLE(scip->set, lb, ub));
22851 
22852  if( SCIPsetIsFeasGT(scip->set, newbound, ub) )
22853  {
22854  *infeasible = TRUE;
22855  return SCIP_OKAY;
22856  }
22857  newbound = MIN(newbound, ub);
22858 
22859  if( (force && SCIPsetIsLE(scip->set, newbound, lb)) || (!force && !SCIPsetIsLbBetter(scip->set, newbound, lb, ub)) )
22860  return SCIP_OKAY;
22861 
22862  switch( scip->set->stage )
22863  {
22864  case SCIP_STAGE_PROBLEM:
22865  assert(!SCIPvarIsTransformed(var));
22866  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22867  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22868  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22869  scip->branchcand, scip->eventqueue, newbound) );
22870  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
22871  break;
22872 
22873  case SCIP_STAGE_PRESOLVING:
22874  if( !SCIPinProbing(scip) )
22875  {
22876  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22877  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22878 
22879  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22880  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22882 
22884  {
22885  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
22886  assert(!(*infeasible));
22887  }
22888  break;
22889  }
22890  /*lint -fallthrough*/
22891  case SCIP_STAGE_SOLVING:
22893  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
22894  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_LOWER, infercons, NULL, inferinfo, FALSE) );
22895  break;
22896 
22897  default:
22898  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22899  return SCIP_INVALIDCALL;
22900  } /*lint !e788*/
22901 
22902  if( tightened != NULL )
22903  *tightened = TRUE;
22904 
22905  return SCIP_OKAY;
22906 }
22907 
22908 /** changes upper bound of variable in preprocessing or in the current node, if the new bound is tighter
22909  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
22910  * the given inference constraint is stored, such that the conflict analysis is able to find out the reason
22911  * for the deduction of the bound change
22912  *
22913  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22914  * SCIPgetVars()) gets resorted.
22915  *
22916  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22917  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22918  *
22919  * @pre This method can be called if @p scip is in one of the following stages:
22920  * - \ref SCIP_STAGE_PROBLEM
22921  * - \ref SCIP_STAGE_PRESOLVING
22922  * - \ref SCIP_STAGE_SOLVING
22923  *
22924  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22925  */
22927  SCIP* scip, /**< SCIP data structure */
22928  SCIP_VAR* var, /**< variable to change the bound for */
22929  SCIP_Real newbound, /**< new value for bound */
22930  SCIP_CONS* infercons, /**< constraint that deduced the bound change */
22931  int inferinfo, /**< user information for inference to help resolving the conflict */
22932  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
22933  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
22934  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
22935  )
22936 {
22937  SCIP_Real lb;
22938  SCIP_Real ub;
22939 
22940  assert(infeasible != NULL);
22941 
22942  SCIP_CALL( checkStage(scip, "SCIPinferVarUbCons", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22943 
22944  *infeasible = FALSE;
22945  if( tightened != NULL )
22946  *tightened = FALSE;
22947 
22948  SCIPvarAdjustUb(var, scip->set, &newbound);
22949 
22950  /* ignore tightenings of upper bounds to -infinity during solving process */
22951  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22952  {
22953 #ifndef NDEBUG
22954  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
22955  SCIPvarGetUbLocal(var));
22956 #endif
22957  return SCIP_OKAY;
22958  }
22959 
22960  /* get current bounds */
22961  lb = SCIPvarGetLbLocal(var);
22962  ub = SCIPvarGetUbLocal(var);
22963  assert(SCIPsetIsLE(scip->set, lb, ub));
22964 
22965  if( SCIPsetIsFeasLT(scip->set, newbound, lb) )
22966  {
22967  *infeasible = TRUE;
22968  return SCIP_OKAY;
22969  }
22970  newbound = MAX(newbound, lb);
22971 
22972  if( (force && SCIPsetIsGE(scip->set, newbound, ub)) || (!force && !SCIPsetIsUbBetter(scip->set, newbound, lb, ub)) )
22973  return SCIP_OKAY;
22974 
22975  switch( scip->set->stage )
22976  {
22977  case SCIP_STAGE_PROBLEM:
22978  assert(!SCIPvarIsTransformed(var));
22979  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22980  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22981  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22982  scip->branchcand, scip->eventqueue, newbound) );
22983  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
22984  break;
22985 
22986  case SCIP_STAGE_PRESOLVING:
22987  if( !SCIPinProbing(scip) )
22988  {
22989  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22990  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22991 
22992  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22993  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22995 
22997  {
22998  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
22999  assert(!(*infeasible));
23000  }
23001  break;
23002  }
23003  /*lint -fallthrough*/
23004  case SCIP_STAGE_SOLVING:
23006  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
23007  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, infercons, NULL, inferinfo, FALSE) );
23008  break;
23009 
23010  default:
23011  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
23012  return SCIP_INVALIDCALL;
23013  } /*lint !e788*/
23014 
23015  if( tightened != NULL )
23016  *tightened = TRUE;
23017 
23018  return SCIP_OKAY;
23019 }
23020 
23021 /** depending on SCIP's stage, fixes binary variable in the problem, in preprocessing, or in current node;
23022  * the given inference constraint is stored, such that the conflict analysis is able to find out the reason for the
23023  * deduction of the fixing
23024  *
23025  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23026  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23027  *
23028  * @pre This method can be called if @p scip is in one of the following stages:
23029  * - \ref SCIP_STAGE_PROBLEM
23030  * - \ref SCIP_STAGE_PRESOLVING
23031  * - \ref SCIP_STAGE_SOLVING
23032  */
23034  SCIP* scip, /**< SCIP data structure */
23035  SCIP_VAR* var, /**< binary variable to fix */
23036  SCIP_Bool fixedval, /**< value to fix binary variable to */
23037  SCIP_CONS* infercons, /**< constraint that deduced the fixing */
23038  int inferinfo, /**< user information for inference to help resolving the conflict */
23039  SCIP_Bool* infeasible, /**< pointer to store whether the fixing is infeasible */
23040  SCIP_Bool* tightened /**< pointer to store whether the fixing tightened the local bounds, or NULL */
23041  )
23042 {
23043  SCIP_Real lb;
23044  SCIP_Real ub;
23045 
23046  assert(SCIPvarIsBinary(var));
23047  assert(fixedval == TRUE || fixedval == FALSE);
23048  assert(infeasible != NULL);
23049 
23050  SCIP_CALL( checkStage(scip, "SCIPinferBinvarCons", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23051 
23052  *infeasible = FALSE;
23053  if( tightened != NULL )
23054  *tightened = FALSE;
23055 
23056  /* get current bounds */
23057  lb = SCIPvarGetLbLocal(var);
23058  ub = SCIPvarGetUbLocal(var);
23059  assert(SCIPsetIsEQ(scip->set, lb, 0.0) || SCIPsetIsEQ(scip->set, lb, 1.0));
23060  assert(SCIPsetIsEQ(scip->set, ub, 0.0) || SCIPsetIsEQ(scip->set, ub, 1.0));
23061  assert(SCIPsetIsLE(scip->set, lb, ub));
23062 
23063  /* check, if variable is already fixed */
23064  if( (lb > 0.5) || (ub < 0.5) )
23065  {
23066  *infeasible = (fixedval == (lb < 0.5));
23067 
23068  return SCIP_OKAY;
23069  }
23070 
23071  /* apply the fixing */
23072  switch( scip->set->stage )
23073  {
23074  case SCIP_STAGE_PROBLEM:
23075  assert(!SCIPvarIsTransformed(var));
23076  if( fixedval == TRUE )
23077  {
23078  SCIP_CALL( SCIPchgVarLb(scip, var, 1.0) );
23079  }
23080  else
23081  {
23082  SCIP_CALL( SCIPchgVarUb(scip, var, 0.0) );
23083  }
23084  break;
23085 
23086  case SCIP_STAGE_PRESOLVING:
23087  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 )
23088  {
23089  SCIP_Bool fixed;
23090 
23091  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
23092  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
23093  (SCIP_Real)fixedval, infeasible, &fixed) );
23094  break;
23095  }
23096  /*lint -fallthrough*/
23097  case SCIP_STAGE_SOLVING:
23098  if( fixedval == TRUE )
23099  {
23101  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
23102  scip->cliquetable, var, 1.0, SCIP_BOUNDTYPE_LOWER, infercons, NULL, inferinfo, FALSE) );
23103  }
23104  else
23105  {
23107  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
23108  scip->cliquetable, var, 0.0, SCIP_BOUNDTYPE_UPPER, infercons, NULL, inferinfo, FALSE) );
23109  }
23110  break;
23111 
23112  default:
23113  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
23114  return SCIP_INVALIDCALL;
23115  } /*lint !e788*/
23116 
23117  if( tightened != NULL )
23118  *tightened = TRUE;
23119 
23120  return SCIP_OKAY;
23121 }
23122 
23123 /** fixes variable in preprocessing or in the current node, if the new bound is tighter (w.r.t. bound strengthening
23124  * epsilon) than the current bound; if possible, adjusts bound to integral value; the given inference constraint is
23125  * stored, such that the conflict analysis is able to find out the reason for the deduction of the bound change
23126  *
23127  * @note In presolving stage when not in probing mode the variable will be fixed directly, otherwise this method
23128  * changes first the lowerbound by calling SCIPinferVarLbProp and second the upperbound by calling
23129  * SCIPinferVarUbProp
23130  *
23131  * @note If SCIP is in presolving stage, it can happen that the internal variable array (which get be accessed via
23132  * SCIPgetVars()) gets resorted.
23133  *
23134  * @note During presolving, an integer variable which bound changes to {0,1} is upgraded to a binary variable.
23135  */
23137  SCIP* scip, /**< SCIP data structure */
23138  SCIP_VAR* var, /**< variable to change the bound for */
23139  SCIP_Real fixedval, /**< new value for fixation */
23140  SCIP_PROP* inferprop, /**< propagator that deduced the bound change */
23141  int inferinfo, /**< user information for inference to help resolving the conflict */
23142  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
23143  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
23144  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
23145  )
23146 {
23147  assert(scip != NULL);
23148  assert(var != NULL);
23149  assert(infeasible != NULL);
23150 
23151  SCIP_CALL( checkStage(scip, "SCIPinferVarFixProp", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23152 
23153  if( tightened != NULL )
23154  *tightened = FALSE;
23155 
23156  /* in presolving case we take the shortcut to directly fix the variables */
23157  if( SCIPgetStage(scip) == SCIP_STAGE_PRESOLVING && SCIPtreeGetCurrentDepth(scip->tree) == 0 )
23158  {
23159  SCIP_Bool fixed;
23160 
23161  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
23162  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
23163  fixedval, infeasible, &fixed) );
23164 
23165  if( tightened != NULL )
23166  *tightened = fixed;
23167  }
23168  /* otherwise we use the lb and ub methods */
23169  else
23170  {
23171  SCIP_Bool lbtightened;
23172 
23173  SCIP_CALL( SCIPinferVarLbProp(scip, var, fixedval, inferprop, inferinfo, force, infeasible, &lbtightened) );
23174 
23175  if( ! (*infeasible) )
23176  {
23177  SCIP_CALL( SCIPinferVarUbProp(scip, var, fixedval, inferprop, inferinfo, force, infeasible, tightened) );
23178 
23179  if( tightened != NULL )
23180  *tightened |= lbtightened;
23181  }
23182  }
23183 
23184  return SCIP_OKAY;
23185 }
23186 
23187 /** changes lower bound of variable in preprocessing or in the current node, if the new bound is tighter
23188  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
23189  * the given inference propagator is stored, such that the conflict analysis is able to find out the reason
23190  * for the deduction of the bound change
23191  *
23192  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
23193  * SCIPgetVars()) gets resorted.
23194  *
23195  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23196  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23197  *
23198  * @pre This method can be called if @p scip is in one of the following stages:
23199  * - \ref SCIP_STAGE_PROBLEM
23200  * - \ref SCIP_STAGE_PRESOLVING
23201  * - \ref SCIP_STAGE_SOLVING
23202  *
23203  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
23204  */
23206  SCIP* scip, /**< SCIP data structure */
23207  SCIP_VAR* var, /**< variable to change the bound for */
23208  SCIP_Real newbound, /**< new value for bound */
23209  SCIP_PROP* inferprop, /**< propagator that deduced the bound change */
23210  int inferinfo, /**< user information for inference to help resolving the conflict */
23211  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
23212  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
23213  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
23214  )
23215 {
23216  SCIP_Real lb;
23217  SCIP_Real ub;
23218 
23219  assert(infeasible != NULL);
23220 
23221  SCIP_CALL( checkStage(scip, "SCIPinferVarLbProp", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23222 
23223  *infeasible = FALSE;
23224  if( tightened != NULL )
23225  *tightened = FALSE;
23226 
23227  SCIPvarAdjustLb(var, scip->set, &newbound);
23228 
23229  /* ignore tightenings of lower bounds to +infinity during solving process */
23230  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
23231  {
23232 #ifndef NDEBUG
23233  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
23234  SCIPvarGetLbLocal(var));
23235 #endif
23236  return SCIP_OKAY;
23237  }
23238 
23239  /* get current bounds */
23240  lb = SCIPvarGetLbLocal(var);
23241  ub = SCIPvarGetUbLocal(var);
23242  assert(SCIPsetIsLE(scip->set, lb, ub));
23243 
23244  if( SCIPsetIsFeasGT(scip->set, newbound, ub) )
23245  {
23246  *infeasible = TRUE;
23247  return SCIP_OKAY;
23248  }
23249  newbound = MIN(newbound, ub);
23250 
23251  if( (!force && !SCIPsetIsLbBetter(scip->set, newbound, lb, ub))
23252  || SCIPsetIsLE(scip->set, newbound, lb) )
23253  return SCIP_OKAY;
23254 
23255  switch( scip->set->stage )
23256  {
23257  case SCIP_STAGE_PROBLEM:
23258  assert(!SCIPvarIsTransformed(var));
23259  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23260  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
23261  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23262  scip->branchcand, scip->eventqueue, newbound) );
23263  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
23264  break;
23265 
23266  case SCIP_STAGE_PRESOLVING:
23267  if( !SCIPinProbing(scip) )
23268  {
23269  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
23270  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
23271 
23272  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
23273  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
23275 
23277  {
23278  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
23279  assert(!(*infeasible));
23280  }
23281  break;
23282  }
23283  /*lint -fallthrough*/
23284  case SCIP_STAGE_SOLVING:
23286  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
23287  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_LOWER, NULL, inferprop, inferinfo, FALSE) );
23288  break;
23289 
23290  default:
23291  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
23292  return SCIP_INVALIDCALL;
23293  } /*lint !e788*/
23294 
23295  if( tightened != NULL )
23296  *tightened = TRUE;
23297 
23298  return SCIP_OKAY;
23299 }
23300 
23301 /** changes upper bound of variable in preprocessing or in the current node, if the new bound is tighter
23302  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
23303  * the given inference propagator is stored, such that the conflict analysis is able to find out the reason
23304  * for the deduction of the bound change
23305  *
23306  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
23307  * SCIPgetVars()) gets resorted.
23308  *
23309  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23310  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23311  *
23312  * @pre This method can be called if @p scip is in one of the following stages:
23313  * - \ref SCIP_STAGE_PROBLEM
23314  * - \ref SCIP_STAGE_PRESOLVING
23315  * - \ref SCIP_STAGE_SOLVING
23316  *
23317  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
23318  */
23320  SCIP* scip, /**< SCIP data structure */
23321  SCIP_VAR* var, /**< variable to change the bound for */
23322  SCIP_Real newbound, /**< new value for bound */
23323  SCIP_PROP* inferprop, /**< propagator that deduced the bound change */
23324  int inferinfo, /**< user information for inference to help resolving the conflict */
23325  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
23326  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
23327  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
23328  )
23329 {
23330  SCIP_Real lb;
23331  SCIP_Real ub;
23332 
23333  assert(infeasible != NULL);
23334 
23335  SCIP_CALL( checkStage(scip, "SCIPinferVarUbProp", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23336 
23337  *infeasible = FALSE;
23338  if( tightened != NULL )
23339  *tightened = FALSE;
23340 
23341  SCIPvarAdjustUb(var, scip->set, &newbound);
23342 
23343  /* ignore tightenings of upper bounds to -infinity during solving process */
23344  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
23345  {
23346 #ifndef NDEBUG
23347  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
23348  SCIPvarGetUbLocal(var));
23349 #endif
23350  return SCIP_OKAY;
23351  }
23352 
23353  /* get current bounds */
23354  lb = SCIPvarGetLbLocal(var);
23355  ub = SCIPvarGetUbLocal(var);
23356  assert(SCIPsetIsLE(scip->set, lb, ub));
23357 
23358  if( SCIPsetIsFeasLT(scip->set, newbound, lb) )
23359  {
23360  *infeasible = TRUE;
23361  return SCIP_OKAY;
23362  }
23363  newbound = MAX(newbound, lb);
23364 
23365  if( (!force && !SCIPsetIsUbBetter(scip->set, newbound, lb, ub))
23366  || SCIPsetIsGE(scip->set, newbound, ub) )
23367  return SCIP_OKAY;
23368 
23369  switch( scip->set->stage )
23370  {
23371  case SCIP_STAGE_PROBLEM:
23372  assert(!SCIPvarIsTransformed(var));
23373  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23374  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
23375  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23376  scip->branchcand, scip->eventqueue, newbound) );
23377  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
23378  break;
23379 
23380  case SCIP_STAGE_PRESOLVING:
23381  if( !SCIPinProbing(scip) )
23382  {
23383  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
23384  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
23385 
23386  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
23387  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
23389 
23391  {
23392  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
23393  assert(!(*infeasible));
23394  }
23395  break;
23396  }
23397  /*lint -fallthrough*/
23398  case SCIP_STAGE_SOLVING:
23400  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
23401  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, NULL, inferprop, inferinfo, FALSE) );
23402  break;
23403 
23404  default:
23405  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
23406  return SCIP_INVALIDCALL;
23407  } /*lint !e788*/
23408 
23409  if( tightened != NULL )
23410  *tightened = TRUE;
23411 
23412  return SCIP_OKAY;
23413 }
23414 
23415 /** depending on SCIP's stage, fixes binary variable in the problem, in preprocessing, or in current node;
23416  * the given inference propagator is stored, such that the conflict analysis is able to find out the reason for the
23417  * deduction of the fixing
23418  *
23419  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23420  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23421  *
23422  * @pre This method can be called if @p scip is in one of the following stages:
23423  * - \ref SCIP_STAGE_PROBLEM
23424  * - \ref SCIP_STAGE_PRESOLVING
23425  * - \ref SCIP_STAGE_PRESOLVED
23426  * - \ref SCIP_STAGE_SOLVING
23427  */
23429  SCIP* scip, /**< SCIP data structure */
23430  SCIP_VAR* var, /**< binary variable to fix */
23431  SCIP_Bool fixedval, /**< value to fix binary variable to */
23432  SCIP_PROP* inferprop, /**< propagator that deduced the fixing */
23433  int inferinfo, /**< user information for inference to help resolving the conflict */
23434  SCIP_Bool* infeasible, /**< pointer to store whether the fixing is infeasible */
23435  SCIP_Bool* tightened /**< pointer to store whether the fixing tightened the local bounds, or NULL */
23436  )
23437 {
23438  SCIP_Real lb;
23439  SCIP_Real ub;
23440 
23441  assert(SCIPvarIsBinary(var));
23442  assert(fixedval == TRUE || fixedval == FALSE);
23443  assert(infeasible != NULL);
23444 
23445  SCIP_CALL( checkStage(scip, "SCIPinferBinvarProp", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23446 
23447  *infeasible = FALSE;
23448  if( tightened != NULL )
23449  *tightened = FALSE;
23450 
23451  /* get current bounds */
23452  lb = SCIPvarGetLbLocal(var);
23453  ub = SCIPvarGetUbLocal(var);
23454  assert(SCIPsetIsEQ(scip->set, lb, 0.0) || SCIPsetIsEQ(scip->set, lb, 1.0));
23455  assert(SCIPsetIsEQ(scip->set, ub, 0.0) || SCIPsetIsEQ(scip->set, ub, 1.0));
23456  assert(SCIPsetIsLE(scip->set, lb, ub));
23457 
23458  /* check, if variable is already fixed */
23459  if( (lb > 0.5) || (ub < 0.5) )
23460  {
23461  *infeasible = (fixedval == (lb < 0.5));
23462 
23463  return SCIP_OKAY;
23464  }
23465 
23466  /* apply the fixing */
23467  switch( scip->set->stage )
23468  {
23469  case SCIP_STAGE_PROBLEM:
23470  assert(!SCIPvarIsTransformed(var));
23471  if( fixedval == TRUE )
23472  {
23473  SCIP_CALL( SCIPchgVarLb(scip, var, 1.0) );
23474  }
23475  else
23476  {
23477  SCIP_CALL( SCIPchgVarUb(scip, var, 0.0) );
23478  }
23479  break;
23480 
23481  case SCIP_STAGE_PRESOLVING:
23482  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 )
23483  {
23484  SCIP_Bool fixed;
23485 
23486  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
23487  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
23488  (SCIP_Real)fixedval, infeasible, &fixed) );
23489  break;
23490  }
23491  /*lint -fallthrough*/
23492  case SCIP_STAGE_SOLVING:
23493  if( fixedval == TRUE )
23494  {
23496  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, 1.0,
23497  SCIP_BOUNDTYPE_LOWER, NULL, inferprop, inferinfo, FALSE) );
23498  }
23499  else
23500  {
23502  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, 0.0,
23503  SCIP_BOUNDTYPE_UPPER, NULL, inferprop, inferinfo, FALSE) );
23504  }
23505  break;
23506 
23507  default:
23508  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
23509  return SCIP_INVALIDCALL;
23510  } /*lint !e788*/
23511 
23512  if( tightened != NULL )
23513  *tightened = TRUE;
23514 
23515  return SCIP_OKAY;
23516 }
23517 
23518 /** changes global lower bound of variable in preprocessing or in the current node, if the new bound is tighter
23519  * (w.r.t. bound strengthening epsilon) than the current global bound; if possible, adjusts bound to integral value;
23520  * also tightens the local bound, if the global bound is better than the local bound
23521  *
23522  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
23523  * SCIPgetVars()) gets resorted.
23524  *
23525  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23526  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23527  *
23528  * @pre This method can be called if @p scip is in one of the following stages:
23529  * - \ref SCIP_STAGE_PROBLEM
23530  * - \ref SCIP_STAGE_TRANSFORMING
23531  * - \ref SCIP_STAGE_PRESOLVING
23532  * - \ref SCIP_STAGE_SOLVING
23533  *
23534  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
23535  */
23537  SCIP* scip, /**< SCIP data structure */
23538  SCIP_VAR* var, /**< variable to change the bound for */
23539  SCIP_Real newbound, /**< new value for bound */
23540  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
23541  SCIP_Bool* infeasible, /**< pointer to store whether the new domain is empty */
23542  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
23543  )
23544 {
23545  SCIP_Real lb;
23546  SCIP_Real ub;
23547 
23548  assert(infeasible != NULL);
23549 
23550  SCIP_CALL( checkStage(scip, "SCIPtightenVarLbGlobal", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23551 
23552  *infeasible = FALSE;
23553  if( tightened != NULL )
23554  *tightened = FALSE;
23555 
23556  SCIPvarAdjustLb(var, scip->set, &newbound);
23557 
23558  /* ignore tightenings of lower bounds to +infinity during solving process */
23559  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
23560  {
23561 #ifndef NDEBUG
23562  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
23563  SCIPvarGetLbLocal(var));
23564 #endif
23565  return SCIP_OKAY;
23566  }
23567 
23568  /* get current bounds */
23569  lb = SCIPvarGetLbGlobal(var);
23570  ub = SCIPvarGetUbGlobal(var);
23571  assert(scip->set->stage == SCIP_STAGE_PROBLEM || SCIPsetIsLE(scip->set, lb, ub));
23572 
23573  if( SCIPsetIsFeasGT(scip->set, newbound, ub) )
23574  {
23575  *infeasible = TRUE;
23576  return SCIP_OKAY;
23577  }
23578  newbound = MIN(newbound, ub);
23579 
23580  /* bound changes of less than epsilon are ignored by SCIPvarChgLb or raise an assert in SCIPnodeAddBoundinfer,
23581  * so don't apply them even if force is set
23582  */
23583  if( SCIPsetIsEQ(scip->set, lb, newbound) || (!force && !SCIPsetIsLbBetter(scip->set, newbound, lb, ub)) )
23584  return SCIP_OKAY;
23585 
23586  switch( scip->set->stage )
23587  {
23588  case SCIP_STAGE_PROBLEM:
23589  assert(!SCIPvarIsTransformed(var));
23590  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23591  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
23592  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23593  scip->branchcand, scip->eventqueue, newbound) );
23594  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
23595  break;
23596 
23598  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23599  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
23600  break;
23601 
23602  case SCIP_STAGE_PRESOLVING:
23603  if( !SCIPinProbing(scip) )
23604  {
23605  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
23606  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
23607 
23608  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
23609  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
23611 
23613  {
23614  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
23615  assert(!(*infeasible));
23616  }
23617  break;
23618  }
23619  /*lint -fallthrough*/
23620  case SCIP_STAGE_SOLVING:
23621  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
23622  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
23624  break;
23625 
23626  default:
23627  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
23628  return SCIP_INVALIDCALL;
23629  } /*lint !e788*/
23630 
23631  /* coverity: unreachable code */
23632  if( tightened != NULL )
23633  *tightened = TRUE;
23634 
23635  return SCIP_OKAY;
23636 }
23637 
23638 /** changes global upper bound of variable in preprocessing or in the current node, if the new bound is tighter
23639  * (w.r.t. bound strengthening epsilon) than the current global bound; if possible, adjusts bound to integral value;
23640  * also tightens the local bound, if the global bound is better than the local bound
23641  *
23642  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
23643  * SCIPgetVars()) gets resorted.
23644  *
23645  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23646  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23647  *
23648  * @pre This method can be called if @p scip is in one of the following stages:
23649  * - \ref SCIP_STAGE_PROBLEM
23650  * - \ref SCIP_STAGE_TRANSFORMING
23651  * - \ref SCIP_STAGE_PRESOLVING
23652  * - \ref SCIP_STAGE_SOLVING
23653  *
23654  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
23655  */
23657  SCIP* scip, /**< SCIP data structure */
23658  SCIP_VAR* var, /**< variable to change the bound for */
23659  SCIP_Real newbound, /**< new value for bound */
23660  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
23661  SCIP_Bool* infeasible, /**< pointer to store whether the new domain is empty */
23662  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
23663  )
23664 {
23665  SCIP_Real lb;
23666  SCIP_Real ub;
23667 
23668  assert(infeasible != NULL);
23669 
23670  SCIP_CALL( checkStage(scip, "SCIPtightenVarUbGlobal", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23671 
23672  *infeasible = FALSE;
23673  if( tightened != NULL )
23674  *tightened = FALSE;
23675 
23676  SCIPvarAdjustUb(var, scip->set, &newbound);
23677 
23678  /* ignore tightenings of upper bounds to -infinity during solving process */
23679  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
23680  {
23681 #ifndef NDEBUG
23682  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
23683  SCIPvarGetUbLocal(var));
23684 #endif
23685  return SCIP_OKAY;
23686  }
23687 
23688  /* get current bounds */
23689  lb = SCIPvarGetLbGlobal(var);
23690  ub = SCIPvarGetUbGlobal(var);
23691  assert(scip->set->stage == SCIP_STAGE_PROBLEM || SCIPsetIsLE(scip->set, lb, ub));
23692 
23693  if( SCIPsetIsFeasLT(scip->set, newbound, lb) )
23694  {
23695  *infeasible = TRUE;
23696  return SCIP_OKAY;
23697  }
23698  newbound = MAX(newbound, lb);
23699 
23700  /* bound changes of less than epsilon are ignored by SCIPvarChgUb or raise an assert in SCIPnodeAddBoundinfer,
23701  * so don't apply them even if force is set
23702  */
23703  if( SCIPsetIsEQ(scip->set, ub, newbound) || (!force && !SCIPsetIsUbBetter(scip->set, newbound, lb, ub)) )
23704  return SCIP_OKAY;
23705 
23706  switch( scip->set->stage )
23707  {
23708  case SCIP_STAGE_PROBLEM:
23709  assert(!SCIPvarIsTransformed(var));
23710  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23711  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
23712  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23713  scip->branchcand, scip->eventqueue, newbound) );
23714  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
23715  break;
23716 
23718  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23719  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
23720  break;
23721 
23722  case SCIP_STAGE_PRESOLVING:
23723  if( !SCIPinProbing(scip) )
23724  {
23725  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
23726  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
23727 
23728  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
23729  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
23731 
23733  {
23734  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
23735  assert(!(*infeasible));
23736  }
23737  break;
23738  }
23739  /*lint -fallthrough*/
23740  case SCIP_STAGE_SOLVING:
23741  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
23742  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
23744  break;
23745 
23746  default:
23747  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
23748  return SCIP_INVALIDCALL;
23749  } /*lint !e788*/
23750 
23751  /* coverity: unreachable code */
23752  if( tightened != NULL )
23753  *tightened = TRUE;
23754 
23755  return SCIP_OKAY;
23756 }
23757 
23758 /* some simple variable functions implemented as defines */
23759 #undef SCIPcomputeVarLbGlobal
23760 #undef SCIPcomputeVarUbGlobal
23761 #undef SCIPcomputeVarLbLocal
23762 #undef SCIPcomputeVarUbLocal
23763 
23764 /** for a multi-aggregated variable, returns the global lower bound computed by adding the global bounds from all aggregation variables
23765  *
23766  * 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
23767  * calling this function for a non-multi-aggregated variable results in a call to SCIPvarGetLbGlobal.
23768  *
23769  * @return the global lower bound computed by adding the global bounds from all aggregation variables
23770  */
23772  SCIP* scip, /**< SCIP data structure */
23773  SCIP_VAR* var /**< variable to compute the bound for */
23774  )
23775 {
23776  assert(scip != NULL);
23777  assert(var != NULL);
23778 
23780  return SCIPvarGetMultaggrLbGlobal(var, scip->set);
23781  else
23782  return SCIPvarGetLbGlobal(var);
23783 }
23784 
23785 /** for a multi-aggregated variable, returns the global upper bound computed by adding the global bounds from all aggregation variables
23786  *
23787  * 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
23788  * calling this function for a non-multi-aggregated variable results in a call to SCIPvarGetUbGlobal
23789  *
23790  * @return the global upper bound computed by adding the global bounds from all aggregation variables
23791  */
23793  SCIP* scip, /**< SCIP data structure */
23794  SCIP_VAR* var /**< variable to compute the bound for */
23795  )
23796 {
23797  assert(scip != NULL);
23798  assert(var != NULL);
23799 
23801  return SCIPvarGetMultaggrUbGlobal(var, scip->set);
23802  else
23803  return SCIPvarGetUbGlobal(var);
23804 }
23805 
23806 /** for a multi-aggregated variable, returns the local lower bound computed by adding the local bounds from all aggregation variables
23807  *
23808  * 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
23809  * calling this function for a non-multi-aggregated variable results in a call to SCIPvarGetLbLocal.
23810  *
23811  * @return the local lower bound computed by adding the global bounds from all aggregation variables
23812  */
23814  SCIP* scip, /**< SCIP data structure */
23815  SCIP_VAR* var /**< variable to compute the bound for */
23816  )
23817 {
23818  assert(scip != NULL);
23819  assert(var != NULL);
23820 
23822  return SCIPvarGetMultaggrLbLocal(var, scip->set);
23823  else
23824  return SCIPvarGetLbLocal(var);
23825 }
23826 
23827 /** for a multi-aggregated variable, returns the local upper bound computed by adding the local bounds from all aggregation variables
23828  *
23829  * 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
23830  * calling this function for a non-multi-aggregated variable results in a call to SCIPvarGetUbLocal.
23831  *
23832  * @return the local upper bound computed by adding the global bounds from all aggregation variables
23833  */
23835  SCIP* scip, /**< SCIP data structure */
23836  SCIP_VAR* var /**< variable to compute the bound for */
23837  )
23838 {
23839  assert(scip != NULL);
23840  assert(var != NULL);
23841 
23843  return SCIPvarGetMultaggrUbLocal(var, scip->set);
23844  else
23845  return SCIPvarGetUbLocal(var);
23846 }
23847 
23848 /** for a multi-aggregated variable, gives the global lower bound computed by adding the global bounds from all
23849  * aggregation variables, this global bound may be tighter than the one given by SCIPvarGetLbGlobal, since the latter is
23850  * not updated if bounds of aggregation variables are changing
23851  *
23852  * calling this function for a non-multi-aggregated variable is not allowed
23853  */
23855  SCIP* scip, /**< SCIP data structure */
23856  SCIP_VAR* var /**< variable to compute the bound for */
23857  )
23858 {
23859  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_MULTAGGR);
23860  return SCIPvarGetMultaggrLbGlobal(var, scip->set);
23861 }
23862 
23863 /** for a multi-aggregated variable, gives the global upper bound computed by adding the global bounds from all
23864  * aggregation variables, this upper bound may be tighter than the one given by SCIPvarGetUbGlobal, since the latter is
23865  * not updated if bounds of aggregation variables are changing
23866  *
23867  * calling this function for a non-multi-aggregated variable is not allowed
23868  */
23870  SCIP* scip, /**< SCIP data structure */
23871  SCIP_VAR* var /**< variable to compute the bound for */
23872  )
23873 {
23874  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_MULTAGGR);
23875  return SCIPvarGetMultaggrUbGlobal(var, scip->set);
23876 }
23877 
23878 /** for a multi-aggregated variable, gives the local lower bound computed by adding the local bounds from all
23879  * aggregation variables, this lower bound may be tighter than the one given by SCIPvarGetLbLocal, since the latter is
23880  * not updated if bounds of aggregation variables are changing
23881  *
23882  * calling this function for a non-multi-aggregated variable is not allowed
23883  */
23885  SCIP* scip, /**< SCIP data structure */
23886  SCIP_VAR* var /**< variable to compute the bound for */
23887  )
23888 {
23889  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_MULTAGGR);
23890  return SCIPvarGetMultaggrLbLocal(var, scip->set);
23891 }
23892 
23893 /** for a multi-aggregated variable, gives the local upper bound computed by adding the local bounds from all
23894  * aggregation variables, this upper bound may be tighter than the one given by SCIPvarGetUbLocal, since the latter is
23895  * not updated if bounds of aggregation variables are changing
23896  *
23897  * calling this function for a non-multi-aggregated variable is not allowed
23898  */
23900  SCIP* scip, /**< SCIP data structure */
23901  SCIP_VAR* var /**< variable to compute the bound for */
23902  )
23903 {
23904  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_MULTAGGR);
23905  return SCIPvarGetMultaggrUbLocal(var, scip->set);
23906 }
23907 
23908 /** returns solution value and index of variable lower bound that is closest to the variable's value in the given primal
23909  * solution or current LP solution if no primal solution is given; returns an index of -1 if no variable lower bound is
23910  * available
23911  *
23912  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23913  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23914  *
23915  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
23916  */
23918  SCIP* scip, /**< SCIP data structure */
23919  SCIP_VAR* var, /**< active problem variable */
23920  SCIP_SOL* sol, /**< primal solution, or NULL for LP solution */
23921  SCIP_Real* closestvlb, /**< pointer to store the value of the closest variable lower bound */
23922  int* closestvlbidx /**< pointer to store the index of the closest variable lower bound */
23923  )
23924 {
23925  SCIP_CALL( checkStage(scip, "SCIPgetVarClosestVlb", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23926 
23927  SCIPvarGetClosestVlb(var, sol, scip->set, scip->stat, closestvlb, closestvlbidx);
23928 
23929  return SCIP_OKAY;
23930 }
23931 
23932 /** returns solution value and index of variable upper bound that is closest to the variable's value in the given primal solution;
23933  * or current LP solution if no primal solution is given; returns an index of -1 if no variable upper bound is available
23934  *
23935  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23936  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23937  *
23938  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
23939  */
23941  SCIP* scip, /**< SCIP data structure */
23942  SCIP_VAR* var, /**< active problem variable */
23943  SCIP_SOL* sol, /**< primal solution, or NULL for LP solution */
23944  SCIP_Real* closestvub, /**< pointer to store the value of the closest variable lower bound */
23945  int* closestvubidx /**< pointer to store the index of the closest variable lower bound */
23946  )
23947 {
23948  SCIP_CALL( checkStage(scip, "SCIPgetVarClosestVub", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23949 
23950  SCIPvarGetClosestVub(var, sol, scip->set, scip->stat, closestvub, closestvubidx);
23951 
23952  return SCIP_OKAY;
23953 }
23954 
23955 /** informs variable x about a globally valid variable lower bound x >= b*z + d with integer variable z;
23956  * if z is binary, the corresponding valid implication for z is also added;
23957  * if z is non-continuous and 1/b not too small, the corresponding valid upper/lower bound
23958  * z <= (x-d)/b or z >= (x-d)/b (depending on the sign of of b) is added, too;
23959  * improves the global bounds of the variable and the vlb variable if possible
23960  *
23961  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23962  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23963  *
23964  * @pre This method can be called if @p scip is in one of the following stages:
23965  * - \ref SCIP_STAGE_PRESOLVING
23966  * - \ref SCIP_STAGE_PRESOLVED
23967  * - \ref SCIP_STAGE_SOLVING
23968  */
23970  SCIP* scip, /**< SCIP data structure */
23971  SCIP_VAR* var, /**< problem variable */
23972  SCIP_VAR* vlbvar, /**< variable z in x >= b*z + d */
23973  SCIP_Real vlbcoef, /**< coefficient b in x >= b*z + d */
23974  SCIP_Real vlbconstant, /**< constant d in x >= b*z + d */
23975  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
23976  int* nbdchgs /**< pointer to store the number of performed bound changes, or NULL */
23977  )
23978 {
23979  int nlocalbdchgs;
23980 
23981  SCIP_CALL( checkStage(scip, "SCIPaddVarVlb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23982 
23983  SCIP_CALL( SCIPvarAddVlb(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob, scip->tree,
23984  scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, vlbvar, vlbcoef, vlbconstant,
23985  TRUE, infeasible, &nlocalbdchgs) );
23986 
23987  *nbdchgs = nlocalbdchgs;
23988 
23989  /* 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
23990  * detected infeasibility
23991  */
23992  if( !(*infeasible) && SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS && !SCIPisZero(scip, 1.0/vlbcoef) )
23993  {
23994  if( vlbcoef > 0.0 )
23995  {
23996  /* if b > 0, we have a variable upper bound: x >= b*z + d => z <= (x-d)/b */
23997  SCIP_CALL( SCIPvarAddVub(vlbvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
23998  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var, 1.0/vlbcoef,
23999  -vlbconstant/vlbcoef, TRUE, infeasible, &nlocalbdchgs) );
24000  }
24001  else
24002  {
24003  /* if b < 0, we have a variable lower bound: x >= b*z + d => z >= (x-d)/b */
24004  SCIP_CALL( SCIPvarAddVlb(vlbvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
24005  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var, 1.0/vlbcoef,
24006  -vlbconstant/vlbcoef, TRUE, infeasible, &nlocalbdchgs) );
24007  }
24008  *nbdchgs += nlocalbdchgs;
24009  }
24010 
24011  return SCIP_OKAY;
24012 }
24013 
24014 /** informs variable x about a globally valid variable upper bound x <= b*z + d with integer variable z;
24015  * if z is binary, the corresponding valid implication for z is also added;
24016  * if z is non-continuous and 1/b not too small, the corresponding valid lower/upper bound
24017  * z >= (x-d)/b or z <= (x-d)/b (depending on the sign of of b) is added, too;
24018  * improves the global bounds of the variable and the vlb variable if possible
24019  *
24020  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24021  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24022  *
24023  * @pre This method can be called if @p scip is in one of the following stages:
24024  * - \ref SCIP_STAGE_PRESOLVING
24025  * - \ref SCIP_STAGE_PRESOLVED
24026  * - \ref SCIP_STAGE_SOLVING
24027  */
24029  SCIP* scip, /**< SCIP data structure */
24030  SCIP_VAR* var, /**< problem variable */
24031  SCIP_VAR* vubvar, /**< variable z in x <= b*z + d */
24032  SCIP_Real vubcoef, /**< coefficient b in x <= b*z + d */
24033  SCIP_Real vubconstant, /**< constant d in x <= b*z + d */
24034  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
24035  int* nbdchgs /**< pointer to store the number of performed bound changes, or NULL */
24036  )
24037 {
24038  int nlocalbdchgs;
24039 
24040  SCIP_CALL( checkStage(scip, "SCIPaddVarVub", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24041 
24042  SCIP_CALL( SCIPvarAddVub(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob, scip->tree,
24043  scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, vubvar, vubcoef, vubconstant, TRUE,
24044  infeasible, &nlocalbdchgs) );
24045 
24046  *nbdchgs = nlocalbdchgs;
24047 
24048  /* 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
24049  * detected infeasibility
24050  */
24051  if( !(*infeasible) && SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS && !SCIPisZero(scip, 1.0/vubcoef) )
24052  {
24053  if( vubcoef > 0.0 )
24054  {
24055  /* if b < 0, we have a variable lower bound: x >= b*z + d => z >= (x-d)/b */
24056  SCIP_CALL( SCIPvarAddVlb(vubvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
24057  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var, 1.0/vubcoef,
24058  -vubconstant/vubcoef, TRUE, infeasible, &nlocalbdchgs) );
24059  }
24060  else
24061  {
24062  /* if b > 0, we have a variable upper bound: x >= b*z + d => z <= (x-d)/b */
24063  SCIP_CALL( SCIPvarAddVub(vubvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
24064  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var, 1.0/vubcoef,
24065  -vubconstant/vubcoef, TRUE, infeasible, &nlocalbdchgs) );
24066  }
24067  *nbdchgs += nlocalbdchgs;
24068  }
24069 
24070  return SCIP_OKAY;
24071 }
24072 
24073 /** informs binary variable x about a globally valid implication: x == 0 or x == 1 ==> y <= b or y >= b;
24074  * also adds the corresponding implication or variable bound to the implied variable;
24075  * if the implication is conflicting, the variable is fixed to the opposite value;
24076  * if the variable is already fixed to the given value, the implication is performed immediately;
24077  * if the implication is redundant with respect to the variables' global bounds, it is ignored
24078  *
24079  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24080  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24081  *
24082  * @pre This method can be called if @p scip is in one of the following stages:
24083  * - \ref SCIP_STAGE_TRANSFORMED
24084  * - \ref SCIP_STAGE_PRESOLVING
24085  * - \ref SCIP_STAGE_PRESOLVED
24086  * - \ref SCIP_STAGE_SOLVING
24087  */
24089  SCIP* scip, /**< SCIP data structure */
24090  SCIP_VAR* var, /**< problem variable */
24091  SCIP_Bool varfixing, /**< FALSE if y should be added in implications for x == 0, TRUE for x == 1 */
24092  SCIP_VAR* implvar, /**< variable y in implication y <= b or y >= b */
24093  SCIP_BOUNDTYPE impltype, /**< type of implication y <= b (SCIP_BOUNDTYPE_UPPER)
24094  * or y >= b (SCIP_BOUNDTYPE_LOWER) */
24095  SCIP_Real implbound, /**< bound b in implication y <= b or y >= b */
24096  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
24097  int* nbdchgs /**< pointer to store the number of performed bound changes, or NULL */
24098  )
24099 {
24100  SCIP_CALL( checkStage(scip, "SCIPaddVarImplication", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24101 
24102  if ( nbdchgs != NULL )
24103  *nbdchgs = 0;
24104 
24105  if( !SCIPvarIsBinary(var) )
24106  {
24107  SCIPerrorMessage("can't add implication for nonbinary variable\n");
24108  return SCIP_INVALIDDATA;
24109  }
24110 
24111  /* transform implication containing two binary variables to clique */
24112  if( SCIPvarIsBinary(implvar) )
24113  {
24114  SCIP_VAR* vars[2];
24115  SCIP_Bool vals[2];
24116 
24117  assert(SCIPisFeasEQ(scip, implbound, 1.0) || SCIPisFeasZero(scip, implbound));
24118  assert((impltype == SCIP_BOUNDTYPE_UPPER) == SCIPisFeasZero(scip, implbound));
24119 
24120  vars[0] = var;
24121  vars[1] = implvar;
24122  vals[0] = varfixing;
24123  vals[1] = (impltype == SCIP_BOUNDTYPE_UPPER);
24124 
24125  SCIP_CALL( SCIPaddClique(scip, vars, vals, 2, FALSE, infeasible, nbdchgs) );
24126 
24127  return SCIP_OKAY;
24128  }
24129 
24130  /* the implication graph can only handle 'real' binary (SCIP_VARTYPE_BINARY) variables, therefore we transform the
24131  * implication in variable bounds, (lowerbound of y will be abbreviated by lby, upperbound equivlaent) the follwing
24132  * four cases are:
24133  *
24134  * 1. (x >= 1 => y >= b) => y >= (b - lby) * x + lby
24135  * 2. (x >= 1 => y <= b) => y <= (b - uby) * x + uby
24136  * 3. (x <= 0 => y >= b) => y >= (lby - b) * x + b
24137  * 4. (x <= 0 => y <= b) => y <= (uby - b) * x + b
24138  */
24139  if( SCIPvarGetType(var) != SCIP_VARTYPE_BINARY )
24140  {
24141  SCIP_Real lby;
24142  SCIP_Real uby;
24143 
24144  lby = SCIPvarGetLbGlobal(implvar);
24145  uby = SCIPvarGetUbGlobal(implvar);
24146 
24147  if( varfixing == TRUE )
24148  {
24149  if( impltype == SCIP_BOUNDTYPE_LOWER )
24150  {
24151  /* we return if the lower bound is infinity */
24152  if( SCIPisInfinity(scip, -lby) )
24153  return SCIP_OKAY;
24154 
24155  SCIP_CALL( SCIPvarAddVlb(implvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
24156  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var,
24157  implbound - lby, lby, TRUE, infeasible, nbdchgs) );
24158  }
24159  else
24160  {
24161  /* we return if the upper bound is infinity */
24162  if( SCIPisInfinity(scip, uby) )
24163  return SCIP_OKAY;
24164 
24165  SCIP_CALL( SCIPvarAddVub(implvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
24166  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var,
24167  implbound - uby, uby, TRUE, infeasible, nbdchgs) );
24168  }
24169  }
24170  else
24171  {
24172  if( impltype == SCIP_BOUNDTYPE_LOWER )
24173  {
24174  /* we return if the lower bound is infinity */
24175  if( SCIPisInfinity(scip, -lby) )
24176  return SCIP_OKAY;
24177 
24178  SCIP_CALL( SCIPvarAddVlb(implvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
24179  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var,
24180  lby - implbound, implbound, TRUE, infeasible, nbdchgs) );
24181  }
24182  else
24183  {
24184  /* we return if the upper bound is infinity */
24185  if( SCIPisInfinity(scip, uby) )
24186  return SCIP_OKAY;
24187 
24188  SCIP_CALL( SCIPvarAddVub(implvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
24189  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var,
24190  uby - implbound, implbound, TRUE, infeasible, nbdchgs) );
24191  }
24192  }
24193  }
24194  else
24195  {
24196  SCIP_CALL( SCIPvarAddImplic(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
24197  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, varfixing, implvar, impltype,
24198  implbound, TRUE, infeasible, nbdchgs) );
24199  }
24200 
24201  return SCIP_OKAY;
24202 }
24203 
24204 /** adds a clique information to SCIP, stating that at most one of the given binary variables can be set to 1;
24205  * if a variable appears twice in the same clique, the corresponding implications are performed
24206  *
24207  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24208  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24209  *
24210  * @pre This method can be called if @p scip is in one of the following stages:
24211  * - \ref SCIP_STAGE_TRANSFORMED
24212  * - \ref SCIP_STAGE_PRESOLVING
24213  * - \ref SCIP_STAGE_PRESOLVED
24214  * - \ref SCIP_STAGE_SOLVING
24215  */
24217  SCIP* scip, /**< SCIP data structure */
24218  SCIP_VAR** vars, /**< binary variables in the clique from which at most one can be set to 1 */
24219  SCIP_Bool* values, /**< values of the variables in the clique; NULL to use TRUE for all vars */
24220  int nvars, /**< number of variables in the clique */
24221  SCIP_Bool isequation, /**< is the clique an equation or an inequality? */
24222  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
24223  int* nbdchgs /**< pointer to store the number of performed bound changes, or NULL */
24224  )
24225 {
24226  SCIP_CALL( checkStage(scip, "SCIPaddClique", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24227 
24228  *infeasible = FALSE;
24229  if( nbdchgs != NULL )
24230  *nbdchgs = 0;
24231 
24232  if( nvars > 1 )
24233  {
24234  /* add the clique to the clique table */
24235  SCIP_CALL( SCIPcliquetableAdd(scip->cliquetable, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
24236  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, vars, values, nvars, isequation,
24237  infeasible, nbdchgs) );
24238  }
24239 
24240  return SCIP_OKAY;
24241 }
24242 
24243 /** relabels the given labels in-place in an increasing fashion: the first seen label is 0, the next label 1, etc...
24244  *
24245  * @note every label equal to -1 is treated as a previously unseen, unique label and gets a new ordered label.
24246  */
24247 static
24249  SCIP*const scip, /**< SCIP data structure */
24250  int* labels, /**< current labels that will be overwritten */
24251  int const nlabels, /**< number of variables in the clique */
24252  int* nclasses /**< pointer to store the total number of distinct labels */
24253  )
24254 {
24255  SCIP_HASHMAP* classidx2newlabel;
24256 
24257  int classidx;
24258  int i;
24259 
24260  SCIP_CALL( SCIPhashmapCreate(&classidx2newlabel, SCIPblkmem(scip), nlabels) );
24261 
24262  classidx = 0;
24263 
24264  /* loop over labels to create local class indices that obey the variable order */
24265  for( i = 0; i < nlabels; ++i )
24266  {
24267  int currentlabel = labels[i];
24268  int localclassidx;
24269 
24270  /* labels equal to -1 are stored as singleton classes */
24271  if( currentlabel == -1 )
24272  {
24273  ++classidx;
24274  localclassidx = classidx;
24275  }
24276  else
24277  {
24278  assert(currentlabel >= 0);
24279  /* look up the class index image in the hash map; if it is not stored yet, new class index is created and stored */
24280  if( !SCIPhashmapExists(classidx2newlabel, (void*)(size_t)currentlabel) )
24281  {
24282  ++classidx;
24283  localclassidx = classidx;
24284  SCIP_CALL( SCIPhashmapInsert(classidx2newlabel, (void*)(size_t)currentlabel, (void *)(size_t)classidx) );
24285  }
24286  else
24287  {
24288  localclassidx = (int)(size_t)SCIPhashmapGetImage(classidx2newlabel, (void*)(size_t)currentlabel);
24289  }
24290  }
24291  assert(localclassidx - 1 >= 0);
24292  assert(localclassidx - 1 <= i);
24293 
24294  /* indices start with zero, but we have an offset of 1 because we cannot store 0 in a hashmap */
24295  labels[i] = localclassidx - 1;
24296  }
24297 
24298  assert(classidx > 0);
24299  assert(classidx <= nlabels);
24300  *nclasses = classidx;
24301 
24302  SCIPhashmapFree(&classidx2newlabel);
24303 
24304  return SCIP_OKAY;
24305 }
24306 
24307 /** sort the variables w.r.t. the given labels; thereby ensure the current order of the variables with the same label. */
24308 static
24310  SCIP* scip, /**< SCIP data structure */
24311  SCIP_VAR** vars, /**< variable array */
24312  int* classlabels, /**< array that contains a class label for every variable */
24313  SCIP_VAR** sortedvars, /**< array to store variables after stable sorting */
24314  int* sortedindices, /**< array to store indices of sorted variables in the original vars array */
24315  int* classesstartposs, /**< starting position array for each label class (must have size nclasses + 1) */
24316  int nvars, /**< size of the vars arrays */
24317  int nclasses /**< number of label classes */
24318  )
24319 {
24320  SCIP_VAR*** varpointers;
24321  int** indexpointers;
24322  int* classcount;
24323 
24324  int nextpos;
24325  int c;
24326  int v;
24327 
24328  assert(scip != NULL);
24329  assert(vars != NULL);
24330  assert(sortedindices != NULL);
24331  assert(classesstartposs != NULL);
24332 
24333  assert(nvars == 0 || vars != NULL);
24334 
24335  if( nvars == 0 )
24336  return SCIP_OKAY;
24337 
24338  assert(classlabels != NULL);
24339  assert(nclasses > 0);
24340 
24341  /* we first count all class cardinalities and allocate temporary memory for a bucket sort */
24342  SCIP_CALL( SCIPallocBufferArray(scip, &classcount, nclasses) );
24343  BMSclearMemoryArray(classcount, nclasses);
24344 
24345  /* first we count for each class the number of elements */
24346  for( v = nvars - 1; v >= 0; --v )
24347  {
24348  assert(0 <= classlabels[v] && classlabels[v] < nclasses);
24349  ++(classcount[classlabels[v]]);
24350  }
24351 
24352 #ifndef NDEBUG
24353  BMSclearMemoryArray(sortedvars, nvars);
24354  BMSclearMemoryArray(sortedindices, nvars);
24355 #endif
24356  SCIP_CALL( SCIPallocBufferArray(scip, &varpointers, nclasses) );
24357  SCIP_CALL( SCIPallocBufferArray(scip, &indexpointers, nclasses) );
24358 
24359  nextpos = 0;
24360  /* now we initialize all start pointers for each class, so they will be ordered */
24361  for( c = 0; c < nclasses; ++c )
24362  {
24363  /* to reach the goal that all variables of each class will be standing next to each other we will initialize the
24364  * starting pointers for each class by adding the cardinality of each class to the last class starting pointer
24365  * e.g. class1 has 4 elements and class2 has 3 elements then the starting pointer for class1 will be the pointer
24366  * to sortedvars[0], the starting pointer to class2 will be the pointer to sortedvars[4] and to class3 it will be
24367  * the pointer to sortedvars[7]
24368  */
24369  varpointers[c] = (SCIP_VAR**) (sortedvars + nextpos);
24370  indexpointers[c] = (int*) (sortedindices + nextpos);
24371  classesstartposs[c] = nextpos;
24372  assert(classcount[c] > 0);
24373  nextpos += classcount[c];
24374  assert(nextpos > 0);
24375  }
24376  assert(nextpos == nvars);
24377  classesstartposs[c] = nextpos;
24378 
24379  /* now we copy all variables to the right order */
24380  for( v = 0; v < nvars; ++v )
24381  {
24382  /* copy variable itself to the right position */
24383  *(varpointers[classlabels[v]]) = vars[v]; /*lint !e613*/
24384  ++(varpointers[classlabels[v]]);
24385 
24386  /* copy index */
24387  *(indexpointers[classlabels[v]]) = v;
24388  ++(indexpointers[classlabels[v]]);
24389  }
24390 
24391 /* in debug mode, we ensure the correctness of the mapping */
24392 #ifndef NDEBUG
24393  for( v = 0; v < nvars; ++v )
24394  {
24395  assert(sortedvars[v] != NULL);
24396  assert(sortedindices[v] >= 0);
24397 
24398  /* assert that the sorted indices map back to the correct variable in the original order */
24399  assert(vars[sortedindices[v]] == sortedvars[v]);
24400  }
24401 #endif
24402 
24403  /* free temporary memory */
24404  SCIPfreeBufferArray(scip, &indexpointers);
24405  SCIPfreeBufferArray(scip, &varpointers);
24406  SCIPfreeBufferArray(scip, &classcount);
24407 
24408  return SCIP_OKAY;
24409 }
24410 
24411 
24412 /* calculate clique partition for a maximal amount of comparisons on variables due to expensive algorithm
24413  * @todo: check for a good value, maybe it's better to check parts of variables
24414  */
24415 #define MAXNCLIQUEVARSCOMP 1000000
24416 
24417 /** calculates a partition of the given set of binary variables into cliques;
24418  * afterwards the output array contains one value for each variable, such that two variables got the same value iff they
24419  * were assigned to the same clique;
24420  * the first variable is always assigned to clique 0, and a variable can only be assigned to clique i if at least one of
24421  * the preceding variables was assigned to clique i-1;
24422  * for each clique at most 1 variables can be set to TRUE in a feasible solution;
24423  *
24424  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24425  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24426  *
24427  * @pre This method can be called if @p scip is in one of the following stages:
24428  * - \ref SCIP_STAGE_INITPRESOLVE
24429  * - \ref SCIP_STAGE_PRESOLVING
24430  * - \ref SCIP_STAGE_EXITPRESOLVE
24431  * - \ref SCIP_STAGE_PRESOLVED
24432  * - \ref SCIP_STAGE_SOLVING
24433  */
24434 static
24436  SCIP*const scip, /**< SCIP data structure */
24437  SCIP_VAR**const vars, /**< binary variables in the clique from which at most one can be set to 1 */
24438  SCIP_Bool*const values, /**< clique value (TRUE or FALSE) for each variable in the clique */
24439  int const nvars, /**< number of variables in the array */
24440  int*const cliquepartition, /**< array of length nvars to store the clique partition */
24441  int*const ncliques /**< pointer to store the number of cliques actually contained in the partition */
24442  )
24443 {
24444  SCIP_VAR** cliquevars;
24445  SCIP_Bool* cliquevalues;
24446  int i;
24447  int maxncliquevarscomp;
24448  int ncliquevars;
24449 
24450 
24451 
24452  /* allocate temporary memory for storing the variables of the current clique */
24453  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &cliquevars, nvars) );
24454  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &cliquevalues, nvars) );
24455 
24456  /* initialize the cliquepartition array with -1 */
24457  for( i = nvars - 1; i >= 0; --i )
24458  cliquepartition[i] = -1;
24459 
24460  maxncliquevarscomp = (int) MIN(nvars * (SCIP_Longint)nvars, MAXNCLIQUEVARSCOMP);
24461  /* calculate the clique partition */
24462  *ncliques = 0;
24463  for( i = 0; i < nvars; ++i )
24464  {
24465  if( cliquepartition[i] == -1 )
24466  {
24467  int j;
24468 
24469  /* variable starts a new clique */
24470  cliquepartition[i] = *ncliques;
24471  cliquevars[0] = vars[i];
24472  cliquevalues[0] = values[i];
24473  ncliquevars = 1;
24474 
24475  /* if variable is not active (multi-aggregated or fixed), it cannot be in any clique */
24476  if( SCIPvarIsActive(vars[i]) && SCIPvarGetNCliques(vars[i], values[i]) > 0 )
24477  {
24478  /* greedily fill up the clique */
24479  for( j = i+1; j < nvars; ++j )
24480  {
24481  /* if variable is not active (multi-aggregated or fixed), it cannot be in any clique */
24482  if( cliquepartition[j] == -1 && SCIPvarIsActive(vars[j]) )
24483  {
24484  int k;
24485 
24486  /* check if every variable in the current clique can be extended by tmpvars[j] */
24487  for( k = ncliquevars - 1; k >= 0; --k )
24488  {
24489  if( !SCIPvarsHaveCommonClique(vars[j], values[j], cliquevars[k], cliquevalues[k], FALSE) )
24490  break;
24491  }
24492 
24493  if( k == -1 )
24494  {
24495  /* put the variable into the same clique */
24496  cliquepartition[j] = cliquepartition[i];
24497  cliquevars[ncliquevars] = vars[j];
24498  cliquevalues[ncliquevars] = values[j];
24499  ++ncliquevars;
24500  }
24501  }
24502  }
24503  }
24504 
24505  /* this clique is finished */
24506  ++(*ncliques);
24507  }
24508  assert(cliquepartition[i] >= 0 && cliquepartition[i] < i+1);
24509 
24510  /* break if we reached the maximal number of comparisons */
24511  if( i * nvars > maxncliquevarscomp )
24512  break;
24513  }
24514  /* if we had to many variables fill up the cliquepartition and put each variable in a separate clique */
24515  for( ; i < nvars; ++i )
24516  {
24517  if( cliquepartition[i] == -1 )
24518  {
24519  cliquepartition[i] = *ncliques;
24520  ++(*ncliques);
24521  }
24522  }
24523 
24524  SCIPsetFreeBufferArray(scip->set, &cliquevalues);
24525  SCIPsetFreeBufferArray(scip->set, &cliquevars);
24526 
24527  return SCIP_OKAY;
24528 }
24529 
24530 /** calculates a partition of the given set of binary variables into cliques; takes into account independent clique components
24531  *
24532  * The algorithm performs the following steps:
24533  * - recomputes connected components of the clique table, if necessary
24534  * - computes a clique partition for every connected component greedily.
24535  * - relabels the resulting clique partition such that it satisfies the description below
24536  *
24537  * afterwards the output array contains one value for each variable, such that two variables got the same value iff they
24538  * were assigned to the same clique;
24539  * the first variable is always assigned to clique 0, and a variable can only be assigned to clique i if at least one of
24540  * the preceding variables was assigned to clique i-1;
24541  * for each clique at most 1 variables can be set to TRUE in a feasible solution;
24542  *
24543  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24544  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24545  *
24546  * @pre This method can be called if @p scip is in one of the following stages:
24547  * - \ref SCIP_STAGE_INITPRESOLVE
24548  * - \ref SCIP_STAGE_PRESOLVING
24549  * - \ref SCIP_STAGE_EXITPRESOLVE
24550  * - \ref SCIP_STAGE_PRESOLVED
24551  * - \ref SCIP_STAGE_SOLVING
24552  */
24554  SCIP*const scip, /**< SCIP data structure */
24555  SCIP_VAR**const vars, /**< binary variables in the clique from which at most one can be set to 1 */
24556  int const nvars, /**< number of variables in the clique */
24557  int*const cliquepartition, /**< array of length nvars to store the clique partition */
24558  int*const ncliques /**< pointer to store the number of cliques actually contained in the partition */
24559  )
24560 {
24561  SCIP_VAR** tmpvars;
24562 
24563  SCIP_VAR** sortedtmpvars;
24564  SCIP_Bool* tmpvalues;
24565  SCIP_Bool* sortedtmpvalues;
24566  int* componentlabels;
24567  int* sortedindices;
24568  int* componentstartposs;
24569  int i;
24570  int c;
24571 
24572  int ncomponents;
24573 
24574  assert(scip != NULL);
24575  assert(nvars == 0 || vars != NULL);
24576  assert(nvars == 0 || cliquepartition != NULL);
24577  assert(ncliques != NULL);
24578 
24579  SCIP_CALL( checkStage(scip, "SCIPcalcCliquePartition", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24580 
24581  if( nvars == 0 )
24582  {
24583  *ncliques = 0;
24584  return SCIP_OKAY;
24585  }
24586 
24587  /* early abort if no cliques are present */
24588  if( SCIPgetNCliques(scip) == 0 )
24589  {
24590  for( i = 0; i < nvars; ++i )
24591  cliquepartition[i] = i;
24592 
24593  *ncliques = nvars;
24594 
24595  return SCIP_OKAY;
24596  }
24597 
24598 
24599  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &tmpvalues, nvars) );
24600  SCIP_CALL( SCIPsetDuplicateBufferArray(scip->set, &tmpvars, vars, nvars) );
24601  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &componentlabels, nvars) );
24602  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &sortedindices, nvars) );
24603 
24604  /* initialize the tmpvalues array */
24605  for( i = nvars - 1; i >= 0; --i )
24606  {
24607  tmpvalues[i] = TRUE;
24608  cliquepartition[i] = -1;
24609  }
24610 
24611  /* get corresponding active problem variables */
24612  SCIP_CALL( SCIPvarsGetProbvarBinary(&tmpvars, &tmpvalues, nvars) );
24613 
24614  ncomponents = -1;
24615 
24616  /* update clique components if necessary */
24618  {
24619  SCIP_VAR** allvars;
24620  int nallbinvars;
24621  int nallintvars;
24622  int nallimplvars;
24623 
24624  SCIP_CALL( SCIPgetVarsData(scip, &allvars, NULL, &nallbinvars, &nallintvars, &nallimplvars, NULL) );
24625 
24626  SCIP_CALL( SCIPcliquetableComputeCliqueComponents(scip->cliquetable, scip->set, SCIPblkmem(scip), allvars, nallbinvars, nallintvars, nallimplvars) );
24627  }
24628 
24630 
24631  /* store the global clique component labels */
24632  for( i = 0; i < nvars; ++i )
24633  {
24634  if( SCIPvarIsActive(tmpvars[i]) )
24635  componentlabels[i] = SCIPcliquetableGetVarComponentIdx(scip->cliquetable, tmpvars[i]);
24636  else
24637  componentlabels[i] = -1;
24638  }
24639 
24640  /* relabel component labels order consistent as prerequisite for a stable sort */
24641  SCIP_CALL( relabelOrderConsistent(scip, componentlabels, nvars, &ncomponents) );
24642  assert(ncomponents >= 1);
24643  assert(ncomponents <= nvars);
24644 
24645  /* allocate storage array for the starting positions of the components */
24646  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &componentstartposs, ncomponents + 1) );
24647 
24648  /* stable sort the variables w.r.t. the component labels so that we can restrict the quadratic algorithm to the components */
24649  if( ncomponents > 1 )
24650  {
24651  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &sortedtmpvars, nvars) );
24652  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &sortedtmpvalues, nvars) );
24653  SCIP_CALL( labelSortStable(scip, tmpvars, componentlabels, sortedtmpvars, sortedindices, componentstartposs, nvars, ncomponents) );
24654 
24655  /* reassign the tmpvalues with respect to the sorting */
24656  for( i = 0; i < nvars; ++i )
24657  {
24658  assert(tmpvars[sortedindices[i]] == sortedtmpvars[i]);
24659  sortedtmpvalues[i] = tmpvalues[sortedindices[i]];
24660  }
24661  }
24662  else
24663  {
24664  /* if we have only one large connected component, skip the stable sorting and prepare the data differently */
24665  sortedtmpvars = tmpvars;
24666  sortedtmpvalues = tmpvalues;
24667  componentstartposs[0] = 0;
24668  componentstartposs[1] = nvars;
24669 
24670  /* sorted indices are the identity */
24671  for( i = 0; i < nvars; ++i )
24672  sortedindices[i] = i;
24673  }
24674 
24675  *ncliques = 0;
24676  /* calculate a greedy clique partition for each connected component */
24677  for( c = 0; c < ncomponents; ++c )
24678  {
24679  int* localcliquepartition;
24680  int nlocalcliques;
24681  int ncomponentvars;
24682  int l;
24683 
24684  /* extract the number of variables in this connected component */
24685  ncomponentvars = componentstartposs[c + 1] - componentstartposs[c];
24686  nlocalcliques = 0;
24687 
24688  /* allocate necessary memory to hold the intermediate component clique partition */
24689  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &localcliquepartition, ncomponentvars) );
24690 
24691  /* call greedy clique algorithm for all component variables */
24692  SCIP_CALL( calcCliquePartitionGreedy(scip, &(sortedtmpvars[componentstartposs[c]]), &(sortedtmpvalues[componentstartposs[c]]),
24693  ncomponentvars, localcliquepartition, &nlocalcliques) );
24694 
24695  assert(nlocalcliques >= 1);
24696  assert(nlocalcliques <= ncomponentvars);
24697 
24698  /* store the obtained clique partition with an offset of ncliques for the original variables */
24699  for( l = componentstartposs[c]; l < componentstartposs[c + 1]; ++l )
24700  {
24701  int origvaridx = sortedindices[l];
24702  assert(cliquepartition[origvaridx] == -1);
24703  assert(localcliquepartition[l - componentstartposs[c]] <= l - componentstartposs[c]);
24704  cliquepartition[origvaridx] = localcliquepartition[l - componentstartposs[c]] + (*ncliques);
24705  }
24706  *ncliques += nlocalcliques;
24707 
24708  /* free the local clique partition */
24709  SCIPsetFreeBufferArray(scip->set, &localcliquepartition);
24710  }
24711 
24712  /* except in the two trivial cases, we have to ensure the order consistency of the partition indices */
24713  if( ncomponents > 1 && ncomponents < nvars )
24714  {
24715  int partitionsize;
24716  SCIP_CALL( relabelOrderConsistent(scip, cliquepartition, nvars, &partitionsize) );
24717 
24718  assert(partitionsize == *ncliques);
24719  }
24720 
24721  if( ncomponents > 1 )
24722  {
24723  SCIPsetFreeBufferArray(scip->set, &sortedtmpvalues);
24724  SCIPsetFreeBufferArray(scip->set, &sortedtmpvars);
24725  }
24726 
24727  /* use the greedy algorithm as a whole to verify the result on small number of variables */
24728 #ifdef SCIP_DISABLED_CODE
24729  {
24730  int* debugcliquepartition;
24731  int ndebugcliques;
24732 
24733  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &debugcliquepartition, nvars) );
24734 
24735  /* call greedy clique algorithm for all component variables */
24736  SCIP_CALL( calcCliquePartitionGreedy(scip, tmpvars, tmpvalues, nvars, debugcliquepartition, &ndebugcliques) );
24737 
24738  /* loop and compare the traditional greedy clique with */
24739  for( i = 0; i < nvars; ++i )
24740  assert(i * nvars > MAXNCLIQUEVARSCOMP || cliquepartition[i] == debugcliquepartition[i]);
24741 
24742  SCIPsetFreeBufferArray(scip->set, &debugcliquepartition);
24743  }
24744 #endif
24745 
24746  /* free temporary memory */
24747  SCIPsetFreeBufferArray(scip->set, &componentstartposs);
24748  SCIPsetFreeBufferArray(scip->set, &sortedindices);
24749  SCIPsetFreeBufferArray(scip->set, &componentlabels);
24750  SCIPsetFreeBufferArray(scip->set, &tmpvars);
24751  SCIPsetFreeBufferArray(scip->set, &tmpvalues);
24752 
24753  return SCIP_OKAY;
24754 }
24755 
24756 /** calculates a partition of the given set of binary variables into negated cliques;
24757  * afterwards the output array contains one value for each variable, such that two variables got the same value iff they
24758  * were assigned to the same negated clique;
24759  * the first variable is always assigned to clique 0 and a variable can only be assigned to clique i if at least one of
24760  * the preceding variables was assigned to clique i-1;
24761  * for each clique with n_c variables at least n_c-1 variables can be set to TRUE in a feasible solution;
24762  *
24763  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24764  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24765  *
24766  * @pre This method can be called if @p scip is in one of the following stages:
24767  * - \ref SCIP_STAGE_INITPRESOLVE
24768  * - \ref SCIP_STAGE_PRESOLVING
24769  * - \ref SCIP_STAGE_EXITPRESOLVE
24770  * - \ref SCIP_STAGE_PRESOLVED
24771  * - \ref SCIP_STAGE_SOLVING
24772  */
24774  SCIP*const scip, /**< SCIP data structure */
24775  SCIP_VAR**const vars, /**< binary variables in the clique from which at most one can be set to 1 */
24776  int const nvars, /**< number of variables in the clique */
24777  int*const cliquepartition, /**< array of length nvars to store the clique partition */
24778  int*const ncliques /**< pointer to store the number of cliques actually contained in the partition */
24779  )
24780 {
24781  SCIP_VAR** negvars;
24782  int v;
24783 
24784  assert(scip != NULL);
24785  assert(cliquepartition != NULL || nvars == 0);
24786  assert(ncliques != NULL);
24787 
24788  if( nvars == 0 )
24789  {
24790  *ncliques = 0;
24791  return SCIP_OKAY;
24792  }
24793  assert(vars != NULL);
24794 
24795  /* allocate temporary memory */
24796  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &negvars, nvars) );
24797 
24798  /* get all negated variables */
24799  for( v = nvars - 1; v >= 0; --v )
24800  {
24801  SCIP_CALL( SCIPgetNegatedVar(scip, vars[v], &(negvars[v])) );
24802  }
24803 
24804  /* calculate cliques on negated variables, which are "negated" cliques on normal variables array */
24805  SCIP_CALL( SCIPcalcCliquePartition( scip, negvars, nvars, cliquepartition, ncliques) );
24806 
24807  /* free temporary memory */
24808  SCIPsetFreeBufferArray(scip->set, &negvars);
24809 
24810  return SCIP_OKAY;
24811 }
24812 
24813 
24814 /** force SCIP to clean up all cliques; cliques do not get automatically cleaned up after presolving. Use
24815  * this method to prevent inactive variables in cliques when retrieved via SCIPgetCliques()
24816  *
24817  * @return SCIP_OKAY if everything worked, otherwise a suitable error code is passed
24818  *
24819  * @pre This method can be called if @p scip is in one of the following stages:
24820  * - \ref SCIP_STAGE_TRANSFORMED
24821  * - \ref SCIP_STAGE_INITPRESOLVE
24822  * - \ref SCIP_STAGE_PRESOLVING
24823  * - \ref SCIP_STAGE_EXITPRESOLVE
24824  * - \ref SCIP_STAGE_PRESOLVED
24825  * - \ref SCIP_STAGE_INITSOLVE
24826  * - \ref SCIP_STAGE_SOLVING
24827  * - \ref SCIP_STAGE_SOLVED
24828  * - \ref SCIP_STAGE_EXITSOLVE
24829  */
24831  SCIP* scip, /**< SCIP data structure */
24832  SCIP_Bool* infeasible /**< pointer to store if cleanup detected infeasibility */
24833  )
24834 {
24835  int nlocalbdchgs;
24836  SCIP_Bool globalinfeasibility;
24837 
24838  SCIP_CALL_ABORT( checkStage(scip, "SCIPcleanupCliques", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
24839 
24840  globalinfeasibility = FALSE;
24841  nlocalbdchgs = 0;
24842  SCIP_CALL( SCIPcliquetableCleanup(scip->cliquetable, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
24843  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, &nlocalbdchgs,
24844  &globalinfeasibility) );
24845 
24846  if( infeasible != NULL )
24847  *infeasible = globalinfeasibility;
24848 
24849  if( globalinfeasibility )
24851 
24852  return SCIP_OKAY;
24853 }
24854 
24855 /** gets the number of cliques in the clique table
24856  *
24857  * @return number of cliques in the clique table
24858  *
24859  * @note cliques do not get automatically cleaned up after presolving. Use SCIPcleanupCliques()
24860  * to prevent inactive variables in cliques when retrieved via SCIPgetCliques(). This might reduce the number of cliques
24861  *
24862  * @pre This method can be called if @p scip is in one of the following stages:
24863  * - \ref SCIP_STAGE_TRANSFORMED
24864  * - \ref SCIP_STAGE_INITPRESOLVE
24865  * - \ref SCIP_STAGE_PRESOLVING
24866  * - \ref SCIP_STAGE_EXITPRESOLVE
24867  * - \ref SCIP_STAGE_PRESOLVED
24868  * - \ref SCIP_STAGE_INITSOLVE
24869  * - \ref SCIP_STAGE_SOLVING
24870  * - \ref SCIP_STAGE_SOLVED
24871  * - \ref SCIP_STAGE_EXITSOLVE
24872  */
24874  SCIP* scip /**< SCIP data structure */
24875  )
24876 {
24877  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCliques", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
24878 
24880 }
24881 
24882 /** gets the number of cliques created so far by the cliquetable
24883  *
24884  * @return number of cliques created so far by the cliquetable
24885  *
24886  * @note cliques do not get automatically cleaned up after presolving. Use SCIPcleanupCliques()
24887  * to prevent inactive variables in cliques when retrieved via SCIPgetCliques(). This might reduce the number of cliques
24888  *
24889  * @pre This method can be called if @p scip is in one of the following stages:
24890  * - \ref SCIP_STAGE_TRANSFORMED
24891  * - \ref SCIP_STAGE_INITPRESOLVE
24892  * - \ref SCIP_STAGE_PRESOLVING
24893  * - \ref SCIP_STAGE_EXITPRESOLVE
24894  * - \ref SCIP_STAGE_PRESOLVED
24895  * - \ref SCIP_STAGE_INITSOLVE
24896  * - \ref SCIP_STAGE_SOLVING
24897  * - \ref SCIP_STAGE_SOLVED
24898  * - \ref SCIP_STAGE_EXITSOLVE
24899  */
24901  SCIP* scip /**< SCIP data structure */
24902  )
24903 {
24904  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCliquesCreated", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
24905 
24907 }
24908 
24909 /** gets the array of cliques in the clique table
24910  *
24911  * @return array of cliques in the clique table
24912  *
24913  * @note cliques do not get automatically cleaned up after presolving. Use SCIPcleanupCliques()
24914  * to prevent inactive variables in cliques when retrieved via SCIPgetCliques(). This might reduce the number of cliques
24915  *
24916  * @pre This method can be called if @p scip is in one of the following stages:
24917  * - \ref SCIP_STAGE_TRANSFORMED
24918  * - \ref SCIP_STAGE_INITPRESOLVE
24919  * - \ref SCIP_STAGE_PRESOLVING
24920  * - \ref SCIP_STAGE_EXITPRESOLVE
24921  * - \ref SCIP_STAGE_PRESOLVED
24922  * - \ref SCIP_STAGE_INITSOLVE
24923  * - \ref SCIP_STAGE_SOLVING
24924  * - \ref SCIP_STAGE_SOLVED
24925  * - \ref SCIP_STAGE_EXITSOLVE
24926  */
24928  SCIP* scip /**< SCIP data structure */
24929  )
24930 {
24931  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCliques", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
24932 
24933  return SCIPcliquetableGetCliques(scip->cliquetable);
24934 }
24935 
24936 /** returns whether there is a clique that contains both given variable/value pairs;
24937  * the variables must be active binary variables;
24938  * if regardimplics is FALSE, only the cliques in the clique table are looked at;
24939  * if regardimplics is TRUE, both the cliques and the implications of the implication graph are regarded
24940  *
24941  * @return TRUE, if there is a clique that contains both variable/clique pairs; FALSE, otherwise
24942  *
24943  * @pre This method can be called if @p scip is in one of the following stages:
24944  * - \ref SCIP_STAGE_TRANSFORMED
24945  * - \ref SCIP_STAGE_INITPRESOLVE
24946  * - \ref SCIP_STAGE_PRESOLVING
24947  * - \ref SCIP_STAGE_EXITPRESOLVE
24948  * - \ref SCIP_STAGE_PRESOLVED
24949  * - \ref SCIP_STAGE_INITSOLVE
24950  * - \ref SCIP_STAGE_SOLVING
24951  * - \ref SCIP_STAGE_SOLVED
24952  * - \ref SCIP_STAGE_EXITSOLVE
24953  *
24954  * @note a variable with it's negated variable are NOT! in a clique
24955  * @note a variable with itself are in a clique
24956  */
24958  SCIP* scip, /**< SCIP data structure */
24959  SCIP_VAR* var1, /**< first variable */
24960  SCIP_Bool value1, /**< value of first variable */
24961  SCIP_VAR* var2, /**< second variable */
24962  SCIP_Bool value2, /**< value of second variable */
24963  SCIP_Bool regardimplics /**< should the implication graph also be searched for a clique? */
24964  )
24965 {
24966  assert(scip != NULL);
24967  assert(var1 != NULL);
24968  assert(var2 != NULL);
24969  assert(SCIPvarIsActive(var1));
24970  assert(SCIPvarIsActive(var2));
24971  assert(SCIPvarIsBinary(var1));
24972  assert(SCIPvarIsBinary(var2));
24973 
24974  SCIP_CALL_ABORT( checkStage(scip, "SCIPhaveVarsCommonClique", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
24975 
24976  /* if both variables together have more cliques then actual cliques exist, then they have a common clique (in debug
24977  * mode we check this for correctness), otherwise we need to call the pairwise comparison method for these variables
24978  */
24979 #ifndef NDEBUG
24980  assert((SCIPvarGetNCliques(var1, value1) + SCIPvarGetNCliques(var2, value2) > SCIPcliquetableGetNCliques(scip->cliquetable)) ? SCIPvarsHaveCommonClique(var1, value1, var2, value2, FALSE) : TRUE);
24981 #endif
24982 
24983  return (SCIPvarGetNCliques(var1, value1) + SCIPvarGetNCliques(var2, value2) > SCIPcliquetableGetNCliques(scip->cliquetable)
24984  || SCIPvarsHaveCommonClique(var1, value1, var2, value2, regardimplics));
24985 }
24986 
24987 
24988 /** writes the clique graph to a gml file
24989  *
24990  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24991  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24992  *
24993  * @pre This method can be called if @p scip is in one of the following stages:
24994  * - \ref SCIP_STAGE_TRANSFORMED
24995  * - \ref SCIP_STAGE_INITPRESOLVE
24996  * - \ref SCIP_STAGE_PRESOLVING
24997  * - \ref SCIP_STAGE_EXITPRESOLVE
24998  * - \ref SCIP_STAGE_PRESOLVED
24999  * - \ref SCIP_STAGE_INITSOLVE
25000  * - \ref SCIP_STAGE_SOLVING
25001  * - \ref SCIP_STAGE_SOLVED
25002  * - \ref SCIP_STAGE_EXITSOLVE
25003  *
25004  * @note there can be duplicated arcs in the output file
25005  *
25006  * If @p writenodeweights is true, only nodes corresponding to variables that have a fractional value and only edges
25007  * between such nodes are written.
25008  */
25010  SCIP* scip, /**< SCIP data structure */
25011  const char* fname, /**< name of file */
25012  SCIP_Bool writenodeweights /**< should we write weights of nodes? */
25013  )
25014 {
25015  FILE* gmlfile;
25016  SCIP_HASHMAP* nodehashmap;
25017  SCIP_CLIQUE** cliques;
25018  SCIP_VAR** clqvars;
25019  SCIP_VAR** allvars;
25020  SCIP_Bool* clqvalues;
25021  char nodename[SCIP_MAXSTRLEN];
25022  int nallvars;
25023  int nbinvars;
25024  int nintvars;
25025  int nimplvars;
25026  int ncliques;
25027  int c;
25028  int v1;
25029  int v2;
25030  int id1;
25031  int id2;
25032 
25033  assert(scip != NULL);
25034  assert(fname != NULL);
25035 
25036  SCIP_CALL_ABORT( checkStage(scip, "SCIPwriteCliqueGraph", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
25037 
25038  /* get all active variables */
25039  SCIP_CALL( SCIPgetVarsData(scip, &allvars, &nallvars, &nbinvars, &nintvars, &nimplvars, NULL) );
25040 
25041  /* no possible variables for cliques exist */
25042  if( nbinvars + nimplvars == 0 )
25043  return SCIP_OKAY;
25044 
25045  ncliques = SCIPgetNCliques(scip);
25046 
25047  /* no cliques and do not wont to check for binary implications */
25048  if( ncliques == 0 )
25049  return SCIP_OKAY;
25050 
25051  /* open gml file */
25052  gmlfile = fopen(fname, "w");
25053 
25054  if( gmlfile == NULL )
25055  {
25056  SCIPerrorMessage("cannot open graph file <%s>\n", fname);
25057  SCIPABORT();
25058  return SCIP_INVALIDDATA; /*lint !e527*/
25059  }
25060 
25061  /* create the hash map */
25062  SCIP_CALL_FINALLY( SCIPhashmapCreate(&nodehashmap, SCIPblkmem(scip), nbinvars+nimplvars), fclose(gmlfile) );
25063 
25064  /* write starting of gml file */
25065  SCIPgmlWriteOpening(gmlfile, TRUE);
25066 
25067  cliques = SCIPgetCliques(scip);
25068 
25069  /* write nodes and arcs for all cliques */
25070  for( c = ncliques - 1; c >= 0; --c )
25071  {
25072  clqvalues = SCIPcliqueGetValues(cliques[c]);
25073  clqvars = SCIPcliqueGetVars(cliques[c]);
25074 
25075  for( v1 = SCIPcliqueGetNVars(cliques[c]) - 1; v1 >= 0; --v1 )
25076  {
25077  id1 = clqvalues[v1] ? SCIPvarGetProbindex(clqvars[v1]) : (nallvars + SCIPvarGetProbindex(clqvars[v1]));
25078 
25079  /* if corresponding node was not added yet, add it */
25080  if( !SCIPhashmapExists(nodehashmap, (void*)(size_t)id1) )
25081  {
25082  assert(id1 >= 0);
25083  SCIP_CALL_FINALLY( SCIPhashmapInsert(nodehashmap, (void*)(size_t)id1, (void*)(size_t) 1), fclose(gmlfile) );
25084 
25085  (void) SCIPsnprintf(nodename, SCIP_MAXSTRLEN, "%s%s", (id1 >= nallvars ? "~" : ""), SCIPvarGetName(clqvars[v1]));
25086 
25087  /* write new gml node for new variable */
25088  if ( writenodeweights )
25089  {
25090  if ( ! SCIPisFeasIntegral(scip, SCIPgetSolVal(scip, NULL, clqvars[v1])) )
25091  SCIPgmlWriteNodeWeight(gmlfile, (unsigned int)id1, nodename, NULL, NULL, NULL, SCIPgetSolVal(scip, NULL, clqvars[v1]));
25092  }
25093  else
25094  {
25095  SCIPgmlWriteNode(gmlfile, (unsigned int)id1, nodename, NULL, NULL, NULL);
25096  }
25097  }
25098 
25099  for( v2 = SCIPcliqueGetNVars(cliques[c]) - 1; v2 >= 0; --v2 )
25100  {
25101  if( v1 == v2 )
25102  continue;
25103 
25104  id2 = clqvalues[v2] ? SCIPvarGetProbindex(clqvars[v2]) : (nallvars + SCIPvarGetProbindex(clqvars[v2]));
25105 
25106  /* if corresponding node was not added yet, add it */
25107  if( !SCIPhashmapExists(nodehashmap, (void*)(size_t)id2) )
25108  {
25109  assert(id2 >= 0);
25110  SCIP_CALL_FINALLY( SCIPhashmapInsert(nodehashmap, (void*)(size_t)id2, (void*)(size_t) 1), fclose(gmlfile) );
25111 
25112  (void) SCIPsnprintf(nodename, SCIP_MAXSTRLEN, "%s%s", (id2 >= nallvars ? "~" : ""), SCIPvarGetName(clqvars[v2]));
25113 
25114  /* write new gml node for new variable */
25115  if ( writenodeweights )
25116  {
25117  if ( ! SCIPisFeasIntegral(scip, SCIPgetSolVal(scip, NULL, clqvars[v2])) )
25118  SCIPgmlWriteNodeWeight(gmlfile, (unsigned int)id2, nodename, NULL, NULL, NULL, SCIPgetSolVal(scip, NULL, clqvars[v2]));
25119  }
25120  else
25121  {
25122  SCIPgmlWriteNode(gmlfile, (unsigned int)id2, nodename, NULL, NULL, NULL);
25123  }
25124  }
25125 
25126  /* write gml arc between resultant and operand */
25127  if ( ! writenodeweights || ! SCIPisFeasIntegral(scip, SCIPgetSolVal(scip, NULL, clqvars[v2])) )
25128  SCIPgmlWriteArc(gmlfile, (unsigned int)id1, (unsigned int)id2, NULL, NULL);
25129  }
25130  }
25131  }
25132 
25133  /* free the hash map */
25134  SCIPhashmapFree(&nodehashmap);
25135 
25136  SCIPgmlWriteClosing(gmlfile);
25137  fclose(gmlfile);
25138 
25139  return SCIP_OKAY;
25140 }
25141 
25142 /** Removes (irrelevant) variable from all its global structures, i.e. cliques, implications and variable bounds.
25143  * This is an advanced method which should be used with care.
25144  *
25145  * @return SCIP_OKAY if everything worked, otherwise a suitable error code is passed
25146  *
25147  * @pre This method can be called if @p scip is in one of the following stages:
25148  * - \ref SCIP_STAGE_TRANSFORMED
25149  * - \ref SCIP_STAGE_INITPRESOLVE
25150  * - \ref SCIP_STAGE_PRESOLVING
25151  * - \ref SCIP_STAGE_EXITPRESOLVE
25152  * - \ref SCIP_STAGE_PRESOLVED
25153  * - \ref SCIP_STAGE_INITSOLVE
25154  * - \ref SCIP_STAGE_SOLVING
25155  * - \ref SCIP_STAGE_SOLVED
25156  * - \ref SCIP_STAGE_EXITSOLVE
25157  */
25159  SCIP* scip, /**< SCIP data structure */
25160  SCIP_VAR* var /**< variable to remove from global structures */
25161  )
25162 {
25163  assert(scip != NULL);
25164 
25165  SCIP_CALL_ABORT( checkStage(scip, "SCIPremoveVarFromGlobalStructures", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
25166 
25167  /* mark the variable as deletable from global structures - This is necessary for the delayed clean up of cliques */
25169 
25170  /* remove variable from all its cliques, implications, and variable bounds */
25172 
25173  return SCIP_OKAY;
25174 }
25175 
25176 /** sets the branch factor of the variable; this value can be used in the branching methods to scale the score
25177  * values of the variables; higher factor leads to a higher probability that this variable is chosen for branching
25178  *
25179  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25180  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25181  *
25182  * @pre This method can be called if @p scip is in one of the following stages:
25183  * - \ref SCIP_STAGE_PROBLEM
25184  * - \ref SCIP_STAGE_TRANSFORMING
25185  * - \ref SCIP_STAGE_TRANSFORMED
25186  * - \ref SCIP_STAGE_INITPRESOLVE
25187  * - \ref SCIP_STAGE_PRESOLVING
25188  * - \ref SCIP_STAGE_EXITPRESOLVE
25189  * - \ref SCIP_STAGE_PRESOLVED
25190  * - \ref SCIP_STAGE_SOLVING
25191  */
25193  SCIP* scip, /**< SCIP data structure */
25194  SCIP_VAR* var, /**< problem variable */
25195  SCIP_Real branchfactor /**< factor to weigh variable's branching score with */
25196  )
25197 {
25198  SCIP_CALL( checkStage(scip, "SCIPchgVarBranchFactor", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25199 
25200  SCIP_CALL( SCIPvarChgBranchFactor(var, scip->set, branchfactor) );
25201 
25202  return SCIP_OKAY;
25203 }
25204 
25205 /** scales the branch factor of the variable with the given value
25206  *
25207  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25208  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25209  *
25210  * @pre This method can be called if @p scip is in one of the following stages:
25211  * - \ref SCIP_STAGE_PROBLEM
25212  * - \ref SCIP_STAGE_TRANSFORMING
25213  * - \ref SCIP_STAGE_TRANSFORMED
25214  * - \ref SCIP_STAGE_INITPRESOLVE
25215  * - \ref SCIP_STAGE_PRESOLVING
25216  * - \ref SCIP_STAGE_EXITPRESOLVE
25217  * - \ref SCIP_STAGE_PRESOLVED
25218  * - \ref SCIP_STAGE_SOLVING
25219  */
25221  SCIP* scip, /**< SCIP data structure */
25222  SCIP_VAR* var, /**< problem variable */
25223  SCIP_Real scale /**< factor to scale variable's branching factor with */
25224  )
25225 {
25226  SCIP_CALL( checkStage(scip, "SCIPscaleVarBranchFactor", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25227 
25228  SCIP_CALL( SCIPvarChgBranchFactor(var, scip->set, scale * SCIPvarGetBranchFactor(var)) );
25229 
25230  return SCIP_OKAY;
25231 }
25232 
25233 /** adds the given value to the branch factor of the variable
25234  *
25235  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25236  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25237  *
25238  * @pre This method can be called if @p scip is in one of the following stages:
25239  * - \ref SCIP_STAGE_PROBLEM
25240  * - \ref SCIP_STAGE_TRANSFORMING
25241  * - \ref SCIP_STAGE_TRANSFORMED
25242  * - \ref SCIP_STAGE_INITPRESOLVE
25243  * - \ref SCIP_STAGE_PRESOLVING
25244  * - \ref SCIP_STAGE_EXITPRESOLVE
25245  * - \ref SCIP_STAGE_PRESOLVED
25246  * - \ref SCIP_STAGE_SOLVING
25247  */
25249  SCIP* scip, /**< SCIP data structure */
25250  SCIP_VAR* var, /**< problem variable */
25251  SCIP_Real addfactor /**< value to add to the branch factor of the variable */
25252  )
25253 {
25254  SCIP_CALL( checkStage(scip, "SCIPaddVarBranchFactor", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25255 
25256  SCIP_CALL( SCIPvarChgBranchFactor(var, scip->set, addfactor + SCIPvarGetBranchFactor(var)) );
25257 
25258  return SCIP_OKAY;
25259 }
25260 
25261 /** sets the branch priority of the variable; variables with higher branch priority are always preferred to variables
25262  * with lower priority in selection of branching variable
25263  *
25264  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25265  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25266  *
25267  * @pre This method can be called if @p scip is in one of the following stages:
25268  * - \ref SCIP_STAGE_PROBLEM
25269  * - \ref SCIP_STAGE_TRANSFORMING
25270  * - \ref SCIP_STAGE_TRANSFORMED
25271  * - \ref SCIP_STAGE_INITPRESOLVE
25272  * - \ref SCIP_STAGE_PRESOLVING
25273  * - \ref SCIP_STAGE_EXITPRESOLVE
25274  * - \ref SCIP_STAGE_PRESOLVED
25275  * - \ref SCIP_STAGE_SOLVING
25276  *
25277  * @note the default branching priority is 0
25278  */
25280  SCIP* scip, /**< SCIP data structure */
25281  SCIP_VAR* var, /**< problem variable */
25282  int branchpriority /**< branch priority of the variable */
25283  )
25284 {
25285  SCIP_CALL( checkStage(scip, "SCIPchgVarBranchPriority", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25286 
25287  assert( var->scip == scip );
25288 
25289  if( SCIPisTransformed(scip) )
25290  {
25291  assert(scip->branchcand != NULL);
25292 
25293  /* inform the pseudo branch candidates that the branch priority changes and change the branch priority */
25294  SCIP_CALL( SCIPbranchcandUpdateVarBranchPriority(scip->branchcand, scip->set, var, branchpriority) );
25295  }
25296  else
25297  {
25298  /* change the branching priority of the variable */
25299  SCIP_CALL( SCIPvarChgBranchPriority(var, branchpriority) );
25300  }
25301 
25302  return SCIP_OKAY;
25303 }
25304 
25305 /** changes the branch priority of the variable to the given value, if it is larger than the current priority
25306  *
25307  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25308  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25309  *
25310  * @pre This method can be called if @p scip is in one of the following stages:
25311  * - \ref SCIP_STAGE_PROBLEM
25312  * - \ref SCIP_STAGE_TRANSFORMING
25313  * - \ref SCIP_STAGE_TRANSFORMED
25314  * - \ref SCIP_STAGE_INITPRESOLVE
25315  * - \ref SCIP_STAGE_PRESOLVING
25316  * - \ref SCIP_STAGE_EXITPRESOLVE
25317  * - \ref SCIP_STAGE_PRESOLVED
25318  * - \ref SCIP_STAGE_SOLVING
25319  */
25321  SCIP* scip, /**< SCIP data structure */
25322  SCIP_VAR* var, /**< problem variable */
25323  int branchpriority /**< new branch priority of the variable, if it is larger than current priority */
25324  )
25325 {
25326  SCIP_CALL( checkStage(scip, "SCIPupdateVarBranchPriority", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25327 
25328  assert( var->scip == scip );
25329 
25330  if( branchpriority > SCIPvarGetBranchPriority(var) )
25331  {
25332  SCIP_CALL( SCIPvarChgBranchPriority(var, branchpriority) );
25333  }
25334 
25335  return SCIP_OKAY;
25336 }
25337 
25338 /** adds the given value to the branch priority of the variable
25339  *
25340  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25341  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25342  *
25343  * @pre This method can be called if @p scip is in one of the following stages:
25344  * - \ref SCIP_STAGE_PROBLEM
25345  * - \ref SCIP_STAGE_TRANSFORMING
25346  * - \ref SCIP_STAGE_TRANSFORMED
25347  * - \ref SCIP_STAGE_INITPRESOLVE
25348  * - \ref SCIP_STAGE_PRESOLVING
25349  * - \ref SCIP_STAGE_EXITPRESOLVE
25350  * - \ref SCIP_STAGE_PRESOLVED
25351  * - \ref SCIP_STAGE_SOLVING
25352  */
25354  SCIP* scip, /**< SCIP data structure */
25355  SCIP_VAR* var, /**< problem variable */
25356  int addpriority /**< value to add to the branch priority of the variable */
25357  )
25358 {
25359  SCIP_CALL( checkStage(scip, "SCIPaddVarBranchPriority", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25360 
25361  assert( var->scip == scip );
25362 
25363  SCIP_CALL( SCIPvarChgBranchPriority(var, addpriority + SCIPvarGetBranchPriority(var)) );
25364 
25365  return SCIP_OKAY;
25366 }
25367 
25368 /** sets the branch direction of the variable (-1: prefer downwards branch, 0: automatic selection, +1: prefer upwards
25369  * branch)
25370  *
25371  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25372  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25373  *
25374  * @pre This method can be called if @p scip is in one of the following stages:
25375  * - \ref SCIP_STAGE_PROBLEM
25376  * - \ref SCIP_STAGE_TRANSFORMING
25377  * - \ref SCIP_STAGE_TRANSFORMED
25378  * - \ref SCIP_STAGE_INITPRESOLVE
25379  * - \ref SCIP_STAGE_PRESOLVING
25380  * - \ref SCIP_STAGE_EXITPRESOLVE
25381  * - \ref SCIP_STAGE_PRESOLVED
25382  * - \ref SCIP_STAGE_SOLVING
25383  */
25385  SCIP* scip, /**< SCIP data structure */
25386  SCIP_VAR* var, /**< problem variable */
25387  SCIP_BRANCHDIR branchdirection /**< preferred branch direction of the variable (downwards, upwards, auto) */
25388  )
25389 {
25390  SCIP_CALL( checkStage(scip, "SCIPchgVarBranchDirection", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25391 
25392  assert( var->scip == scip );
25393 
25394  SCIP_CALL( SCIPvarChgBranchDirection(var, branchdirection) );
25395 
25396  return SCIP_OKAY;
25397 }
25398 
25399 /** tightens the variable bounds due a new variable type */
25400 static
25402  SCIP* scip, /**< SCIP data structure */
25403  SCIP_VAR* var, /**< variable to change the bound for */
25404  SCIP_VARTYPE vartype, /**< new type of variable */
25405  SCIP_Bool* infeasible /**< pointer to store whether an infeasibility was detected (, due to
25406  * integrality condition of the new variable type) */
25407  )
25408 {
25409  assert(scip != NULL);
25411  assert(scip->set->stage == SCIP_STAGE_PROBLEM || SCIPvarIsTransformed(var));
25412  assert(var->scip == scip);
25413 
25414  *infeasible = FALSE;
25415 
25416  /* adjusts bounds if the variable type changed form continuous to non-continuous (integral) */
25418  {
25419  SCIP_Bool tightened;
25420 
25421  /* we adjust variable bounds to integers first, since otherwise a later bound tightening with a fractional old
25422  * bound may give an assert because SCIP expects non-continuous variables to have non-fractional bounds
25423  *
25424  * we adjust bounds with a fractionality within [eps,feastol] only if the resulting bound change is a bound
25425  * tightening, because relaxing bounds may not be allowed
25426  */
25427  if( !SCIPisFeasIntegral(scip, SCIPvarGetLbGlobal(var)) ||
25429  )
25430  {
25431  SCIP_CALL( SCIPtightenVarLbGlobal(scip, var, SCIPfeasCeil(scip, SCIPvarGetLbGlobal(var)), TRUE, infeasible, &tightened) );
25432  if( *infeasible )
25433  return SCIP_OKAY;
25434 
25435  /* 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
25436  * 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
25437  */
25438  assert(tightened || SCIPisFeasLE(scip, SCIPvarGetUbGlobal(var), SCIPfeasCeil(scip, SCIPvarGetLbGlobal(var))));
25439  }
25440  if( !SCIPisFeasIntegral(scip, SCIPvarGetUbGlobal(var)) ||
25442  )
25443  {
25444  SCIP_CALL( SCIPtightenVarUbGlobal(scip, var, SCIPfeasFloor(scip, SCIPvarGetUbGlobal(var)), TRUE, infeasible, &tightened) );
25445  if( *infeasible )
25446  return SCIP_OKAY;
25447 
25448  assert(tightened || SCIPisFeasGE(scip, SCIPvarGetLbGlobal(var), SCIPfeasFloor(scip, SCIPvarGetUbGlobal(var))));
25449  }
25450  }
25451 
25452  return SCIP_OKAY;
25453 }
25454 
25455 /** changes type of variable in the problem;
25456  *
25457  * @warning This type change might change the variable array returned from SCIPgetVars() and SCIPgetVarsData();
25458  *
25459  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25460  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25461  *
25462  * @pre This method can be called if @p scip is in one of the following stages:
25463  * - \ref SCIP_STAGE_PROBLEM
25464  * - \ref SCIP_STAGE_TRANSFORMING
25465  * - \ref SCIP_STAGE_PRESOLVING
25466  *
25467  * @note If SCIP is already beyond the SCIP_STAGE_PROBLEM and a original variable is passed, the variable type of the
25468  * corresponding transformed variable is changed; the type of the original variable does not change
25469  *
25470  * @note If the type changes from a continuous variable to a non-continuous variable the bounds of the variable get
25471  * adjusted w.r.t. to integrality information
25472  */
25474  SCIP* scip, /**< SCIP data structure */
25475  SCIP_VAR* var, /**< variable to change the bound for */
25476  SCIP_VARTYPE vartype, /**< new type of variable */
25477  SCIP_Bool* infeasible /**< pointer to store whether an infeasibility was detected (, due to
25478  * integrality condition of the new variable type) */
25479  )
25480 {
25481  SCIP_CALL( checkStage(scip, "SCIPchgVarType", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
25482 
25483  assert(var != NULL);
25484  assert(var->scip == scip);
25485 
25486  if( SCIPvarIsNegated(var) )
25487  {
25488  SCIPdebugMsg(scip, "upgrading type of negated variable <%s> from %d to %d\n", SCIPvarGetName(var), SCIPvarGetType(var), vartype);
25489  var = SCIPvarGetNegationVar(var);
25490  }
25491 #ifndef NDEBUG
25492  else
25493  {
25494  if( SCIPgetStage(scip) > SCIP_STAGE_PROBLEM )
25495  {
25496  SCIPdebugMsg(scip, "upgrading type of variable <%s> from %d to %d\n", SCIPvarGetName(var), SCIPvarGetType(var), vartype);
25497  }
25498  }
25499 #endif
25500 
25501  /* change variable type */
25502  switch( scip->set->stage )
25503  {
25504  case SCIP_STAGE_PROBLEM:
25505  assert(!SCIPvarIsTransformed(var));
25506 
25507  /* first adjust the variable due to new integrality information */
25508  SCIP_CALL( tightenBounds(scip, var, vartype, infeasible) );
25509 
25510  /* second change variable type */
25511  if( SCIPvarGetProbindex(var) >= 0 )
25512  {
25513  SCIP_CALL( SCIPprobChgVarType(scip->origprob, scip->mem->probmem, scip->set, scip->branchcand, scip->cliquetable, var, vartype) );
25514  }
25515  else
25516  {
25517  SCIP_CALL( SCIPvarChgType(var, vartype) );
25518  }
25519  break;
25520 
25521  case SCIP_STAGE_PRESOLVING:
25522  if( !SCIPvarIsTransformed(var) )
25523  {
25524  SCIP_VAR* transvar;
25525 
25526  SCIP_CALL( SCIPgetTransformedVar(scip, var, &transvar) );
25527  assert(transvar != NULL);
25528 
25529  /* recall method with transformed variable */
25530  SCIP_CALL( SCIPchgVarType(scip, transvar, vartype, infeasible) );
25531  return SCIP_OKAY;
25532  }
25533 
25534  /* first adjust the variable due to new integrality information */
25535  SCIP_CALL( tightenBounds(scip, var, vartype, infeasible) );
25536 
25537  /* second change variable type */
25538  if( SCIPvarGetProbindex(var) >= 0 )
25539  {
25540  SCIP_CALL( SCIPprobChgVarType(scip->transprob, scip->mem->probmem, scip->set, scip->branchcand, scip->cliquetable, var, vartype) );
25541  }
25542  else
25543  {
25544  SCIP_CALL( SCIPvarChgType(var, vartype) );
25545  }
25546  break;
25547 
25548  default:
25549  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
25550  return SCIP_INVALIDCALL;
25551  } /*lint !e788*/
25552 
25553  return SCIP_OKAY;
25554 }
25555 
25556 /** in problem creation and solving stage, both bounds of the variable are set to the given value;
25557  * in presolving stage, the variable is converted into a fixed variable, and bounds are changed respectively;
25558  * conversion into a fixed variable changes the vars array returned from SCIPgetVars() and SCIPgetVarsData(),
25559  * and also renders arrays returned from the SCIPvarGetImpl...() methods invalid
25560  *
25561  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25562  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25563  *
25564  * @pre This method can be called if @p scip is in one of the following stages:
25565  * - \ref SCIP_STAGE_PROBLEM
25566  * - \ref SCIP_STAGE_PRESOLVING
25567  * - \ref SCIP_STAGE_SOLVING
25568  */
25570  SCIP* scip, /**< SCIP data structure */
25571  SCIP_VAR* var, /**< variable to fix */
25572  SCIP_Real fixedval, /**< value to fix variable to */
25573  SCIP_Bool* infeasible, /**< pointer to store whether the fixing is infeasible */
25574  SCIP_Bool* fixed /**< pointer to store whether the fixing was performed (variable was unfixed) */
25575  )
25576 {
25577  assert(var != NULL);
25578  assert(infeasible != NULL);
25579  assert(fixed != NULL);
25580 
25581  SCIP_CALL( checkStage(scip, "SCIPfixVar", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25582 
25583  *infeasible = FALSE;
25584  *fixed = FALSE;
25585 
25586  /* in the problem creation stage, modify the bounds as requested, independently from the current bounds */
25587  if( scip->set->stage != SCIP_STAGE_PROBLEM )
25588  {
25589  if( (SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS && !SCIPsetIsFeasIntegral(scip->set, fixedval))
25590  || SCIPsetIsFeasLT(scip->set, fixedval, SCIPvarGetLbLocal(var))
25591  || SCIPsetIsFeasGT(scip->set, fixedval, SCIPvarGetUbLocal(var)) )
25592  {
25593  *infeasible = TRUE;
25594  return SCIP_OKAY;
25595  }
25596  else if( SCIPvarGetStatus(var) == SCIP_VARSTATUS_FIXED )
25597  {
25598  *infeasible = !SCIPsetIsFeasEQ(scip->set, fixedval, SCIPvarGetLbLocal(var));
25599  return SCIP_OKAY;
25600  }
25601  }
25602  else
25603  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_ORIGINAL);
25604 
25605  switch( scip->set->stage )
25606  {
25607  case SCIP_STAGE_PROBLEM:
25608  /* in the problem creation stage, modify the bounds as requested, independently from the current bounds;
25609  * we have to make sure, that the order of the bound changes does not intermediately produce an invalid
25610  * interval lb > ub
25611  */
25612  if( fixedval <= SCIPvarGetLbLocal(var) )
25613  {
25614  SCIP_CALL( SCIPchgVarLb(scip, var, fixedval) );
25615  SCIP_CALL( SCIPchgVarUb(scip, var, fixedval) );
25616  *fixed = TRUE;
25617  }
25618  else
25619  {
25620  SCIP_CALL( SCIPchgVarUb(scip, var, fixedval) );
25621  SCIP_CALL( SCIPchgVarLb(scip, var, fixedval) );
25622  *fixed = TRUE;
25623  }
25624  return SCIP_OKAY;
25625 
25626  case SCIP_STAGE_PRESOLVING:
25627  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 )
25628  {
25629  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
25630  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
25631  fixedval, infeasible, fixed) );
25632  return SCIP_OKAY;
25633  }
25634  /*lint -fallthrough*/
25635  case SCIP_STAGE_SOLVING:
25636  if( SCIPsetIsFeasGT(scip->set, fixedval, SCIPvarGetLbLocal(var)) )
25637  {
25638  SCIP_CALL( SCIPchgVarLb(scip, var, fixedval) );
25639  *fixed = TRUE;
25640  }
25641  if( SCIPsetIsFeasLT(scip->set, fixedval, SCIPvarGetUbLocal(var)) )
25642  {
25643  SCIP_CALL( SCIPchgVarUb(scip, var, fixedval) );
25644  *fixed = TRUE;
25645  }
25646  return SCIP_OKAY;
25647 
25648  default:
25649  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
25650  return SCIP_INVALIDCALL;
25651  } /*lint !e788*/
25652 }
25653 
25654 /** From a given equality a*x + b*y == c, aggregates one of the variables and removes it from the set of
25655  * active problem variables. This changes the vars array returned from SCIPgetVars() and SCIPgetVarsData(),
25656  * and also renders the arrays returned from the SCIPvarGetImpl...() methods for the two variables invalid.
25657  * In the first step, the equality is transformed into an equality with active problem variables
25658  * a'*x' + b'*y' == c'. If x' == y', this leads to the detection of redundancy if a' == -b' and c' == 0,
25659  * of infeasibility, if a' == -b' and c' != 0, or to a variable fixing x' == c'/(a'+b') (and possible
25660  * infeasibility) otherwise.
25661  * In the second step, the variable to be aggregated is chosen among x' and y', prefering a less strict variable
25662  * type as aggregation variable (i.e. continuous variables are preferred over implicit integers, implicit integers
25663  * over integers, and integers over binaries). If none of the variables is continuous, it is tried to find an integer
25664  * aggregation (i.e. integral coefficients a'' and b'', such that a''*x' + b''*y' == c''). This can lead to
25665  * the detection of infeasibility (e.g. if c'' is fractional), or to a rejection of the aggregation (denoted by
25666  * aggregated == FALSE), if the resulting integer coefficients are too large and thus numerically instable.
25667  *
25668  * The output flags have the following meaning:
25669  * - infeasible: the problem is infeasible
25670  * - redundant: the equality can be deleted from the constraint set
25671  * - aggregated: the aggregation was successfully performed (the variables were not aggregated before)
25672  *
25673  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25674  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25675  *
25676  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_PRESOLVING
25677  */
25679  SCIP* scip, /**< SCIP data structure */
25680  SCIP_VAR* varx, /**< variable x in equality a*x + b*y == c */
25681  SCIP_VAR* vary, /**< variable y in equality a*x + b*y == c */
25682  SCIP_Real scalarx, /**< multiplier a in equality a*x + b*y == c */
25683  SCIP_Real scalary, /**< multiplier b in equality a*x + b*y == c */
25684  SCIP_Real rhs, /**< right hand side c in equality a*x + b*y == c */
25685  SCIP_Bool* infeasible, /**< pointer to store whether the aggregation is infeasible */
25686  SCIP_Bool* redundant, /**< pointer to store whether the equality is (now) redundant */
25687  SCIP_Bool* aggregated /**< pointer to store whether the aggregation was successful */
25688  )
25689 {
25690  SCIP_Real constantx;
25691  SCIP_Real constanty;
25692 
25693  assert(infeasible != NULL);
25694  assert(redundant != NULL);
25695  assert(aggregated != NULL);
25696 
25697  SCIP_CALL( checkStage(scip, "SCIPaggregateVars", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
25698 
25699  *infeasible = FALSE;
25700  *redundant = FALSE;
25701  *aggregated = FALSE;
25702 
25703  if( SCIPtreeProbing(scip->tree) )
25704  {
25705  SCIPerrorMessage("cannot aggregate variables during probing\n");
25706  return SCIP_INVALIDCALL;
25707  }
25708  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
25709 
25710  /* do not perform aggregation if it is globally deactivated */
25711  if( scip->set->presol_donotaggr )
25712  return SCIP_OKAY;
25713 
25714  /* get the corresponding equality in active problem variable space:
25715  * transform both expressions "a*x + 0" and "b*y + 0" into problem variable space
25716  */
25717  constantx = 0.0;
25718  constanty = 0.0;
25719  SCIP_CALL( SCIPvarGetProbvarSum(&varx, scip->set, &scalarx, &constantx) );
25720  SCIP_CALL( SCIPvarGetProbvarSum(&vary, scip->set, &scalary, &constanty) );
25721 
25722  /* we cannot aggregate multi-aggregated variables */
25724  return SCIP_OKAY;
25725 
25726  /* move the constant to the right hand side to acquire the form "a'*x' + b'*y' == c'" */
25727  rhs -= (constantx + constanty);
25728 
25729  /* if a scalar is zero, treat the variable as fixed-to-zero variable */
25730  if( SCIPsetIsZero(scip->set, scalarx) )
25731  varx = NULL;
25732  if( SCIPsetIsZero(scip->set, scalary) )
25733  vary = NULL;
25734 
25735  /* capture the special cases that less than two variables are left, due to resolutions to a fixed variable or
25736  * to the same active variable
25737  */
25738  if( varx == NULL && vary == NULL )
25739  {
25740  /* both variables were resolved to fixed variables */
25741  *infeasible = !SCIPsetIsZero(scip->set, rhs);
25742  *redundant = TRUE;
25743  }
25744  else if( varx == NULL )
25745  {
25746  assert(SCIPsetIsZero(scip->set, scalarx));
25747  assert(!SCIPsetIsZero(scip->set, scalary));
25748 
25749  /* variable x was resolved to fixed variable: variable y can be fixed to c'/b' */
25750  SCIP_CALL( SCIPvarFix(vary, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
25751  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
25752  rhs/scalary, infeasible, aggregated) );
25753  *redundant = TRUE;
25754  }
25755  else if( vary == NULL )
25756  {
25757  assert(SCIPsetIsZero(scip->set, scalary));
25758  assert(!SCIPsetIsZero(scip->set, scalarx));
25759 
25760  /* variable y was resolved to fixed variable: variable x can be fixed to c'/a' */
25761  SCIP_CALL( SCIPvarFix(varx, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
25762  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
25763  rhs/scalarx, infeasible, aggregated) );
25764  *redundant = TRUE;
25765  }
25766  else if( varx == vary )
25767  {
25768  /* both variables were resolved to the same active problem variable: this variable can be fixed */
25769  scalarx += scalary;
25770  if( SCIPsetIsZero(scip->set, scalarx) )
25771  {
25772  /* left hand side of equality is zero: equality is potentially infeasible */
25773  *infeasible = !SCIPsetIsZero(scip->set, rhs);
25774  }
25775  else
25776  {
25777  /* sum of scalars is not zero: fix variable x' == y' to c'/(a'+b') */
25778  SCIP_CALL( SCIPvarFix(varx, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
25779  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
25780  rhs/scalarx, infeasible, aggregated) );
25781  }
25782  *redundant = TRUE;
25783  }
25784  else
25785  {
25786  /* both variables are different active problem variables, and both scalars are non-zero: try to aggregate them */
25787  SCIP_CALL( SCIPvarTryAggregateVars(scip->set, scip->mem->probmem, scip->stat, scip->transprob, scip->origprob,
25788  scip->primal, scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventfilter,
25789  scip->eventqueue, varx, vary, scalarx, scalary, rhs, infeasible, aggregated) );
25790  *redundant = *aggregated;
25791  }
25792 
25793  return SCIP_OKAY;
25794 }
25795 
25796 /** converts variable into multi-aggregated variable; this changes the variable array returned from
25797  * SCIPgetVars() and SCIPgetVarsData();
25798  *
25799  * @warning The integrality condition is not checked anymore on the multi-aggregated variable. You must not
25800  * multi-aggregate an integer variable without being sure, that integrality on the aggregation variables
25801  * implies integrality on the aggregated variable.
25802  *
25803  * The output flags have the following meaning:
25804  * - infeasible: the problem is infeasible
25805  * - aggregated: the aggregation was successfully performed (the variables were not aggregated before)
25806  *
25807  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25808  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25809  *
25810  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_PRESOLVING
25811  */
25813  SCIP* scip, /**< SCIP data structure */
25814  SCIP_VAR* var, /**< variable x to aggregate */
25815  int naggvars, /**< number n of variables in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
25816  SCIP_VAR** aggvars, /**< variables y_i in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
25817  SCIP_Real* scalars, /**< multipliers a_i in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
25818  SCIP_Real constant, /**< constant shift c in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
25819  SCIP_Bool* infeasible, /**< pointer to store whether the aggregation is infeasible */
25820  SCIP_Bool* aggregated /**< pointer to store whether the aggregation was successful */
25821  )
25822 {
25823  SCIP_CALL( checkStage(scip, "SCIPmultiaggregateVar", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
25824 
25825  assert(var->scip == scip);
25826 
25827  if( SCIPtreeProbing(scip->tree) )
25828  {
25829  SCIPerrorMessage("cannot multi-aggregate variables during probing\n");
25830  return SCIP_INVALIDCALL;
25831  }
25832  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
25833 
25834  SCIP_CALL( SCIPvarMultiaggregate(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
25835  scip->primal, scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventfilter,
25836  scip->eventqueue, naggvars, aggvars, scalars, constant, infeasible, aggregated) );
25837 
25838  return SCIP_OKAY;
25839 }
25840 
25841 /** returns whether aggregation of variables is not allowed */
25843  SCIP* scip /**< SCIP data structure */
25844  )
25845 {
25846  assert(scip != NULL);
25847 
25848  return scip->set->presol_donotaggr;
25849 }
25850 
25851 /** returns whether multi-aggregation is disabled */
25853  SCIP* scip /**< SCIP data structure */
25854  )
25855 {
25856  assert(scip != NULL);
25857 
25858  return scip->set->presol_donotmultaggr;
25859 }
25860 
25861 /** returns whether variable is not allowed to be multi-aggregated */
25863  SCIP* scip, /**< SCIP data structure */
25864  SCIP_VAR* var /**< variable x to aggregate */
25865  )
25866 {
25867  assert(scip != NULL);
25868  assert(var != NULL);
25869  assert(var->scip == scip);
25870 
25871  return scip->set->presol_donotmultaggr || SCIPvarDoNotMultaggr(var);
25872 }
25873 
25874 /** returns whether dual reduction are allowed during propagation and presolving
25875  *
25876  * @note A reduction is called dual, if it may discard feasible solutions, but leaves at least one optimal solution
25877  * intact. Often such reductions are based on analyzing the objective function, reduced costs and/or dual LPs.
25878  */
25880  SCIP* scip /**< SCIP data structure */
25881  )
25882 {
25883  assert(scip != NULL);
25884 
25885  return !scip->set->reopt_enable && scip->set->misc_allowdualreds;
25886 }
25887 
25888 /** returns whether propagation w.r.t. current objective is allowed */
25890  SCIP* scip /**< SCIP data structure */
25891  )
25892 {
25893  assert(scip != NULL);
25894 
25895  return !scip->set->reopt_enable && scip->set->misc_allowobjprop;
25896 }
25897 
25898 /** modifies an initial seed value with the global shift of random seeds */
25900  SCIP* scip, /**< SCIP data structure */
25901  int initialseedvalue /**< initial seed value to be modified */
25902  )
25903 {
25904  assert(scip != NULL);
25905 
25906  return (unsigned int)SCIPsetInitializeRandomSeed(scip->set, initialseedvalue);
25907 }
25908 
25909 /** marks the variable that it must not be multi-aggregated
25910  *
25911  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25912  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25913  *
25914  * @pre This method can be called if @p scip is in one of the following stages:
25915  * - \ref SCIP_STAGE_INIT
25916  * - \ref SCIP_STAGE_PROBLEM
25917  * - \ref SCIP_STAGE_TRANSFORMING
25918  * - \ref SCIP_STAGE_TRANSFORMED
25919  * - \ref SCIP_STAGE_INITPRESOLVE
25920  * - \ref SCIP_STAGE_PRESOLVING
25921  * - \ref SCIP_STAGE_EXITPRESOLVE
25922  *
25923  * @note There exists no "unmark" method since it has to be ensured that if a plugin requires that a variable is not
25924  * multi-aggregated that this is will be the case.
25925  */
25927  SCIP* scip, /**< SCIP data structure */
25928  SCIP_VAR* var /**< variable to delete */
25929  )
25930 {
25931  assert(scip != NULL);
25932  assert(var != NULL);
25933  assert(var->scip == scip);
25934 
25935  SCIP_CALL( checkStage(scip, "SCIPmarkDoNotMultaggrVar", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE) );
25936 
25938 
25939  return SCIP_OKAY;
25940 }
25941 
25942 /** enables the collection of statistics for a variable
25943  *
25944  * @pre This method can be called if @p scip is in one of the following stages:
25945  * - \ref SCIP_STAGE_PROBLEM
25946  * - \ref SCIP_STAGE_INITPRESOLVE
25947  * - \ref SCIP_STAGE_PRESOLVING
25948  * - \ref SCIP_STAGE_EXITPRESOLVE
25949  * - \ref SCIP_STAGE_SOLVING
25950  * - \ref SCIP_STAGE_SOLVED
25951  */
25953  SCIP* scip /**< SCIP data structure */
25954  )
25955 {
25956  SCIP_CALL_ABORT( checkStage(scip, "SCIPenableVarHistory", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25957 
25959 }
25960 
25961 /** disables the collection of any statistic for a variable
25962  *
25963  * @pre This method can be called if @p scip is in one of the following stages:
25964  * - \ref SCIP_STAGE_PROBLEM
25965  * - \ref SCIP_STAGE_INITPRESOLVE
25966  * - \ref SCIP_STAGE_PRESOLVING
25967  * - \ref SCIP_STAGE_EXITPRESOLVE
25968  * - \ref SCIP_STAGE_SOLVING
25969  * - \ref SCIP_STAGE_SOLVED
25970  */
25972  SCIP* scip /**< SCIP data structure */
25973  )
25974 {
25975  SCIP_CALL_ABORT( checkStage(scip, "SCIPdisableVarHistory", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25976 
25978 }
25979 
25980 /** updates the pseudo costs of the given variable and the global pseudo costs after a change of "solvaldelta" in the
25981  * variable's solution value and resulting change of "objdelta" in the in the LP's objective value;
25982  * the update is ignored, if the objective value difference is infinite
25983  *
25984  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25985  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25986  *
25987  * @pre This method can be called if @p scip is in one of the following stages:
25988  * - \ref SCIP_STAGE_SOLVING
25989  * - \ref SCIP_STAGE_SOLVED
25990  */
25992  SCIP* scip, /**< SCIP data structure */
25993  SCIP_VAR* var, /**< problem variable */
25994  SCIP_Real solvaldelta, /**< difference of variable's new LP value - old LP value */
25995  SCIP_Real objdelta, /**< difference of new LP's objective value - old LP's objective value */
25996  SCIP_Real weight /**< weight in (0,1] of this update in pseudo cost sum */
25997  )
25998 {
25999  SCIP_CALL( checkStage(scip, "SCIPupdateVarPseudocost", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26000 
26001  if( !SCIPsetIsInfinity(scip->set, 2*objdelta) ) /* differences infinity - eps should also be treated as infinity */
26002  {
26003  if( scip->set->branch_divingpscost || (!scip->lp->diving && !SCIPtreeProbing(scip->tree)) )
26004  {
26005  SCIP_CALL( SCIPvarUpdatePseudocost(var, scip->set, scip->stat, solvaldelta, objdelta, weight) );
26006  }
26007  }
26008 
26009  return SCIP_OKAY;
26010 }
26011 
26012 /** gets the variable's pseudo cost value for the given change of the variable's LP value
26013  *
26014  * @return the variable's pseudo cost value for the given change of the variable's LP value
26015  *
26016  * @pre This method can be called if @p scip is in one of the following stages:
26017  * - \ref SCIP_STAGE_INITPRESOLVE
26018  * - \ref SCIP_STAGE_PRESOLVING
26019  * - \ref SCIP_STAGE_EXITPRESOLVE
26020  * - \ref SCIP_STAGE_PRESOLVED
26021  * - \ref SCIP_STAGE_INITSOLVE
26022  * - \ref SCIP_STAGE_SOLVING
26023  * - \ref SCIP_STAGE_SOLVED
26024  */
26026  SCIP* scip, /**< SCIP data structure */
26027  SCIP_VAR* var, /**< problem variable */
26028  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
26029  )
26030 {
26031  assert( var->scip == scip );
26032 
26033  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostVal", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26034 
26035  return SCIPvarGetPseudocost(var, scip->stat, solvaldelta);
26036 }
26037 
26038 /** gets the variable's pseudo cost value for the given change of the variable's LP value,
26039  * only using the pseudo cost information of the current run
26040  *
26041  * @return the variable's pseudo cost value for the given change of the variable's LP value,
26042  * only using the pseudo cost information of the current run
26043  *
26044  * @pre This method can be called if @p scip is in one of the following stages:
26045  * - \ref SCIP_STAGE_INITPRESOLVE
26046  * - \ref SCIP_STAGE_PRESOLVING
26047  * - \ref SCIP_STAGE_EXITPRESOLVE
26048  * - \ref SCIP_STAGE_PRESOLVED
26049  * - \ref SCIP_STAGE_INITSOLVE
26050  * - \ref SCIP_STAGE_SOLVING
26051  * - \ref SCIP_STAGE_SOLVED
26052  */
26054  SCIP* scip, /**< SCIP data structure */
26055  SCIP_VAR* var, /**< problem variable */
26056  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
26057  )
26058 {
26059  assert( var->scip == scip );
26060 
26061  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostValCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26062 
26063  return SCIPvarGetPseudocostCurrentRun(var, scip->stat, solvaldelta);
26064 }
26065 
26066 /** gets the variable's pseudo cost value for the given direction
26067  *
26068  * @return the variable's pseudo cost value for the given direction
26069  *
26070  * @pre This method can be called if @p scip is in one of the following stages:
26071  * - \ref SCIP_STAGE_INITPRESOLVE
26072  * - \ref SCIP_STAGE_PRESOLVING
26073  * - \ref SCIP_STAGE_EXITPRESOLVE
26074  * - \ref SCIP_STAGE_PRESOLVED
26075  * - \ref SCIP_STAGE_INITSOLVE
26076  * - \ref SCIP_STAGE_SOLVING
26077  * - \ref SCIP_STAGE_SOLVED
26078  */
26080  SCIP* scip, /**< SCIP data structure */
26081  SCIP_VAR* var, /**< problem variable */
26082  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26083  )
26084 {
26085  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocost", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26086  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
26087  assert(var->scip == scip);
26088 
26089  return SCIPvarGetPseudocost(var, scip->stat, dir == SCIP_BRANCHDIR_DOWNWARDS ? -1.0 : 1.0);
26090 }
26091 
26092 /** gets the variable's pseudo cost value for the given direction,
26093  * only using the pseudo cost information of the current run
26094  *
26095  * @return the variable's pseudo cost value for the given direction,
26096  * only using the pseudo cost information of the current run
26097  *
26098  * @pre This method can be called if @p scip is in one of the following stages:
26099  * - \ref SCIP_STAGE_INITPRESOLVE
26100  * - \ref SCIP_STAGE_PRESOLVING
26101  * - \ref SCIP_STAGE_EXITPRESOLVE
26102  * - \ref SCIP_STAGE_PRESOLVED
26103  * - \ref SCIP_STAGE_INITSOLVE
26104  * - \ref SCIP_STAGE_SOLVING
26105  * - \ref SCIP_STAGE_SOLVED
26106  */
26108  SCIP* scip, /**< SCIP data structure */
26109  SCIP_VAR* var, /**< problem variable */
26110  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26111  )
26112 {
26113  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26114  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
26115  assert(var->scip == scip);
26116 
26117  return SCIPvarGetPseudocostCurrentRun(var, scip->stat, dir == SCIP_BRANCHDIR_DOWNWARDS ? -1.0 : 1.0);
26118 }
26119 
26120 /** gets the variable's (possible fractional) number of pseudo cost updates for the given direction
26121  *
26122  * @return the variable's (possible fractional) number of pseudo cost updates for the given direction
26123  *
26124  * @pre This method can be called if @p scip is in one of the following stages:
26125  * - \ref SCIP_STAGE_INITPRESOLVE
26126  * - \ref SCIP_STAGE_PRESOLVING
26127  * - \ref SCIP_STAGE_EXITPRESOLVE
26128  * - \ref SCIP_STAGE_PRESOLVED
26129  * - \ref SCIP_STAGE_INITSOLVE
26130  * - \ref SCIP_STAGE_SOLVING
26131  * - \ref SCIP_STAGE_SOLVED
26132  */
26134  SCIP* scip, /**< SCIP data structure */
26135  SCIP_VAR* var, /**< problem variable */
26136  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26137  )
26138 {
26139  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostCount", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26140  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
26141  assert(var->scip == scip);
26142 
26143  return SCIPvarGetPseudocostCount(var, dir);
26144 }
26145 
26146 /** gets the variable's (possible fractional) number of pseudo cost updates for the given direction,
26147  * only using the pseudo cost information of the current run
26148  *
26149  * @return the variable's (possible fractional) number of pseudo cost updates for the given direction,
26150  * only using the pseudo cost information of the current run
26151  *
26152  * @pre This method can be called if @p scip is in one of the following stages:
26153  * - \ref SCIP_STAGE_INITPRESOLVE
26154  * - \ref SCIP_STAGE_PRESOLVING
26155  * - \ref SCIP_STAGE_EXITPRESOLVE
26156  * - \ref SCIP_STAGE_PRESOLVED
26157  * - \ref SCIP_STAGE_INITSOLVE
26158  * - \ref SCIP_STAGE_SOLVING
26159  * - \ref SCIP_STAGE_SOLVED
26160  */
26162  SCIP* scip, /**< SCIP data structure */
26163  SCIP_VAR* var, /**< problem variable */
26164  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26165  )
26166 {
26167  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostCountCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26168  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
26169  assert(var->scip == scip);
26170 
26171  return SCIPvarGetPseudocostCountCurrentRun(var, dir);
26172 }
26173 
26174 /** get pseudo cost variance of the variable, either for entire solve or only for current branch and bound run
26175  *
26176  * @return returns the (corrected) variance of pseudo code information collected so far.
26177  *
26178  * @pre This method can be called if @p scip is in one of the following stages:
26179  * - \ref SCIP_STAGE_INITPRESOLVE
26180  * - \ref SCIP_STAGE_PRESOLVING
26181  * - \ref SCIP_STAGE_EXITPRESOLVE
26182  * - \ref SCIP_STAGE_PRESOLVED
26183  * - \ref SCIP_STAGE_INITSOLVE
26184  * - \ref SCIP_STAGE_SOLVING
26185  * - \ref SCIP_STAGE_SOLVED
26186  */
26188  SCIP* scip, /**< SCIP data structure */
26189  SCIP_VAR* var, /**< problem variable */
26190  SCIP_BRANCHDIR dir, /**< branching direction (downwards, or upwards) */
26191  SCIP_Bool onlycurrentrun /**< only for pseudo costs of current branch and bound run */
26192  )
26193 {
26194  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostVariance", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26195  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
26196  assert(var->scip == scip);
26197 
26198  return SCIPvarGetPseudocostVariance(var, dir, onlycurrentrun);
26199 }
26200 
26201 /** calculates a confidence bound for this variable under the assumption of normally distributed pseudo costs
26202  *
26203  * The confidence bound \f$ \theta \geq 0\f$ denotes the interval borders \f$ [X - \theta, \ X + \theta]\f$, which contains
26204  * the true pseudo costs of the variable, i.e., the expected value of the normal distribution, with a probability
26205  * of 2 * clevel - 1.
26206  *
26207  * @return value of confidence bound for this variable
26208  */
26210  SCIP* scip, /**< SCIP data structure */
26211  SCIP_VAR* var, /**< variable in question */
26212  SCIP_BRANCHDIR dir, /**< the branching direction for the confidence bound */
26213  SCIP_Bool onlycurrentrun, /**< should only the current run be taken into account */
26214  SCIP_CONFIDENCELEVEL clevel /**< confidence level for the interval */
26215  )
26216 {
26217  SCIP_CALL_ABORT( checkStage(scip, "SCIPcalculatePscostConfidenceBound", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26218 
26219  return SCIPvarCalcPscostConfidenceBound(var, scip->set, dir, onlycurrentrun, clevel);
26220 }
26221 
26222 /** check if variable pseudo-costs have a significant difference in location. The significance depends on
26223  * the choice of \p clevel and on the kind of tested hypothesis. The one-sided hypothesis, which
26224  * should be rejected, is that fracy * mu_y >= fracx * mu_x, where mu_y and mu_x denote the
26225  * unknown location means of the underlying pseudo-cost distributions of x and y.
26226  *
26227  * This method is applied best if variable x has a better pseudo-cost score than y. The method hypothesizes that y were actually
26228  * better than x (despite the current information), meaning that y can be expected to yield branching
26229  * decisions as least as good as x in the long run. If the method returns TRUE, the current history information is
26230  * sufficient to safely rely on the alternative hypothesis that x yields indeed a better branching score (on average)
26231  * than y.
26232  *
26233  * @note The order of x and y matters for the one-sided hypothesis
26234  *
26235  * @note set \p onesided to FALSE if you are not sure which variable is better. The hypothesis tested then reads
26236  * fracy * mu_y == fracx * mu_x vs the alternative hypothesis fracy * mu_y != fracx * mu_x.
26237  *
26238  * @return TRUE if the hypothesis can be safely rejected at the given confidence level
26239  */
26241  SCIP* scip, /**< SCIP data structure */
26242  SCIP_VAR* varx, /**< variable x */
26243  SCIP_Real fracx, /**< the fractionality of variable x */
26244  SCIP_VAR* vary, /**< variable y */
26245  SCIP_Real fracy, /**< the fractionality of variable y */
26246  SCIP_BRANCHDIR dir, /**< branching direction */
26247  SCIP_CONFIDENCELEVEL clevel, /**< confidence level for rejecting hypothesis */
26248  SCIP_Bool onesided /**< should a one-sided hypothesis y >= x be tested? */
26249  )
26250 {
26251  SCIP_CALL_ABORT( checkStage(scip, "SCIPsignificantVarPscostDifference", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26252 
26253  return SCIPvarSignificantPscostDifference(scip->set, scip->stat, varx, fracx, vary, fracy, dir, clevel, onesided);
26254 }
26255 
26256 /** tests at a given confidence level whether the variable pseudo-costs only have a small probability to
26257  * exceed a \p threshold. This is useful to determine if past observations provide enough evidence
26258  * to skip an expensive strong-branching step if there is already a candidate that has been proven to yield an improvement
26259  * of at least \p threshold.
26260  *
26261  * @note use \p clevel to adjust the level of confidence. For SCIP_CONFIDENCELEVEL_MIN, the method returns TRUE if
26262  * the estimated probability to exceed \p threshold is less than 25 %.
26263  *
26264  * @see SCIP_Confidencelevel for a list of available levels. The used probability limits refer to the one-sided levels
26265  * of confidence.
26266  *
26267  * @return TRUE if the variable pseudo-cost probabilistic model is likely to be smaller than \p threshold
26268  * at the given confidence level \p clevel.
26269  */
26271  SCIP* scip, /**< SCIP data structure */
26272  SCIP_VAR* var, /**< variable x */
26273  SCIP_Real frac, /**< the fractionality of variable x */
26274  SCIP_Real threshold, /**< the threshold to test against */
26275  SCIP_BRANCHDIR dir, /**< branching direction */
26276  SCIP_CONFIDENCELEVEL clevel /**< confidence level for rejecting hypothesis */
26277  )
26278 {
26279  SCIP_CALL_ABORT( checkStage(scip, "SCIPpscostThresholdProbabilityTest", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26280 
26281  return SCIPvarPscostThresholdProbabilityTest(scip->set, scip->stat, var, frac, threshold, dir, clevel);
26282 }
26283 
26284 /** check if the current pseudo cost relative error in a direction violates the given threshold. The Relative
26285  * Error is calculated at a specific confidence level
26286  *
26287  * @return TRUE if relative error in variable pseudo costs is smaller than \p threshold
26288  */
26290  SCIP* scip, /**< SCIP data structure */
26291  SCIP_VAR* var, /**< variable in question */
26292  SCIP_Real threshold, /**< threshold for relative errors to be considered reliable (enough) */
26293  SCIP_CONFIDENCELEVEL clevel /**< a given confidence level */
26294  )
26295 {
26296  SCIP_CALL_ABORT( checkStage(scip, "SCIPisVarPscostRelerrorReliable", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26297 
26298  return SCIPvarIsPscostRelerrorReliable(var, scip->set, scip->stat, threshold, clevel);
26299 }
26300 
26301 /** gets the variable's pseudo cost score value for the given LP solution value
26302  *
26303  * @return the variable's pseudo cost score value for the given LP solution value
26304  *
26305  * @pre This method can be called if @p scip is in one of the following stages:
26306  * - \ref SCIP_STAGE_INITPRESOLVE
26307  * - \ref SCIP_STAGE_PRESOLVING
26308  * - \ref SCIP_STAGE_EXITPRESOLVE
26309  * - \ref SCIP_STAGE_PRESOLVED
26310  * - \ref SCIP_STAGE_INITSOLVE
26311  * - \ref SCIP_STAGE_SOLVING
26312  * - \ref SCIP_STAGE_SOLVED
26313  */
26315  SCIP* scip, /**< SCIP data structure */
26316  SCIP_VAR* var, /**< problem variable */
26317  SCIP_Real solval /**< variable's LP solution value */
26318  )
26319 {
26320  SCIP_Real downsol;
26321  SCIP_Real upsol;
26322  SCIP_Real pscostdown;
26323  SCIP_Real pscostup;
26324 
26325  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26326 
26327  assert( var->scip == scip );
26328 
26329  downsol = SCIPsetFeasCeil(scip->set, solval-1.0);
26330  upsol = SCIPsetFeasFloor(scip->set, solval+1.0);
26331  pscostdown = SCIPvarGetPseudocost(var, scip->stat, downsol-solval);
26332  pscostup = SCIPvarGetPseudocost(var, scip->stat, upsol-solval);
26333 
26334  return SCIPbranchGetScore(scip->set, var, pscostdown, pscostup);
26335 }
26336 
26337 /** gets the variable's pseudo cost score value for the given LP solution value,
26338  * only using the pseudo cost information of the current run
26339  *
26340  * @return the variable's pseudo cost score value for the given LP solution value,
26341  * only using the pseudo cost information of the current run
26342  *
26343  * @pre This method can be called if @p scip is in one of the following stages:
26344  * - \ref SCIP_STAGE_INITPRESOLVE
26345  * - \ref SCIP_STAGE_PRESOLVING
26346  * - \ref SCIP_STAGE_EXITPRESOLVE
26347  * - \ref SCIP_STAGE_PRESOLVED
26348  * - \ref SCIP_STAGE_INITSOLVE
26349  * - \ref SCIP_STAGE_SOLVING
26350  * - \ref SCIP_STAGE_SOLVED
26351  */
26353  SCIP* scip, /**< SCIP data structure */
26354  SCIP_VAR* var, /**< problem variable */
26355  SCIP_Real solval /**< variable's LP solution value */
26356  )
26357 {
26358  SCIP_Real downsol;
26359  SCIP_Real upsol;
26360  SCIP_Real pscostdown;
26361  SCIP_Real pscostup;
26362 
26363  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26364 
26365  assert( var->scip == scip );
26366 
26367  downsol = SCIPsetFeasCeil(scip->set, solval-1.0);
26368  upsol = SCIPsetFeasFloor(scip->set, solval+1.0);
26369  pscostdown = SCIPvarGetPseudocostCurrentRun(var, scip->stat, downsol-solval);
26370  pscostup = SCIPvarGetPseudocostCurrentRun(var, scip->stat, upsol-solval);
26371 
26372  return SCIPbranchGetScore(scip->set, var, pscostdown, pscostup);
26373 }
26374 
26375 /** returns the variable's VSIDS value
26376  *
26377  * @return the variable's VSIDS value
26378  *
26379  * @pre This method can be called if @p scip is in one of the following stages:
26380  * - \ref SCIP_STAGE_INITPRESOLVE
26381  * - \ref SCIP_STAGE_PRESOLVING
26382  * - \ref SCIP_STAGE_EXITPRESOLVE
26383  * - \ref SCIP_STAGE_PRESOLVED
26384  * - \ref SCIP_STAGE_INITSOLVE
26385  * - \ref SCIP_STAGE_SOLVING
26386  * - \ref SCIP_STAGE_SOLVED
26387  */
26389  SCIP* scip, /**< SCIP data structure */
26390  SCIP_VAR* var, /**< problem variable */
26391  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26392  )
26393 {
26394  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarVSIDS", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26395 
26396  assert( var->scip == scip );
26397 
26398  if( dir != SCIP_BRANCHDIR_DOWNWARDS && dir != SCIP_BRANCHDIR_UPWARDS )
26399  {
26400  SCIPerrorMessage("invalid branching direction %d when asking for VSIDS value\n", dir);
26401  return SCIP_INVALID;
26402  }
26403 
26404  return SCIPvarGetVSIDS(var, scip->stat, dir);
26405 }
26406 
26407 /** returns the variable's VSIDS value only using conflicts of the current run
26408  *
26409  * @return the variable's VSIDS value only using conflicts of the current run
26410  *
26411  * @pre This method can be called if @p scip is in one of the following stages:
26412  * - \ref SCIP_STAGE_INITPRESOLVE
26413  * - \ref SCIP_STAGE_PRESOLVING
26414  * - \ref SCIP_STAGE_EXITPRESOLVE
26415  * - \ref SCIP_STAGE_PRESOLVED
26416  * - \ref SCIP_STAGE_INITSOLVE
26417  * - \ref SCIP_STAGE_SOLVING
26418  * - \ref SCIP_STAGE_SOLVED
26419  */
26421  SCIP* scip, /**< SCIP data structure */
26422  SCIP_VAR* var, /**< problem variable */
26423  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26424  )
26425 {
26426  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarVSIDSCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26427 
26428  assert( var->scip == scip );
26429 
26430  if( dir != SCIP_BRANCHDIR_DOWNWARDS && dir != SCIP_BRANCHDIR_UPWARDS )
26431  {
26432  SCIPerrorMessage("invalid branching direction %d when asking for VSIDS value\n", dir);
26433  return SCIP_INVALID;
26434  }
26435 
26436  return SCIPvarGetVSIDSCurrentRun(var, scip->stat, dir);
26437 }
26438 
26439 /** returns the variable's conflict score value
26440  *
26441  * @return the variable's conflict score value
26442  *
26443  * @pre This method can be called if @p scip is in one of the following stages:
26444  * - \ref SCIP_STAGE_INITPRESOLVE
26445  * - \ref SCIP_STAGE_PRESOLVING
26446  * - \ref SCIP_STAGE_EXITPRESOLVE
26447  * - \ref SCIP_STAGE_PRESOLVED
26448  * - \ref SCIP_STAGE_INITSOLVE
26449  * - \ref SCIP_STAGE_SOLVING
26450  * - \ref SCIP_STAGE_SOLVED
26451  */
26453  SCIP* scip, /**< SCIP data structure */
26454  SCIP_VAR* var /**< problem variable */
26455  )
26456 {
26457  SCIP_Real downscore;
26458  SCIP_Real upscore;
26459 
26460  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarConflictScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26461 
26462  assert( var->scip == scip );
26463 
26464  downscore = SCIPvarGetVSIDS(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
26465  upscore = SCIPvarGetVSIDS(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
26466 
26467  return SCIPbranchGetScore(scip->set, var, downscore, upscore);
26468 }
26469 
26470 /** returns the variable's conflict score value only using conflicts of the current run
26471  *
26472  * @return the variable's conflict score value only using conflicts of the current run
26473  *
26474  * @pre This method can be called if @p scip is in one of the following stages:
26475  * - \ref SCIP_STAGE_INITPRESOLVE
26476  * - \ref SCIP_STAGE_PRESOLVING
26477  * - \ref SCIP_STAGE_EXITPRESOLVE
26478  * - \ref SCIP_STAGE_PRESOLVED
26479  * - \ref SCIP_STAGE_INITSOLVE
26480  * - \ref SCIP_STAGE_SOLVING
26481  * - \ref SCIP_STAGE_SOLVED
26482  */
26484  SCIP* scip, /**< SCIP data structure */
26485  SCIP_VAR* var /**< problem variable */
26486  )
26487 {
26488  SCIP_Real downscore;
26489  SCIP_Real upscore;
26490 
26491  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarConflictScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26492 
26493  assert( var->scip == scip );
26494 
26495  downscore = SCIPvarGetVSIDSCurrentRun(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
26496  upscore = SCIPvarGetVSIDSCurrentRun(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
26497 
26498  return SCIPbranchGetScore(scip->set, var, downscore, upscore);
26499 }
26500 
26501 /** returns the variable's conflict length score
26502  *
26503  * @return the variable's conflict length score
26504  *
26505  * @pre This method can be called if @p scip is in one of the following stages:
26506  * - \ref SCIP_STAGE_INITPRESOLVE
26507  * - \ref SCIP_STAGE_PRESOLVING
26508  * - \ref SCIP_STAGE_EXITPRESOLVE
26509  * - \ref SCIP_STAGE_PRESOLVED
26510  * - \ref SCIP_STAGE_INITSOLVE
26511  * - \ref SCIP_STAGE_SOLVING
26512  * - \ref SCIP_STAGE_SOLVED
26513  */
26515  SCIP* scip, /**< SCIP data structure */
26516  SCIP_VAR* var /**< problem variable */
26517  )
26518 {
26519  SCIP_Real downscore;
26520  SCIP_Real upscore;
26521 
26522  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarConflictlengthScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26523 
26524  assert( var->scip == scip );
26525 
26528 
26529  return SCIPbranchGetScore(scip->set, var, downscore, upscore);
26530 }
26531 
26532 /** returns the variable's conflict length score only using conflicts of the current run
26533  *
26534  * @return the variable's conflict length score only using conflicts of the current run
26535  *
26536  * @pre This method can be called if @p scip is in one of the following stages:
26537  * - \ref SCIP_STAGE_INITPRESOLVE
26538  * - \ref SCIP_STAGE_PRESOLVING
26539  * - \ref SCIP_STAGE_EXITPRESOLVE
26540  * - \ref SCIP_STAGE_PRESOLVED
26541  * - \ref SCIP_STAGE_INITSOLVE
26542  * - \ref SCIP_STAGE_SOLVING
26543  * - \ref SCIP_STAGE_SOLVED
26544  */
26546  SCIP* scip, /**< SCIP data structure */
26547  SCIP_VAR* var /**< problem variable */
26548  )
26549 {
26550  SCIP_Real downscore;
26551  SCIP_Real upscore;
26552 
26553  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarConflictlengthScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26554 
26555  assert( var->scip == scip );
26556 
26559 
26560  return SCIPbranchGetScore(scip->set, var, downscore, upscore);
26561 }
26562 
26563 /** returns the variable's average conflict length
26564  *
26565  * @return the variable's average conflict length
26566  *
26567  * @pre This method can be called if @p scip is in one of the following stages:
26568  * - \ref SCIP_STAGE_INITPRESOLVE
26569  * - \ref SCIP_STAGE_PRESOLVING
26570  * - \ref SCIP_STAGE_EXITPRESOLVE
26571  * - \ref SCIP_STAGE_PRESOLVED
26572  * - \ref SCIP_STAGE_INITSOLVE
26573  * - \ref SCIP_STAGE_SOLVING
26574  * - \ref SCIP_STAGE_SOLVED
26575  */
26577  SCIP* scip, /**< SCIP data structure */
26578  SCIP_VAR* var, /**< problem variable */
26579  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26580  )
26581 {
26582  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgConflictlength", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26583 
26584  assert( var->scip == scip );
26585 
26586  return SCIPvarGetAvgConflictlength(var, dir);
26587 }
26588 
26589 /** returns the variable's average conflict length only using conflicts of the current run
26590  *
26591  * @return the variable's average conflict length only using conflicts of the current run
26592  *
26593  * @pre This method can be called if @p scip is in one of the following stages:
26594  * - \ref SCIP_STAGE_INITPRESOLVE
26595  * - \ref SCIP_STAGE_PRESOLVING
26596  * - \ref SCIP_STAGE_EXITPRESOLVE
26597  * - \ref SCIP_STAGE_PRESOLVED
26598  * - \ref SCIP_STAGE_INITSOLVE
26599  * - \ref SCIP_STAGE_SOLVING
26600  * - \ref SCIP_STAGE_SOLVED
26601  */
26603  SCIP* scip, /**< SCIP data structure */
26604  SCIP_VAR* var, /**< problem variable */
26605  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26606  )
26607 {
26608  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgConflictlengthCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26609 
26610  assert( var->scip == scip );
26611 
26612  return SCIPvarGetAvgConflictlengthCurrentRun(var, dir);
26613 }
26614 
26615 /** returns the average number of inferences found after branching on the variable in given direction;
26616  * if branching on the variable in the given direction was yet evaluated, the average number of inferences
26617  * over all variables for branching in the given direction is returned
26618  *
26619  * @return the average number of inferences found after branching on the variable in given direction
26620  *
26621  * @pre This method can be called if @p scip is in one of the following stages:
26622  * - \ref SCIP_STAGE_INITPRESOLVE
26623  * - \ref SCIP_STAGE_PRESOLVING
26624  * - \ref SCIP_STAGE_EXITPRESOLVE
26625  * - \ref SCIP_STAGE_PRESOLVED
26626  * - \ref SCIP_STAGE_INITSOLVE
26627  * - \ref SCIP_STAGE_SOLVING
26628  * - \ref SCIP_STAGE_SOLVED
26629  */
26631  SCIP* scip, /**< SCIP data structure */
26632  SCIP_VAR* var, /**< problem variable */
26633  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26634  )
26635 {
26636  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferences", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26637 
26638  assert( var->scip == scip );
26639 
26640  return SCIPvarGetAvgInferences(var, scip->stat, dir);
26641 }
26642 
26643 /** returns the average number of inferences found after branching on the variable in given direction in the current run;
26644  * if branching on the variable in the given direction was yet evaluated, the average number of inferences
26645  * over all variables for branching in the given direction is returned
26646  *
26647  * @return the average number of inferences found after branching on the variable in given direction in the current run
26648  *
26649  * @pre This method can be called if @p scip is in one of the following stages:
26650  * - \ref SCIP_STAGE_INITPRESOLVE
26651  * - \ref SCIP_STAGE_PRESOLVING
26652  * - \ref SCIP_STAGE_EXITPRESOLVE
26653  * - \ref SCIP_STAGE_PRESOLVED
26654  * - \ref SCIP_STAGE_INITSOLVE
26655  * - \ref SCIP_STAGE_SOLVING
26656  * - \ref SCIP_STAGE_SOLVED
26657  */
26659  SCIP* scip, /**< SCIP data structure */
26660  SCIP_VAR* var, /**< problem variable */
26661  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26662  )
26663 {
26664  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferencesCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26665 
26666  assert( var->scip == scip );
26667 
26668  return SCIPvarGetAvgInferencesCurrentRun(var, scip->stat, dir);
26669 }
26670 
26671 /** returns the variable's average inference score value
26672  *
26673  * @return the variable's average inference score value
26674  *
26675  * @pre This method can be called if @p scip is in one of the following stages:
26676  * - \ref SCIP_STAGE_INITPRESOLVE
26677  * - \ref SCIP_STAGE_PRESOLVING
26678  * - \ref SCIP_STAGE_EXITPRESOLVE
26679  * - \ref SCIP_STAGE_PRESOLVED
26680  * - \ref SCIP_STAGE_INITSOLVE
26681  * - \ref SCIP_STAGE_SOLVING
26682  * - \ref SCIP_STAGE_SOLVED
26683  */
26685  SCIP* scip, /**< SCIP data structure */
26686  SCIP_VAR* var /**< problem variable */
26687  )
26688 {
26689  SCIP_Real inferdown;
26690  SCIP_Real inferup;
26691 
26692  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferenceScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26693 
26694  assert( var->scip == scip );
26695 
26696  inferdown = SCIPvarGetAvgInferences(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
26697  inferup = SCIPvarGetAvgInferences(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
26698 
26699  return SCIPbranchGetScore(scip->set, var, inferdown, inferup);
26700 }
26701 
26702 /** returns the variable's average inference score value only using inferences of the current run
26703  *
26704  * @return the variable's average inference score value only using inferences of the current run
26705  *
26706  * @pre This method can be called if @p scip is in one of the following stages:
26707  * - \ref SCIP_STAGE_INITPRESOLVE
26708  * - \ref SCIP_STAGE_PRESOLVING
26709  * - \ref SCIP_STAGE_EXITPRESOLVE
26710  * - \ref SCIP_STAGE_PRESOLVED
26711  * - \ref SCIP_STAGE_INITSOLVE
26712  * - \ref SCIP_STAGE_SOLVING
26713  * - \ref SCIP_STAGE_SOLVED
26714  */
26716  SCIP* scip, /**< SCIP data structure */
26717  SCIP_VAR* var /**< problem variable */
26718  )
26719 {
26720  SCIP_Real inferdown;
26721  SCIP_Real inferup;
26722 
26723  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferenceScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26724 
26725  assert( var->scip == scip );
26726 
26729 
26730  return SCIPbranchGetScore(scip->set, var, inferdown, inferup);
26731 }
26732 
26733 /** initializes the upwards and downwards pseudocosts, conflict scores, conflict lengths, inference scores, cutoff scores
26734  * of a variable to the given values
26735  *
26736  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26737  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26738  *
26739  * @pre This method can be called if @p scip is in one of the following stages:
26740  * - \ref SCIP_STAGE_TRANSFORMED
26741  * - \ref SCIP_STAGE_INITPRESOLVE
26742  * - \ref SCIP_STAGE_PRESOLVING
26743  * - \ref SCIP_STAGE_EXITPRESOLVE
26744  * - \ref SCIP_STAGE_PRESOLVED
26745  * - \ref SCIP_STAGE_INITSOLVE
26746  * - \ref SCIP_STAGE_SOLVING
26747  */
26749  SCIP* scip, /**< SCIP data structure */
26750  SCIP_VAR* var, /**< variable which should be initialized */
26751  SCIP_Real downpscost, /**< value to which pseudocosts for downwards branching should be initialized */
26752  SCIP_Real uppscost, /**< value to which pseudocosts for upwards branching should be initialized */
26753  SCIP_Real downvsids, /**< value to which VSIDS score for downwards branching should be initialized */
26754  SCIP_Real upvsids, /**< value to which VSIDS score for upwards branching should be initialized */
26755  SCIP_Real downconflen, /**< value to which conflict length score for downwards branching should be initialized */
26756  SCIP_Real upconflen, /**< value to which conflict length score for upwards branching should be initialized */
26757  SCIP_Real downinfer, /**< value to which inference counter for downwards branching should be initialized */
26758  SCIP_Real upinfer, /**< value to which inference counter for upwards branching should be initialized */
26759  SCIP_Real downcutoff, /**< value to which cutoff counter for downwards branching should be initialized */
26760  SCIP_Real upcutoff /**< value to which cutoff counter for upwards branching should be initialized */
26761  )
26762 {
26763  SCIP_CALL( checkStage(scip, "SCIPinitVarBranchStats", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26764 
26765  assert(downpscost >= 0.0 && uppscost >= 0.0);
26766  assert(downvsids >= 0.0 && upvsids >= 0.0);
26767  assert(downconflen >= 0.0 && upconflen >= 0.0);
26768  assert(downinfer >= 0.0 && upinfer >= 0.0);
26769  assert(downcutoff >= 0.0 && upcutoff >= 0.0);
26770 
26771  if( !SCIPisFeasZero(scip, downpscost) || !SCIPisFeasZero(scip, downvsids)
26772  || !SCIPisFeasZero(scip, downinfer) || !SCIPisFeasZero(scip, downcutoff) )
26773  {
26775  SCIP_CALL( SCIPvarUpdatePseudocost(var, scip->set, scip->stat, -1.0, downpscost, 1.0) );
26776  SCIP_CALL( SCIPvarIncInferenceSum(var, NULL, NULL, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, SCIP_UNKNOWN, downinfer) );
26777  SCIP_CALL( SCIPvarIncVSIDS(var, NULL, scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, SCIP_UNKNOWN, downvsids) );
26778  SCIP_CALL( SCIPvarIncCutoffSum(var, NULL, NULL, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, SCIP_UNKNOWN, downcutoff) );
26779  }
26780 
26781  if( !SCIPisFeasZero(scip, downconflen) )
26782  {
26783  SCIP_CALL( SCIPvarIncNActiveConflicts(var, NULL, NULL, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, SCIP_UNKNOWN, downconflen) );
26784  }
26785 
26786  if( !SCIPisFeasZero(scip, uppscost) || !SCIPisFeasZero(scip, upvsids)
26787  || !SCIPisFeasZero(scip, upinfer) || !SCIPisFeasZero(scip, upcutoff) )
26788  {
26790  SCIP_CALL( SCIPvarUpdatePseudocost(var, scip->set, scip->stat, 1.0, uppscost, 1.0) );
26791  SCIP_CALL( SCIPvarIncInferenceSum(var, NULL, NULL, scip->stat, SCIP_BRANCHDIR_UPWARDS, SCIP_UNKNOWN, upinfer) );
26792  SCIP_CALL( SCIPvarIncVSIDS(var, NULL, scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, SCIP_UNKNOWN, upvsids) );
26793  SCIP_CALL( SCIPvarIncCutoffSum(var, NULL, NULL, scip->stat, SCIP_BRANCHDIR_UPWARDS, SCIP_UNKNOWN, upcutoff) );
26794  }
26795 
26796  if( !SCIPisFeasZero(scip, upconflen) )
26797  {
26798  SCIP_CALL( SCIPvarIncNActiveConflicts(var, NULL, NULL, scip->stat, SCIP_BRANCHDIR_UPWARDS, SCIP_UNKNOWN, upconflen) );
26799  }
26800 
26801  return SCIP_OKAY;
26802 }
26803 
26804 /** initializes the upwards and downwards conflict scores, conflict lengths, inference scores, cutoff scores of a
26805  * variable w.r.t. a value by the given values (SCIP_VALUEHISTORY)
26806  *
26807  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26808  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26809  *
26810  * @pre This method can be called if @p scip is in one of the following stages:
26811  * - \ref SCIP_STAGE_TRANSFORMED
26812  * - \ref SCIP_STAGE_INITPRESOLVE
26813  * - \ref SCIP_STAGE_PRESOLVING
26814  * - \ref SCIP_STAGE_EXITPRESOLVE
26815  * - \ref SCIP_STAGE_PRESOLVED
26816  * - \ref SCIP_STAGE_INITSOLVE
26817  * - \ref SCIP_STAGE_SOLVING
26818  */
26820  SCIP* scip, /**< SCIP data structure */
26821  SCIP_VAR* var, /**< variable which should be initialized */
26822  SCIP_Real value, /**< domain value, or SCIP_UNKNOWN */
26823  SCIP_Real downvsids, /**< value to which VSIDS score for downwards branching should be initialized */
26824  SCIP_Real upvsids, /**< value to which VSIDS score for upwards branching should be initialized */
26825  SCIP_Real downconflen, /**< value to which conflict length score for downwards branching should be initialized */
26826  SCIP_Real upconflen, /**< value to which conflict length score for upwards branching should be initialized */
26827  SCIP_Real downinfer, /**< value to which inference counter for downwards branching should be initialized */
26828  SCIP_Real upinfer, /**< value to which inference counter for upwards branching should be initialized */
26829  SCIP_Real downcutoff, /**< value to which cutoff counter for downwards branching should be initialized */
26830  SCIP_Real upcutoff /**< value to which cutoff counter for upwards branching should be initialized */
26831  )
26832 {
26833  SCIP_CALL( checkStage(scip, "SCIPinitVarValueBranchStats", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26834 
26835  assert(downvsids >= 0.0 && upvsids >= 0.0);
26836  assert(downconflen >= 0.0 && upconflen >= 0.0);
26837  assert(downinfer >= 0.0 && upinfer >= 0.0);
26838  assert(downcutoff >= 0.0 && upcutoff >= 0.0);
26839 
26840  if( !SCIPisFeasZero(scip, downvsids) || !SCIPisFeasZero(scip, downinfer) || !SCIPisFeasZero(scip, downcutoff) )
26841  {
26842  SCIP_CALL( SCIPvarIncNBranchings(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, 1) );
26843  SCIP_CALL( SCIPvarIncInferenceSum(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, downinfer) );
26844  SCIP_CALL( SCIPvarIncVSIDS(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, downvsids) );
26845  SCIP_CALL( SCIPvarIncCutoffSum(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, downcutoff) );
26846  }
26847 
26848  if( !SCIPisFeasZero(scip, downconflen) )
26849  {
26850  SCIP_CALL( SCIPvarIncNActiveConflicts(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, downconflen) );
26851  }
26852 
26853  if( !SCIPisFeasZero(scip, upvsids) || !SCIPisFeasZero(scip, upinfer) || !SCIPisFeasZero(scip, upcutoff) )
26854  {
26855  SCIP_CALL( SCIPvarIncNBranchings(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, 1) );
26856  SCIP_CALL( SCIPvarIncInferenceSum(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, upinfer) );
26857  SCIP_CALL( SCIPvarIncVSIDS(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, upvsids) );
26858  SCIP_CALL( SCIPvarIncCutoffSum(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, upcutoff) );
26859  }
26860 
26861  if( !SCIPisFeasZero(scip, upconflen) )
26862  {
26863  SCIP_CALL( SCIPvarIncNActiveConflicts(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, upconflen) );
26864  }
26865 
26866  return SCIP_OKAY;
26867 }
26868 
26869 /** returns the average number of cutoffs found after branching on the variable in given direction;
26870  * if branching on the variable in the given direction was yet evaluated, the average number of cutoffs
26871  * over all variables for branching in the given direction is returned
26872  *
26873  * @return the average number of cutoffs found after branching on the variable in given direction
26874  *
26875  * @pre This method can be called if @p scip is in one of the following stages:
26876  * - \ref SCIP_STAGE_INITPRESOLVE
26877  * - \ref SCIP_STAGE_PRESOLVING
26878  * - \ref SCIP_STAGE_EXITPRESOLVE
26879  * - \ref SCIP_STAGE_PRESOLVED
26880  * - \ref SCIP_STAGE_INITSOLVE
26881  * - \ref SCIP_STAGE_SOLVING
26882  * - \ref SCIP_STAGE_SOLVED
26883  */
26885  SCIP* scip, /**< SCIP data structure */
26886  SCIP_VAR* var, /**< problem variable */
26887  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26888  )
26889 {
26890  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgCutoffs", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26891 
26892  assert( var->scip == scip );
26893 
26894  return SCIPvarGetAvgCutoffs(var, scip->stat, dir);
26895 }
26896 
26897 /** returns the average number of cutoffs found after branching on the variable in given direction in the current run;
26898  * if branching on the variable in the given direction was yet evaluated, the average number of cutoffs
26899  * over all variables for branching in the given direction is returned
26900  *
26901  * @return the average number of cutoffs found after branching on the variable in given direction in the current run
26902  *
26903  * @pre This method can be called if @p scip is in one of the following stages:
26904  * - \ref SCIP_STAGE_INITPRESOLVE
26905  * - \ref SCIP_STAGE_PRESOLVING
26906  * - \ref SCIP_STAGE_EXITPRESOLVE
26907  * - \ref SCIP_STAGE_PRESOLVED
26908  * - \ref SCIP_STAGE_INITSOLVE
26909  * - \ref SCIP_STAGE_SOLVING
26910  * - \ref SCIP_STAGE_SOLVED
26911  */
26913  SCIP* scip, /**< SCIP data structure */
26914  SCIP_VAR* var, /**< problem variable */
26915  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26916  )
26917 {
26918  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgCutoffsCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26919 
26920  assert( var->scip == scip );
26921 
26922  return SCIPvarGetAvgCutoffsCurrentRun(var, scip->stat, dir);
26923 }
26924 
26925 /** returns the variable's average cutoff score value
26926  *
26927  * @return the variable's average cutoff score value
26928  *
26929  * @pre This method can be called if @p scip is in one of the following stages:
26930  * - \ref SCIP_STAGE_INITPRESOLVE
26931  * - \ref SCIP_STAGE_PRESOLVING
26932  * - \ref SCIP_STAGE_EXITPRESOLVE
26933  * - \ref SCIP_STAGE_PRESOLVED
26934  * - \ref SCIP_STAGE_INITSOLVE
26935  * - \ref SCIP_STAGE_SOLVING
26936  * - \ref SCIP_STAGE_SOLVED
26937  */
26939  SCIP* scip, /**< SCIP data structure */
26940  SCIP_VAR* var /**< problem variable */
26941  )
26942 {
26943  SCIP_Real cutoffdown;
26944  SCIP_Real cutoffup;
26945 
26946  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgCutoffScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26947 
26948  assert( var->scip == scip );
26949 
26950  cutoffdown = SCIPvarGetAvgCutoffs(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
26951  cutoffup = SCIPvarGetAvgCutoffs(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
26952 
26953  return SCIPbranchGetScore(scip->set, var, cutoffdown, cutoffup);
26954 }
26955 
26956 /** returns the variable's average cutoff score value, only using cutoffs of the current run
26957  *
26958  * @return the variable's average cutoff score value, only using cutoffs of the current run
26959  *
26960  * @pre This method can be called if @p scip is in one of the following stages:
26961  * - \ref SCIP_STAGE_INITPRESOLVE
26962  * - \ref SCIP_STAGE_PRESOLVING
26963  * - \ref SCIP_STAGE_EXITPRESOLVE
26964  * - \ref SCIP_STAGE_PRESOLVED
26965  * - \ref SCIP_STAGE_INITSOLVE
26966  * - \ref SCIP_STAGE_SOLVING
26967  * - \ref SCIP_STAGE_SOLVED
26968  */
26970  SCIP* scip, /**< SCIP data structure */
26971  SCIP_VAR* var /**< problem variable */
26972  )
26973 {
26974  SCIP_Real cutoffdown;
26975  SCIP_Real cutoffup;
26976 
26977  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgCutoffScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26978 
26979  assert( var->scip == scip );
26980 
26983 
26984  return SCIPbranchGetScore(scip->set, var, cutoffdown, cutoffup);
26985 }
26986 
26987 /** returns the variable's average inference/cutoff score value, weighting the cutoffs of the variable with the given
26988  * factor
26989  *
26990  * @return the variable's average inference/cutoff score value
26991  *
26992  * @pre This method can be called if @p scip is in one of the following stages:
26993  * - \ref SCIP_STAGE_INITPRESOLVE
26994  * - \ref SCIP_STAGE_PRESOLVING
26995  * - \ref SCIP_STAGE_EXITPRESOLVE
26996  * - \ref SCIP_STAGE_PRESOLVED
26997  * - \ref SCIP_STAGE_INITSOLVE
26998  * - \ref SCIP_STAGE_SOLVING
26999  * - \ref SCIP_STAGE_SOLVED
27000  */
27002  SCIP* scip, /**< SCIP data structure */
27003  SCIP_VAR* var, /**< problem variable */
27004  SCIP_Real cutoffweight /**< factor to weigh average number of cutoffs in branching score */
27005  )
27006 {
27007  SCIP_Real avginferdown;
27008  SCIP_Real avginferup;
27009  SCIP_Real avginfer;
27010  SCIP_Real inferdown;
27011  SCIP_Real inferup;
27012  SCIP_Real cutoffdown;
27013  SCIP_Real cutoffup;
27014 
27015  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferenceCutoffScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
27016 
27017  assert( var->scip == scip );
27018 
27021  avginfer = (avginferdown + avginferup)/2.0;
27022  inferdown = SCIPvarGetAvgInferences(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
27023  inferup = SCIPvarGetAvgInferences(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
27024  cutoffdown = SCIPvarGetAvgCutoffs(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
27025  cutoffup = SCIPvarGetAvgCutoffs(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
27026 
27027  return SCIPbranchGetScore(scip->set, var,
27028  inferdown + cutoffweight * avginfer * cutoffdown, inferup + cutoffweight * avginfer * cutoffup);
27029 }
27030 
27031 /** returns the variable's average inference/cutoff score value, weighting the cutoffs of the variable with the given
27032  * factor, only using inferences and cutoffs of the current run
27033  *
27034  * @return the variable's average inference/cutoff score value, only using inferences and cutoffs of the current run
27035  *
27036  * @pre This method can be called if @p scip is in one of the following stages:
27037  * - \ref SCIP_STAGE_INITPRESOLVE
27038  * - \ref SCIP_STAGE_PRESOLVING
27039  * - \ref SCIP_STAGE_EXITPRESOLVE
27040  * - \ref SCIP_STAGE_PRESOLVED
27041  * - \ref SCIP_STAGE_INITSOLVE
27042  * - \ref SCIP_STAGE_SOLVING
27043  * - \ref SCIP_STAGE_SOLVED
27044  */
27046  SCIP* scip, /**< SCIP data structure */
27047  SCIP_VAR* var, /**< problem variable */
27048  SCIP_Real cutoffweight /**< factor to weigh average number of cutoffs in branching score */
27049  )
27050 {
27051  SCIP_Real avginferdown;
27052  SCIP_Real avginferup;
27053  SCIP_Real avginfer;
27054  SCIP_Real inferdown;
27055  SCIP_Real inferup;
27056  SCIP_Real cutoffdown;
27057  SCIP_Real cutoffup;
27058 
27059  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferenceCutoffScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
27060 
27061  assert( var->scip == scip );
27062 
27065  avginfer = (avginferdown + avginferup)/2.0;
27070 
27071  return SCIPbranchGetScore(scip->set, var,
27072  inferdown + cutoffweight * avginfer * cutoffdown, inferup + cutoffweight * avginfer * cutoffup);
27073 }
27074 
27075 /** outputs variable information to file stream via the message system
27076  *
27077  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27078  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27079  *
27080  * @pre This method can be called if @p scip is in one of the following stages:
27081  * - \ref SCIP_STAGE_PROBLEM
27082  * - \ref SCIP_STAGE_TRANSFORMING
27083  * - \ref SCIP_STAGE_TRANSFORMED
27084  * - \ref SCIP_STAGE_INITPRESOLVE
27085  * - \ref SCIP_STAGE_PRESOLVING
27086  * - \ref SCIP_STAGE_EXITPRESOLVE
27087  * - \ref SCIP_STAGE_PRESOLVED
27088  * - \ref SCIP_STAGE_INITSOLVE
27089  * - \ref SCIP_STAGE_SOLVING
27090  * - \ref SCIP_STAGE_SOLVED
27091  * - \ref SCIP_STAGE_EXITSOLVE
27092  * - \ref SCIP_STAGE_FREETRANS
27093  *
27094  * @note If the message handler is set to a NULL pointer nothing will be printed
27095  */
27097  SCIP* scip, /**< SCIP data structure */
27098  SCIP_VAR* var, /**< problem variable */
27099  FILE* file /**< output file (or NULL for standard output) */
27100  )
27101 {
27102  SCIP_CALL( checkStage(scip, "SCIPprintVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
27103 
27104  SCIP_CALL( SCIPvarPrint(var, scip->set, scip->messagehdlr, file) );
27105 
27106  return SCIP_OKAY;
27107 }
27108 
27109 /*
27110  * conflict analysis methods
27111  */
27112 
27113 /** return TRUE if conflict analysis is applicable; In case the function return FALSE there is no need to initialize the
27114  * conflict analysis since it will not be applied
27115  *
27116  * @return return TRUE if conflict analysis is applicable; In case the function return FALSE there is no need to initialize the
27117  * conflict analysis since it will not be applied
27118  *
27119  * @pre This method can be called if SCIP is in one of the following stages:
27120  * - \ref SCIP_STAGE_INITPRESOLVE
27121  * - \ref SCIP_STAGE_PRESOLVING
27122  * - \ref SCIP_STAGE_EXITPRESOLVE
27123  * - \ref SCIP_STAGE_SOLVING
27124  *
27125  * @note SCIP stage does not get changed
27126  */
27128  SCIP* scip /**< SCIP data structure */
27129  )
27130 {
27131  SCIP_CALL_ABORT( checkStage(scip, "SCIPisConflictAnalysisApplicable", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27132 
27133  return (SCIPgetDepth(scip) > 0 && SCIPconflictApplicable(scip->set));
27134 }
27135 
27136 /** initializes the conflict analysis by clearing the conflict candidate queue; this method must be called before you
27137  * enter the conflict variables by calling SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(),
27138  * SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or SCIPaddConflictBinvar();
27139  *
27140  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27141  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27142  *
27143  * @pre This method can be called if SCIP is in one of the following stages:
27144  * - \ref SCIP_STAGE_PRESOLVING
27145  * - \ref SCIP_STAGE_SOLVING
27146  *
27147  * @note SCIP stage does not get changed
27148  */
27150  SCIP* scip, /**< SCIP data structure */
27151  SCIP_CONFTYPE conftype, /**< type of conflict */
27152  SCIP_Bool iscutoffinvolved /**< is the current cutoff bound involved? */
27153  )
27154 {
27155  SCIP_CALL( checkStage(scip, "SCIPinitConflictAnalysis", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27156 
27157  SCIP_CALL( SCIPconflictInit(scip->conflict, scip->set, scip->stat, scip->transprob, conftype, iscutoffinvolved) );
27158 
27159  return SCIP_OKAY;
27160 }
27161 
27162 /** adds lower bound of variable at the time of the given bound change index to the conflict analysis' candidate storage;
27163  * this method should be called in one of the following two cases:
27164  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictLb() should be called for each lower bound
27165  * that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
27166  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictLb() should be called
27167  * for each lower bound, whose current assignment led to the deduction of the given conflict bound.
27168  *
27169  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27170  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27171  *
27172  * @pre This method can be called if SCIP is in one of the following stages:
27173  * - \ref SCIP_STAGE_PRESOLVING
27174  * - \ref SCIP_STAGE_SOLVING
27175  *
27176  * @note SCIP stage does not get changed
27177  */
27179  SCIP* scip, /**< SCIP data structure */
27180  SCIP_VAR* var, /**< variable whose lower bound should be added to conflict candidate queue */
27181  SCIP_BDCHGIDX* bdchgidx /**< bound change index representing time on path to current node, when the
27182  * conflicting bound was valid, NULL for current local bound */
27183  )
27184 {
27185  SCIP_CALL( checkStage(scip, "SCIPaddConflictLb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27186 
27187  assert( var->scip == scip );
27188 
27189  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_LOWER, bdchgidx) );
27190 
27191  return SCIP_OKAY;
27192 }
27193 
27194 /** adds lower bound of variable at the time of the given bound change index to the conflict analysis' candidate storage
27195  * with the additional information of a relaxed lower bound; this relaxed lower bound is the one which would be enough
27196  * to explain a certain bound change;
27197  * this method should be called in one of the following two cases:
27198  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictRelaxedLb() should be called for each (relaxed) lower bound
27199  * that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
27200  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictRelexedLb() should be called
27201  * for each (relaxed) lower bound, whose current assignment led to the deduction of the given conflict bound.
27202  *
27203  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27204  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27205  *
27206  * @pre This method can be called if SCIP is in one of the following stages:
27207  * - \ref SCIP_STAGE_PRESOLVING
27208  * - \ref SCIP_STAGE_SOLVING
27209  *
27210  * @note SCIP stage does not get changed
27211  */
27213  SCIP* scip, /**< SCIP data structure */
27214  SCIP_VAR* var, /**< variable whose lower bound should be added to conflict candidate queue */
27215  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node, when the
27216  * conflicting bound was valid, NULL for current local bound */
27217  SCIP_Real relaxedlb /**< the relaxed lower bound */
27218  )
27219 {
27220  SCIP_CALL( checkStage(scip, "SCIPaddConflictRelaxedLb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27221 
27222  assert( var->scip == scip );
27223 
27224  SCIP_CALL( SCIPconflictAddRelaxedBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_LOWER, bdchgidx, relaxedlb) );
27225 
27226  return SCIP_OKAY;
27227 }
27228 
27229 /** adds upper bound of variable at the time of the given bound change index to the conflict analysis' candidate storage;
27230  * this method should be called in one of the following two cases:
27231  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictUb() should be called for each upper bound that
27232  * led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
27233  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictUb() should be called for
27234  * each upper bound, whose current assignment led to the deduction of the given conflict bound.
27235  *
27236  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27237  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27238  *
27239  * @pre This method can be called if SCIP is in one of the following stages:
27240  * - \ref SCIP_STAGE_PRESOLVING
27241  * - \ref SCIP_STAGE_SOLVING
27242  *
27243  * @note SCIP stage does not get changed
27244  */
27246  SCIP* scip, /**< SCIP data structure */
27247  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
27248  SCIP_BDCHGIDX* bdchgidx /**< bound change index representing time on path to current node, when the
27249  * conflicting bound was valid, NULL for current local bound */
27250  )
27251 {
27252  SCIP_CALL( checkStage(scip, "SCIPaddConflictUb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27253 
27254  assert( var->scip == scip );
27255 
27256  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_UPPER, bdchgidx) );
27257 
27258  return SCIP_OKAY;
27259 }
27260 
27261 /** adds upper bound of variable at the time of the given bound change index to the conflict analysis' candidate storage
27262  * with the additional information of a relaxed upper bound; this relaxed upper bound is the one which would be enough
27263  * to explain a certain bound change;
27264  * this method should be called in one of the following two cases:
27265  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictRelaxedUb() should be called for each (relaxed) upper
27266  * bound that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
27267  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictRelaxedUb() should be
27268  * called for each (relaxed) upper bound, whose current assignment led to the deduction of the given conflict
27269  * bound.
27270  *
27271  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27272  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27273  *
27274  * @pre This method can be called if SCIP is in one of the following stages:
27275  * - \ref SCIP_STAGE_PRESOLVING
27276  * - \ref SCIP_STAGE_SOLVING
27277  *
27278  * @note SCIP stage does not get changed
27279  */
27281  SCIP* scip, /**< SCIP data structure */
27282  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
27283  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node, when the
27284  * conflicting bound was valid, NULL for current local bound */
27285  SCIP_Real relaxedub /**< the relaxed upper bound */
27286  )
27287 {
27288  SCIP_CALL( checkStage(scip, "SCIPaddConflictRelaxedUb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27289 
27290  assert( var->scip == scip );
27291 
27292  SCIP_CALL( SCIPconflictAddRelaxedBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_UPPER, bdchgidx, relaxedub) );
27293 
27294  return SCIP_OKAY;
27295 }
27296 
27297 /** adds lower or upper bound of variable at the time of the given bound change index to the conflict analysis' candidate
27298  * storage; this method should be called in one of the following two cases:
27299  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictBd() should be called for each bound
27300  * that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
27301  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictBd() should be called
27302  * for each bound, whose current assignment led to the deduction of the given conflict bound.
27303  *
27304  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27305  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27306  *
27307  * @pre This method can be called if SCIP is in one of the following stages:
27308  * - \ref SCIP_STAGE_PRESOLVING
27309  * - \ref SCIP_STAGE_SOLVING
27310  *
27311  * @note SCIP stage does not get changed
27312  */
27314  SCIP* scip, /**< SCIP data structure */
27315  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
27316  SCIP_BOUNDTYPE boundtype, /**< the type of the conflicting bound (lower or upper bound) */
27317  SCIP_BDCHGIDX* bdchgidx /**< bound change index representing time on path to current node, when the
27318  * conflicting bound was valid, NULL for current local bound */
27319  )
27320 {
27321  SCIP_CALL( checkStage(scip, "SCIPaddConflictBd", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27322 
27323  assert( var->scip == scip );
27324 
27325  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, boundtype, bdchgidx) );
27326 
27327  return SCIP_OKAY;
27328 }
27329 
27330 /** adds lower or upper bound of variable at the time of the given bound change index to the conflict analysis'
27331  * candidate storage; with the additional information of a relaxed upper bound; this relaxed upper bound is the one
27332  * which would be enough to explain a certain bound change;
27333  * this method should be called in one of the following two cases:
27334  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictRelaxedBd() should be called for each (relaxed)
27335  * bound that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
27336  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictRelaxedBd() should be
27337  * called for each (relaxed) bound, whose current assignment led to the deduction of the given conflict bound.
27338  *
27339  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27340  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27341  *
27342  * @pre This method can be called if SCIP is in one of the following stages:
27343  * - \ref SCIP_STAGE_PRESOLVING
27344  * - \ref SCIP_STAGE_SOLVING
27345  *
27346  * @note SCIP stage does not get changed
27347  */
27349  SCIP* scip, /**< SCIP data structure */
27350  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
27351  SCIP_BOUNDTYPE boundtype, /**< the type of the conflicting bound (lower or upper bound) */
27352  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node, when the
27353  * conflicting bound was valid, NULL for current local bound */
27354  SCIP_Real relaxedbd /**< the relaxed bound */
27355  )
27356 {
27357  SCIP_CALL( checkStage(scip, "SCIPaddConflictRelaxedBd", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27358 
27359  assert( var->scip == scip );
27360 
27361  SCIP_CALL( SCIPconflictAddRelaxedBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, boundtype, bdchgidx, relaxedbd) );
27362 
27363  return SCIP_OKAY;
27364 }
27365 
27366 /** adds changed bound of fixed binary variable to the conflict analysis' candidate storage;
27367  * this method should be called in one of the following two cases:
27368  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictBinvar() should be called for each fixed binary
27369  * variable that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
27370  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictBinvar() should be called
27371  * for each binary variable, whose current fixing led to the deduction of the given conflict bound.
27372  *
27373  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27374  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27375  *
27376  * @pre This method can be called if SCIP is in one of the following stages:
27377  * - \ref SCIP_STAGE_PRESOLVING
27378  * - \ref SCIP_STAGE_SOLVING
27379  *
27380  * @note SCIP stage does not get changed
27381  */
27383  SCIP* scip, /**< SCIP data structure */
27384  SCIP_VAR* var /**< binary variable whose changed bound should be added to conflict queue */
27385  )
27386 {
27387  SCIP_CALL( checkStage(scip, "SCIPaddConflictBinvar", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27388 
27389  assert(var->scip == scip);
27390  assert(SCIPvarIsBinary(var));
27391 
27392  if( SCIPvarGetLbLocal(var) > 0.5 )
27393  {
27394  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_LOWER, NULL) );
27395  }
27396  else if( SCIPvarGetUbLocal(var) < 0.5 )
27397  {
27398  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_UPPER, NULL) );
27399  }
27400 
27401  return SCIP_OKAY;
27402 }
27403 
27404 /** checks if the given variable is already part of the current conflict set or queued for resolving with the same or
27405  * even stronger bound
27406  *
27407  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27408  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27409  *
27410  * @pre This method can be called if SCIP is in one of the following stages:
27411  * - \ref SCIP_STAGE_PRESOLVING
27412  * - \ref SCIP_STAGE_SOLVING
27413  *
27414  * @note SCIP stage does not get changed
27415  */
27417  SCIP* scip, /**< SCIP data structure */
27418  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
27419  SCIP_BOUNDTYPE boundtype, /**< the type of the conflicting bound (lower or upper bound) */
27420  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node, when the
27421  * conflicting bound was valid, NULL for current local bound */
27422  SCIP_Bool* used /**< pointer to store if the variable is already used */
27423  )
27424 {
27425  SCIP_CALL_ABORT( checkStage(scip, "SCIPisConflictVarUsed", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27426 
27427  assert( var->scip == scip );
27428 
27429  return SCIPconflictIsVarUsed(scip->conflict, var, scip->set, boundtype, bdchgidx, used);
27430 }
27431 
27432 /** returns the conflict lower bound if the variable is present in the current conflict set; otherwise the global lower
27433  * bound
27434  *
27435  * @return returns the conflict lower bound if the variable is present in the current conflict set; otherwise the global lower
27436  * bound
27437  *
27438  * @pre This method can be called if SCIP is in one of the following stages:
27439  * - \ref SCIP_STAGE_PRESOLVING
27440  * - \ref SCIP_STAGE_SOLVING
27441  *
27442  * @note SCIP stage does not get changed
27443  */
27445  SCIP* scip, /**< SCIP data structure */
27446  SCIP_VAR* var /**< problem variable */
27447  )
27448 {
27449  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetConflictVarLb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27450 
27451  assert( var->scip == scip );
27452 
27453  return SCIPconflictGetVarLb(scip->conflict, var);
27454 }
27455 
27456 /** returns the conflict upper bound if the variable is present in the current conflict set; otherwise minus global
27457  * upper bound
27458  *
27459  * @return returns the conflict upper bound if the variable is present in the current conflict set; otherwise minus global
27460  * upper bound
27461  *
27462  * @pre This method can be called if SCIP is in one of the following stages:
27463  * - \ref SCIP_STAGE_PRESOLVING
27464  * - \ref SCIP_STAGE_SOLVING
27465  *
27466  * @note SCIP stage does not get changed
27467  */
27469  SCIP* scip, /**< SCIP data structure */
27470  SCIP_VAR* var /**< problem variable */
27471  )
27472 {
27473  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetConflictVarUb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27474 
27475  assert( var->scip == scip );
27476 
27477  return SCIPconflictGetVarUb(scip->conflict, var);
27478 }
27479 
27480 /** analyzes conflict bounds that were added after a call to SCIPinitConflictAnalysis() with calls to
27481  * SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(), SCIPaddConflictRelaxedLb(),
27482  * SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or SCIPaddConflictBinvar(); on success, calls the conflict
27483  * handlers to create a conflict constraint out of the resulting conflict set; the given valid depth must be a depth
27484  * level, at which the conflict set defined by calls to SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(),
27485  * SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), and SCIPaddConflictBinvar() is
27486  * valid for the whole subtree; if the conflict was found by a violated constraint, use SCIPanalyzeConflictCons()
27487  * instead of SCIPanalyzeConflict() to make sure, that the correct valid depth is used
27488  *
27489  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27490  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27491  *
27492  * @pre This method can be called if SCIP is in one of the following stages:
27493  * - \ref SCIP_STAGE_PRESOLVING
27494  * - \ref SCIP_STAGE_SOLVING
27495  *
27496  * @note SCIP stage does not get changed
27497  */
27499  SCIP* scip, /**< SCIP data structure */
27500  int validdepth, /**< minimal depth level at which the initial conflict set is valid */
27501  SCIP_Bool* success /**< pointer to store whether a conflict constraint was created, or NULL */
27502  )
27503 {
27504  SCIP_CALL( checkStage(scip, "SCIPanalyzeConflict", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27505 
27506  SCIP_CALL( SCIPconflictAnalyze(scip->conflict, scip->mem->probmem, scip->set, scip->stat,
27507  scip->transprob, scip->tree, validdepth, success) );
27508 
27509  return SCIP_OKAY;
27510 }
27511 
27512 /** analyzes conflict bounds that were added with calls to SCIPaddConflictLb(), SCIPaddConflictUb(),
27513  * SCIPaddConflictBd(), SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or
27514  * SCIPaddConflictBinvar(); on success, calls the conflict handlers to create a conflict constraint out of the
27515  * resulting conflict set; the given constraint must be the constraint that detected the conflict, i.e. the constraint
27516  * that is infeasible in the local bounds of the initial conflict set (defined by calls to SCIPaddConflictLb(),
27517  * SCIPaddConflictUb(), SCIPaddConflictBd(), SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(),
27518  * SCIPaddConflictRelaxedBd(), and SCIPaddConflictBinvar())
27519  *
27520  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27521  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27522  *
27523  * @pre This method can be called if SCIP is in one of the following stages:
27524  * - \ref SCIP_STAGE_PRESOLVING
27525  * - \ref SCIP_STAGE_SOLVING
27526  *
27527  * @note SCIP stage does not get changed
27528  */
27530  SCIP* scip, /**< SCIP data structure */
27531  SCIP_CONS* cons, /**< constraint that detected the conflict */
27532  SCIP_Bool* success /**< pointer to store whether a conflict constraint was created, or NULL */
27533  )
27534 {
27535  SCIP_CALL( checkStage(scip, "SCIPanalyzeConflictCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27536 
27537  if( SCIPconsIsGlobal(cons) )
27538  {
27539  SCIP_CALL( SCIPconflictAnalyze(scip->conflict, scip->mem->probmem, scip->set, scip->stat,
27540  scip->transprob, scip->tree, 0, success) );
27541  }
27542  else if( SCIPconsIsActive(cons) )
27543  {
27544  SCIP_CALL( SCIPconflictAnalyze(scip->conflict, scip->mem->probmem, scip->set, scip->stat,
27545  scip->transprob, scip->tree, SCIPconsGetValidDepth(cons), success) );
27546  }
27547 
27548  return SCIP_OKAY;
27549 }
27550 
27551 /*
27552  * constraint methods
27553  */
27554 
27555 /** creates and captures a constraint of the given constraint handler
27556  *
27557  * @warning If a constraint is marked to be checked for feasibility but not to be enforced, a LP or pseudo solution may
27558  * be declared feasible even if it violates this particular constraint. This constellation should only be
27559  * used, if no LP or pseudo solution can violate the constraint -- e.g. if a local constraint is redundant due
27560  * to the variable's local bounds.
27561  *
27562  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27563  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27564  *
27565  * @pre This method can be called if @p scip is in one of the following stages:
27566  * - \ref SCIP_STAGE_PROBLEM
27567  * - \ref SCIP_STAGE_TRANSFORMING
27568  * - \ref SCIP_STAGE_INITPRESOLVE
27569  * - \ref SCIP_STAGE_PRESOLVING
27570  * - \ref SCIP_STAGE_EXITPRESOLVE
27571  * - \ref SCIP_STAGE_PRESOLVED
27572  * - \ref SCIP_STAGE_INITSOLVE
27573  * - \ref SCIP_STAGE_SOLVING
27574  * - \ref SCIP_STAGE_EXITSOLVE
27575  *
27576  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
27577  */
27579  SCIP* scip, /**< SCIP data structure */
27580  SCIP_CONS** cons, /**< pointer to constraint */
27581  const char* name, /**< name of constraint */
27582  SCIP_CONSHDLR* conshdlr, /**< constraint handler for this constraint */
27583  SCIP_CONSDATA* consdata, /**< data for this specific constraint */
27584  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
27585  * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
27586  SCIP_Bool separate, /**< should the constraint be separated during LP processing?
27587  * Usually set to TRUE. */
27588  SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
27589  * TRUE for model constraints, FALSE for additional, redundant constraints. */
27590  SCIP_Bool check, /**< should the constraint be checked for feasibility?
27591  * TRUE for model constraints, FALSE for additional, redundant constraints. */
27592  SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
27593  * Usually set to TRUE. */
27594  SCIP_Bool local, /**< is constraint only valid locally?
27595  * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
27596  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
27597  * Usually set to FALSE. In column generation applications, set to TRUE if pricing
27598  * adds coefficients to this constraint. */
27599  SCIP_Bool dynamic, /**< is constraint subject to aging?
27600  * Usually set to FALSE. Set to TRUE for own cuts which
27601  * are separated as constraints. */
27602  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
27603  * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
27604  SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
27605  * if it may be moved to a more global node?
27606  * Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
27607  )
27608 {
27609  assert(cons != NULL);
27610  assert(name != NULL);
27611  assert(conshdlr != NULL);
27612 
27613  SCIP_CALL( checkStage(scip, "SCIPcreateCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
27614 
27615  switch( scip->set->stage )
27616  {
27617  case SCIP_STAGE_PROBLEM:
27618  SCIP_CALL( SCIPconsCreate(cons, scip->mem->probmem, scip->set, name, conshdlr, consdata,
27619  initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, TRUE, TRUE) );
27620  return SCIP_OKAY;
27621 
27625  case SCIP_STAGE_PRESOLVING:
27627  case SCIP_STAGE_PRESOLVED:
27628  case SCIP_STAGE_INITSOLVE:
27629  case SCIP_STAGE_SOLVING:
27630  case SCIP_STAGE_EXITSOLVE:
27631  SCIP_CALL( SCIPconsCreate(cons, scip->mem->probmem, scip->set, name, conshdlr, consdata,
27632  initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, FALSE, TRUE) );
27633  return SCIP_OKAY;
27634 
27635  default:
27636  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
27637  return SCIP_INVALIDCALL;
27638  } /*lint !e788*/
27639 }
27640 
27641 /** parses constraint information (in cip format) out of a string; if the parsing process was successful a constraint is
27642  * creates and captures;
27643  *
27644  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27645  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27646  *
27647  * @pre This method can be called if @p scip is in one of the following stages:
27648  * - \ref SCIP_STAGE_PROBLEM
27649  * - \ref SCIP_STAGE_TRANSFORMING
27650  * - \ref SCIP_STAGE_INITPRESOLVE
27651  * - \ref SCIP_STAGE_PRESOLVING
27652  * - \ref SCIP_STAGE_EXITPRESOLVE
27653  * - \ref SCIP_STAGE_PRESOLVED
27654  * - \ref SCIP_STAGE_SOLVING
27655  * - \ref SCIP_STAGE_EXITSOLVE
27656  *
27657  * @warning If a constraint is marked to be checked for feasibility but not to be enforced, a LP or pseudo solution may
27658  * be declared feasible even if it violates this particular constraint. This constellation should only be
27659  * used, if no LP or pseudo solution can violate the constraint -- e.g. if a local constraint is redundant due
27660  * to the variable's local bounds.
27661  */
27663  SCIP* scip, /**< SCIP data structure */
27664  SCIP_CONS** cons, /**< pointer to store constraint */
27665  const char* str, /**< string to parse for constraint */
27666  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
27667  * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
27668  SCIP_Bool separate, /**< should the constraint be separated during LP processing?
27669  * Usually set to TRUE. */
27670  SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
27671  * TRUE for model constraints, FALSE for additional, redundant constraints. */
27672  SCIP_Bool check, /**< should the constraint be checked for feasibility?
27673  * TRUE for model constraints, FALSE for additional, redundant constraints. */
27674  SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
27675  * Usually set to TRUE. */
27676  SCIP_Bool local, /**< is constraint only valid locally?
27677  * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
27678  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
27679  * Usually set to FALSE. In column generation applications, set to TRUE if pricing
27680  * adds coefficients to this constraint. */
27681  SCIP_Bool dynamic, /**< is constraint subject to aging?
27682  * Usually set to FALSE. Set to TRUE for own cuts which
27683  * are separated as constraints. */
27684  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
27685  * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
27686  SCIP_Bool stickingatnode, /**< should the constraint always be kept at the node where it was added, even
27687  * if it may be moved to a more global node?
27688  * Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
27689  SCIP_Bool* success /**< pointer to store if the paring process was successful */
27690  )
27691 {
27692  assert(cons != NULL);
27693 
27694  SCIP_CALL( checkStage(scip, "SCIPparseCons", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
27695 
27696  SCIP_CALL( SCIPconsParse(cons, scip->set, scip->messagehdlr, str,
27697  initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, success) );
27698 
27699 
27700  return SCIP_OKAY;
27701 }
27702 
27703 /** increases usage counter of constraint
27704  *
27705  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27706  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27707  *
27708  * @pre This method can be called if @p scip is in one of the following stages:
27709  * - \ref SCIP_STAGE_PROBLEM
27710  * - \ref SCIP_STAGE_TRANSFORMING
27711  * - \ref SCIP_STAGE_TRANSFORMED
27712  * - \ref SCIP_STAGE_INITPRESOLVE
27713  * - \ref SCIP_STAGE_PRESOLVING
27714  * - \ref SCIP_STAGE_EXITPRESOLVE
27715  * - \ref SCIP_STAGE_PRESOLVED
27716  * - \ref SCIP_STAGE_INITSOLVE
27717  * - \ref SCIP_STAGE_SOLVING
27718  * - \ref SCIP_STAGE_SOLVED
27719  */
27721  SCIP* scip, /**< SCIP data structure */
27722  SCIP_CONS* cons /**< constraint to capture */
27723  )
27724 {
27725  SCIP_CALL( checkStage(scip, "SCIPcaptureCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
27726 
27727  assert( cons->scip == scip );
27728 
27729  SCIPconsCapture(cons);
27730 
27731  return SCIP_OKAY;
27732 }
27733 
27734 /** decreases usage counter of constraint, if the usage pointer reaches zero the constraint gets freed
27735  *
27736  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27737  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27738  *
27739  * @pre This method can be called if @p scip is in one of the following stages:
27740  * - \ref SCIP_STAGE_PROBLEM
27741  * - \ref SCIP_STAGE_TRANSFORMING
27742  * - \ref SCIP_STAGE_TRANSFORMED
27743  * - \ref SCIP_STAGE_INITPRESOLVE
27744  * - \ref SCIP_STAGE_PRESOLVING
27745  * - \ref SCIP_STAGE_EXITPRESOLVE
27746  * - \ref SCIP_STAGE_PRESOLVED
27747  * - \ref SCIP_STAGE_INITSOLVE
27748  * - \ref SCIP_STAGE_SOLVING
27749  * - \ref SCIP_STAGE_SOLVED
27750  * - \ref SCIP_STAGE_EXITSOLVE
27751  * - \ref SCIP_STAGE_FREETRANS
27752  *
27753  * @note the pointer of the constraint will be NULLed
27754  */
27756  SCIP* scip, /**< SCIP data structure */
27757  SCIP_CONS** cons /**< pointer to constraint */
27758  )
27759 {
27760  assert(cons != NULL);
27761  assert(*cons != NULL);
27762 
27763  SCIP_CALL( checkStage(scip, "SCIPreleaseCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
27764 
27765  switch( scip->set->stage )
27766  {
27767  case SCIP_STAGE_PROBLEM:
27768  SCIP_CALL( SCIPconsRelease(cons, scip->mem->probmem, scip->set) );
27769  return SCIP_OKAY;
27770 
27774  case SCIP_STAGE_PRESOLVING:
27776  case SCIP_STAGE_PRESOLVED:
27777  case SCIP_STAGE_INITSOLVE:
27778  case SCIP_STAGE_SOLVING:
27779  case SCIP_STAGE_SOLVED:
27780  case SCIP_STAGE_EXITSOLVE:
27781  case SCIP_STAGE_FREETRANS:
27782  if( SCIPconsIsOriginal(*cons) && (*cons)->nuses == 1 )
27783  {
27784  SCIPerrorMessage("cannot release last use of original constraint while the transformed problem exists\n");
27785  return SCIP_INVALIDCALL;
27786  }
27787  SCIP_CALL( SCIPconsRelease(cons, scip->mem->probmem, scip->set) );
27788  return SCIP_OKAY;
27789 
27790  default:
27791  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
27792  return SCIP_INVALIDCALL;
27793  } /*lint !e788*/
27794 }
27795 
27796 /** change constraint name
27797  *
27798  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27799  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27800  *
27801  * @pre This method can be called if @p scip is in one of the following stages:
27802  * - \ref SCIP_STAGE_PROBLEM
27803  *
27804  * @note to get the current name of a constraint, use SCIPconsGetName() from pub_cons.h
27805  */
27807  SCIP* scip, /**< SCIP data structure */
27808  SCIP_CONS* cons, /**< constraint */
27809  const char* name /**< new name of constraint */
27810  )
27811 {
27812  SCIP_CALL( checkStage(scip, "SCIPchgConsName", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE , FALSE, FALSE, FALSE) );
27813 
27814  assert( cons->scip == scip );
27815 
27816  if( SCIPgetStage(scip) != SCIP_STAGE_PROBLEM )
27817  {
27818  SCIPerrorMessage("constraint names can only be changed in problem creation stage\n");
27819  SCIPABORT();
27820  return SCIP_INVALIDCALL; /*lint !e527*/
27821  }
27822 
27823  /* remove constraint's name from the namespace if the constraint was already added */
27824  if( SCIPconsIsAdded(cons) )
27825  {
27826  SCIP_CALL( SCIPprobRemoveConsName(scip->origprob, cons) );
27827  }
27828 
27829  /* change constraint name */
27830  SCIP_CALL( SCIPconsChgName(cons, SCIPblkmem(scip), name) );
27831 
27832  /* add constraint's name to the namespace if the constraint was already added */
27833  if( SCIPconsIsAdded(cons) )
27834  {
27835  SCIP_CALL( SCIPprobAddConsName(scip->origprob, cons) );
27836  }
27837 
27838  return SCIP_OKAY;
27839 }
27840 
27841 /** sets the initial flag of the given constraint
27842  *
27843  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27844  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27845  *
27846  * @pre This method can be called if @p scip is in one of the following stages:
27847  * - \ref SCIP_STAGE_PROBLEM
27848  * - \ref SCIP_STAGE_TRANSFORMING
27849  * - \ref SCIP_STAGE_PRESOLVING
27850  * - \ref SCIP_STAGE_PRESOLVED
27851  * - \ref SCIP_STAGE_SOLVING
27852  */
27854  SCIP* scip, /**< SCIP data structure */
27855  SCIP_CONS* cons, /**< constraint */
27856  SCIP_Bool initial /**< new value */
27857  )
27858 {
27859  SCIP_CALL( checkStage(scip, "SCIPsetConsInitial", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27860 
27861  SCIP_CALL( SCIPconsSetInitial(cons, scip->set, scip->stat, initial) );
27862 
27863  return SCIP_OKAY;
27864 }
27865 
27866 /** sets the separate flag of the given constraint
27867  *
27868  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27869  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27870  *
27871  * @pre This method can be called if @p scip is in one of the following stages:
27872  * - \ref SCIP_STAGE_PROBLEM
27873  * - \ref SCIP_STAGE_TRANSFORMING
27874  * - \ref SCIP_STAGE_PRESOLVING
27875  * - \ref SCIP_STAGE_PRESOLVED
27876  * - \ref SCIP_STAGE_SOLVING
27877  */
27879  SCIP* scip, /**< SCIP data structure */
27880  SCIP_CONS* cons, /**< constraint */
27881  SCIP_Bool separate /**< new value */
27882  )
27883 {
27884  SCIP_CALL( checkStage(scip, "SCIPsetConsSeparated", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27885 
27886  SCIP_CALL( SCIPconsSetSeparated(cons, scip->set, separate) );
27887 
27888  return SCIP_OKAY;
27889 }
27890 
27891 /** sets the enforce flag of the given constraint
27892  *
27893  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27894  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27895  *
27896  * @pre This method can be called if @p scip is in one of the following stages:
27897  * - \ref SCIP_STAGE_PROBLEM
27898  * - \ref SCIP_STAGE_TRANSFORMING
27899  * - \ref SCIP_STAGE_PRESOLVING
27900  * - \ref SCIP_STAGE_PRESOLVED
27901  * - \ref SCIP_STAGE_SOLVING
27902  */
27904  SCIP* scip, /**< SCIP data structure */
27905  SCIP_CONS* cons, /**< constraint */
27906  SCIP_Bool enforce /**< new value */
27907  )
27908 {
27909  SCIP_CALL( checkStage(scip, "SCIPsetConsEnforced", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27910 
27911  SCIP_CALL( SCIPconsSetEnforced(cons, scip->set, enforce) );
27912 
27913  return SCIP_OKAY;
27914 }
27915 
27916 /** sets the check flag of the given constraint
27917  *
27918  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27919  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27920  *
27921  * @pre This method can be called if @p scip is in one of the following stages:
27922  * - \ref SCIP_STAGE_PROBLEM
27923  * - \ref SCIP_STAGE_TRANSFORMING
27924  * - \ref SCIP_STAGE_PRESOLVING
27925  * - \ref SCIP_STAGE_PRESOLVED
27926  * - \ref SCIP_STAGE_SOLVING
27927  */
27929  SCIP* scip, /**< SCIP data structure */
27930  SCIP_CONS* cons, /**< constraint */
27931  SCIP_Bool check /**< new value */
27932  )
27933 {
27934  SCIP_CALL( checkStage(scip, "SCIPsetConsChecked", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27935 
27936  SCIP_CALL( SCIPconsSetChecked(cons, scip->set, check) );
27937 
27938  return SCIP_OKAY;
27939 }
27940 
27941 /** sets the propagate flag of the given constraint
27942  *
27943  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27944  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27945  *
27946  * @pre This method can be called if @p scip is in one of the following stages:
27947  * - \ref SCIP_STAGE_PROBLEM
27948  * - \ref SCIP_STAGE_TRANSFORMING
27949  * - \ref SCIP_STAGE_PRESOLVING
27950  * - \ref SCIP_STAGE_PRESOLVED
27951  * - \ref SCIP_STAGE_SOLVING
27952  */
27954  SCIP* scip, /**< SCIP data structure */
27955  SCIP_CONS* cons, /**< constraint */
27956  SCIP_Bool propagate /**< new value */
27957  )
27958 {
27959  SCIP_CALL( checkStage(scip, "SCIPsetConsPropagated", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27960 
27961  SCIP_CALL( SCIPconsSetPropagated(cons, scip->set, propagate) );
27962 
27963  return SCIP_OKAY;
27964 }
27965 
27966 /** sets the local flag of the given constraint
27967  *
27968  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27969  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27970  *
27971  * @pre This method can be called if @p scip is in one of the following stages:
27972  * - \ref SCIP_STAGE_PROBLEM
27973  * - \ref SCIP_STAGE_TRANSFORMING
27974  * - \ref SCIP_STAGE_INITPRESOLVE
27975  * - \ref SCIP_STAGE_PRESOLVING
27976  * - \ref SCIP_STAGE_PRESOLVED
27977  * - \ref SCIP_STAGE_INITSOLVE
27978  * - \ref SCIP_STAGE_SOLVING
27979  */
27981  SCIP* scip, /**< SCIP data structure */
27982  SCIP_CONS* cons, /**< constraint */
27983  SCIP_Bool local /**< new value */
27984  )
27985 {
27986  SCIP_CALL( checkStage(scip, "SCIPsetConsLocal", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27987 
27988  SCIPconsSetLocal(cons, local);
27989 
27990  return SCIP_OKAY;
27991 }
27992 
27993 /** sets the modifiable flag of the given constraint
27994  *
27995  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27996  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27997  *
27998  * @pre This method can be called if @p scip is in one of the following stages:
27999  * - \ref SCIP_STAGE_PROBLEM
28000  * - \ref SCIP_STAGE_TRANSFORMING
28001  * - \ref SCIP_STAGE_PRESOLVING
28002  * - \ref SCIP_STAGE_PRESOLVED
28003  * - \ref SCIP_STAGE_SOLVING
28004  * - \ref SCIP_STAGE_EXITSOLVE
28005  */
28007  SCIP* scip, /**< SCIP data structure */
28008  SCIP_CONS* cons, /**< constraint */
28009  SCIP_Bool modifiable /**< new value */
28010  )
28011 {
28012  SCIP_CALL( checkStage(scip, "SCIPsetConsModifiable", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
28013 
28014  SCIPconsSetModifiable(cons, modifiable);
28015 
28016  return SCIP_OKAY;
28017 }
28018 
28019 /** sets the dynamic flag of the given constraint
28020  *
28021  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28022  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28023  *
28024  * @pre This method can be called if @p scip is in one of the following stages:
28025  * - \ref SCIP_STAGE_PROBLEM
28026  * - \ref SCIP_STAGE_TRANSFORMING
28027  * - \ref SCIP_STAGE_PRESOLVING
28028  * - \ref SCIP_STAGE_PRESOLVED
28029  * - \ref SCIP_STAGE_SOLVING
28030  */
28032  SCIP* scip, /**< SCIP data structure */
28033  SCIP_CONS* cons, /**< constraint */
28034  SCIP_Bool dynamic /**< new value */
28035  )
28036 {
28037  SCIP_CALL( checkStage(scip, "SCIPsetConsDynamic", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28038 
28039  SCIPconsSetDynamic(cons, dynamic);
28040 
28041  return SCIP_OKAY;
28042 }
28043 
28044 /** sets the removable flag of the given constraint
28045  *
28046  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28047  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28048  *
28049  * @pre This method can be called if @p scip is in one of the following stages:
28050  * - \ref SCIP_STAGE_PROBLEM
28051  * - \ref SCIP_STAGE_TRANSFORMING
28052  * - \ref SCIP_STAGE_PRESOLVING
28053  * - \ref SCIP_STAGE_PRESOLVED
28054  * - \ref SCIP_STAGE_SOLVING
28055  */
28057  SCIP* scip, /**< SCIP data structure */
28058  SCIP_CONS* cons, /**< constraint */
28059  SCIP_Bool removable /**< new value */
28060  )
28061 {
28062  SCIP_CALL( checkStage(scip, "SCIPsetConsRemovable", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28063 
28064  SCIPconsSetRemovable(cons, removable);
28065 
28066  return SCIP_OKAY;
28067 }
28068 
28069 /** sets the stickingatnode flag of the given constraint
28070  *
28071  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28072  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28073  *
28074  * @pre This method can be called if @p scip is in one of the following stages:
28075  * - \ref SCIP_STAGE_PROBLEM
28076  * - \ref SCIP_STAGE_TRANSFORMING
28077  * - \ref SCIP_STAGE_PRESOLVING
28078  * - \ref SCIP_STAGE_PRESOLVED
28079  * - \ref SCIP_STAGE_SOLVING
28080  */
28082  SCIP* scip, /**< SCIP data structure */
28083  SCIP_CONS* cons, /**< constraint */
28084  SCIP_Bool stickingatnode /**< new value */
28085  )
28086 {
28087  SCIP_CALL( checkStage(scip, "SCIPsetConsStickingAtNode", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28088 
28089  SCIPconsSetStickingAtNode(cons, stickingatnode);
28090 
28091  return SCIP_OKAY;
28092 }
28093 
28094 /** updates the flags of the first constraint according to the ones of the second constraint
28095  *
28096  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28097  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28098  *
28099  * @pre This method can be called if @p scip is in one of the following stages:
28100  * - \ref SCIP_STAGE_PROBLEM
28101  * - \ref SCIP_STAGE_TRANSFORMING
28102  * - \ref SCIP_STAGE_PRESOLVING
28103  * - \ref SCIP_STAGE_PRESOLVED
28104  * - \ref SCIP_STAGE_SOLVING
28105  */
28107  SCIP* scip, /**< SCIP data structure */
28108  SCIP_CONS* cons0, /**< constraint that should stay */
28109  SCIP_CONS* cons1 /**< constraint that should be deleted */
28110  )
28111 {
28112  SCIP_CALL( checkStage(scip, "SCIPupdateConsFlags", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28113 
28114  if( SCIPconsIsInitial(cons1) )
28115  {
28116  SCIP_CALL( SCIPsetConsInitial(scip, cons0, TRUE) );
28117  }
28118  if( SCIPconsIsSeparated(cons1) )
28119  {
28120  SCIP_CALL( SCIPsetConsSeparated(scip, cons0, TRUE) );
28121  }
28122  if( SCIPconsIsEnforced(cons1) )
28123  {
28124  SCIP_CALL( SCIPsetConsEnforced(scip, cons0, TRUE) );
28125  }
28126  if( SCIPconsIsChecked(cons1) )
28127  {
28128  SCIP_CALL( SCIPsetConsChecked(scip, cons0, TRUE) );
28129  }
28130  if( SCIPconsIsPropagated(cons1) )
28131  {
28132  SCIP_CALL( SCIPsetConsPropagated(scip, cons0, TRUE) );
28133  }
28134  if( !SCIPconsIsDynamic(cons1) )
28135  {
28136  SCIP_CALL( SCIPsetConsDynamic(scip, cons0, FALSE) );
28137  }
28138  if( !SCIPconsIsRemovable(cons1) )
28139  {
28140  SCIP_CALL( SCIPsetConsRemovable(scip, cons0, FALSE) );
28141  }
28142  if( SCIPconsIsStickingAtNode(cons1) )
28143  {
28144  SCIP_CALL( SCIPsetConsStickingAtNode(scip, cons0, TRUE) );
28145  }
28146 
28147  return SCIP_OKAY;
28148 }
28149 
28150 /** gets and captures transformed constraint of a given constraint; if the constraint is not yet transformed,
28151  * a new transformed constraint for this constraint is created
28152  *
28153  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28154  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28155  *
28156  * @pre This method can be called if @p scip is in one of the following stages:
28157  * - \ref SCIP_STAGE_TRANSFORMING
28158  * - \ref SCIP_STAGE_TRANSFORMED
28159  * - \ref SCIP_STAGE_INITPRESOLVE
28160  * - \ref SCIP_STAGE_PRESOLVING
28161  * - \ref SCIP_STAGE_EXITPRESOLVE
28162  * - \ref SCIP_STAGE_PRESOLVED
28163  * - \ref SCIP_STAGE_INITSOLVE
28164  * - \ref SCIP_STAGE_SOLVING
28165  */
28167  SCIP* scip, /**< SCIP data structure */
28168  SCIP_CONS* cons, /**< constraint to get/create transformed constraint for */
28169  SCIP_CONS** transcons /**< pointer to store the transformed constraint */
28170  )
28171 {
28172  assert(transcons != NULL);
28173  assert(cons->scip == scip);
28174 
28175  SCIP_CALL( checkStage(scip, "SCIPtransformCons", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28176 
28177  if( SCIPconsIsTransformed(cons) )
28178  {
28179  *transcons = cons;
28180  SCIPconsCapture(*transcons);
28181  }
28182  else
28183  {
28184  SCIP_CALL( SCIPconsTransform(cons, scip->mem->probmem, scip->set, transcons) );
28185  }
28186 
28187  return SCIP_OKAY;
28188 }
28189 
28190 /** gets and captures transformed constraints for an array of constraints;
28191  * if a constraint in the array is not yet transformed, a new transformed constraint for this constraint is created;
28192  * it is possible to call this method with conss == transconss
28193  *
28194  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28195  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28196  *
28197  * @pre This method can be called if @p scip is in one of the following stages:
28198  * - \ref SCIP_STAGE_TRANSFORMING
28199  * - \ref SCIP_STAGE_TRANSFORMED
28200  * - \ref SCIP_STAGE_INITPRESOLVE
28201  * - \ref SCIP_STAGE_PRESOLVING
28202  * - \ref SCIP_STAGE_EXITPRESOLVE
28203  * - \ref SCIP_STAGE_PRESOLVED
28204  * - \ref SCIP_STAGE_INITSOLVE
28205  * - \ref SCIP_STAGE_SOLVING
28206  */
28208  SCIP* scip, /**< SCIP data structure */
28209  int nconss, /**< number of constraints to get/create transformed constraints for */
28210  SCIP_CONS** conss, /**< array with constraints to get/create transformed constraints for */
28211  SCIP_CONS** transconss /**< array to store the transformed constraints */
28212  )
28213 {
28214  int c;
28215 
28216  assert(nconss == 0 || conss != NULL);
28217  assert(nconss == 0 || transconss != NULL);
28218 
28219  SCIP_CALL( checkStage(scip, "SCIPtransformConss", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28220 
28221  for( c = 0; c < nconss; ++c )
28222  {
28223  if( SCIPconsIsTransformed(conss[c]) )
28224  {
28225  transconss[c] = conss[c];
28226  SCIPconsCapture(transconss[c]);
28227  }
28228  else
28229  {
28230  SCIP_CALL( SCIPconsTransform(conss[c], scip->mem->probmem, scip->set, &transconss[c]) );
28231  }
28232  }
28233 
28234  return SCIP_OKAY;
28235 }
28236 
28237 /** gets corresponding transformed constraint of a given constraint;
28238  * returns NULL as transcons, if transformed constraint is not yet existing
28239  *
28240  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28241  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28242  *
28243  * @pre This method can be called if @p scip is in one of the following stages:
28244  * - \ref SCIP_STAGE_TRANSFORMING
28245  * - \ref SCIP_STAGE_TRANSFORMED
28246  * - \ref SCIP_STAGE_INITPRESOLVE
28247  * - \ref SCIP_STAGE_PRESOLVING
28248  * - \ref SCIP_STAGE_EXITPRESOLVE
28249  * - \ref SCIP_STAGE_PRESOLVED
28250  * - \ref SCIP_STAGE_INITSOLVE
28251  * - \ref SCIP_STAGE_SOLVING
28252  * - \ref SCIP_STAGE_SOLVED
28253  * - \ref SCIP_STAGE_EXITSOLVE
28254  * - \ref SCIP_STAGE_FREETRANS
28255  */
28257  SCIP* scip, /**< SCIP data structure */
28258  SCIP_CONS* cons, /**< constraint to get the transformed constraint for */
28259  SCIP_CONS** transcons /**< pointer to store the transformed constraint */
28260  )
28261 {
28262  assert(transcons != NULL);
28263  assert(cons->scip == scip);
28264 
28265  SCIP_CALL( checkStage(scip, "SCIPgetTransformedCons", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
28266 
28267  if( SCIPconsIsTransformed(cons) )
28268  *transcons = cons;
28269  else
28270  *transcons = SCIPconsGetTransformed(cons);
28271 
28272  return SCIP_OKAY;
28273 }
28274 
28275 /** gets corresponding transformed constraints for an array of constraints;
28276  * stores NULL in a transconss slot, if the transformed constraint is not yet existing;
28277  * it is possible to call this method with conss == transconss, but remember that constraints that are not
28278  * yet transformed will be replaced with NULL
28279  *
28280  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28281  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28282  *
28283  * @pre This method can be called if @p scip is in one of the following stages:
28284  * - \ref SCIP_STAGE_TRANSFORMING
28285  * - \ref SCIP_STAGE_TRANSFORMED
28286  * - \ref SCIP_STAGE_INITPRESOLVE
28287  * - \ref SCIP_STAGE_PRESOLVING
28288  * - \ref SCIP_STAGE_EXITPRESOLVE
28289  * - \ref SCIP_STAGE_PRESOLVED
28290  * - \ref SCIP_STAGE_INITSOLVE
28291  * - \ref SCIP_STAGE_SOLVING
28292  * - \ref SCIP_STAGE_SOLVED
28293  * - \ref SCIP_STAGE_EXITSOLVE
28294  * - \ref SCIP_STAGE_FREETRANS
28295  */
28297  SCIP* scip, /**< SCIP data structure */
28298  int nconss, /**< number of constraints to get the transformed constraints for */
28299  SCIP_CONS** conss, /**< constraints to get the transformed constraints for */
28300  SCIP_CONS** transconss /**< array to store the transformed constraints */
28301  )
28302 {
28303  int c;
28304 
28305  assert(nconss == 0 || conss != NULL);
28306  assert(nconss == 0 || transconss != NULL);
28307 
28308  SCIP_CALL( checkStage(scip, "SCIPgetTransformedConss", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
28309 
28310  for( c = 0; c < nconss; ++c )
28311  {
28312  if( SCIPconsIsTransformed(conss[c]) )
28313  transconss[c] = conss[c];
28314  else
28315  transconss[c] = SCIPconsGetTransformed(conss[c]);
28316  }
28317 
28318  return SCIP_OKAY;
28319 }
28320 
28321 /** adds given value to age of constraint, but age can never become negative;
28322  * should be called
28323  * - in constraint separation, if no cut was found for this constraint,
28324  * - in constraint enforcing, if constraint was feasible, and
28325  * - in constraint propagation, if no domain reduction was deduced;
28326  *
28327  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28328  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28329  *
28330  * @pre This method can be called if @p scip is in one of the following stages:
28331  * - \ref SCIP_STAGE_TRANSFORMED
28332  * - \ref SCIP_STAGE_PRESOLVING
28333  * - \ref SCIP_STAGE_PRESOLVED
28334  * - \ref SCIP_STAGE_SOLVING
28335  * - \ref SCIP_STAGE_SOLVED
28336  */
28338  SCIP* scip, /**< SCIP data structure */
28339  SCIP_CONS* cons, /**< constraint */
28340  SCIP_Real deltaage /**< value to add to the constraint's age */
28341  )
28342 {
28343  SCIP_CALL( checkStage(scip, "SCIPaddConsAge", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28344 
28345  SCIP_CALL( SCIPconsAddAge(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, deltaage, scip->reopt) );
28346 
28347  return SCIP_OKAY;
28348 }
28349 
28350 /** increases age of constraint by 1.0;
28351  * should be called
28352  * - in constraint separation, if no cut was found for this constraint,
28353  * - in constraint enforcing, if constraint was feasible, and
28354  * - in constraint propagation, if no domain reduction was deduced;
28355  *
28356  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28357  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28358  *
28359  * @pre This method can be called if @p scip is in one of the following stages:
28360  * - \ref SCIP_STAGE_TRANSFORMED
28361  * - \ref SCIP_STAGE_PRESOLVING
28362  * - \ref SCIP_STAGE_PRESOLVED
28363  * - \ref SCIP_STAGE_SOLVING
28364  * - \ref SCIP_STAGE_SOLVED
28365  */
28367  SCIP* scip, /**< SCIP data structure */
28368  SCIP_CONS* cons /**< constraint */
28369  )
28370 {
28371  SCIP_CALL( checkStage(scip, "SCIPincConsAge", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28372 
28373  SCIP_CALL( SCIPconsIncAge(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->reopt) );
28374 
28375  return SCIP_OKAY;
28376 }
28377 
28378 /** resets age of constraint to zero;
28379  * should be called
28380  * - in constraint separation, if a cut was found for this constraint,
28381  * - in constraint enforcing, if the constraint was violated, and
28382  * - in constraint propagation, if a domain reduction was deduced;
28383  *
28384  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28385  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28386  *
28387  * @pre This method can be called if @p scip is in one of the following stages:
28388  * - \ref SCIP_STAGE_TRANSFORMED
28389  * - \ref SCIP_STAGE_PRESOLVING
28390  * - \ref SCIP_STAGE_PRESOLVED
28391  * - \ref SCIP_STAGE_SOLVING
28392  * - \ref SCIP_STAGE_SOLVED
28393  */
28395  SCIP* scip, /**< SCIP data structure */
28396  SCIP_CONS* cons /**< constraint */
28397  )
28398 {
28399  SCIP_CALL( checkStage(scip, "SCIPresetConsAge", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28400 
28401  SCIP_CALL( SCIPconsResetAge(cons, scip->set) );
28402 
28403  return SCIP_OKAY;
28404 }
28405 
28406 /** enables constraint's separation, propagation, and enforcing capabilities
28407  *
28408  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28409  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28410  *
28411  * @pre This method can be called if @p scip is in one of the following stages:
28412  * - \ref SCIP_STAGE_TRANSFORMED
28413  * - \ref SCIP_STAGE_PRESOLVING
28414  * - \ref SCIP_STAGE_PRESOLVED
28415  * - \ref SCIP_STAGE_INITSOLVE
28416  * - \ref SCIP_STAGE_SOLVING
28417  * - \ref SCIP_STAGE_SOLVED
28418  */
28420  SCIP* scip, /**< SCIP data structure */
28421  SCIP_CONS* cons /**< constraint */
28422  )
28423 {
28424  SCIP_CALL( checkStage(scip, "SCIPenableCons", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28425 
28426  SCIP_CALL( SCIPconsEnable(cons, scip->set, scip->stat) );
28427 
28428  return SCIP_OKAY;
28429 }
28430 
28431 /** disables constraint's separation, propagation, and enforcing capabilities, s.t. the constraint is not propagated,
28432  * separated, and enforced anymore until it is enabled again with a call to SCIPenableCons();
28433  * in contrast to SCIPdelConsLocal() and SCIPdelConsNode(), the disabling is not associated to a node in the tree and
28434  * does not consume memory; therefore, the constraint is neither automatically enabled on leaving the node nor
28435  * automatically disabled again on entering the node again;
28436  * note that the constraints enforcing capabilities are necessary for the solution's feasibility, if the constraint
28437  * is a model constraint; that means, you must be sure that the constraint cannot be violated in the current subtree,
28438  * and you have to enable it again manually by calling SCIPenableCons(), if this subtree is left (e.g. by using
28439  * an appropriate event handler that watches the corresponding variables' domain changes)
28440  *
28441  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28442  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28443  *
28444  * @pre This method can be called if @p scip is in one of the following stages:
28445  * - \ref SCIP_STAGE_TRANSFORMED
28446  * - \ref SCIP_STAGE_INITPRESOLVE
28447  * - \ref SCIP_STAGE_PRESOLVING
28448  * - \ref SCIP_STAGE_PRESOLVED
28449  * - \ref SCIP_STAGE_INITSOLVE
28450  * - \ref SCIP_STAGE_SOLVING
28451  * - \ref SCIP_STAGE_SOLVED
28452  */
28454  SCIP* scip, /**< SCIP data structure */
28455  SCIP_CONS* cons /**< constraint */
28456  )
28457 {
28458  SCIP_CALL( checkStage(scip, "SCIPdisableCons", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28459 
28460  SCIP_CALL( SCIPconsDisable(cons, scip->set, scip->stat) );
28461 
28462  return SCIP_OKAY;
28463 }
28464 
28465 /** enables constraint's separation capabilities
28466  *
28467  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28468  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28469  *
28470  * @pre This method can be called if @p scip is in one of the following stages:
28471  * - \ref SCIP_STAGE_TRANSFORMED
28472  * - \ref SCIP_STAGE_PRESOLVING
28473  * - \ref SCIP_STAGE_PRESOLVED
28474  * - \ref SCIP_STAGE_INITSOLVE
28475  * - \ref SCIP_STAGE_SOLVING
28476  * - \ref SCIP_STAGE_SOLVED
28477  */
28479  SCIP* scip, /**< SCIP data structure */
28480  SCIP_CONS* cons /**< constraint */
28481  )
28482 {
28483  SCIP_CALL( checkStage(scip, "SCIPenableConsSeparation", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28484 
28485  SCIP_CALL( SCIPconsEnableSeparation(cons, scip->set) );
28486 
28487  return SCIP_OKAY;
28488 }
28489 
28490 /** disables constraint's separation capabilities s.t. the constraint is not separated anymore until the separation
28491  * is enabled again with a call to SCIPenableConsSeparation(); in contrast to SCIPdelConsLocal() and SCIPdelConsNode(),
28492  * the disabling is not associated to a node in the tree and does not consume memory; therefore, the constraint
28493  * is neither automatically enabled on leaving the node nor automatically disabled again on entering the node again
28494  *
28495  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28496  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28497  *
28498  * @pre This method can be called if @p scip is in one of the following stages:
28499  * - \ref SCIP_STAGE_TRANSFORMED
28500  * - \ref SCIP_STAGE_PRESOLVING
28501  * - \ref SCIP_STAGE_PRESOLVED
28502  * - \ref SCIP_STAGE_INITSOLVE
28503  * - \ref SCIP_STAGE_SOLVING
28504  * - \ref SCIP_STAGE_SOLVED
28505  */
28507  SCIP* scip, /**< SCIP data structure */
28508  SCIP_CONS* cons /**< constraint */
28509  )
28510 {
28511  SCIP_CALL( checkStage(scip, "SCIPdisableConsSeparation", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28512 
28513  SCIP_CALL( SCIPconsDisableSeparation(cons, scip->set) );
28514 
28515  return SCIP_OKAY;
28516 }
28517 
28518 /** enables constraint's propagation capabilities
28519  *
28520  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28521  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28522  *
28523  * @pre This method can be called if @p scip is in one of the following stages:
28524  * - \ref SCIP_STAGE_TRANSFORMED
28525  * - \ref SCIP_STAGE_INITPRESOLVE
28526  * - \ref SCIP_STAGE_PRESOLVING
28527  * - \ref SCIP_STAGE_EXITPRESOLVE
28528  * - \ref SCIP_STAGE_PRESOLVED
28529  * - \ref SCIP_STAGE_INITSOLVE
28530  * - \ref SCIP_STAGE_SOLVING
28531  * - \ref SCIP_STAGE_SOLVED
28532  */
28534  SCIP* scip, /**< SCIP data structure */
28535  SCIP_CONS* cons /**< constraint */
28536  )
28537 {
28538  SCIP_CALL( checkStage(scip, "SCIPenableConsPropagation", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28539 
28540  SCIP_CALL( SCIPconsEnablePropagation(cons, scip->set) );
28541 
28542  return SCIP_OKAY;
28543 }
28544 
28545 /** disables constraint's propagation capabilities s.t. the constraint is not propagated anymore until the propagation
28546  * is enabled again with a call to SCIPenableConsPropagation(); in contrast to SCIPdelConsLocal() and SCIPdelConsNode(),
28547  * the disabling is not associated to a node in the tree and does not consume memory; therefore, the constraint
28548  * is neither automatically enabled on leaving the node nor automatically disabled again on entering the node again
28549  *
28550  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28551  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28552  *
28553  * @pre This method can be called if @p scip is in one of the following stages:
28554  * - \ref SCIP_STAGE_TRANSFORMED
28555  * - \ref SCIP_STAGE_INITPRESOLVE
28556  * - \ref SCIP_STAGE_PRESOLVING
28557  * - \ref SCIP_STAGE_EXITPRESOLVE
28558  * - \ref SCIP_STAGE_PRESOLVED
28559  * - \ref SCIP_STAGE_INITSOLVE
28560  * - \ref SCIP_STAGE_SOLVING
28561  * - \ref SCIP_STAGE_SOLVED
28562  */
28564  SCIP* scip, /**< SCIP data structure */
28565  SCIP_CONS* cons /**< constraint */
28566  )
28567 {
28568  SCIP_CALL( checkStage(scip, "SCIPdisableConsPropagation", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28569 
28570  SCIP_CALL( SCIPconsDisablePropagation(cons, scip->set) );
28571 
28572  return SCIP_OKAY;
28573 }
28574 
28575 #undef SCIPmarkConsPropagate
28576 
28577 /** marks constraint to be propagated
28578  *
28579  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28580  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28581  *
28582  * @pre This method can be called if @p scip is in one of the following stages:
28583  * - \ref SCIP_STAGE_TRANSFORMING
28584  * - \ref SCIP_STAGE_TRANSFORMED
28585  * - \ref SCIP_STAGE_INITPRESOLVE
28586  * - \ref SCIP_STAGE_PRESOLVING
28587  * - \ref SCIP_STAGE_EXITPRESOLVE
28588  * - \ref SCIP_STAGE_PRESOLVED
28589  * - \ref SCIP_STAGE_INITSOLVE
28590  * - \ref SCIP_STAGE_SOLVING
28591  * - \ref SCIP_STAGE_SOLVED
28592  * - \ref SCIP_STAGE_EXITSOLVE
28593  *
28594  * @note if a constraint is marked to be propagated, the age of the constraint will be ignored for propagation
28595  */
28597  SCIP* scip, /**< SCIP data structure */
28598  SCIP_CONS* cons /**< constraint */
28599  )
28600 {
28601  SCIP_CALL( checkStage(scip, "SCIPmarkConsPropagate", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
28602 
28603  SCIP_CALL( SCIPconsMarkPropagate(cons, scip->set) );
28604 
28605  assert(!SCIPconsIsEnabled(cons) || SCIPconsIsMarkedPropagate(cons));
28606 
28607  return SCIP_OKAY;
28608 }
28609 
28610 /** unmarks the constraint to be propagated
28611  *
28612  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28613  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28614  *
28615  * @pre This method can be called if @p scip is in one of the following stages:
28616  * - \ref SCIP_STAGE_TRANSFORMED
28617  * - \ref SCIP_STAGE_PRESOLVING
28618  * - \ref SCIP_STAGE_EXITPRESOLVE
28619  * - \ref SCIP_STAGE_PRESOLVED
28620  * - \ref SCIP_STAGE_INITSOLVE
28621  * - \ref SCIP_STAGE_SOLVING
28622  * - \ref SCIP_STAGE_SOLVED
28623  */
28625  SCIP* scip, /**< SCIP data structure */
28626  SCIP_CONS* cons /**< constraint */
28627  )
28628 {
28629  SCIP_CALL( checkStage(scip, "SCIPunmarkConsPropagate", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28630 
28631  SCIP_CALL( SCIPconsUnmarkPropagate(cons, scip->set) );
28632 
28633  assert(!SCIPconsIsEnabled(cons) || !SCIPconsIsMarkedPropagate(cons));
28634 
28635  return SCIP_OKAY;
28636 }
28637 
28638 /** adds given values to lock status of the constraint and updates the rounding locks of the involved variables
28639  *
28640  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28641  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28642  *
28643  * @pre This method can be called if @p scip is in one of the following stages:
28644  * - \ref SCIP_STAGE_PROBLEM
28645  * - \ref SCIP_STAGE_TRANSFORMING
28646  * - \ref SCIP_STAGE_INITPRESOLVE
28647  * - \ref SCIP_STAGE_PRESOLVING
28648  * - \ref SCIP_STAGE_EXITPRESOLVE
28649  * - \ref SCIP_STAGE_INITSOLVE
28650  * - \ref SCIP_STAGE_SOLVING
28651  * - \ref SCIP_STAGE_EXITSOLVE
28652  * - \ref SCIP_STAGE_FREETRANS
28653  */
28655  SCIP* scip, /**< SCIP data structure */
28656  SCIP_CONS* cons, /**< constraint */
28657  int nlockspos, /**< increase in number of rounding locks for constraint */
28658  int nlocksneg /**< increase in number of rounding locks for constraint's negation */
28659  )
28660 {
28661  SCIP_CALL( checkStage(scip, "SCIPaddConsLocks", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE) );
28662 
28663  SCIP_CALL( SCIPconsAddLocks(cons, scip->set, nlockspos, nlocksneg) );
28664 
28665  return SCIP_OKAY;
28666 }
28667 
28668 /** checks single constraint for feasibility of the given solution
28669  *
28670  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28671  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28672  *
28673  * @pre This method can be called if @p scip is in one of the following stages:
28674  * - \ref SCIP_STAGE_PROBLEM
28675  * - \ref SCIP_STAGE_TRANSFORMED
28676  * - \ref SCIP_STAGE_INITPRESOLVE
28677  * - \ref SCIP_STAGE_PRESOLVING
28678  * - \ref SCIP_STAGE_EXITPRESOLVE
28679  * - \ref SCIP_STAGE_PRESOLVED
28680  * - \ref SCIP_STAGE_INITSOLVE
28681  * - \ref SCIP_STAGE_SOLVING
28682  * - \ref SCIP_STAGE_SOLVED
28683  */
28685  SCIP* scip, /**< SCIP data structure */
28686  SCIP_CONS* cons, /**< constraint to check */
28687  SCIP_SOL* sol, /**< primal CIP solution */
28688  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
28689  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
28690  SCIP_Bool printreason, /**< Should the reason for the violation be printed? */
28691  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28692  )
28693 {
28694  SCIP_CALL( checkStage(scip, "SCIPcheckCons", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28695 
28696  SCIP_CALL( SCIPconsCheck(cons, scip->set, sol, checkintegrality, checklprows, printreason, result) );
28697 
28698  return SCIP_OKAY;
28699 }
28700 
28701 /** enforces single constraint for a given pseudo solution
28702  *
28703  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28704  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28705  *
28706  * @pre This method can be called if @p scip is in one of the following stages:
28707  * - \ref SCIP_STAGE_SOLVING
28708  *
28709  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
28710  * added to SCIP beforehand.
28711  */
28713  SCIP* scip, /**< SCIP data structure */
28714  SCIP_CONS* cons, /**< constraint to enforce */
28715  SCIP_Bool solinfeasible, /**< was the solution already declared infeasible by a constraint handler? */
28716  SCIP_Bool objinfeasible, /**< is the solution infeasible anyway due to violating lower objective bound? */
28717  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28718  )
28719 {
28720  assert(scip != NULL);
28721  assert(cons != NULL);
28722  assert(!SCIPconsIsAdded(cons));
28723  assert(result != NULL);
28724 
28725  SCIP_CALL( checkStage(scip, "SCIPenfopsCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28726 
28727  SCIP_CALL( SCIPconsEnfops(cons, scip->set, solinfeasible, objinfeasible, result) );
28728 
28729  return SCIP_OKAY;
28730 }
28731 
28732 /** enforces single constraint for a given LP solution
28733  *
28734  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28735  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28736  *
28737  * @pre This method can be called if @p scip is in one of the following stages:
28738  * - \ref SCIP_STAGE_SOLVING
28739  *
28740  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
28741  * added to SCIP beforehand.
28742  */
28744  SCIP* scip, /**< SCIP data structure */
28745  SCIP_CONS* cons, /**< constraint to enforce */
28746  SCIP_Bool solinfeasible, /**< was the solution already declared infeasible by a constraint handler? */
28747  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28748  )
28749 {
28750  assert(scip != NULL);
28751  assert(cons != NULL);
28752  assert(!SCIPconsIsAdded(cons));
28753  assert(result != NULL);
28754 
28755  SCIP_CALL( checkStage(scip, "SCIPenfolpCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28756 
28757  SCIP_CALL( SCIPconsEnfolp(cons, scip->set, solinfeasible, result) );
28758 
28759  return SCIP_OKAY;
28760 }
28761 
28762 /** enforces single constraint for a given relaxation solution
28763  *
28764  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28765  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28766  *
28767  * @pre This method can be called if @p scip is in one of the following stages:
28768  * - \ref SCIP_STAGE_SOLVING
28769  *
28770  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
28771  * added to SCIP beforehand.
28772  */
28774  SCIP* scip, /**< SCIP data structure */
28775  SCIP_CONS* cons, /**< constraint to enforce */
28776  SCIP_SOL* sol, /**< solution to enforce */
28777  SCIP_Bool solinfeasible, /**< was the solution already declared infeasible by a constraint handler? */
28778  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28779  )
28780 {
28781  assert(scip != NULL);
28782  assert(cons != NULL);
28783  assert(!SCIPconsIsAdded(cons));
28784  assert(sol != NULL);
28785  assert(result != NULL);
28786 
28787  SCIP_CALL( checkStage(scip, "SCIPenforelaxCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28788 
28789  SCIP_CALL( SCIPconsEnforelax(cons, scip->set, sol, solinfeasible, result) );
28790 
28791  return SCIP_OKAY;
28792 }
28793 
28794 /** calls LP initialization method for single constraint
28795  *
28796  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28797  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28798  *
28799  * @pre This method can be called if @p scip is in one of the following stages:
28800  * - \ref SCIP_STAGE_SOLVING
28801  *
28802  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
28803  * added to SCIP beforehand.
28804  */
28806  SCIP* scip, /**< SCIP data structure */
28807  SCIP_CONS* cons, /**< constraint to initialize */
28808  SCIP_Bool* infeasible /**< pointer to store whether infeasibility was detected while building the LP */
28809  )
28810 {
28811  assert(scip != NULL);
28812  assert(cons != NULL);
28813  assert(!SCIPconsIsAdded(cons));
28814 
28815  SCIP_CALL( checkStage(scip, "SCIPinitlpCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28816 
28817  SCIP_CALL( SCIPconsInitlp(cons, scip->set, infeasible) );
28818 
28819  return SCIP_OKAY;
28820 }
28821 
28822 /** calls separation method of single constraint for LP solution
28823  *
28824  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28825  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28826  *
28827  * @pre This method can be called if @p scip is in one of the following stages:
28828  * - \ref SCIP_STAGE_SOLVING
28829  *
28830  * @note This is an advanced method and should be used with caution.
28831  */
28833  SCIP* scip, /**< SCIP data structure */
28834  SCIP_CONS* cons, /**< constraint to separate */
28835  SCIP_RESULT* result /**< pointer to store the result of the separation call */
28836  )
28837 {
28838  assert(scip != NULL);
28839  assert(cons != NULL);
28840  assert(result != NULL);
28841 
28842  SCIP_CALL( checkStage(scip, "SCIPsepalpCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28843 
28844  SCIP_CALL( SCIPconsSepalp(cons, scip->set, result) );
28845 
28846  return SCIP_OKAY;
28847 }
28848 
28849 /** calls separation method of single constraint for given primal solution
28850  *
28851  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28852  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28853  *
28854  * @pre This method can be called if @p scip is in one of the following stages:
28855  * - \ref SCIP_STAGE_SOLVING
28856  *
28857  * @note This is an advanced method and should be used with caution.
28858  */
28860  SCIP* scip, /**< SCIP data structure */
28861  SCIP_CONS* cons, /**< constraint to separate */
28862  SCIP_SOL* sol, /**< primal solution that should be separated*/
28863  SCIP_RESULT* result /**< pointer to store the result of the separation call */
28864  )
28865 {
28866  assert(scip != NULL);
28867  assert(cons != NULL);
28868  assert(sol != NULL);
28869  assert(result != NULL);
28870 
28871  SCIP_CALL( checkStage(scip, "SCIPsepasolCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28872 
28873  SCIP_CALL( SCIPconsSepasol(cons, scip->set, sol, result) );
28874 
28875  return SCIP_OKAY;
28876 }
28877 
28878 /** calls domain propagation method of single constraint
28879  *
28880  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28881  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28882  *
28883  * @pre This method can be called if @p scip is in one of the following stages:
28884  * - \ref SCIP_STAGE_PRESOLVING
28885  * - \ref SCIP_STAGE_SOLVING
28886  *
28887  * @note This is an advanced method and should be used with caution.
28888  */
28890  SCIP* scip, /**< SCIP data structure */
28891  SCIP_CONS* cons, /**< constraint to propagate */
28892  SCIP_PROPTIMING proptiming, /**< current point in the node solving loop */
28893  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28894  )
28895 {
28896  assert(scip != NULL);
28897  assert(cons != NULL);
28898  assert(result != NULL);
28899 
28900  SCIP_CALL( checkStage(scip, "SCIPpropCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28901 
28902  SCIP_CALL( SCIPconsProp(cons, scip->set, proptiming, result) );
28903 
28904  return SCIP_OKAY;
28905 }
28906 
28907 /** resolves propagation conflict of single constraint
28908  *
28909  *
28910  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28911  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28912  *
28913  * @pre This method can be called if @p scip is in one of the following stages:
28914  * - \ref SCIP_STAGE_PRESOLVING
28915  * - \ref SCIP_STAGE_SOLVING
28916  *
28917  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
28918  * added to SCIP beforehand.
28919  */
28921  SCIP* scip, /**< SCIP data structure */
28922  SCIP_CONS* cons, /**< constraint to resolve conflict for */
28923  SCIP_VAR* infervar, /**< the conflict variable whose bound change has to be resolved */
28924  int inferinfo, /**< the user information passed to the corresponding SCIPinferVarLbCons() or SCIPinferVarUbCons() call */
28925  SCIP_BOUNDTYPE boundtype, /**< the type of the changed bound (lower or upper bound) */
28926  SCIP_BDCHGIDX* bdchgidx, /**< the index of the bound change, representing the point of time where the change took place */
28927  SCIP_Real relaxedbd, /**< the relaxed bound which is sufficient to be explained */
28928  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28929  )
28930 {
28931  assert(scip != NULL);
28932  assert(cons != NULL);
28933  assert(!SCIPconsIsAdded(cons));
28934  assert(infervar != NULL);
28935  assert(bdchgidx != NULL);
28936  assert(result != NULL);
28937 
28938  SCIP_CALL( checkStage(scip, "SCIPrespropCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28939 
28940  SCIP_CALL( SCIPconsResprop(cons, scip->set, infervar, inferinfo, boundtype, bdchgidx, relaxedbd, result) );
28941 
28942  return SCIP_OKAY;
28943 }
28944 
28945 /** presolves of single constraint
28946  *
28947  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28948  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28949  *
28950  * @pre This method can be called if @p scip is in one of the following stages:
28951  * - \ref SCIP_STAGE_PRESOLVING
28952  *
28953  * @note This is an advanced method and should be used with caution.
28954  */
28956  SCIP* scip, /**< SCIP data structure */
28957  SCIP_CONS* cons, /**< constraint to presolve */
28958  int nrounds, /**< number of presolving rounds already done */
28959  SCIP_PRESOLTIMING presoltiming, /**< presolving timing(s) to be performed */
28960  int nnewfixedvars, /**< number of variables fixed since the last call to the presolving method */
28961  int nnewaggrvars, /**< number of variables aggregated since the last call to the presolving method */
28962  int nnewchgvartypes, /**< number of variable type changes since the last call to the presolving method */
28963  int nnewchgbds, /**< number of variable bounds tightened since the last call to the presolving method */
28964  int nnewholes, /**< number of domain holes added since the last call to the presolving method */
28965  int nnewdelconss, /**< number of deleted constraints since the last call to the presolving method */
28966  int nnewaddconss, /**< number of added constraints since the last call to the presolving method */
28967  int nnewupgdconss, /**< number of upgraded constraints since the last call to the presolving method */
28968  int nnewchgcoefs, /**< number of changed coefficients since the last call to the presolving method */
28969  int nnewchgsides, /**< number of changed left or right hand sides since the last call to the presolving method */
28970  int* nfixedvars, /**< pointer to count total number of variables fixed of all presolvers */
28971  int* naggrvars, /**< pointer to count total number of variables aggregated of all presolvers */
28972  int* nchgvartypes, /**< pointer to count total number of variable type changes of all presolvers */
28973  int* nchgbds, /**< pointer to count total number of variable bounds tightened of all presolvers */
28974  int* naddholes, /**< pointer to count total number of domain holes added of all presolvers */
28975  int* ndelconss, /**< pointer to count total number of deleted constraints of all presolvers */
28976  int* naddconss, /**< pointer to count total number of added constraints of all presolvers */
28977  int* nupgdconss, /**< pointer to count total number of upgraded constraints of all presolvers */
28978  int* nchgcoefs, /**< pointer to count total number of changed coefficients of all presolvers */
28979  int* nchgsides, /**< pointer to count total number of changed left/right hand sides of all presolvers */
28980  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28981  )
28982 {
28983  assert(scip != NULL);
28984  assert(cons != NULL);
28985  assert(nfixedvars != NULL);
28986  assert(naggrvars != NULL);
28987  assert(nchgvartypes != NULL);
28988  assert(nchgbds != NULL);
28989  assert(naddholes != NULL);
28990  assert(ndelconss != NULL);
28991  assert(naddconss != NULL);
28992  assert(nupgdconss != NULL);
28993  assert(nchgcoefs != NULL);
28994  assert(nchgsides != NULL);
28995  assert(result != NULL);
28996 
28997  SCIP_CALL( checkStage(scip, "SCIPpresolCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
28998 
28999  SCIP_CALL( SCIPconsPresol(cons, scip->set, nrounds, presoltiming, nnewfixedvars, nnewaggrvars, nnewchgvartypes, nnewchgbds, nnewholes,
29000  nnewdelconss, nnewaddconss, nnewupgdconss, nnewchgcoefs, nnewchgsides, nfixedvars, naggrvars, nchgvartypes,
29001  nchgbds, naddholes, ndelconss, naddconss, nupgdconss, nchgcoefs, nchgsides , result) );
29002 
29003  return SCIP_OKAY;
29004 }
29005 
29006 /** calls constraint activation notification method of single constraint
29007  *
29008  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29009  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29010  *
29011  * @pre This method can be called if @p scip is in one of the following stages:
29012  * - \ref SCIP_STAGE_TRANSFORMING
29013  *
29014  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
29015  * added to SCIP beforehand.
29016  */
29018  SCIP* scip, /**< SCIP data structure */
29019  SCIP_CONS* cons /**< constraint to notify */
29020  )
29021 {
29022  assert(scip != NULL);
29023  assert(cons != NULL);
29024  assert(!SCIPconsIsAdded(cons));
29025  assert(!SCIPconsIsDeleted(cons));
29026 
29027  SCIP_CALL( checkStage(scip, "SCIPactiveCons", FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
29028 
29029  SCIP_CALL( SCIPconsActive(cons, scip->set) );
29030 
29031  return SCIP_OKAY;
29032 }
29033 
29034 /** calls constraint deactivation notification method of single constraint
29035  *
29036  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29037  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29038  *
29039  * @pre This method can be called if @p scip is in one of the following stages:
29040  * - \ref SCIP_STAGE_PRESOLVING
29041  * - \ref SCIP_STAGE_SOLVING
29042  *
29043  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
29044  * added to SCIP beforehand.
29045  */
29047  SCIP* scip, /**< SCIP data structure */
29048  SCIP_CONS* cons /**< constraint to notify */
29049  )
29050 {
29051  assert(scip != NULL);
29052  assert(cons != NULL);
29053  assert(!SCIPconsIsAdded(cons));
29054 
29055  SCIP_CALL( checkStage(scip, "SCIPdeactiveCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29056 
29057  SCIP_CALL( SCIPconsDeactive(cons, scip->set) );
29058 
29059  return SCIP_OKAY;
29060 }
29061 
29062 /** outputs constraint information to file stream via the message handler system
29063  *
29064  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29065  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29066  *
29067  * @pre This method can be called if @p scip is in one of the following stages:
29068  * - \ref SCIP_STAGE_PROBLEM
29069  * - \ref SCIP_STAGE_TRANSFORMING
29070  * - \ref SCIP_STAGE_TRANSFORMED
29071  * - \ref SCIP_STAGE_INITPRESOLVE
29072  * - \ref SCIP_STAGE_PRESOLVING
29073  * - \ref SCIP_STAGE_EXITPRESOLVE
29074  * - \ref SCIP_STAGE_PRESOLVED
29075  * - \ref SCIP_STAGE_INITSOLVE
29076  * - \ref SCIP_STAGE_SOLVING
29077  * - \ref SCIP_STAGE_SOLVED
29078  * - \ref SCIP_STAGE_EXITSOLVE
29079  * - \ref SCIP_STAGE_FREETRANS
29080  *
29081  * @note If the message handler is set to a NULL pointer nothing will be printed.
29082  * @note The file stream will not be flushed directly, this can be achieved by calling SCIPinfoMessage() printing a
29083  * newline character.
29084  */
29086  SCIP* scip, /**< SCIP data structure */
29087  SCIP_CONS* cons, /**< constraint */
29088  FILE* file /**< output file (or NULL for standard output) */
29089  )
29090 {
29091  SCIP_CALL( checkStage(scip, "SCIPprintCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
29092 
29093  SCIP_CALL( SCIPconsPrint(cons, scip->set, scip->messagehdlr, file) );
29094 
29095  return SCIP_OKAY;
29096 }
29097 
29098 /** method to collect the variables of a constraint
29099  *
29100  * If the number of variables is greater than the available slots in the variable array, nothing happens except that
29101  * the success point is set to FALSE. With the method SCIPgetConsNVars() it is possible to get the number of variables
29102  * a constraint has in its scope.
29103  *
29104  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29105  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29106  *
29107  * @pre This method can be called if @p scip is in one of the following stages:
29108  * - \ref SCIP_STAGE_PROBLEM
29109  * - \ref SCIP_STAGE_TRANSFORMING
29110  * - \ref SCIP_STAGE_TRANSFORMED
29111  * - \ref SCIP_STAGE_INITPRESOLVE
29112  * - \ref SCIP_STAGE_PRESOLVING
29113  * - \ref SCIP_STAGE_EXITPRESOLVE
29114  * - \ref SCIP_STAGE_PRESOLVED
29115  * - \ref SCIP_STAGE_INITSOLVE
29116  * - \ref SCIP_STAGE_SOLVING
29117  * - \ref SCIP_STAGE_SOLVED
29118  * - \ref SCIP_STAGE_EXITSOLVE
29119  * - \ref SCIP_STAGE_FREETRANS
29120  *
29121  * @note The success pointer indicates if all variables were copied into the vars arrray.
29122  *
29123  * @note It might be that a constraint handler does not support this functionality, in that case the success pointer is
29124  * set to FALSE.
29125  */
29127  SCIP* scip, /**< SCIP data structure */
29128  SCIP_CONS* cons, /**< constraint for which the variables are wanted */
29129  SCIP_VAR** vars, /**< array to store the involved variable of the constraint */
29130  int varssize, /**< available slots in vars array which is needed to check if the array is large enough */
29131  SCIP_Bool* success /**< pointer to store whether the variables are successfully copied */
29132  )
29133 {
29134  SCIP_CALL( checkStage(scip, "SCIPgetConsVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
29135 
29136  assert(scip != NULL);
29137  assert(cons != NULL);
29138  assert(vars != NULL);
29139  assert(success != NULL);
29140 
29141  SCIP_CALL( SCIPconsGetVars(cons, scip->set, vars, varssize, success) );
29142 
29143  return SCIP_OKAY;
29144 }
29145 
29146 /** method to collect the number of variables of a constraint
29147  *
29148  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29149  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29150  *
29151  * @pre This method can be called if @p scip is in one of the following stages:
29152  * - \ref SCIP_STAGE_PROBLEM
29153  * - \ref SCIP_STAGE_TRANSFORMING
29154  * - \ref SCIP_STAGE_TRANSFORMED
29155  * - \ref SCIP_STAGE_INITPRESOLVE
29156  * - \ref SCIP_STAGE_PRESOLVING
29157  * - \ref SCIP_STAGE_EXITPRESOLVE
29158  * - \ref SCIP_STAGE_PRESOLVED
29159  * - \ref SCIP_STAGE_INITSOLVE
29160  * - \ref SCIP_STAGE_SOLVING
29161  * - \ref SCIP_STAGE_SOLVED
29162  * - \ref SCIP_STAGE_EXITSOLVE
29163  * - \ref SCIP_STAGE_FREETRANS
29164  *
29165  * @note The success pointer indicates if the contraint handler was able to return the number of variables
29166  *
29167  * @note It might be that a constraint handler does not support this functionality, in that case the success pointer is
29168  * set to FALSE
29169  */
29171  SCIP* scip, /**< SCIP data structure */
29172  SCIP_CONS* cons, /**< constraint for which the number of variables is wanted */
29173  int* nvars, /**< pointer to store the number of variables */
29174  SCIP_Bool* success /**< pointer to store whether the constraint successfully returned the number of variables */
29175  )
29176 {
29177  SCIP_CALL( checkStage(scip, "SCIPgetConsNVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
29178 
29179  assert(scip != NULL);
29180  assert(cons != NULL);
29181  assert(nvars != NULL);
29182  assert(success != NULL);
29183 
29184  SCIP_CALL( SCIPconsGetNVars(cons, scip->set, nvars, success) );
29185 
29186  return SCIP_OKAY;
29187 }
29188 
29189 /*
29190  * LP methods
29191  */
29192 
29193 /** returns, whether the LP was or is to be solved in the current node
29194  *
29195  * @return whether the LP was or is to be solved in the current node.
29196  *
29197  * @pre This method can be called if @p scip is in one of the following stages:
29198  * - \ref SCIP_STAGE_SOLVING
29199  *
29200  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29201  */
29203  SCIP* scip /**< SCIP data structure */
29204  )
29205 {
29206  SCIP_CALL_ABORT( checkStage(scip, "SCIPhasCurrentNodeLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29207 
29208  return SCIPtreeHasCurrentNodeLP(scip->tree);
29209 }
29210 
29211 /** returns, whether the LP of the current node is already constructed
29212  *
29213  * @return whether the LP of the current node is already constructed.
29214  *
29215  * @pre This method can be called if @p scip is in one of the following stages:
29216  * - \ref SCIP_STAGE_SOLVING
29217  *
29218  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29219  */
29221  SCIP* scip /**< SCIP data structure */
29222  )
29223 {
29224  SCIP_CALL_ABORT( checkStage(scip, "SCIPisLPConstructed", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29225 
29226  return SCIPtreeIsFocusNodeLPConstructed(scip->tree);
29227 }
29228 
29229 /** makes sure that the LP of the current node is loaded and may be accessed through the LP information methods
29230  *
29231  * @warning Contructing the LP might change the amount of variables known in the transformed problem and therefore also
29232  * the variables array of SCIP (returned by SCIPgetVars() and SCIPgetVarsData()), so it might be necessary to
29233  * call one of the later method after this one
29234  *
29235  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29236  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29237  *
29238  * @pre This method can be called if @p scip is in one of the following stages:
29239  * - \ref SCIP_STAGE_SOLVING
29240  *
29241  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29242  */
29244  SCIP* scip, /**< SCIP data structure */
29245  SCIP_Bool* cutoff /**< pointer to store whether the node can be cut off */
29246  )
29247 {
29248  SCIP_CALL( checkStage(scip, "SCIPconstructLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29249 
29250  SCIP_CALL( SCIPconstructCurrentLP(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
29251  scip->tree, scip->reopt, scip->lp, scip->pricestore, scip->sepastore, scip->cutpool, scip->branchcand,
29252  scip->eventqueue, scip->eventfilter, scip->cliquetable, FALSE, cutoff) );
29253 
29254  return SCIP_OKAY;
29255 }
29256 
29257 /** makes sure that the LP of the current node is flushed
29258  *
29259  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29260  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29261  *
29262  * @pre This method can be called if @p scip is in one of the following stages:
29263  * - \ref SCIP_STAGE_SOLVING
29264  *
29265  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29266  */
29268  SCIP* scip /**< SCIP data structure */
29269  )
29270 {
29271  SCIP_CALL( checkStage(scip, "SCIPflushLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29272 
29273  SCIP_CALL( SCIPlpFlush(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue) );
29274 
29275  return SCIP_OKAY;
29276 }
29277 
29278 /** gets solution status of current LP
29279  *
29280  * @return the solution status of current LP.
29281  *
29282  * @pre This method can be called if @p scip is in one of the following stages:
29283  * - \ref SCIP_STAGE_SOLVING
29284  *
29285  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29286  */
29288  SCIP* scip /**< SCIP data structure */
29289  )
29290 {
29291  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPSolstat", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29292 
29294  return SCIPlpGetSolstat(scip->lp);
29295  else
29296  return SCIP_LPSOLSTAT_NOTSOLVED;
29297 }
29298 
29299 /** returns whether the current LP solution passed the primal feasibility check
29300  *
29301  * @return whether the current LP solution passed the primal feasibility check.
29302  *
29303  * @pre This method can be called if @p scip is in one of the following stages:
29304  * - \ref SCIP_STAGE_SOLVING
29305  *
29306  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29307  */
29309  SCIP* scip /**< SCIP data structure */
29310  )
29311 {
29312  SCIP_CALL_ABORT( checkStage(scip, "SCIPisLPPrimalReliable", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29313 
29314  return SCIPlpIsPrimalReliable(scip->lp);
29315 }
29316 
29317 /** returns whether the current LP solution passed the dual feasibility check
29318  *
29319  * @returns whether the current LP solution passed the dual feasibility check.
29320  *
29321  * @pre This method can be called if @p scip is in one of the following stages:
29322  * - \ref SCIP_STAGE_SOLVING
29323  *
29324  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29325  */
29327  SCIP* scip /**< SCIP data structure */
29328  )
29329 {
29330  SCIP_CALL_ABORT( checkStage(scip, "SCIPisLPDualReliable", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29331 
29332  return SCIPlpIsDualReliable(scip->lp);
29333 }
29334 
29335 /** returns whether the current lp is a relaxation of the current problem and its optimal objective value is a local lower bound
29336  *
29337  * @return whether the current lp is a relaxation of the current problem and its optimal objective value is a local lower bound.
29338  *
29339  * @pre This method can be called if @p scip is in one of the following stages:
29340  * - \ref SCIP_STAGE_SOLVING
29341  *
29342  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29343  */
29345  SCIP* scip /**< SCIP data structure */
29346  )
29347 {
29348  SCIP_CALL_ABORT( checkStage(scip, "SCIPisLPRelax", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29349 
29350  return SCIPlpIsRelax(scip->lp);
29351 }
29352 
29353 /** gets objective value of current LP (which is the sum of column and loose objective value)
29354  *
29355  * @return the objective value of current LP (which is the sum of column and loose objective value).
29356  *
29357  * @pre This method can be called if @p scip is in one of the following stages:
29358  * - \ref SCIP_STAGE_SOLVING
29359  *
29360  * @note This method returns the objective value of the current LP solution, which might be primal or dual infeasible
29361  * if a limit was hit during solving. It must not be used as a dual bound if the LP solution status returned by
29362  * SCIPgetLPSolstat() is SCIP_LPSOLSTAT_ITERLIMIT or SCIP_LPSOLSTAT_TIMELIMIT.
29363  *
29364  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29365  */
29367  SCIP* scip /**< SCIP data structure */
29368  )
29369 {
29370  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29371 
29372  return SCIPlpGetObjval(scip->lp, scip->set, scip->transprob);
29373 }
29374 
29375 /** gets part of objective value of current LP that results from COLUMN variables only
29376  *
29377  * @return the part of objective value of current LP that results from COLUMN variables only.
29378  *
29379  * @pre This method can be called if @p scip is in one of the following stages:
29380  * - \ref SCIP_STAGE_SOLVING
29381  *
29382  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29383  */
29385  SCIP* scip /**< SCIP data structure */
29386  )
29387 {
29388  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPColumnObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29389 
29390  return SCIPlpGetColumnObjval(scip->lp);
29391 }
29392 
29393 /** gets part of objective value of current LP that results from LOOSE variables only
29394  *
29395  * @return part of objective value of current LP that results from LOOSE variables only.
29396  *
29397  * @pre This method can be called if @p scip is in one of the following stages:
29398  * - \ref SCIP_STAGE_SOLVING
29399  *
29400  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29401  */
29403  SCIP* scip /**< SCIP data structure */
29404  )
29405 {
29406  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPLooseObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29407 
29408  return SCIPlpGetLooseObjval(scip->lp, scip->set, scip->transprob);
29409 }
29410 
29411 /** gets the global pseudo objective value; that is all variables set to their best (w.r.t. the objective
29412  * function) global bound
29413  *
29414  * @return the global pseudo objective value; that is all variables set to their best (w.r.t. the objective
29415  * function) global bound.
29416  *
29417  * @pre This method can be called if @p scip is in one of the following stages:
29418  * - \ref SCIP_STAGE_INITPRESOLVE
29419  * - \ref SCIP_STAGE_PRESOLVING
29420  * - \ref SCIP_STAGE_EXITPRESOLVE
29421  * - \ref SCIP_STAGE_PRESOLVED
29422  * - \ref SCIP_STAGE_INITSOLVE
29423  * - \ref SCIP_STAGE_SOLVING
29424  *
29425  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29426  */
29428  SCIP* scip /**< SCIP data structure */
29429  )
29430 {
29431  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetGlobalPseudoObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29432 
29433  return SCIPlpGetGlobalPseudoObjval(scip->lp, scip->set, scip->transprob);
29434 }
29435 
29436 /** gets the pseudo objective value for the current search node; that is all variables set to their best (w.r.t. the
29437  * objective function) local bound
29438  *
29439  * @return the pseudo objective value for the current search node; that is all variables set to their best (w.r.t. the
29440  * objective function) local bound.
29441  *
29442  * @pre This method can be called if @p scip is in one of the following stages:
29443  * - \ref SCIP_STAGE_INITPRESOLVE
29444  * - \ref SCIP_STAGE_PRESOLVING
29445  * - \ref SCIP_STAGE_EXITPRESOLVE
29446  * - \ref SCIP_STAGE_PRESOLVED
29447  * - \ref SCIP_STAGE_INITSOLVE
29448  * - \ref SCIP_STAGE_SOLVING
29449  *
29450  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29451  */
29453  SCIP* scip /**< SCIP data structure */
29454  )
29455 {
29456  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPseudoObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29457 
29458  return SCIPlpGetPseudoObjval(scip->lp, scip->set, scip->transprob);
29459 }
29460 
29461 /** returns whether the root lp is a relaxation of the problem and its optimal objective value is a global lower bound
29462  *
29463  * @return whether the root lp is a relaxation of the problem and its optimal objective value is a global lower bound.
29464  *
29465  * @pre This method can be called if @p scip is in one of the following stages:
29466  * - \ref SCIP_STAGE_SOLVING
29467  *
29468  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29469  */
29471  SCIP* scip /**< SCIP data structure */
29472  )
29473 {
29474  SCIP_CALL_ABORT( checkStage(scip, "SCIPisRootLPRelax", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29475 
29476  return SCIPlpIsRootLPRelax(scip->lp);
29477 }
29478 
29479 /** gets the objective value of the root node LP or SCIP_INVALID if the root node LP was not (yet) solved
29480  *
29481  * @return the objective value of the root node LP or SCIP_INVALID if the root node LP was not (yet) solved.
29482  *
29483  * @pre This method can be called if @p scip is in one of the following stages:
29484  * - \ref SCIP_STAGE_INITPRESOLVE
29485  * - \ref SCIP_STAGE_PRESOLVING
29486  * - \ref SCIP_STAGE_EXITPRESOLVE
29487  * - \ref SCIP_STAGE_SOLVING
29488  *
29489  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29490  */
29492  SCIP* scip /**< SCIP data structure */
29493  )
29494 {
29495  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPRootObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29496 
29497  return SCIPlpGetRootObjval(scip->lp);
29498 }
29499 
29500 /** gets part of the objective value of the root node LP that results from COLUMN variables only;
29501  * returns SCIP_INVALID if the root node LP was not (yet) solved
29502  *
29503  * @return the part of the objective value of the root node LP that results from COLUMN variables only;
29504  * or SCIP_INVALID if the root node LP was not (yet) solved.
29505  *
29506  * @pre This method can be called if @p scip is in one of the following stages:
29507  * - \ref SCIP_STAGE_INITPRESOLVE
29508  * - \ref SCIP_STAGE_PRESOLVING
29509  * - \ref SCIP_STAGE_EXITPRESOLVE
29510  * - \ref SCIP_STAGE_SOLVING
29511  *
29512  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29513  */
29515  SCIP* scip /**< SCIP data structure */
29516  )
29517 {
29518  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPRootColumnObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29519 
29520  return SCIPlpGetRootColumnObjval(scip->lp);
29521 }
29522 
29523 /** gets part of the objective value of the root node LP that results from LOOSE variables only;
29524  * returns SCIP_INVALID if the root node LP was not (yet) solved
29525  *
29526  * @return the part of the objective value of the root node LP that results from LOOSE variables only;
29527  * or SCIP_INVALID if the root node LP was not (yet) solved.
29528  *
29529  * @pre This method can be called if @p scip is in one of the following stages:
29530  * - \ref SCIP_STAGE_INITPRESOLVE
29531  * - \ref SCIP_STAGE_PRESOLVING
29532  * - \ref SCIP_STAGE_EXITPRESOLVE
29533  * - \ref SCIP_STAGE_SOLVING
29534  *
29535  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29536  */
29538  SCIP* scip /**< SCIP data structure */
29539  )
29540 {
29541  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPRootLooseObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29542 
29543  return SCIPlpGetRootLooseObjval(scip->lp);
29544 }
29545 
29546 /** gets current LP columns along with the current number of LP columns
29547  *
29548  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29549  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29550  *
29551  * @pre This method can be called if @p scip is in one of the following stages:
29552  * - \ref SCIP_STAGE_SOLVING
29553  *
29554  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29555  */
29557  SCIP* scip, /**< SCIP data structure */
29558  SCIP_COL*** cols, /**< pointer to store the array of LP columns, or NULL */
29559  int* ncols /**< pointer to store the number of LP columns, or NULL */
29560  )
29561 {
29562  SCIP_CALL( checkStage(scip, "SCIPgetLPColsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29563 
29565  {
29566  if( cols != NULL )
29567  *cols = SCIPlpGetCols(scip->lp);
29568  if( ncols != NULL )
29569  *ncols = SCIPlpGetNCols(scip->lp);
29570  }
29571  else
29572  {
29573  if( cols != NULL )
29574  *cols = NULL;
29575  if( ncols != NULL )
29576  *ncols = 0;
29577  }
29578 
29579  return SCIP_OKAY;
29580 }
29581 
29582 /** gets current LP columns
29583  *
29584  * @return the current LP columns.
29585  *
29586  * @pre This method can be called if @p scip is in one of the following stages:
29587  * - \ref SCIP_STAGE_SOLVING
29588  *
29589  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29590  */
29592  SCIP* scip /**< SCIP data structure */
29593  )
29594 {
29595  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPCols", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29596 
29598  return SCIPlpGetCols(scip->lp);
29599  else
29600  return NULL;
29601 }
29602 
29603 /** gets current number of LP columns
29604  *
29605  * @return the current number of LP columns.
29606  *
29607  * @pre This method can be called if @p scip is in one of the following stages:
29608  * - \ref SCIP_STAGE_SOLVING
29609  *
29610  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29611  */
29613  SCIP* scip /**< SCIP data structure */
29614  )
29615 {
29616  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPCols", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29617 
29619  return SCIPlpGetNCols(scip->lp);
29620  else
29621  return 0;
29622 }
29623 
29624 /** gets current LP rows along with the current number of LP rows
29625  *
29626  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29627  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29628  *
29629  * @pre This method can be called if @p scip is in one of the following stages:
29630  * - \ref SCIP_STAGE_SOLVING
29631  *
29632  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29633  */
29635  SCIP* scip, /**< SCIP data structure */
29636  SCIP_ROW*** rows, /**< pointer to store the array of LP rows, or NULL */
29637  int* nrows /**< pointer to store the number of LP rows, or NULL */
29638  )
29639 {
29640  SCIP_CALL( checkStage(scip, "SCIPgetLPRowsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29641 
29643  {
29644  if( rows != NULL )
29645  *rows = SCIPlpGetRows(scip->lp);
29646  if( nrows != NULL )
29647  *nrows = SCIPlpGetNRows(scip->lp);
29648  }
29649  else
29650  {
29651  if( rows != NULL )
29652  *rows = NULL;
29653  if( nrows != NULL )
29654  *nrows = 0;
29655  }
29656 
29657  return SCIP_OKAY;
29658 }
29659 
29660 /** gets current LP rows
29661  *
29662  * @return the current LP rows.
29663  *
29664  * @pre This method can be called if @p scip is in one of the following stages:
29665  * - \ref SCIP_STAGE_SOLVING
29666  *
29667  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29668  */
29670  SCIP* scip /**< SCIP data structure */
29671  )
29672 {
29673  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29674 
29676  return SCIPlpGetRows(scip->lp);
29677  else
29678  return NULL;
29679 }
29680 
29681 /** gets current number of LP rows
29682  *
29683  * @return the current number of LP rows.
29684  *
29685  * @pre This method can be called if @p scip is in one of the following stages:
29686  * - \ref SCIP_STAGE_SOLVING
29687  *
29688  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29689  */
29691  SCIP* scip /**< SCIP data structure */
29692  )
29693 {
29694  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29695 
29697  return SCIPlpGetNRows(scip->lp);
29698  else
29699  return 0;
29700 }
29701 
29702 /** returns TRUE iff all columns, i.e. every variable with non-empty column w.r.t. all ever created rows, are present
29703  * in the LP, and FALSE, if there are additional already existing columns, that may be added to the LP in pricing
29704  *
29705  * @return TRUE iff all columns, i.e. every variable with non-empty column w.r.t. all ever created rows, are present
29706  * in the LP, and FALSE, if there are additional already existing columns, that may be added to the LP in pricing.
29707  *
29708  * @pre This method can be called if @p scip is in one of the following stages:
29709  * - \ref SCIP_STAGE_SOLVING
29710  *
29711  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29712  */
29714  SCIP* scip /**< SCIP data structure */
29715  )
29716 {
29717  SCIP_CALL_ABORT( checkStage(scip, "SCIPallColsInLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29718 
29719  return SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp);
29720 }
29721 
29722 /** returns whether the current LP solution is basic, i.e. is defined by a valid simplex basis
29723  *
29724  * @return whether the current LP solution is basic, i.e. is defined by a valid simplex basis.
29725  *
29726  * @pre This method can be called if @p scip is in one of the following stages:
29727  * - \ref SCIP_STAGE_SOLVING
29728  *
29729  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29730  */
29732  SCIP* scip /**< SCIP data structure */
29733  )
29734 {
29735  SCIP_CALL_ABORT( checkStage(scip, "SCIPisLPSolBasic", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29736 
29737  return SCIPlpIsSolBasic(scip->lp);
29738 }
29739 
29740 /** gets all indices of basic columns and rows: index i >= 0 corresponds to column i, index i < 0 to row -i-1
29741  *
29742  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29743  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29744  *
29745  * @pre This method can be called if @p scip is in one of the following stages:
29746  * - \ref SCIP_STAGE_SOLVING
29747  *
29748  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29749  */
29751  SCIP* scip, /**< SCIP data structure */
29752  int* basisind /**< pointer to store basis indices ready to keep number of rows entries */
29753  )
29754 {
29755  SCIP_CALL( checkStage(scip, "SCIPgetLPBasisInd", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29756 
29757  if( !SCIPlpIsSolBasic(scip->lp) )
29758  {
29759  SCIPerrorMessage("current LP solution is not basic\n");
29760  return SCIP_INVALIDCALL;
29761  }
29762 
29763  SCIP_CALL( SCIPlpGetBasisInd(scip->lp, basisind) );
29764 
29765  return SCIP_OKAY;
29766 }
29767 
29768 /** gets a row from the inverse basis matrix B^-1
29769  *
29770  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29771  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29772  *
29773  * @pre This method can be called if @p scip is in one of the following stages:
29774  * - \ref SCIP_STAGE_SOLVING
29775  *
29776  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29777  */
29779  SCIP* scip, /**< SCIP data structure */
29780  int r, /**< row number */
29781  SCIP_Real* coefs, /**< array to store the coefficients of the row */
29782  int* inds, /**< array to store the non-zero indices, or NULL */
29783  int* ninds /**< pointer to store the number of non-zero indices, or NULL
29784  * (-1: if we do not store sparsity informations) */
29785  )
29786 {
29787  SCIP_CALL( checkStage(scip, "SCIPgetLPBInvRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29788 
29789  if( !SCIPlpIsSolBasic(scip->lp) )
29790  {
29791  SCIPerrorMessage("current LP solution is not basic\n");
29792  return SCIP_INVALIDCALL;
29793  }
29794 
29795  SCIP_CALL( SCIPlpGetBInvRow(scip->lp, r, coefs, inds, ninds) );
29796 
29797  /* debug check if the coef is the r-th line of the inverse matrix B^-1 */
29798  SCIP_CALL( SCIPdebugCheckBInvRow(scip, r, coefs) ); /*lint !e506 !e774*/
29799 
29800  return SCIP_OKAY;
29801 }
29802 
29803 /** gets a column from the inverse basis matrix B^-1
29804  *
29805  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29806  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29807  *
29808  * @pre This method can be called if @p scip is in one of the following stages:
29809  * - \ref SCIP_STAGE_SOLVING
29810  *
29811  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29812  */
29814  SCIP* scip, /**< SCIP data structure */
29815  int c, /**< column number of B^-1; this is NOT the number of the column in the LP
29816  * returned by SCIPcolGetLPPos(); you have to call SCIPgetBasisInd()
29817  * to get the array which links the B^-1 column numbers to the row and
29818  * column numbers of the LP! c must be between 0 and nrows-1, since the
29819  * basis has the size nrows * nrows */
29820  SCIP_Real* coefs, /**< array to store the coefficients of the column */
29821  int* inds, /**< array to store the non-zero indices, or NULL */
29822  int* ninds /**< pointer to store the number of non-zero indices, or NULL
29823  * (-1: if we do not store sparsity informations) */
29824  )
29825 {
29826  SCIP_CALL( checkStage(scip, "SCIPgetLPBInvCol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29827 
29828  if( !SCIPlpIsSolBasic(scip->lp) )
29829  {
29830  SCIPerrorMessage("current LP solution is not basic\n");
29831  return SCIP_INVALIDCALL;
29832  }
29833 
29834  SCIP_CALL( SCIPlpGetBInvCol(scip->lp, c, coefs, inds, ninds) );
29835 
29836  return SCIP_OKAY;
29837 }
29838 
29839 /** gets a row from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A)
29840  *
29841  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29842  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29843  *
29844  * @pre This method can be called if @p scip is in one of the following stages:
29845  * - \ref SCIP_STAGE_SOLVING
29846  *
29847  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29848  */
29850  SCIP* scip, /**< SCIP data structure */
29851  int r, /**< row number */
29852  SCIP_Real* binvrow, /**< row in B^-1 from prior call to SCIPgetLPBInvRow(), or NULL */
29853  SCIP_Real* coefs, /**< array to store the coefficients of the row */
29854  int* inds, /**< array to store the non-zero indices, or NULL */
29855  int* ninds /**< pointer to store the number of non-zero indices, or NULL
29856  * (-1: if we do not store sparsity informations) */
29857  )
29858 {
29859  SCIP_CALL( checkStage(scip, "SCIPgetLPBInvARow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29860 
29861  if( !SCIPlpIsSolBasic(scip->lp) )
29862  {
29863  SCIPerrorMessage("current LP solution is not basic\n");
29864  return SCIP_INVALIDCALL;
29865  }
29866 
29867  SCIP_CALL( SCIPlpGetBInvARow(scip->lp, r, binvrow, coefs, inds, ninds) );
29868 
29869  return SCIP_OKAY;
29870 }
29871 
29872 /** gets a column from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A),
29873  * i.e., it computes B^-1 * A_c with A_c being the c'th column of A
29874  *
29875  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29876  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29877  *
29878  * @pre This method can be called if @p scip is in one of the following stages:
29879  * - \ref SCIP_STAGE_SOLVING
29880  *
29881  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29882  */
29884  SCIP* scip, /**< SCIP data structure */
29885  int c, /**< column number which can be accessed by SCIPcolGetLPPos() */
29886  SCIP_Real* coefs, /**< array to store the coefficients of the column */
29887  int* inds, /**< array to store the non-zero indices, or NULL */
29888  int* ninds /**< pointer to store the number of non-zero indices, or NULL
29889  * (-1: if we do not store sparsity informations) */
29890  )
29891 {
29892  SCIP_CALL( checkStage(scip, "SCIPgetLPBInvACol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29893 
29894  if( !SCIPlpIsSolBasic(scip->lp) )
29895  {
29896  SCIPerrorMessage("current LP solution is not basic\n");
29897  return SCIP_INVALIDCALL;
29898  }
29899 
29900  SCIP_CALL( SCIPlpGetBInvACol(scip->lp, c, coefs, inds, ninds) );
29901 
29902  return SCIP_OKAY;
29903 }
29904 
29905 /** calculates a weighted sum of all LP rows; for negative weights, the left and right hand side of the corresponding
29906  * LP row are swapped in the summation
29907  *
29908  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29909  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29910  *
29911  * @pre This method can be called if @p scip is in one of the following stages:
29912  * - \ref SCIP_STAGE_SOLVING
29913  *
29914  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29915  */
29917  SCIP* scip, /**< SCIP data structure */
29918  SCIP_Real* weights, /**< row weights in row summation */
29919  SCIP_REALARRAY* sumcoef, /**< array to store sum coefficients indexed by variables' probindex */
29920  SCIP_Real* sumlhs, /**< pointer to store the left hand side of the row summation */
29921  SCIP_Real* sumrhs /**< pointer to store the right hand side of the row summation */
29922  )
29923 {
29924  SCIP_CALL( checkStage(scip, "SCIPsumLPRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29925 
29926  SCIP_CALL( SCIPlpSumRows(scip->lp, scip->set, scip->transprob, weights, sumcoef, sumlhs, sumrhs) );
29927 
29928  return SCIP_OKAY;
29929 }
29930 
29931 /** writes current LP to a file
29932  *
29933  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29934  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29935  *
29936  * @pre This method can be called if @p scip is in one of the following stages:
29937  * - \ref SCIP_STAGE_SOLVING
29938  *
29939  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29940  */
29942  SCIP* scip, /**< SCIP data structure */
29943  const char* filename /**< file name */
29944  )
29945 {
29946  SCIP_Bool cutoff;
29947 
29948  SCIP_CALL( checkStage(scip, "SCIPwriteLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29949 
29951  {
29952  SCIP_CALL( SCIPconstructCurrentLP(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
29953  scip->tree, scip->reopt, scip->lp, scip->pricestore, scip->sepastore, scip->cutpool, scip->branchcand,
29954  scip->eventqueue, scip->eventfilter, scip->cliquetable, FALSE, &cutoff) );
29955  }
29956 
29957  /* we need a flushed lp to write the current lp */
29958  SCIP_CALL( SCIPlpFlush(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue) );
29959 
29960  SCIP_CALL( SCIPlpWrite(scip->lp, filename) );
29961 
29962  return SCIP_OKAY;
29963 }
29964 
29965 /** writes MIP relaxation of the current branch-and-bound node to a file
29966  *
29967  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29968  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29969  *
29970  * @pre This method can be called if @p scip is in one of the following stages:
29971  * - \ref SCIP_STAGE_SOLVING
29972  *
29973  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29974  */
29976  SCIP* scip, /**< SCIP data structure */
29977  const char* filename, /**< file name */
29978  SCIP_Bool genericnames, /**< should generic names like x_i and row_j be used in order to avoid
29979  * troubles with reserved symbols? */
29980  SCIP_Bool origobj, /**< should the original objective function be used? */
29981  SCIP_Bool lazyconss /**< output removable rows as lazy constraints? */
29982  )
29983 {
29984  SCIP_CALL( checkStage(scip, "SCIPwriteMIP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29985 
29986  /* we need a flushed lp to write the current mip */
29987  SCIP_CALL( SCIPlpFlush(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue) );
29988 
29989  SCIP_CALL( SCIPlpWriteMip(scip->lp, scip->set, scip->messagehdlr, filename, genericnames,
29990  origobj, scip->origprob->objsense, scip->transprob->objscale, scip->transprob->objoffset, lazyconss) );
29991 
29992  return SCIP_OKAY;
29993 }
29994 
29995 /** gets the LP interface of SCIP;
29996  * with the LPI you can use all of the methods defined in lpi/lpi.h;
29997  *
29998  * @warning You have to make sure, that the full internal state of the LPI does not change or is recovered completely
29999  * after the end of the method that uses the LPI. In particular, if you manipulate the LP or its solution
30000  * (e.g. by calling one of the SCIPlpiAdd...() or one of the SCIPlpiSolve...() methods), you have to check in
30001  * advance with SCIPlpiWasSolved() whether the LP is currently solved. If this is the case, you have to make
30002  * sure, the internal solution status is recovered completely at the end of your method. This can be achieved
30003  * by getting the LPI state before applying any LPI manipulations with SCIPlpiGetState() and restoring it
30004  * afterwards with SCIPlpiSetState() and SCIPlpiFreeState(). Additionally you have to resolve the LP with the
30005  * appropriate SCIPlpiSolve...() call in order to reinstall the internal solution status.
30006  *
30007  * @warning Make also sure, that all parameter values that you have changed are set back to their original values.
30008  *
30009  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30010  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30011  *
30012  * @pre This method can be called if @p scip is in one of the following stages:
30013  * - \ref SCIP_STAGE_TRANSFORMED
30014  * - \ref SCIP_STAGE_INITPRESOLVE
30015  * - \ref SCIP_STAGE_PRESOLVING
30016  * - \ref SCIP_STAGE_EXITPRESOLVE
30017  * - \ref SCIP_STAGE_PRESOLVED
30018  * - \ref SCIP_STAGE_INITSOLVE
30019  * - \ref SCIP_STAGE_SOLVING
30020  * - \ref SCIP_STAGE_SOLVED
30021  * - \ref SCIP_STAGE_EXITSOLVE
30022  *
30023  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
30024  */
30026  SCIP* scip, /**< SCIP data structure */
30027  SCIP_LPI** lpi /**< pointer to store the LP interface */
30028  )
30029 {
30030  assert(lpi != NULL);
30031 
30032  SCIP_CALL( checkStage(scip, "SCIPgetLPI", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
30033 
30034  *lpi = SCIPlpGetLPI(scip->lp);
30035 
30036  return SCIP_OKAY;
30037 }
30038 
30039 /** displays quality information about the current LP solution. An LP solution need to be available; information printed
30040  * is subject to what the LP solver supports
30041  *
30042  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30043  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30044  *
30045  * @pre This method can be called if @p scip is in one of the following stages:
30046  * - \ref SCIP_STAGE_INIT
30047  * - \ref SCIP_STAGE_PROBLEM
30048  * - \ref SCIP_STAGE_TRANSFORMED
30049  * - \ref SCIP_STAGE_INITPRESOLVE
30050  * - \ref SCIP_STAGE_PRESOLVING
30051  * - \ref SCIP_STAGE_EXITPRESOLVE
30052  * - \ref SCIP_STAGE_PRESOLVED
30053  * - \ref SCIP_STAGE_SOLVING
30054  * - \ref SCIP_STAGE_SOLVED
30055  * - \ref SCIP_STAGE_FREE
30056  *
30057  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
30058  *
30059  * @note The printing process is done via the message handler system.
30060  */
30062  SCIP* scip, /**< SCIP data structure */
30063  FILE* file /**< output file (or NULL for standard output) */
30064  )
30065 {
30066  SCIP_LPI* lpi;
30067  SCIP_Real quality;
30068 
30069  SCIP_CALL( checkStage(scip, "SCIPprintLPSolutionQuality", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE) );
30070 
30071  switch( scip->set->stage )
30072  {
30073  case SCIP_STAGE_INIT:
30074  case SCIP_STAGE_PROBLEM:
30077  case SCIP_STAGE_PRESOLVING:
30079  case SCIP_STAGE_PRESOLVED:
30080  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Problem not solving yet, no LP available.\n");
30081  return SCIP_OKAY;
30082 
30083  case SCIP_STAGE_SOLVING:
30084  case SCIP_STAGE_SOLVED:
30085  break;
30086 
30087  default:
30088  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
30089  return SCIP_INVALIDCALL;
30090  } /*lint !e788*/
30091 
30092  /* note that after diving mode, the LPI may only have the basis information, but SCIPlpiWasSolved() can be false; in
30093  * this case, we will (depending on the LP solver) probably not obtain the quality measure; one solution would be to
30094  * store the results of SCIPlpiGetRealSolQuality() within the SCIP_LP after each LP solve; this would have the added
30095  * advantage, that we reduce direct access to the LPI, but it sounds potentially expensive
30096  */
30097  lpi = SCIPlpGetLPI(scip->lp);
30098  assert(lpi != NULL);
30099 
30101  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Basis matrix condition (estimated): ");
30102  if( quality != SCIP_INVALID ) /*lint !e777*/
30103  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%.6e\n", quality);
30104  else
30105  SCIPmessageFPrintInfo(scip->messagehdlr, file, "not available\n", quality);
30106 
30108  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Basis matrix condition (exact): ");
30109  if( quality != SCIP_INVALID ) /*lint !e777*/
30110  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%.6e\n", quality);
30111  else
30112  SCIPmessageFPrintInfo(scip->messagehdlr, file, "not available\n", quality);
30113 
30114  return SCIP_OKAY;
30115 }
30116 
30117 /** compute relative interior point to current LP
30118  * @see SCIPlpComputeRelIntPoint
30119  *
30120  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30121  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30122  *
30123  * @pre This method can be called if @p scip is in one of the following stages:
30124  * - \ref SCIP_STAGE_TRANSFORMED
30125  * - \ref SCIP_STAGE_INITPRESOLVE
30126  * - \ref SCIP_STAGE_PRESOLVING
30127  * - \ref SCIP_STAGE_EXITPRESOLVE
30128  * - \ref SCIP_STAGE_PRESOLVED
30129  * - \ref SCIP_STAGE_SOLVING
30130  * - \ref SCIP_STAGE_SOLVED
30131  *
30132  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
30133  */
30135  SCIP* scip, /**< SCIP data structure */
30136  SCIP_Bool relaxrows, /**< should the rows be relaxed */
30137  SCIP_Bool inclobjcutoff, /**< should a row for the objective cutoff be included */
30138  SCIP_Real timelimit, /**< time limit for LP solver */
30139  int iterlimit, /**< iteration limit for LP solver */
30140  SCIP_SOL** point /**< relative interior point on exit */
30141  )
30142 {
30143  SCIP_Real* pointvals;
30144  SCIP_Bool success;
30145 
30146  SCIP_CALL( checkStage(scip, "SCIPcomputeLPRelIntPoint", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
30147 
30148  assert(scip != NULL);
30149  assert(scip->lp != NULL);
30150  assert(point != NULL);
30151 
30152  *point = NULL;
30153 
30154  SCIP_CALL( SCIPallocBufferArray(scip, &pointvals, SCIPlpGetNCols(scip->lp)) );
30155 
30156  SCIP_CALL( SCIPlpComputeRelIntPoint(scip->set, scip->messagehdlr, scip->lp, scip->transprob,
30157  relaxrows, inclobjcutoff, timelimit, iterlimit, pointvals, &success) );
30158 
30159  /* if successful, create new solution with point values */
30160  if( success )
30161  {
30162  int i;
30163 
30164  SCIP_CALL( SCIPcreateSol(scip, point, NULL) );
30165 
30166  for( i = 0; i < SCIPlpGetNCols(scip->lp); ++i )
30167  {
30168  SCIP_CALL( SCIPsetSolVal(scip, *point, SCIPcolGetVar(SCIPlpGetCols(scip->lp)[i]), pointvals[i]) );
30169  }
30170  }
30171 
30172  SCIPfreeBufferArray(scip, &pointvals);
30173 
30174  return SCIP_OKAY;
30175 }
30176 
30177 /*
30178  * LP column methods
30179  */
30180 
30181 /** returns the reduced costs of a column in the last (feasible) LP
30182  *
30183  * @return the reduced costs of a column in the last (feasible) LP
30184  *
30185  * @pre this method can be called in one of the following stages of the SCIP solving process:
30186  * - \ref SCIP_STAGE_SOLVING
30187  * - \ref SCIP_STAGE_SOLVED
30188  *
30189  * @note calling this method in SCIP_STAGE_SOLVED is only recommended to experienced users and should only be called
30190  * for pure LP instances (without presolving)
30191  *
30192  * @note The return value of this method should be used carefully if the dual feasibility check was explictely disabled.
30193  */
30195  SCIP* scip, /**< SCIP data structure */
30196  SCIP_COL* col /**< LP column */
30197  )
30198 {
30199  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetColRedcost", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
30200 
30201  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
30202  {
30203  SCIPerrorMessage("cannot get reduced costs, because node LP is not processed\n");
30204  SCIPABORT();
30205  return 0.0; /*lint !e527*/
30206  }
30207 
30208  return SCIPcolGetRedcost(col, scip->stat, scip->lp);
30209 }
30210 
30211 
30212 /** returns the Farkas coefficient of a column in the last (infeasible) LP
30213  *
30214  * @return the Farkas coefficient of a column in the last (infeasible) LP
30215  *
30216  * @pre this method can be called in one of the following stages of the SCIP solving process:
30217  * - \ref SCIP_STAGE_SOLVING
30218  */
30220  SCIP* scip, /**< SCIP data structure */
30221  SCIP_COL* col /**< LP column */
30222  )
30223 {
30224  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetColFarkasCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30225 
30226  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
30227  {
30228  SCIPerrorMessage("cannot get Farkas coeff, because node LP is not processed\n");
30229  SCIPABORT();
30230  return 0.0; /*lint !e527*/
30231  }
30232 
30233  return SCIPcolGetFarkasCoef(col, scip->stat, scip->lp);
30234 }
30235 
30236 /** marks a column to be not removable from the LP in the current node
30237  *
30238  * @pre this method can be called in the following stage of the SCIP solving process:
30239  * - \ref SCIP_STAGE_SOLVING
30240  */
30242  SCIP* scip, /**< SCIP data structure */
30243  SCIP_COL* col /**< LP column */
30244  )
30245 {
30246  SCIP_CALL_ABORT( checkStage(scip, "SCIPmarkColNotRemovableLocal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30247 
30248  SCIPcolMarkNotRemovableLocal(col, scip->stat);
30249 }
30250 
30251 /*
30252  * LP row methods
30253  */
30254 
30255 /** creates and captures an LP row from a constraint handler
30256  *
30257  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30258  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30259  *
30260  * @pre this method can be called in one of the following stages of the SCIP solving process:
30261  * - \ref SCIP_STAGE_INITSOLVE
30262  * - \ref SCIP_STAGE_SOLVING
30263  */
30265  SCIP* scip, /**< SCIP data structure */
30266  SCIP_ROW** row, /**< pointer to row */
30267  SCIP_CONSHDLR* conshdlr, /**< constraint handler that creates the row */
30268  const char* name, /**< name of row */
30269  int len, /**< number of nonzeros in the row */
30270  SCIP_COL** cols, /**< array with columns of row entries */
30271  SCIP_Real* vals, /**< array with coefficients of row entries */
30272  SCIP_Real lhs, /**< left hand side of row */
30273  SCIP_Real rhs, /**< right hand side of row */
30274  SCIP_Bool local, /**< is row only valid locally? */
30275  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30276  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30277  )
30278 {
30279  assert(conshdlr != NULL);
30280 
30281  SCIP_CALL( checkStage(scip, "SCIPcreateRowCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30282 
30283  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
30284  name, len, cols, vals, lhs, rhs, SCIP_ROWORIGINTYPE_CONS, (void*) conshdlr, local, modifiable, removable) );
30285 
30286  return SCIP_OKAY;
30287 }
30288 
30289 /** creates and captures an LP row from a separator
30290  *
30291  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30292  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30293  *
30294  * @pre this method can be called in one of the following stages of the SCIP solving process:
30295  * - \ref SCIP_STAGE_INITSOLVE
30296  * - \ref SCIP_STAGE_SOLVING
30297  */
30299  SCIP* scip, /**< SCIP data structure */
30300  SCIP_ROW** row, /**< pointer to row */
30301  SCIP_SEPA* sepa, /**< separator that creates the row */
30302  const char* name, /**< name of row */
30303  int len, /**< number of nonzeros in the row */
30304  SCIP_COL** cols, /**< array with columns of row entries */
30305  SCIP_Real* vals, /**< array with coefficients of row entries */
30306  SCIP_Real lhs, /**< left hand side of row */
30307  SCIP_Real rhs, /**< right hand side of row */
30308  SCIP_Bool local, /**< is row only valid locally? */
30309  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30310  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30311  )
30312 {
30313  assert(sepa != NULL);
30314 
30315  SCIP_CALL( checkStage(scip, "SCIPcreateRowSepa", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30316 
30317  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
30318  name, len, cols, vals, lhs, rhs, SCIP_ROWORIGINTYPE_SEPA, (void*) sepa, local, modifiable, removable) );
30319 
30320  return SCIP_OKAY;
30321 }
30322 
30323 /** creates and captures an LP row from an unspecified source
30324  *
30325  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30326  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30327  *
30328  * @pre this method can be called in one of the following stages of the SCIP solving process:
30329  * - \ref SCIP_STAGE_INITSOLVE
30330  * - \ref SCIP_STAGE_SOLVING
30331  */
30333  SCIP* scip, /**< SCIP data structure */
30334  SCIP_ROW** row, /**< pointer to row */
30335  const char* name, /**< name of row */
30336  int len, /**< number of nonzeros in the row */
30337  SCIP_COL** cols, /**< array with columns of row entries */
30338  SCIP_Real* vals, /**< array with coefficients of row entries */
30339  SCIP_Real lhs, /**< left hand side of row */
30340  SCIP_Real rhs, /**< right hand side of row */
30341  SCIP_Bool local, /**< is row only valid locally? */
30342  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30343  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30344  )
30345 {
30346  SCIP_CALL( checkStage(scip, "SCIPcreateRowUnspec", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30347 
30348  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
30349  name, len, cols, vals, lhs, rhs, SCIP_ROWORIGINTYPE_UNSPEC, NULL, local, modifiable, removable) );
30350 
30351  return SCIP_OKAY;
30352 }
30353 
30354 /** creates and captures an LP row
30355  *
30356  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30357  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30358  *
30359  * @pre this method can be called in one of the following stages of the SCIP solving process:
30360  * - \ref SCIP_STAGE_INITSOLVE
30361  * - \ref SCIP_STAGE_SOLVING
30362  *
30363  * @deprecated Please use SCIPcreateRowCons() or SCIPcreateRowSepa() when calling from a constraint handler or separator in order
30364  * to facilitate correct statistics. If the call is from neither a constraint handler or separator, use SCIPcreateRowUnspec().
30365  */
30367  SCIP* scip, /**< SCIP data structure */
30368  SCIP_ROW** row, /**< pointer to row */
30369  const char* name, /**< name of row */
30370  int len, /**< number of nonzeros in the row */
30371  SCIP_COL** cols, /**< array with columns of row entries */
30372  SCIP_Real* vals, /**< array with coefficients of row entries */
30373  SCIP_Real lhs, /**< left hand side of row */
30374  SCIP_Real rhs, /**< right hand side of row */
30375  SCIP_Bool local, /**< is row only valid locally? */
30376  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30377  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30378  )
30379 {
30380  SCIP_CALL( checkStage(scip, "SCIPcreateRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30381 
30382  SCIP_CALL( SCIPcreateRowUnspec(scip, row, name, len, cols, vals, lhs, rhs, local, modifiable, removable) );
30383 
30384  return SCIP_OKAY;
30385 }
30386 
30387 /** creates and captures an LP row without any coefficients from a constraint handler
30388  *
30389  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30390  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30391  *
30392  * @pre this method can be called in one of the following stages of the SCIP solving process:
30393  * - \ref SCIP_STAGE_INITSOLVE
30394  * - \ref SCIP_STAGE_SOLVING
30395  */
30397  SCIP* scip, /**< SCIP data structure */
30398  SCIP_ROW** row, /**< pointer to row */
30399  SCIP_CONSHDLR* conshdlr, /**< constraint handler that creates the row */
30400  const char* name, /**< name of row */
30401  SCIP_Real lhs, /**< left hand side of row */
30402  SCIP_Real rhs, /**< right hand side of row */
30403  SCIP_Bool local, /**< is row only valid locally? */
30404  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30405  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30406  )
30407 {
30408  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyRowCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30409 
30410  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
30411  name, 0, NULL, NULL, lhs, rhs, SCIP_ROWORIGINTYPE_CONS, (void*) conshdlr, local, modifiable, removable) );
30412 
30413  return SCIP_OKAY;
30414 }
30415 
30416 /** creates and captures an LP row without any coefficients from a separator
30417  *
30418  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30419  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30420  *
30421  * @pre this method can be called in one of the following stages of the SCIP solving process:
30422  * - \ref SCIP_STAGE_INITSOLVE
30423  * - \ref SCIP_STAGE_SOLVING
30424  */
30426  SCIP* scip, /**< SCIP data structure */
30427  SCIP_ROW** row, /**< pointer to row */
30428  SCIP_SEPA* sepa, /**< separator that creates the row */
30429  const char* name, /**< name of row */
30430  SCIP_Real lhs, /**< left hand side of row */
30431  SCIP_Real rhs, /**< right hand side of row */
30432  SCIP_Bool local, /**< is row only valid locally? */
30433  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30434  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30435  )
30436 {
30437  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyRowSepa", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30438 
30439  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
30440  name, 0, NULL, NULL, lhs, rhs, SCIP_ROWORIGINTYPE_SEPA, (void*) sepa, local, modifiable, removable) );
30441 
30442  return SCIP_OKAY;
30443 }
30444 
30445 /** creates and captures an LP row without any coefficients from an unspecified source
30446  *
30447  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30448  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30449  *
30450  * @pre this method can be called in one of the following stages of the SCIP solving process:
30451  * - \ref SCIP_STAGE_INITSOLVE
30452  * - \ref SCIP_STAGE_SOLVING
30453  */
30455  SCIP* scip, /**< SCIP data structure */
30456  SCIP_ROW** row, /**< pointer to row */
30457  const char* name, /**< name of row */
30458  SCIP_Real lhs, /**< left hand side of row */
30459  SCIP_Real rhs, /**< right hand side of row */
30460  SCIP_Bool local, /**< is row only valid locally? */
30461  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30462  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30463  )
30464 {
30465  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyRowUnspec", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30466 
30467  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
30468  name, 0, NULL, NULL, lhs, rhs, SCIP_ROWORIGINTYPE_UNSPEC, NULL, local, modifiable, removable) );
30469 
30470  return SCIP_OKAY;
30471 }
30472 
30473 /** creates and captures an LP row without any coefficients
30474  *
30475  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30476  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30477  *
30478  * @pre this method can be called in one of the following stages of the SCIP solving process:
30479  * - \ref SCIP_STAGE_INITSOLVE
30480  * - \ref SCIP_STAGE_SOLVING
30481  *
30482  * @deprecated Please use SCIPcreateEmptyRowCons() or SCIPcreateEmptyRowSepa() when calling from a constraint handler or separator in order
30483  * to facilitate correct statistics. If the call is from neither a constraint handler or separator, use SCIPcreateEmptyRowUnspec().
30484  */
30486  SCIP* scip, /**< SCIP data structure */
30487  SCIP_ROW** row, /**< pointer to row */
30488  const char* name, /**< name of row */
30489  SCIP_Real lhs, /**< left hand side of row */
30490  SCIP_Real rhs, /**< right hand side of row */
30491  SCIP_Bool local, /**< is row only valid locally? */
30492  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30493  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30494  )
30495 {
30496  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30497 
30498  SCIP_CALL( SCIPcreateEmptyRowUnspec(scip, row, name, lhs, rhs, local, modifiable, removable) );
30499 
30500  return SCIP_OKAY;
30501 }
30502 
30503 /** increases usage counter of LP row
30504  *
30505  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30506  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30507  *
30508  * @pre this method can be called in one of the following stages of the SCIP solving process:
30509  * - \ref SCIP_STAGE_INITSOLVE
30510  * - \ref SCIP_STAGE_SOLVING
30511  */
30513  SCIP* scip, /**< SCIP data structure */
30514  SCIP_ROW* row /**< row to capture */
30515  )
30516 {
30517  SCIP_CALL( checkStage(scip, "SCIPcaptureRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30518 
30519  SCIProwCapture(row);
30520 
30521  return SCIP_OKAY;
30522 }
30523 
30524 /** decreases usage counter of LP row, and frees memory if necessary
30525  *
30526  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30527  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30528  *
30529  * @pre this method can be called in one of the following stages of the SCIP solving process:
30530  * - \ref SCIP_STAGE_INITSOLVE
30531  * - \ref SCIP_STAGE_SOLVING
30532  * - \ref SCIP_STAGE_EXITSOLVE
30533  */
30535  SCIP* scip, /**< SCIP data structure */
30536  SCIP_ROW** row /**< pointer to LP row */
30537  )
30538 {
30539  SCIP_CALL( checkStage(scip, "SCIPreleaseRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
30540 
30541  SCIP_CALL( SCIProwRelease(row, scip->mem->probmem, scip->set, scip->lp) );
30542 
30543  return SCIP_OKAY;
30544 }
30545 
30546 /** changes left hand side of LP row
30547  *
30548  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30549  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30550  *
30551  * @pre this method can be called in one of the following stages of the SCIP solving process:
30552  * - \ref SCIP_STAGE_INITSOLVE
30553  * - \ref SCIP_STAGE_SOLVING
30554  */
30556  SCIP* scip, /**< SCIP data structure */
30557  SCIP_ROW* row, /**< LP row */
30558  SCIP_Real lhs /**< new left hand side */
30559  )
30560 {
30561  SCIP_CALL( checkStage(scip, "SCIPchgRowLhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30562 
30563  assert(!SCIPlpDiving(scip->lp) || (row->lppos == -1));
30564 
30565  SCIP_CALL( SCIProwChgLhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, lhs) );
30566 
30567  return SCIP_OKAY;
30568 }
30569 
30570 /** changes right hand side of LP row
30571  *
30572  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30573  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30574  *
30575  * @pre this method can be called in one of the following stages of the SCIP solving process:
30576  * - \ref SCIP_STAGE_INITSOLVE
30577  * - \ref SCIP_STAGE_SOLVING
30578  */
30580  SCIP* scip, /**< SCIP data structure */
30581  SCIP_ROW* row, /**< LP row */
30582  SCIP_Real rhs /**< new right hand side */
30583  )
30584 {
30585  SCIP_CALL( checkStage(scip, "SCIPchgRowRhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30586 
30587  assert(!SCIPlpDiving(scip->lp) || (row->lppos == -1));
30588 
30589  SCIP_CALL( SCIProwChgRhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, rhs) );
30590 
30591  return SCIP_OKAY;
30592 }
30593 
30594 /** informs row, that all subsequent additions of variables to the row should be cached and not directly applied;
30595  * after all additions were applied, SCIPflushRowExtensions() must be called;
30596  * while the caching of row extensions is activated, information methods of the row give invalid results;
30597  * caching should be used, if a row is build with SCIPaddVarToRow() calls variable by variable to increase
30598  * the performance
30599  *
30600  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30601  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30602  *
30603  * @pre this method can be called in one of the following stages of the SCIP solving process:
30604  * - \ref SCIP_STAGE_INITSOLVE
30605  * - \ref SCIP_STAGE_SOLVING
30606  */
30608  SCIP* scip, /**< SCIP data structure */
30609  SCIP_ROW* row /**< LP row */
30610  )
30611 {
30612  SCIP_CALL( checkStage(scip, "SCIPcacheRowExtensions", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30613 
30614  /* delay the row sorting */
30615  SCIProwDelaySort(row);
30616 
30617  return SCIP_OKAY;
30618 }
30619 
30620 /** flushes all cached row extensions after a call of SCIPcacheRowExtensions() and merges coefficients with
30621  * equal columns into a single coefficient
30622  *
30623  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30624  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30625  *
30626  * @pre this method can be called in one of the following stages of the SCIP solving process:
30627  * - \ref SCIP_STAGE_INITSOLVE
30628  * - \ref SCIP_STAGE_SOLVING
30629  */
30631  SCIP* scip, /**< SCIP data structure */
30632  SCIP_ROW* row /**< LP row */
30633  )
30634 {
30635  SCIP_CALL( checkStage(scip, "SCIPflushRowExtensions", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30636 
30637  /* force the row sorting, and merge equal column entries */
30638  SCIProwForceSort(row, scip->set);
30639 
30640  return SCIP_OKAY;
30641 }
30642 
30643 /** resolves variable to columns and adds them with the coefficient to the row
30644  *
30645  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30646  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30647  *
30648  * @attention If the absolute value of val is below the SCIP epsilon tolerance, the variable will not added.
30649  *
30650  * @pre this method can be called in one of the following stages of the SCIP solving process:
30651  * - \ref SCIP_STAGE_INITSOLVE
30652  * - \ref SCIP_STAGE_SOLVING
30653  *
30654  * @note In case calling this method in the enforcement process of an lp solution, it might be that some variables,
30655  * that were not yet in the LP (e.g. dynamic columns) will change their lp solution value returned by SCIP.
30656  * For example, a variable, which has a negative objective value, that has no column in the lp yet, is in the lp solution
30657  * on its upper bound (variables with status SCIP_VARSTATUS_LOOSE are in an lp solution on it's best bound), but
30658  * creating the column, changes the solution value (variable than has status SCIP_VARSTATUS_COLUMN, and the
30659  * initialization sets the lp solution value) to 0.0. (This leads to the conclusion that, if a constraint was
30660  * violated, the linear relaxation might not be violated anymore.)
30661  */
30663  SCIP* scip, /**< SCIP data structure */
30664  SCIP_ROW* row, /**< LP row */
30665  SCIP_VAR* var, /**< problem variable */
30666  SCIP_Real val /**< value of coefficient */
30667  )
30668 {
30669  SCIP_CALL( checkStage(scip, "SCIPaddVarToRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30670 
30671  SCIP_CALL( SCIPvarAddToRow(var, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->transprob, scip->lp, row, val) );
30672 
30673  return SCIP_OKAY;
30674 }
30675 
30676 /** resolves variables to columns and adds them with the coefficients to the row;
30677  * this method caches the row extensions and flushes them afterwards to gain better performance
30678  *
30679  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30680  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30681  *
30682  * @attention If a coefficients absolute value is below the SCIP epsilon tolerance, the variable with its value is not added.
30683  *
30684  * @pre this method can be called in one of the following stages of the SCIP solving process:
30685  * - \ref SCIP_STAGE_INITSOLVE
30686  * - \ref SCIP_STAGE_SOLVING
30687  */
30689  SCIP* scip, /**< SCIP data structure */
30690  SCIP_ROW* row, /**< LP row */
30691  int nvars, /**< number of variables to add to the row */
30692  SCIP_VAR** vars, /**< problem variables to add */
30693  SCIP_Real* vals /**< values of coefficients */
30694  )
30695 {
30696  int v;
30697 
30698  assert(nvars == 0 || vars != NULL);
30699  assert(nvars == 0 || vals != NULL);
30700 
30701  SCIP_CALL( checkStage(scip, "SCIPaddVarsToRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30702 
30703  /* resize the row to be able to store all variables (at least, if they are COLUMN variables) */
30704  SCIP_CALL( SCIProwEnsureSize(row, scip->mem->probmem, scip->set, SCIProwGetNNonz(row) + nvars) );
30705 
30706  /* delay the row sorting */
30707  SCIProwDelaySort(row);
30708 
30709  /* add the variables to the row */
30710  for( v = 0; v < nvars; ++v )
30711  {
30712  SCIP_CALL( SCIPvarAddToRow(vars[v], scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->transprob, scip->lp,
30713  row, vals[v]) );
30714  }
30715 
30716  /* force the row sorting */
30717  SCIProwForceSort(row, scip->set);
30718 
30719  return SCIP_OKAY;
30720 }
30721 
30722 /** resolves variables to columns and adds them with the same single coefficient to the row;
30723  * this method caches the row extensions and flushes them afterwards to gain better performance
30724  *
30725  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30726  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30727  *
30728  * @attention If the absolute value of val is below the SCIP epsilon tolerance, the variables will not added.
30729  *
30730  * @pre this method can be called in one of the following stages of the SCIP solving process:
30731  * - \ref SCIP_STAGE_INITSOLVE
30732  * - \ref SCIP_STAGE_SOLVING
30733  */
30735  SCIP* scip, /**< SCIP data structure */
30736  SCIP_ROW* row, /**< LP row */
30737  int nvars, /**< number of variables to add to the row */
30738  SCIP_VAR** vars, /**< problem variables to add */
30739  SCIP_Real val /**< unique value of all coefficients */
30740  )
30741 {
30742  int v;
30743 
30744  assert(nvars == 0 || vars != NULL);
30745 
30746  SCIP_CALL( checkStage(scip, "SCIPaddVarsToRowSameCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30747 
30748  /* resize the row to be able to store all variables (at least, if they are COLUMN variables) */
30749  SCIP_CALL( SCIProwEnsureSize(row, scip->mem->probmem, scip->set, SCIProwGetNNonz(row) + nvars) );
30750 
30751  /* delay the row sorting */
30752  SCIProwDelaySort(row);
30753 
30754  /* add the variables to the row */
30755  for( v = 0; v < nvars; ++v )
30756  {
30757  SCIP_CALL( SCIPvarAddToRow(vars[v], scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->transprob, scip->lp,
30758  row, val) );
30759  }
30760 
30761  /* force the row sorting */
30762  SCIProwForceSort(row, scip->set);
30763 
30764  return SCIP_OKAY;
30765 }
30766 
30767 /** tries to find a value, such that all row coefficients, if scaled with this value become integral
30768  *
30769  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30770  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30771  *
30772  * @pre this method can be called in one of the following stages of the SCIP solving process:
30773  * - \ref SCIP_STAGE_INITSOLVE
30774  * - \ref SCIP_STAGE_SOLVING
30775  */
30777  SCIP* scip, /**< SCIP data structure */
30778  SCIP_ROW* row, /**< LP row */
30779  SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
30780  SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
30781  SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
30782  SCIP_Real maxscale, /**< maximal allowed scalar */
30783  SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */
30784  SCIP_Real* intscalar, /**< pointer to store scalar that would make the coefficients integral, or NULL */
30785  SCIP_Bool* success /**< stores whether returned value is valid */
30786  )
30787 {
30788  SCIP_CALL( checkStage(scip, "SCIPcalcRowIntegralScalar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30789 
30790  SCIP_CALL( SCIProwCalcIntegralScalar(row, scip->set, mindelta, maxdelta, maxdnom, maxscale,
30791  usecontvars, intscalar, success) );
30792 
30793  return SCIP_OKAY;
30794 }
30795 
30796 /** tries to scale row, s.t. all coefficients (of integer variables) become integral
30797  *
30798  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30799  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30800  *
30801  * @pre this method can be called in one of the following stages of the SCIP solving process:
30802  * - \ref SCIP_STAGE_INITSOLVE
30803  * - \ref SCIP_STAGE_SOLVING
30804  */
30806  SCIP* scip, /**< SCIP data structure */
30807  SCIP_ROW* row, /**< LP row */
30808  SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
30809  SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
30810  SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
30811  SCIP_Real maxscale, /**< maximal value to scale row with */
30812  SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */
30813  SCIP_Bool* success /**< stores whether row could be made rational */
30814  )
30815 {
30816  SCIP_CALL( checkStage(scip, "SCIPmakeRowIntegral", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30817 
30818  SCIP_CALL( SCIProwMakeIntegral(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->stat, scip->lp, mindelta, maxdelta, maxdnom, maxscale,
30819  usecontvars, success) );
30820 
30821  return SCIP_OKAY;
30822 }
30823 
30824 /** marks a row to be not removable from the LP in the current node
30825  *
30826  * @pre this method can be called in the following stage of the SCIP solving process:
30827  * - \ref SCIP_STAGE_SOLVING
30828  */
30830  SCIP* scip, /**< SCIP data structure */
30831  SCIP_ROW* row /**< LP row */
30832  )
30833 {
30834  SCIP_CALL_ABORT( checkStage(scip, "SCIPmarkRowNotRemovableLocal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30835 
30836  SCIProwMarkNotRemovableLocal(row, scip->stat);
30837 }
30838 
30839 /** returns number of integral columns in the row
30840  *
30841  * @return number of integral columns in the row
30842  *
30843  * @pre this method can be called in one of the following stages of the SCIP solving process:
30844  * - \ref SCIP_STAGE_INITSOLVE
30845  * - \ref SCIP_STAGE_SOLVING
30846  */
30848  SCIP* scip, /**< SCIP data structure */
30849  SCIP_ROW* row /**< LP row */
30850  )
30851 {
30852  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowNumIntCols", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30853 
30854  return SCIProwGetNumIntCols(row, scip->set);
30855 }
30856 
30857 /** returns minimal absolute value of row vector's non-zero coefficients
30858  *
30859  * @return minimal absolute value of row vector's non-zero coefficients
30860  *
30861  * @pre this method can be called in one of the following stages of the SCIP solving process:
30862  * - \ref SCIP_STAGE_INITSOLVE
30863  * - \ref SCIP_STAGE_SOLVING
30864  */
30866  SCIP* scip, /**< SCIP data structure */
30867  SCIP_ROW* row /**< LP row */
30868  )
30869 {
30870  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowMinCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30871 
30872  return SCIProwGetMinval(row, scip->set);
30873 }
30874 
30875 /** returns maximal absolute value of row vector's non-zero coefficients
30876  *
30877  * @return maximal absolute value of row vector's non-zero coefficients
30878  *
30879  * @pre this method can be called in one of the following stages of the SCIP solving process:
30880  * - \ref SCIP_STAGE_INITSOLVE
30881  * - \ref SCIP_STAGE_SOLVING
30882  */
30884  SCIP* scip, /**< SCIP data structure */
30885  SCIP_ROW* row /**< LP row */
30886  )
30887 {
30888  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowMaxCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30889 
30890  return SCIProwGetMaxval(row, scip->set);
30891 }
30892 
30893 /** returns the minimal activity of a row w.r.t. the column's bounds
30894  *
30895  * @return the minimal activity of a row w.r.t. the column's bounds
30896  *
30897  * @pre this method can be called in one of the following stages of the SCIP solving process:
30898  * - \ref SCIP_STAGE_SOLVING
30899  */
30901  SCIP* scip, /**< SCIP data structure */
30902  SCIP_ROW* row /**< LP row */
30903  )
30904 {
30905  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowMinActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30906 
30907  return SCIProwGetMinActivity(row, scip->set, scip->stat);
30908 }
30909 
30910 /** returns the maximal activity of a row w.r.t. the column's bounds
30911  *
30912  * @return the maximal activity of a row w.r.t. the column's bounds
30913  *
30914  * @pre this method can be called in one of the following stages of the SCIP solving process:
30915  * - \ref SCIP_STAGE_SOLVING
30916  */
30918  SCIP* scip, /**< SCIP data structure */
30919  SCIP_ROW* row /**< LP row */
30920  )
30921 {
30922  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowMaxActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30923 
30924  return SCIProwGetMaxActivity(row, scip->set, scip->stat);
30925 }
30926 
30927 /** recalculates the activity of a row in the last LP solution
30928  *
30929  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30930  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30931  *
30932  * @pre this method can be called in one of the following stages of the SCIP solving process:
30933  * - \ref SCIP_STAGE_SOLVING
30934  */
30936  SCIP* scip, /**< SCIP data structure */
30937  SCIP_ROW* row /**< LP row */
30938  )
30939 {
30940  SCIP_CALL( checkStage(scip, "SCIPrecalcRowLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30941 
30942  SCIProwRecalcLPActivity(row, scip->stat);
30943 
30944  return SCIP_OKAY;
30945 }
30946 
30947 /** returns the activity of a row in the last LP solution
30948  *
30949  * @return activity of a row in the last LP solution
30950  *
30951  * @pre this method can be called in one of the following stages of the SCIP solving process:
30952  * - \ref SCIP_STAGE_SOLVING
30953  */
30955  SCIP* scip, /**< SCIP data structure */
30956  SCIP_ROW* row /**< LP row */
30957  )
30958 {
30959  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30960 
30961  return SCIProwGetLPActivity(row, scip->set, scip->stat, scip->lp);
30962 }
30963 
30964 /** returns the feasibility of a row in the last LP solution
30965  *
30966  * @return the feasibility of a row in the last LP solution: negative value means infeasibility
30967  *
30968  * @pre this method can be called in one of the following stages of the SCIP solving process:
30969  * - \ref SCIP_STAGE_SOLVING
30970  */
30972  SCIP* scip, /**< SCIP data structure */
30973  SCIP_ROW* row /**< LP row */
30974  )
30975 {
30976  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowLPFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30977 
30978  return SCIProwGetLPFeasibility(row, scip->set, scip->stat, scip->lp);
30979 }
30980 
30981 /** recalculates the activity of a row for the current pseudo solution
30982  *
30983  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30984  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30985  *
30986  * @pre this method can be called in one of the following stages of the SCIP solving process:
30987  * - \ref SCIP_STAGE_SOLVING
30988  */
30990  SCIP* scip, /**< SCIP data structure */
30991  SCIP_ROW* row /**< LP row */
30992  )
30993 {
30994  SCIP_CALL( checkStage(scip, "SCIPrecalcRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30995 
30996  SCIProwRecalcPseudoActivity(row, scip->stat);
30997 
30998  return SCIP_OKAY;
30999 }
31000 
31001 /** returns the activity of a row for the current pseudo solution
31002  *
31003  * @return the activity of a row for the current pseudo solution
31004  *
31005  * @pre this method can be called in one of the following stages of the SCIP solving process:
31006  * - \ref SCIP_STAGE_SOLVING
31007  */
31009  SCIP* scip, /**< SCIP data structure */
31010  SCIP_ROW* row /**< LP row */
31011  )
31012 {
31013  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31014 
31015  return SCIProwGetPseudoActivity(row, scip->set, scip->stat);
31016 }
31017 
31018 /** returns the feasibility of a row for the current pseudo solution: negative value means infeasibility
31019  *
31020  * @return the feasibility of a row for the current pseudo solution: negative value means infeasibility
31021  *
31022  * @pre this method can be called in one of the following stages of the SCIP solving process:
31023  * - \ref SCIP_STAGE_SOLVING
31024  */
31026  SCIP* scip, /**< SCIP data structure */
31027  SCIP_ROW* row /**< LP row */
31028  )
31029 {
31030  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowPseudoFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31031 
31032  return SCIProwGetPseudoFeasibility(row, scip->set, scip->stat);
31033 }
31034 
31035 /** recalculates the activity of a row in the last LP or pseudo solution
31036  *
31037  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31038  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31039  *
31040  * @pre this method can be called in one of the following stages of the SCIP solving process:
31041  * - \ref SCIP_STAGE_SOLVING
31042  */
31044  SCIP* scip, /**< SCIP data structure */
31045  SCIP_ROW* row /**< LP row */
31046  )
31047 {
31048  SCIP_CALL( checkStage(scip, "SCIPrecalcRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31049 
31050  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
31051  SCIProwRecalcLPActivity(row, scip->stat);
31052  else
31053  SCIProwRecalcPseudoActivity(row, scip->stat);
31054 
31055  return SCIP_OKAY;
31056 }
31057 
31058 /** returns the activity of a row in the last LP or pseudo solution
31059  *
31060  * @return the activity of a row in the last LP or pseudo solution
31061  *
31062  * @pre this method can be called in one of the following stages of the SCIP solving process:
31063  * - \ref SCIP_STAGE_SOLVING
31064  */
31066  SCIP* scip, /**< SCIP data structure */
31067  SCIP_ROW* row /**< LP row */
31068  )
31069 {
31070  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31071 
31072  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
31073  return SCIProwGetLPActivity(row, scip->set, scip->stat, scip->lp);
31074  else
31075  return SCIProwGetPseudoActivity(row, scip->set, scip->stat);
31076 }
31077 
31078 /** returns the feasibility of a row in the last LP or pseudo solution
31079  *
31080  * @return the feasibility of a row in the last LP or pseudo solution
31081  *
31082  * @pre this method can be called in one of the following stages of the SCIP solving process:
31083  * - \ref SCIP_STAGE_SOLVING
31084  */
31086  SCIP* scip, /**< SCIP data structure */
31087  SCIP_ROW* row /**< LP row */
31088  )
31089 {
31090  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31091 
31092  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
31093  return SCIProwGetLPFeasibility(row, scip->set, scip->stat, scip->lp);
31094  else
31095  return SCIProwGetPseudoFeasibility(row, scip->set, scip->stat);
31096 }
31097 
31098 /** returns the activity of a row for the given primal solution
31099  *
31100  * @return the activitiy of a row for the given primal solution
31101  *
31102  * @pre this method can be called in one of the following stages of the SCIP solving process:
31103  * - \ref SCIP_STAGE_SOLVING
31104  */
31106  SCIP* scip, /**< SCIP data structure */
31107  SCIP_ROW* row, /**< LP row */
31108  SCIP_SOL* sol /**< primal CIP solution */
31109  )
31110 {
31111  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowSolActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
31112 
31113  if( sol != NULL )
31114  return SCIProwGetSolActivity(row, scip->set, scip->stat, sol);
31115  else if( SCIPtreeHasCurrentNodeLP(scip->tree) )
31116  return SCIProwGetLPActivity(row, scip->set, scip->stat, scip->lp);
31117  else
31118  return SCIProwGetPseudoActivity(row, scip->set, scip->stat);
31119 }
31120 
31121 /** returns the feasibility of a row for the given primal solution
31122  *
31123  * @return the feasibility of a row for the given primal solution
31124  *
31125  * @pre this method can be called in one of the following stages of the SCIP solving process:
31126  * - \ref SCIP_STAGE_SOLVING
31127  */
31129  SCIP* scip, /**< SCIP data structure */
31130  SCIP_ROW* row, /**< LP row */
31131  SCIP_SOL* sol /**< primal CIP solution */
31132  )
31133 {
31134  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowSolFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31135 
31136  if( sol != NULL )
31137  return SCIProwGetSolFeasibility(row, scip->set, scip->stat, sol);
31138  else if( SCIPtreeHasCurrentNodeLP(scip->tree) )
31139  return SCIProwGetLPFeasibility(row, scip->set, scip->stat, scip->lp);
31140  else
31141  return SCIProwGetPseudoFeasibility(row, scip->set, scip->stat);
31142 }
31143 
31144 /** output row to file stream via the message handler system
31145  *
31146  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31147  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31148  *
31149  * @pre this method can be called in one of the following stages of the SCIP solving process:
31150  * - \ref SCIP_STAGE_SOLVING
31151  * - \ref SCIP_STAGE_SOLVED
31152  * - \ref SCIP_STAGE_EXITSOLVE
31153  */
31155  SCIP* scip, /**< SCIP data structure */
31156  SCIP_ROW* row, /**< LP row */
31157  FILE* file /**< output file (or NULL for standard output) */
31158  )
31159 {
31160  assert(row != NULL);
31161 
31162  SCIP_CALL( checkStage(scip, "SCIPprintRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
31163 
31164  SCIProwPrint(row, scip->messagehdlr, file);
31165 
31166  return SCIP_OKAY;
31167 }
31168 
31169 
31170 /*
31171  * NLP methods
31172  */
31173 
31174 /** returns whether the NLP relaxation has been enabled
31175  *
31176  * If the NLP relaxation is enabled, then SCIP will construct the NLP relaxation when the solving process is about to begin.
31177  * To check whether an NLP is existing, use SCIPisNLPConstructed().
31178  *
31179  * @pre This method can be called if SCIP is in one of the following stages:
31180  * - \ref SCIP_STAGE_INITPRESOLVE
31181  * - \ref SCIP_STAGE_PRESOLVING
31182  * - \ref SCIP_STAGE_EXITPRESOLVE
31183  * - \ref SCIP_STAGE_PRESOLVED
31184  * - \ref SCIP_STAGE_INITSOLVE
31185  * - \ref SCIP_STAGE_SOLVING
31186  *
31187  * @see SCIPenableNLP
31188  */
31190  SCIP* scip /**< SCIP data structure */
31191  )
31192 {
31193  SCIP_CALL_ABORT( checkStage(scip, "SCIPisNLPEnabled", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31194 
31195  return scip->transprob->nlpenabled;
31196 }
31197 
31198 /** marks that there are constraints that are representable by nonlinear rows
31199  *
31200  * This method should be called by a constraint handler if it has constraints that have a representation as nonlinear rows.
31201  *
31202  * The function should be called before the branch-and-bound process is initialized, e.g., when presolve is exiting.
31203  *
31204  * @pre This method can be called if SCIP is in one of the following stages:
31205  * - \ref SCIP_STAGE_INITPRESOLVE
31206  * - \ref SCIP_STAGE_PRESOLVING
31207  * - \ref SCIP_STAGE_EXITPRESOLVE
31208  * - \ref SCIP_STAGE_PRESOLVED
31209  * - \ref SCIP_STAGE_INITSOLVE
31210  * - \ref SCIP_STAGE_SOLVING
31211  */
31213  SCIP* scip /**< SCIP data structure */
31214  )
31215 {
31216  SCIP_CALL_ABORT( checkStage(scip, "SCIPenableNLP", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31217 
31218  scip->transprob->nlpenabled = TRUE;
31219 }
31220 
31221 /** returns, whether an NLP has been constructed
31222  *
31223  * @pre This method can be called if SCIP is in one of the following stages:
31224  * - \ref SCIP_STAGE_INITSOLVE
31225  * - \ref SCIP_STAGE_SOLVING
31226  */
31228  SCIP* scip /**< SCIP data structure */
31229  )
31230 {
31231  SCIP_CALL_ABORT( checkStage(scip, "SCIPisNLPConstructed", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31232 
31233  return (scip->nlp != NULL);
31234 }
31235 
31236 /** returns whether the NLP has a continuous variable in a nonlinear term
31237  *
31238  * @pre This method can be called if SCIP is in one of the following stages:
31239  * - \ref SCIP_STAGE_INITSOLVE
31240  * - \ref SCIP_STAGE_SOLVING
31241  */
31243  SCIP* scip /**< SCIP data structure */
31244  )
31245 {
31246  SCIP_CALL_ABORT( checkStage(scip, "SCIPhasNLPContinuousNonlinearity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31247 
31248  if( scip->nlp == NULL )
31249  {
31250  SCIPerrorMessage("NLP has not been not constructed.\n");
31251  SCIPABORT();
31252  return FALSE; /*lint !e527*/
31253  }
31254 
31255  return SCIPnlpHasContinuousNonlinearity(scip->nlp);
31256 }
31257 
31258 /** gets current NLP variables along with the current number of NLP variables
31259  *
31260  * @pre This method can be called if SCIP is in one of the following stages:
31261  * - \ref SCIP_STAGE_INITSOLVE
31262  * - \ref SCIP_STAGE_SOLVING
31263  */
31265  SCIP* scip, /**< SCIP data structure */
31266  SCIP_VAR*** vars, /**< pointer to store the array of NLP variables, or NULL */
31267  int* nvars /**< pointer to store the number of NLP variables, or NULL */
31268  )
31269 {
31270  SCIP_CALL( checkStage(scip, "SCIPgetNLPVarsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31271 
31272  if( scip->nlp != NULL )
31273  {
31274  if( vars != NULL )
31275  *vars = SCIPnlpGetVars(scip->nlp);
31276  if( nvars != NULL )
31277  *nvars = SCIPnlpGetNVars(scip->nlp);
31278  }
31279  else
31280  {
31281  SCIPerrorMessage("NLP has not been constructed.\n");
31282  return SCIP_INVALIDCALL;
31283  }
31284 
31285  return SCIP_OKAY;
31286 }
31287 
31288 /** gets array with variables of the NLP
31289  *
31290  * @pre This method can be called if SCIP is in one of the following stages:
31291  * - \ref SCIP_STAGE_INITSOLVE
31292  * - \ref SCIP_STAGE_SOLVING
31293  */
31295  SCIP* scip /**< SCIP data structure */
31296  )
31297 {
31298  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPVars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31299 
31300  if( scip->nlp == NULL )
31301  {
31302  SCIPerrorMessage("NLP has not been constructed.\n");
31303  SCIPABORT();
31304  return NULL; /*lint !e527*/
31305  }
31306 
31307  return SCIPnlpGetVars(scip->nlp);
31308 }
31309 
31310 /** gets current number of variables in NLP
31311  *
31312  * @pre This method can be called if SCIP is in one of the following stages:
31313  * - \ref SCIP_STAGE_INITSOLVE
31314  * - \ref SCIP_STAGE_SOLVING
31315  */
31317  SCIP* scip /**< SCIP data structure */
31318  )
31319 {
31320  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNLPVars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31321 
31322  if( scip->nlp == NULL )
31323  {
31324  SCIPerrorMessage("NLP has not been constructed.\n");
31325  SCIPABORT();
31326  return 0; /*lint !e527*/
31327  }
31328 
31329  return SCIPnlpGetNVars(scip->nlp);
31330 }
31331 
31332 /** computes for each variables the number of NLP rows in which the variable appears in a nonlinear var
31333  *
31334  * @pre This method can be called if SCIP is in one of the following stages:
31335  * - \ref SCIP_STAGE_INITSOLVE
31336  * - \ref SCIP_STAGE_SOLVING
31337  */
31339  SCIP* scip, /**< SCIP data structure */
31340  int* nlcount /**< an array of length at least SCIPnlpGetNVars() to store nonlinearity counts of variables */
31341  )
31342 {
31343  SCIP_CALL( checkStage(scip, "SCIPgetNLPVarsNonlinearity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31344 
31345  if( scip->nlp == NULL )
31346  {
31347  SCIPerrorMessage("NLP has not been constructed.\n");
31348  return SCIP_INVALIDCALL;
31349  }
31350 
31351  SCIP_CALL( SCIPnlpGetVarsNonlinearity(scip->nlp, nlcount) );
31352 
31353  return SCIP_OKAY;
31354 }
31355 
31356 /** returns dual solution values associated with lower bounds of NLP variables
31357  *
31358  * @pre This method can be called if SCIP is in one of the following stages:
31359  * - \ref SCIP_STAGE_INITSOLVE
31360  * - \ref SCIP_STAGE_SOLVING
31361  */
31363  SCIP* scip /**< SCIP data structure */
31364  )
31365 {
31366  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPVarsLbDualsol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31367 
31368  if( scip->nlp == NULL )
31369  {
31370  SCIPerrorMessage("NLP has not been constructed.\n");
31371  SCIPABORT();
31372  return NULL; /*lint !e527*/
31373  }
31374 
31375  return SCIPnlpGetVarsLbDualsol(scip->nlp);
31376 }
31377 
31378 /** returns dual solution values associated with upper bounds of NLP variables
31379  *
31380  * @pre This method can be called if SCIP is in one of the following stages:
31381  * - \ref SCIP_STAGE_INITSOLVE
31382  * - \ref SCIP_STAGE_SOLVING
31383  */
31385  SCIP* scip /**< SCIP data structure */
31386  )
31387 {
31388  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPVarsUbDualsol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31389 
31390  if( scip->nlp == NULL )
31391  {
31392  SCIPerrorMessage("NLP has not been constructed.\n");
31393  SCIPABORT();
31394  return NULL; /*lint !e527*/
31395  }
31396 
31397  return SCIPnlpGetVarsUbDualsol(scip->nlp);
31398 }
31399 
31400 /** gets current NLP nonlinear rows along with the current number of NLP nonlinear rows
31401  *
31402  * @pre This method can be called if SCIP is in one of the following stages:
31403  * - \ref SCIP_STAGE_INITSOLVE
31404  * - \ref SCIP_STAGE_SOLVING
31405  */
31407  SCIP* scip, /**< SCIP data structure */
31408  SCIP_NLROW*** nlrows, /**< pointer to store the array of NLP nonlinear rows, or NULL */
31409  int* nnlrows /**< pointer to store the number of NLP nonlinear rows, or NULL */
31410  )
31411 {
31412  SCIP_CALL( checkStage(scip, "SCIPgetNLPNlRowsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31413 
31414  if( scip->nlp == NULL )
31415  {
31416  SCIPerrorMessage("NLP has not been constructed.\n");
31417  return SCIP_INVALIDCALL;
31418  }
31419 
31420  if( nlrows != NULL )
31421  *nlrows = SCIPnlpGetNlRows(scip->nlp);
31422  if( nnlrows != NULL )
31423  *nnlrows = SCIPnlpGetNNlRows(scip->nlp);
31424 
31425  return SCIP_OKAY;
31426 }
31427 
31428 /** gets array with nonlinear rows of the NLP
31429  *
31430  * @pre This method can be called if SCIP is in one of the following stages:
31431  * - \ref SCIP_STAGE_INITSOLVE
31432  * - \ref SCIP_STAGE_SOLVING
31433  */
31435  SCIP* scip /**< SCIP data structure */
31436  )
31437 {
31438  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPNlRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31439 
31440  if( scip->nlp == NULL )
31441  {
31442  SCIPerrorMessage("NLP has not been constructed.\n");
31443  SCIPABORT();
31444  return NULL; /*lint !e527*/
31445  }
31446 
31447  return SCIPnlpGetNlRows(scip->nlp);
31448 }
31449 
31450 /** gets current number of nonlinear rows in NLP
31451  *
31452  * @pre This method can be called if SCIP is in one of the following stages:
31453  * - \ref SCIP_STAGE_INITSOLVE
31454  * - \ref SCIP_STAGE_SOLVING
31455  */
31457  SCIP* scip /**< SCIP data structure */
31458  )
31459 {
31460  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNLPNlRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31461 
31462  if( scip->nlp == NULL )
31463  {
31464  SCIPerrorMessage("NLP has not been constructed.\n");
31465  SCIPABORT();
31466  return 0; /*lint !e527*/
31467  }
31468 
31469  return SCIPnlpGetNNlRows(scip->nlp);
31470 }
31471 
31472 /** adds a nonlinear row to the NLP. This row is captured by the NLP.
31473  *
31474  * @pre This method can be called if SCIP is in one of the following stages:
31475  * - \ref SCIP_STAGE_INITSOLVE
31476  * - \ref SCIP_STAGE_SOLVING
31477  */
31479  SCIP* scip, /**< SCIP data structure */
31480  SCIP_NLROW* nlrow /**< nonlinear row to add to NLP */
31481  )
31482 {
31483  SCIP_CALL( checkStage(scip, "SCIPaddNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31484 
31485  if( scip->nlp == NULL )
31486  {
31487  SCIPerrorMessage("NLP has not been constructed.\n");
31488  return SCIP_INVALIDCALL;
31489  }
31490 
31491  SCIP_CALL( SCIPnlpAddNlRow(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat, nlrow) );
31492 
31493  return SCIP_OKAY;
31494 }
31495 
31496 /** makes sure that the NLP of the current node is flushed
31497  *
31498  * @pre This method can be called if SCIP is in one of the following stages:
31499  * - \ref SCIP_STAGE_INITSOLVE
31500  * - \ref SCIP_STAGE_SOLVING
31501  */
31503  SCIP* scip /**< SCIP data structure */
31504  )
31505 {
31506  SCIP_CALL( checkStage(scip, "SCIPflushNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31507 
31508  if( scip->nlp == NULL )
31509  {
31510  SCIPerrorMessage("NLP has not been constructed.\n");
31511  return SCIP_INVALIDCALL;
31512  }
31513 
31514  SCIP_CALL( SCIPnlpFlush(scip->nlp, scip->mem->probmem, scip->set) );
31515 
31516  return SCIP_OKAY;
31517 }
31518 
31519 /** sets or clears initial primal guess for NLP solution (start point for NLP solver)
31520  *
31521  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31522  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31523  *
31524  * @pre This method can be called if SCIP is in one of the following stages:
31525  * - \ref SCIP_STAGE_INITSOLVE
31526  * - \ref SCIP_STAGE_SOLVING
31527  */
31529  SCIP* scip, /**< SCIP data structure */
31530  SCIP_Real* initialguess /**< values of initial guess (corresponding to variables from SCIPgetNLPVarsData), or NULL to use no start point */
31531  )
31532 {
31533  SCIP_CALL( checkStage(scip, "SCIPsetNLPInitialGuess", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31534 
31535  if( scip->nlp == NULL )
31536  {
31537  SCIPerrorMessage("NLP has not been constructed.\n");
31538  return SCIP_INVALIDCALL;
31539  }
31540 
31541  SCIP_CALL( SCIPnlpSetInitialGuess(scip->nlp, SCIPblkmem(scip), initialguess) );
31542 
31543  return SCIP_OKAY;
31544 }
31545 
31546 /** sets initial primal guess for NLP solution (start point for NLP solver)
31547  *
31548  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31549  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31550  *
31551  * @pre This method can be called if SCIP is in one of the following stages:
31552  * - \ref SCIP_STAGE_INITSOLVE
31553  * - \ref SCIP_STAGE_SOLVING
31554  */
31556  SCIP* scip, /**< SCIP data structure */
31557  SCIP_SOL* sol /**< solution which values should be taken as initial guess, or NULL for LP solution */
31558  )
31559 {
31560  SCIP_Real* vals;
31561 
31562  SCIP_CALL( checkStage(scip, "SCIPsetNLPInitialGuessSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31563 
31564  if( scip->nlp == NULL )
31565  {
31566  SCIPerrorMessage("NLP has not been constructed.\n");
31567  return SCIP_INVALIDCALL;
31568  }
31569 
31570  SCIP_CALL( SCIPallocBufferArray(scip, &vals, SCIPnlpGetNVars(scip->nlp)) );
31571  SCIP_CALL( SCIPgetSolVals(scip, sol, SCIPnlpGetNVars(scip->nlp), SCIPnlpGetVars(scip->nlp), vals) );
31572  SCIP_CALL( SCIPnlpSetInitialGuess(scip->nlp, SCIPblkmem(scip), vals) );
31573  SCIPfreeBufferArray(scip, &vals);
31574 
31575  return SCIP_OKAY;
31576 }
31577 
31578 /** solves the current NLP
31579  *
31580  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31581  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31582  *
31583  * @pre This method can be called if SCIP is in one of the following stages:
31584  * - \ref SCIP_STAGE_INITSOLVE
31585  * - \ref SCIP_STAGE_SOLVING
31586  */
31588  SCIP* scip /**< SCIP data structure */
31589  )
31590 {
31591  SCIP_CALL( checkStage(scip, "SCIPsolveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31592 
31593  if( scip->nlp == NULL )
31594  {
31595  SCIPerrorMessage("NLP has not been constructed.\n");
31596  return SCIP_INVALIDCALL;
31597  }
31598 
31599  SCIP_CALL( SCIPnlpSolve(scip->nlp, SCIPblkmem(scip), scip->set, scip->messagehdlr, scip->stat) );
31600 
31601  return SCIP_OKAY;
31602 }
31603 
31604 /** gets solution status of current NLP
31605  *
31606  * @pre This method can be called if SCIP is in one of the following stages:
31607  * - \ref SCIP_STAGE_INITSOLVE
31608  * - \ref SCIP_STAGE_SOLVING
31609  */
31611  SCIP* scip /**< SCIP data structure */
31612  )
31613 {
31614  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPSolstat", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31615 
31616  if( scip->nlp == NULL )
31617  {
31618  SCIPerrorMessage("NLP has not been constructed.\n");
31619  SCIPABORT();
31620  return SCIP_NLPSOLSTAT_UNKNOWN; /*lint !e527*/
31621  }
31622 
31623  return SCIPnlpGetSolstat(scip->nlp);
31624 }
31625 
31626 /** gets termination status of last NLP solve
31627  *
31628  * @pre This method can be called if SCIP is in one of the following stages:
31629  * - \ref SCIP_STAGE_INITSOLVE
31630  * - \ref SCIP_STAGE_SOLVING
31631  */
31633  SCIP* scip /**< SCIP data structure */
31634  )
31635 {
31636  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPTermstat", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31637 
31638  if( scip->nlp == NULL )
31639  {
31640  SCIPerrorMessage("NLP has not been constructed.\n");
31641  SCIPABORT();
31642  return SCIP_NLPTERMSTAT_OTHER; /*lint !e527*/
31643  }
31644 
31645  return SCIPnlpGetTermstat(scip->nlp);
31646 }
31647 
31648 /** gives statistics (number of iterations, solving time, ...) of last NLP solve
31649  *
31650  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31651  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31652  *
31653  * @pre This method can be called if SCIP is in one of the following stages:
31654  * - \ref SCIP_STAGE_INITSOLVE
31655  * - \ref SCIP_STAGE_SOLVING
31656  */
31658  SCIP* scip, /**< SCIP data structure */
31659  SCIP_NLPSTATISTICS* statistics /**< pointer to store statistics */
31660  )
31661 {
31662  SCIP_CALL( checkStage(scip, "SCIPgetNLPStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31663 
31664  if( scip->nlp == NULL )
31665  {
31666  SCIPerrorMessage("NLP has not been constructed.\n");
31667  return SCIP_INVALIDCALL;
31668  }
31669 
31670  SCIP_CALL( SCIPnlpGetStatistics(scip->nlp, statistics) );
31671 
31672  return SCIP_OKAY;
31673 }
31674 
31675 /** gets objective value of current NLP
31676  *
31677  * @pre This method can be called if SCIP is in one of the following stages:
31678  * - \ref SCIP_STAGE_INITSOLVE
31679  * - \ref SCIP_STAGE_SOLVING
31680  */
31682  SCIP* scip /**< SCIP data structure */
31683  )
31684 {
31685  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31686 
31687  if( scip->nlp != NULL )
31688  {
31689  return SCIPnlpGetObjval(scip->nlp);
31690  }
31691  else
31692  {
31693  SCIPerrorMessage("NLP has not been constructed.\n");
31694  return SCIP_INVALID;
31695  }
31696 }
31697 
31698 /** indicates whether a feasible solution for the current NLP is available
31699  * thus, returns whether the solution status <= feasible
31700  *
31701  * @pre This method can be called if SCIP is in one of the following stages:
31702  * - \ref SCIP_STAGE_INITSOLVE
31703  * - \ref SCIP_STAGE_SOLVING
31704  */
31706  SCIP* scip /**< SCIP data structure */
31707  )
31708 {
31709  SCIP_CALL_ABORT( checkStage(scip, "SCIPhasNLPSolution", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31710 
31711  if( scip->nlp == NULL )
31712  {
31713  SCIPerrorMessage("NLP has not been constructed.\n");
31714  SCIPABORT();
31715  return FALSE; /*lint !e527*/
31716  }
31717 
31718  return SCIPnlpHasSolution(scip->nlp);
31719 }
31720 
31721 /** gets fractional variables of last NLP solution along with solution values and fractionalities
31722  *
31723  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31724  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31725  *
31726  * @pre This method can be called if SCIP is in one of the following stages:
31727  * - \ref SCIP_STAGE_INITSOLVE
31728  * - \ref SCIP_STAGE_SOLVING
31729  */
31731  SCIP* scip, /**< SCIP data structure */
31732  SCIP_VAR*** fracvars, /**< pointer to store the array of NLP fractional variables, or NULL */
31733  SCIP_Real** fracvarssol, /**< pointer to store the array of NLP fractional variables solution values, or NULL */
31734  SCIP_Real** fracvarsfrac, /**< pointer to store the array of NLP fractional variables fractionalities, or NULL */
31735  int* nfracvars, /**< pointer to store the number of NLP fractional variables , or NULL */
31736  int* npriofracvars /**< pointer to store the number of NLP fractional variables with maximal branching priority, or NULL */
31737  )
31738 {
31739  SCIP_CALL( checkStage(scip, "SCIPgetNLPFracVars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31740 
31741  if( scip->nlp == NULL )
31742  {
31743  SCIPerrorMessage("NLP has not been constructed.\n");
31744  return SCIP_INVALIDCALL;
31745  }
31746 
31747  SCIP_CALL( SCIPnlpGetFracVars(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat, fracvars, fracvarssol, fracvarsfrac, nfracvars, npriofracvars) );
31748 
31749  return SCIP_OKAY;
31750 }
31751 
31752 /** gets integer parameter of NLP
31753  *
31754  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31755  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31756  *
31757  * @pre This method can be called if SCIP is in one of the following stages:
31758  * - \ref SCIP_STAGE_INITSOLVE
31759  * - \ref SCIP_STAGE_SOLVING
31760  */
31762  SCIP* scip, /**< SCIP data structure */
31763  SCIP_NLPPARAM type, /**< parameter number */
31764  int* ival /**< pointer to store the parameter value */
31765  )
31766 {
31767  SCIP_CALL( checkStage(scip, "SCIPgetNLPIntPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31768 
31769  if( scip->nlp == NULL )
31770  {
31771  SCIPerrorMessage("NLP has not been constructed.\n");
31772  return SCIP_INVALIDCALL;
31773  }
31774 
31775  SCIP_CALL( SCIPnlpGetIntPar(scip->nlp, type, ival) );
31776 
31777  return SCIP_OKAY;
31778 }
31779 
31780 /** sets integer parameter of NLP
31781  *
31782  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31783  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31784  *
31785  * @pre This method can be called if SCIP is in one of the following stages:
31786  * - \ref SCIP_STAGE_INITSOLVE
31787  * - \ref SCIP_STAGE_SOLVING
31788  */
31790  SCIP* scip, /**< SCIP data structure */
31791  SCIP_NLPPARAM type, /**< parameter number */
31792  int ival /**< parameter value */
31793  )
31794 {
31795  SCIP_CALL( checkStage(scip, "SCIPsetNLPIntPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31796 
31797  if( scip->nlp == NULL )
31798  {
31799  SCIPerrorMessage("NLP has not been constructed.\n");
31800  return SCIP_INVALIDCALL;
31801  }
31802 
31803  SCIP_CALL( SCIPnlpSetIntPar(scip->nlp, type, ival) );
31804 
31805  return SCIP_OKAY;
31806 }
31807 
31808 /** gets floating point parameter of NLP
31809  *
31810  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31811  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31812  *
31813  * @pre This method can be called if SCIP is in one of the following stages:
31814  * - \ref SCIP_STAGE_INITSOLVE
31815  * - \ref SCIP_STAGE_SOLVING
31816  */
31818  SCIP* scip, /**< SCIP data structure */
31819  SCIP_NLPPARAM type, /**< parameter number */
31820  SCIP_Real* dval /**< pointer to store the parameter value */
31821  )
31822 {
31823  SCIP_CALL( checkStage(scip, "SCIPgetNLPRealPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31824 
31825  if( scip->nlp == NULL )
31826  {
31827  SCIPerrorMessage("NLP has not been constructed.\n");
31828  return SCIP_INVALIDCALL;
31829  }
31830 
31831  SCIP_CALL( SCIPnlpGetRealPar(scip->nlp, type, dval) );
31832 
31833  return SCIP_OKAY;
31834 }
31835 
31836 /** sets floating point parameter of NLP
31837  *
31838  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31839  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31840  *
31841  * @pre This method can be called if SCIP is in one of the following stages:
31842  * - \ref SCIP_STAGE_INITSOLVE
31843  * - \ref SCIP_STAGE_SOLVING
31844  */
31846  SCIP* scip, /**< SCIP data structure */
31847  SCIP_NLPPARAM type, /**< parameter number */
31848  SCIP_Real dval /**< parameter value */
31849  )
31850 {
31851  SCIP_CALL( checkStage(scip, "SCIPsetNLPRealPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31852 
31853  if( scip->nlp == NULL )
31854  {
31855  SCIPerrorMessage("NLP has not been constructed.\n");
31856  return SCIP_INVALIDCALL;
31857  }
31858 
31859  SCIP_CALL( SCIPnlpSetRealPar(scip->nlp, type, dval) );
31860 
31861  return SCIP_OKAY;
31862 }
31863 
31864 /** gets string parameter of NLP
31865  *
31866  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31867  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31868  *
31869  * @pre This method can be called if SCIP is in one of the following stages:
31870  * - \ref SCIP_STAGE_INITSOLVE
31871  * - \ref SCIP_STAGE_SOLVING
31872  */
31874  SCIP* scip, /**< SCIP data structure */
31875  SCIP_NLPPARAM type, /**< parameter number */
31876  const char** sval /**< pointer to store the parameter value */
31877  )
31878 {
31879  SCIP_CALL( checkStage(scip, "SCIPgetNLPStringPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31880 
31881  if( scip->nlp == NULL )
31882  {
31883  SCIPerrorMessage("NLP has not been constructed.\n");
31884  return SCIP_INVALIDCALL;
31885  }
31886 
31887  SCIP_CALL( SCIPnlpGetStringPar(scip->nlp, type, sval) );
31888 
31889  return SCIP_OKAY;
31890 }
31891 
31892 /** sets string parameter of NLP
31893  *
31894  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31895  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31896  *
31897  * @pre This method can be called if SCIP is in one of the following stages:
31898  * - \ref SCIP_STAGE_INITSOLVE
31899  * - \ref SCIP_STAGE_SOLVING
31900  */
31902  SCIP* scip, /**< SCIP data structure */
31903  SCIP_NLPPARAM type, /**< parameter number */
31904  const char* sval /**< parameter value */
31905  )
31906 {
31907  SCIP_CALL( checkStage(scip, "SCIPsetNLPStringPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31908 
31909  if( scip->nlp == NULL )
31910  {
31911  SCIPerrorMessage("NLP has not been constructed.\n");
31912  return SCIP_INVALIDCALL;
31913  }
31914 
31915  SCIP_CALL( SCIPnlpSetStringPar(scip->nlp, type, sval) );
31916 
31917  return SCIP_OKAY;
31918 }
31919 
31920 /** writes current NLP to a file
31921  *
31922  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31923  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31924  *
31925  * @pre This method can be called if SCIP is in one of the following stages:
31926  * - \ref SCIP_STAGE_INITSOLVE
31927  * - \ref SCIP_STAGE_SOLVING
31928  */
31930  SCIP* scip, /**< SCIP data structure */
31931  const char* filename /**< file name */
31932  )
31933 {
31934  SCIP_CALL( checkStage(scip, "SCIPwriteNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31935 
31936  if( scip->nlp == NULL )
31937  {
31938  SCIPerrorMessage("NLP has not been constructed.\n");
31939  return SCIP_INVALIDCALL;
31940  }
31941 
31942  SCIP_CALL( SCIPnlpWrite(scip->nlp, scip->set, scip->messagehdlr, filename) );
31943 
31944  return SCIP_OKAY;
31945 }
31946 
31947 /** gets the NLP interface and problem used by the SCIP NLP;
31948  * with the NLPI and its problem you can use all of the methods defined in nlpi/nlpi.h;
31949  *
31950  * @warning You have to make sure, that the full internal state of the NLPI does not change or is recovered completely
31951  * after the end of the method that uses the NLPI. In particular, if you manipulate the NLP or its solution
31952  * (e.g. by calling one of the SCIPnlpiAdd...() or the SCIPnlpiSolve() method), you have to check in advance
31953  * whether the NLP is currently solved. If this is the case, you have to make sure, the internal solution
31954  * status is recovered completely at the end of your method. Additionally you have to resolve the NLP with
31955  * SCIPnlpiSolve() in order to reinstall the internal solution status.
31956  *
31957  * @warning Make also sure, that all parameter values that you have changed are set back to their original values.
31958  *
31959  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31960  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31961  *
31962  * @pre This method can be called if SCIP is in one of the following stages:
31963  * - \ref SCIP_STAGE_INITSOLVE
31964  * - \ref SCIP_STAGE_SOLVING
31965  */
31967  SCIP* scip, /**< SCIP data structure */
31968  SCIP_NLPI** nlpi, /**< pointer to store the NLP solver interface */
31969  SCIP_NLPIPROBLEM** nlpiproblem /**< pointer to store the NLP solver interface problem */
31970  )
31971 {
31972  assert(nlpi != NULL);
31973  assert(nlpiproblem != NULL);
31974 
31975  SCIP_CALL( checkStage(scip, "SCIPgetNLPI", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31976 
31977  if( scip->nlp == NULL )
31978  {
31979  SCIPerrorMessage("NLP has not been constructed.\n");
31980  return SCIP_INVALIDCALL;
31981  }
31982 
31983  *nlpi = SCIPnlpGetNLPI(scip->nlp);
31984  *nlpiproblem = SCIPnlpGetNLPIProblem(scip->nlp);
31985 
31986  return SCIP_OKAY;
31987 }
31988 
31989 
31990 /*
31991  * NLP diving methods
31992  */
31993 
31994 /**@name NLP Diving Methods */
31995 /**@{ */
31996 
31997 /** initiates NLP diving making methods SCIPchgVarObjDiveNLP(), SCIPchgVarBoundsDiveNLP(), SCIPchgVarsBoundsDiveNLP(), and SCIPsolveDiveNLP() available
31998  *
31999  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32000  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32001  *
32002  * @pre This method can be called if SCIP is in one of the following stages:
32003  * - \ref SCIP_STAGE_INITSOLVE
32004  * - \ref SCIP_STAGE_SOLVING
32005  */
32007  SCIP* scip /**< SCIP data structure */
32008  )
32009 {
32010  SCIP_CALL( checkStage(scip, "SCIPstartDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32011 
32012  if( scip->nlp == NULL )
32013  {
32014  SCIPerrorMessage("NLP has not been constructed.\n");
32015  return SCIP_INVALIDCALL;
32016  }
32017 
32018  SCIP_CALL( SCIPnlpStartDive(scip->nlp, SCIPblkmem(scip), scip->set) );
32019 
32020  return SCIP_OKAY;
32021 }
32022 
32023 /** ends NLP diving
32024  *
32025  * Resets changes made by SCIPchgVarObjDiveNLP(), SCIPchgVarBoundsDiveNLP(), and SCIPchgVarsBoundsDiveNLP().
32026  *
32027  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32028  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32029  *
32030  * @pre This method can be called if SCIP is in one of the following stages:
32031  * - \ref SCIP_STAGE_INITSOLVE
32032  * - \ref SCIP_STAGE_SOLVING
32033  */
32035  SCIP* scip /**< SCIP data structure */
32036  )
32037 {
32038  SCIP_CALL( checkStage(scip, "SCIPendDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32039 
32040  if( scip->nlp == NULL )
32041  {
32042  SCIPerrorMessage("NLP has not been constructed.\n");
32043  return SCIP_INVALIDCALL;
32044  }
32045 
32046  SCIP_CALL( SCIPnlpEndDive(scip->nlp, SCIPblkmem(scip), scip->set) );
32047 
32048  return SCIP_OKAY;
32049 }
32050 
32051 /** changes linear objective coefficient of a variable in diving NLP
32052  *
32053  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32054  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32055  *
32056  * @pre This method can be called if SCIP is in one of the following stages:
32057  * - \ref SCIP_STAGE_INITSOLVE
32058  * - \ref SCIP_STAGE_SOLVING
32059  */
32061  SCIP* scip, /**< SCIP data structure */
32062  SCIP_VAR* var, /**< variable which coefficient to change */
32063  SCIP_Real coef /**< new value for coefficient */
32064  )
32065 {
32066  SCIP_CALL( checkStage(scip, "SCIPchgVarObjDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32067 
32068  assert( var->scip == scip );
32069 
32070  if( scip->nlp == NULL )
32071  {
32072  SCIPerrorMessage("NLP has not been constructed.\n");
32073  return SCIP_INVALIDCALL;
32074  }
32075 
32076  SCIP_CALL( SCIPnlpChgVarObjDive(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat, var, coef) );
32077 
32078  return SCIP_OKAY;
32079 }
32080 
32081 /** changes bounds of a variable in diving NLP
32082  *
32083  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32084  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32085  *
32086  * @pre This method can be called if SCIP is in one of the following stages:
32087  * - \ref SCIP_STAGE_INITSOLVE
32088  * - \ref SCIP_STAGE_SOLVING
32089  */
32091  SCIP* scip, /**< SCIP data structure */
32092  SCIP_VAR* var, /**< variable which bounds to change */
32093  SCIP_Real lb, /**< new lower bound */
32094  SCIP_Real ub /**< new upper bound */
32095  )
32096 {
32097  SCIP_CALL( checkStage(scip, "SCIPchgVarBoundsDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32098 
32099  assert( var->scip == scip );
32100 
32101  if( scip->nlp == NULL )
32102  {
32103  SCIPerrorMessage("NLP has not been constructed.\n");
32104  return SCIP_INVALIDCALL;
32105  }
32106 
32107  SCIP_CALL( SCIPnlpChgVarBoundsDive(scip->nlp, var, lb, ub) );
32108 
32109  return SCIP_OKAY;
32110 }
32111 
32112 /** changes bounds of a set of variables in diving NLP
32113  *
32114  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32115  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32116  *
32117  * @pre This method can be called if SCIP is in one of the following stages:
32118  * - \ref SCIP_STAGE_INITSOLVE
32119  * - \ref SCIP_STAGE_SOLVING
32120  */
32122  SCIP* scip, /**< SCIP data structure */
32123  int nvars, /**< number of variables which bounds to changes */
32124  SCIP_VAR** vars, /**< variables which bounds to change */
32125  SCIP_Real* lbs, /**< new lower bounds */
32126  SCIP_Real* ubs /**< new upper bounds */
32127  )
32128 {
32129  SCIP_CALL( checkStage(scip, "SCIPchgVarsBoundsDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32130 
32131  if( scip->nlp == NULL )
32132  {
32133  SCIPerrorMessage("NLP has not been constructed.\n");
32134  return SCIP_INVALIDCALL;
32135  }
32136 
32137  SCIP_CALL( SCIPnlpChgVarsBoundsDive(scip->nlp, scip->set, nvars, vars, lbs, ubs) );
32138 
32139  return SCIP_OKAY;
32140 }
32141 
32142 /** solves diving NLP
32143  *
32144  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32145  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32146  *
32147  * @pre This method can be called if SCIP is in one of the following stages:
32148  * - \ref SCIP_STAGE_INITSOLVE
32149  * - \ref SCIP_STAGE_SOLVING
32150  */
32152  SCIP* scip /**< SCIP data structure */
32153  )
32154 {
32155  SCIP_CALL( checkStage(scip, "SCIPsolveDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32156 
32157  if( scip->nlp == NULL )
32158  {
32159  SCIPerrorMessage("NLP has not been constructed.\n");
32160  return SCIP_INVALIDCALL;
32161  }
32162 
32163  SCIP_CALL( SCIPnlpSolveDive(scip->nlp, SCIPblkmem(scip), scip->set, scip->messagehdlr, scip->stat) );
32164 
32165  return SCIP_OKAY;
32166 }
32167 
32168 /**@} */
32169 
32170 
32171 /*
32172  * NLP nonlinear row methods
32173  */
32174 
32175 /** creates and captures an NLP row
32176  *
32177  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32178  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32179  *
32180  * @pre This method can be called if SCIP is in one of the following stages:
32181  * - \ref SCIP_STAGE_PRESOLVED
32182  * - \ref SCIP_STAGE_INITSOLVE
32183  * - \ref SCIP_STAGE_SOLVING
32184  */
32186  SCIP* scip, /**< SCIP data structure */
32187  SCIP_NLROW** nlrow, /**< buffer to store pointer to nonlinear row */
32188  const char* name, /**< name of nonlinear row */
32189  SCIP_Real constant, /**< constant */
32190  int nlinvars, /**< number of linear variables */
32191  SCIP_VAR** linvars, /**< linear variables, or NULL if nlinvars == 0 */
32192  SCIP_Real* lincoefs, /**< linear coefficients, or NULL if nlinvars == 0 */
32193  int nquadvars, /**< number variables in quadratic terms */
32194  SCIP_VAR** quadvars, /**< variables in quadratic terms, or NULL if nquadvars == 0 */
32195  int nquadelems, /**< number of elements in quadratic term */
32196  SCIP_QUADELEM* quadelems, /**< elements (i.e., monomials) in quadratic term, or NULL if nquadelems == 0 */
32197  SCIP_EXPRTREE* expression, /**< nonlinear expression, or NULL */
32198  SCIP_Real lhs, /**< left hand side */
32199  SCIP_Real rhs, /**< right hand side */
32200  SCIP_EXPRCURV curvature /**< curvature of the nonlinear row */
32201  )
32202 {
32203  SCIP_CALL( checkStage(scip, "SCIPcreateNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32204 
32205  SCIP_CALL( SCIPnlrowCreate(nlrow, scip->mem->probmem, scip->set,
32206  name, constant, nlinvars, linvars, lincoefs, nquadvars, quadvars, nquadelems, quadelems, expression, lhs, rhs, curvature) );
32207 
32208  return SCIP_OKAY;
32209 }
32210 
32211 /** creates and captures an NLP nonlinear row without any coefficients
32212  *
32213  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32214  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32215  *
32216  * @pre This method can be called if SCIP is in one of the following stages:
32217  * - \ref SCIP_STAGE_PRESOLVED
32218  * - \ref SCIP_STAGE_INITSOLVE
32219  * - \ref SCIP_STAGE_SOLVING
32220  */
32222  SCIP* scip, /**< SCIP data structure */
32223  SCIP_NLROW** nlrow, /**< pointer to nonlinear row */
32224  const char* name, /**< name of nonlinear row */
32225  SCIP_Real lhs, /**< left hand side */
32226  SCIP_Real rhs /**< right hand side */
32227  )
32228 {
32229  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32230 
32231  SCIP_CALL( SCIPnlrowCreate(nlrow, scip->mem->probmem, scip->set,
32232  name, 0.0, 0, NULL, NULL, 0, NULL, 0, NULL, NULL, lhs, rhs, SCIP_EXPRCURV_UNKNOWN) );
32233 
32234  return SCIP_OKAY;
32235 }
32236 
32237 /** creates and captures an NLP row from a linear row
32238  *
32239  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32240  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32241  *
32242  * @pre This method can be called if SCIP is in one of the following stages:
32243  * - \ref SCIP_STAGE_PRESOLVED
32244  * - \ref SCIP_STAGE_INITSOLVE
32245  * - \ref SCIP_STAGE_SOLVING
32246  */
32248  SCIP* scip, /**< SCIP data structure */
32249  SCIP_NLROW** nlrow, /**< pointer to nonlinear row */
32250  SCIP_ROW* row /**< the linear row to copy */
32251  )
32252 {
32253  SCIP_CALL( checkStage(scip, "SCIPcreateNlRowFromRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32254 
32255  SCIP_CALL( SCIPnlrowCreateFromRow(nlrow, scip->mem->probmem, scip->set, row) );
32256 
32257  return SCIP_OKAY;
32258 }
32259 
32260 /** increases usage counter of NLP nonlinear row
32261  *
32262  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32263  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32264  *
32265  * @pre This method can be called if SCIP is in one of the following stages:
32266  * - \ref SCIP_STAGE_PRESOLVED
32267  * - \ref SCIP_STAGE_INITSOLVE
32268  * - \ref SCIP_STAGE_SOLVING
32269  */
32271  SCIP* scip, /**< SCIP data structure */
32272  SCIP_NLROW* nlrow /**< nonlinear row to capture */
32273  )
32274 {
32275  SCIP_CALL( checkStage(scip, "SCIPcaptureNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32276 
32277  SCIPnlrowCapture(nlrow);
32278 
32279  return SCIP_OKAY;
32280 }
32281 
32282 /** decreases usage counter of NLP nonlinear row, and frees memory if necessary
32283  *
32284  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32285  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32286  *
32287  * @pre This method can be called if SCIP is in one of the following stages:
32288  * - \ref SCIP_STAGE_PRESOLVED
32289  * - \ref SCIP_STAGE_INITSOLVE
32290  * - \ref SCIP_STAGE_SOLVING
32291  * - \ref SCIP_STAGE_EXITSOLVE
32292  */
32294  SCIP* scip, /**< SCIP data structure */
32295  SCIP_NLROW** nlrow /**< pointer to nonlinear row */
32296  )
32297 {
32298  SCIP_CALL( checkStage(scip, "SCIPreleaseNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
32299 
32300  SCIP_CALL( SCIPnlrowRelease(nlrow, scip->mem->probmem, scip->set) );
32301 
32302  return SCIP_OKAY;
32303 }
32304 
32305 /** changes left hand side of NLP nonlinear row
32306  *
32307  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32308  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32309  *
32310  * @pre This method can be called if SCIP is in one of the following stages:
32311  * - \ref SCIP_STAGE_PRESOLVED
32312  * - \ref SCIP_STAGE_INITSOLVE
32313  * - \ref SCIP_STAGE_SOLVING
32314  */
32316  SCIP* scip, /**< SCIP data structure */
32317  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32318  SCIP_Real lhs /**< new left hand side */
32319  )
32320 {
32321  SCIP_CALL( checkStage(scip, "SCIPchgNlRowLhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32322 
32323  SCIP_CALL( SCIPnlrowChgLhs(nlrow, scip->set, scip->stat, scip->nlp, lhs) );
32324 
32325  return SCIP_OKAY;
32326 }
32327 
32328 /** changes right hand side of NLP nonlinear row
32329  *
32330  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32331  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32332  *
32333  * @pre This method can be called if SCIP is in one of the following stages:
32334  * - \ref SCIP_STAGE_PRESOLVED
32335  * - \ref SCIP_STAGE_INITSOLVE
32336  * - \ref SCIP_STAGE_SOLVING
32337  */
32339  SCIP* scip, /**< SCIP data structure */
32340  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32341  SCIP_Real rhs /**< new right hand side */
32342  )
32343 {
32344  SCIP_CALL( checkStage(scip, "SCIPchgNlRowRhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32345 
32346  SCIP_CALL( SCIPnlrowChgRhs(nlrow, scip->set, scip->stat, scip->nlp, rhs) );
32347 
32348  return SCIP_OKAY;
32349 }
32350 
32351 /** changes constant of NLP nonlinear row
32352  *
32353  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32354  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32355  *
32356  * @pre This method can be called if SCIP is in one of the following stages:
32357  * - \ref SCIP_STAGE_PRESOLVED
32358  * - \ref SCIP_STAGE_INITSOLVE
32359  * - \ref SCIP_STAGE_SOLVING
32360  */
32362  SCIP* scip, /**< SCIP data structure */
32363  SCIP_NLROW* nlrow, /**< NLP row */
32364  SCIP_Real constant /**< new value for constant */
32365  )
32366 {
32367  SCIP_CALL( checkStage(scip, "SCIPchgNlRowConstant", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32368 
32369  SCIP_CALL( SCIPnlrowChgConstant(nlrow, scip->set, scip->stat, scip->nlp, constant) );
32370 
32371  return SCIP_OKAY;
32372 }
32373 
32374 /** adds variable with a linear coefficient to the nonlinear row
32375  *
32376  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32377  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32378  *
32379  * @pre This method can be called if SCIP is in one of the following stages:
32380  * - \ref SCIP_STAGE_PRESOLVED
32381  * - \ref SCIP_STAGE_INITSOLVE
32382  * - \ref SCIP_STAGE_SOLVING
32383  */
32385  SCIP* scip, /**< SCIP data structure */
32386  SCIP_NLROW* nlrow, /**< NLP row */
32387  SCIP_VAR* var, /**< problem variable */
32388  SCIP_Real val /**< value of coefficient in linear part of row */
32389  )
32390 {
32391  SCIP_CALL( checkStage(scip, "SCIPaddLinearCoefToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32392 
32393  SCIP_CALL( SCIPnlrowAddLinearCoef(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, var, val) );
32394 
32395  return SCIP_OKAY;
32396 }
32397 
32398 /** adds variables with linear coefficients to the row
32399  *
32400  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32401  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32402  *
32403  * @pre This method can be called if SCIP is in one of the following stages:
32404  * - \ref SCIP_STAGE_PRESOLVED
32405  * - \ref SCIP_STAGE_INITSOLVE
32406  * - \ref SCIP_STAGE_SOLVING
32407  */
32409  SCIP* scip, /**< SCIP data structure */
32410  SCIP_NLROW* nlrow, /**< NLP row */
32411  int nvars, /**< number of variables to add to the row */
32412  SCIP_VAR** vars, /**< problem variables to add */
32413  SCIP_Real* vals /**< values of coefficients in linear part of row */
32414  )
32415 {
32416  int v;
32417 
32418  assert(nvars == 0 || vars != NULL);
32419  assert(nvars == 0 || vals != NULL);
32420 
32421  SCIP_CALL( checkStage(scip, "SCIPaddLinearCoefsToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32422 
32423  /* add the variables to the row */
32424  for( v = 0; v < nvars; ++v )
32425  {
32426  SCIP_CALL( SCIPnlrowAddLinearCoef(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, vars[v], vals[v]) );
32427  }
32428 
32429  return SCIP_OKAY;
32430 }
32431 
32432 /** changes linear coefficient of a variables in a row
32433  *
32434  * Setting the coefficient to 0.0 means that it is removed from the row
32435  * the variable does not need to exists before.
32436  *
32437  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32438  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32439  *
32440  * @pre This method can be called if SCIP is in one of the following stages:
32441  * - \ref SCIP_STAGE_PRESOLVED
32442  * - \ref SCIP_STAGE_INITSOLVE
32443  * - \ref SCIP_STAGE_SOLVING
32444  */
32446  SCIP* scip, /**< SCIP data structure */
32447  SCIP_NLROW* nlrow, /**< NLP row */
32448  SCIP_VAR* var, /**< variable */
32449  SCIP_Real coef /**< new value of coefficient */
32450  )
32451 {
32452  assert(var != NULL);
32453 
32454  SCIP_CALL( checkStage(scip, "SCIPchgNlRowLinearCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32455 
32456  SCIP_CALL( SCIPnlrowChgLinearCoef(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, var, coef) );
32457 
32458  return SCIP_OKAY;
32459 }
32460 
32461 /** adds quadratic variable to the nonlinear row
32462  *
32463  * After adding a quadratic variable, it can be used to add quadratic elements.
32464  *
32465  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32466  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32467  *
32468  * @pre This method can be called if SCIP is in one of the following stages:
32469  * - \ref SCIP_STAGE_PRESOLVED
32470  * - \ref SCIP_STAGE_INITSOLVE
32471  * - \ref SCIP_STAGE_SOLVING
32472  */
32474  SCIP* scip, /**< SCIP data structure */
32475  SCIP_NLROW* nlrow, /**< NLP row */
32476  SCIP_VAR* var /**< problem variable */
32477  )
32478 {
32479  SCIP_CALL( checkStage(scip, "SCIPaddQuadVarToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32480 
32481  SCIP_CALL( SCIPnlrowAddQuadVar(nlrow, scip->mem->probmem, scip->set, var) );
32482 
32483  return SCIP_OKAY;
32484 }
32485 
32486 /** adds quadratic variables to the nonlinear row
32487  *
32488  * After adding quadratic variables, they can be used to add quadratic elements.
32489  *
32490  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32491  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32492  *
32493  * @pre This method can be called if SCIP is in one of the following stages:
32494  * - \ref SCIP_STAGE_PRESOLVED
32495  * - \ref SCIP_STAGE_INITSOLVE
32496  * - \ref SCIP_STAGE_SOLVING
32497  */
32499  SCIP* scip, /**< SCIP data structure */
32500  SCIP_NLROW* nlrow, /**< NLP row */
32501  int nvars, /**< number of problem variables */
32502  SCIP_VAR** vars /**< problem variables */
32503  )
32504 {
32505  int v;
32506 
32507  assert(nvars == 0 || vars != NULL);
32508 
32509  SCIP_CALL( checkStage(scip, "SCIPaddQuadVarsToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32510 
32511  SCIP_CALL( SCIPnlrowEnsureQuadVarsSize(nlrow, scip->mem->probmem, scip->set, SCIPnlrowGetNQuadVars(nlrow) + nvars) );
32512  for( v = 0; v < nvars; ++v )
32513  {
32514  SCIP_CALL( SCIPnlrowAddQuadVar(nlrow, scip->mem->probmem, scip->set, vars[v]) );
32515  }
32516 
32517  return SCIP_OKAY;
32518 }
32519 
32520 /** add a quadratic element to the nonlinear row
32521  *
32522  * Variable indices of the quadratic element need to be relative to quadratic variables array of row.
32523  *
32524  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32525  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32526  *
32527  * @pre This method can be called if SCIP is in one of the following stages:
32528  * - \ref SCIP_STAGE_PRESOLVED
32529  * - \ref SCIP_STAGE_INITSOLVE
32530  * - \ref SCIP_STAGE_SOLVING
32531  */
32533  SCIP* scip, /**< SCIP data structure */
32534  SCIP_NLROW* nlrow, /**< NLP row */
32535  SCIP_QUADELEM quadelem /**< quadratic element */
32536  )
32537 {
32538  SCIP_CALL( checkStage(scip, "SCIPaddQuadElementToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32539 
32540  SCIP_CALL( SCIPnlrowAddQuadElement(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, quadelem) );
32541 
32542  /* invalidate curvature */
32543  if( quadelem.coef != 0.0 )
32545 
32546  return SCIP_OKAY;
32547 }
32548 
32549 /** adds quadratic elements to the nonlinear row
32550  *
32551  * Variable indices of the quadratic elements need to be relative to quadratic variables array of row.
32552  *
32553  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32554  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32555  *
32556  * @pre This method can be called if SCIP is in one of the following stages:
32557  * - \ref SCIP_STAGE_PRESOLVED
32558  * - \ref SCIP_STAGE_INITSOLVE
32559  * - \ref SCIP_STAGE_SOLVING
32560  */
32562  SCIP* scip, /**< SCIP data structure */
32563  SCIP_NLROW* nlrow, /**< NLP row */
32564  int nquadelems, /**< number of quadratic elements */
32565  SCIP_QUADELEM* quadelems /**< quadratic elements */
32566  )
32567 {
32568  int v;
32569 
32570  assert(nquadelems == 0 || quadelems != NULL);
32571 
32572  SCIP_CALL( checkStage(scip, "SCIPaddQuadElementsToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32573 
32574  SCIP_CALL( SCIPnlrowEnsureQuadElementsSize(nlrow, scip->mem->probmem, scip->set, SCIPnlrowGetNQuadElems(nlrow) + nquadelems) );
32575  for( v = 0; v < nquadelems; ++v )
32576  {
32577  SCIP_CALL( SCIPnlrowAddQuadElement(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, quadelems[v]) );
32578  }
32579 
32580  /* invalidate curvature */
32582 
32583  return SCIP_OKAY;
32584 }
32585 
32586 /** changes coefficient in quadratic part of a row
32587  *
32588  * Setting the coefficient in the quadelement to 0.0 means that it is removed from the row
32589  * the element does not need to exists before.
32590  *
32591  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32592  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32593  *
32594  * @pre This method can be called if SCIP is in one of the following stages:
32595  * - \ref SCIP_STAGE_PRESOLVED
32596  * - \ref SCIP_STAGE_INITSOLVE
32597  * - \ref SCIP_STAGE_SOLVING
32598  */
32600  SCIP* scip, /**< SCIP data structure */
32601  SCIP_NLROW* nlrow, /**< NLP row */
32602  SCIP_QUADELEM quadelement /**< new quadratic element, or update for existing one */
32603  )
32604 {
32605  SCIP_CALL( checkStage(scip, "SCIPchgNlRowQuadElement", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32606 
32607  SCIP_CALL( SCIPnlrowChgQuadElem(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, quadelement) );
32608 
32609  return SCIP_OKAY;
32610 }
32611 
32612 /** sets or deletes expression tree in the nonlinear row
32613  *
32614  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32615  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32616  *
32617  * @pre This method can be called if SCIP is in one of the following stages:
32618  * - \ref SCIP_STAGE_PRESOLVED
32619  * - \ref SCIP_STAGE_INITSOLVE
32620  * - \ref SCIP_STAGE_SOLVING
32621  */
32623  SCIP* scip, /**< SCIP data structure */
32624  SCIP_NLROW* nlrow, /**< NLP row */
32625  SCIP_EXPRTREE* exprtree /**< expression tree, or NULL */
32626  )
32627 {
32628  SCIP_CALL( checkStage(scip, "SCIPsetNlRowExprtree", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32629 
32630  SCIP_CALL( SCIPnlrowChgExprtree(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, exprtree) );
32631 
32632  /* invalidate curvature */
32634 
32635  return SCIP_OKAY;
32636 }
32637 
32638 /** sets a parameter of expression tree in the nonlinear row
32639  *
32640  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32641  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32642  *
32643  * @pre This method can be called if SCIP is in one of the following stages:
32644  * - \ref SCIP_STAGE_PRESOLVED
32645  * - \ref SCIP_STAGE_INITSOLVE
32646  * - \ref SCIP_STAGE_SOLVING
32647  */
32649  SCIP* scip, /**< SCIP data structure */
32650  SCIP_NLROW* nlrow, /**< NLP row */
32651  int paramidx, /**< index of parameter in expression tree */
32652  SCIP_Real paramval /**< new value of parameter in expression tree */
32653  )
32654 {
32655  SCIP_CALL( checkStage(scip, "SCIPsetNlRowExprtreeParam", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32656 
32657  SCIP_CALL( SCIPnlrowChgExprtreeParam(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, paramidx, paramval) );
32658 
32659  return SCIP_OKAY;
32660 }
32661 
32662 /** sets parameters of expression tree in the nonlinear row
32663  *
32664  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32665  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32666  *
32667  * @pre This method can be called if SCIP is in one of the following stages:
32668  * - \ref SCIP_STAGE_PRESOLVED
32669  * - \ref SCIP_STAGE_INITSOLVE
32670  * - \ref SCIP_STAGE_SOLVING
32671  */
32673  SCIP* scip, /**< SCIP data structure */
32674  SCIP_NLROW* nlrow, /**< NLP row */
32675  SCIP_Real* paramvals /**< new values of parameter in expression tree */
32676  )
32677 {
32678  SCIP_CALL( checkStage(scip, "SCIPsetNlRowExprtreeParams", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32679 
32680  SCIP_CALL( SCIPnlrowChgExprtreeParams(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, paramvals) );
32681 
32682  return SCIP_OKAY;
32683 }
32684 
32685 /** recalculates the activity of a nonlinear row in the last NLP solution
32686  *
32687  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32688  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32689  *
32690  * @pre This method can be called if SCIP is in one of the following stages:
32691  * - \ref SCIP_STAGE_PRESOLVED
32692  * - \ref SCIP_STAGE_INITSOLVE
32693  * - \ref SCIP_STAGE_SOLVING
32694  */
32696  SCIP* scip, /**< SCIP data structure */
32697  SCIP_NLROW* nlrow /**< NLP nonlinear row */
32698  )
32699 {
32700  SCIP_CALL( checkStage(scip, "SCIPrecalcNlRowNLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32701 
32702  if( scip->nlp == NULL )
32703  {
32704  SCIPerrorMessage("do not have NLP for computing NLP activity\n");
32705  return SCIP_INVALIDCALL;
32706  }
32707 
32708  SCIP_CALL( SCIPnlrowRecalcNLPActivity(nlrow, scip->set, scip->stat, scip->nlp) );
32709 
32710  return SCIP_OKAY;
32711 }
32712 
32713 /** returns the activity of a nonlinear row in the last NLP solution
32714  *
32715  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32716  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32717  *
32718  * @pre This method can be called if SCIP is in one of the following stages:
32719  * - \ref SCIP_STAGE_INITSOLVE
32720  * - \ref SCIP_STAGE_SOLVING
32721  */
32723  SCIP* scip, /**< SCIP data structure */
32724  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32725  SCIP_Real* activity /**< pointer to store activity value */
32726  )
32727 {
32728  SCIP_CALL( checkStage(scip, "SCIPgetNlRowNLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32729 
32730  if( scip->nlp == NULL )
32731  {
32732  SCIPerrorMessage("do not have NLP for computing NLP activity\n");
32733  return SCIP_INVALIDCALL;
32734  }
32735 
32736  SCIP_CALL( SCIPnlrowGetNLPActivity(nlrow, scip->set, scip->stat, scip->nlp, activity) );
32737 
32738  return SCIP_OKAY;
32739 }
32740 
32741 /** gives the feasibility of a nonlinear row in the last NLP solution: negative value means infeasibility
32742  *
32743  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32744  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32745  *
32746  * @pre This method can be called if SCIP is in one of the following stages:
32747  * - \ref SCIP_STAGE_INITSOLVE
32748  * - \ref SCIP_STAGE_SOLVING
32749  */
32751  SCIP* scip, /**< SCIP data structure */
32752  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32753  SCIP_Real* feasibility /**< pointer to store feasibility value */
32754  )
32755 {
32756  SCIP_CALL( checkStage(scip, "SCIPgetNlRowNLPFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32757 
32758  if( scip->nlp == NULL )
32759  {
32760  SCIPerrorMessage("do not have NLP for computing NLP feasibility\n");
32761  return SCIP_INVALIDCALL;
32762  }
32763 
32764  SCIP_CALL( SCIPnlrowGetNLPFeasibility(nlrow, scip->set, scip->stat, scip->nlp, feasibility) );
32765 
32766  return SCIP_OKAY;
32767 }
32768 
32769 /** recalculates the activity of a nonlinear row for the current pseudo solution
32770  *
32771  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32772  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32773  *
32774  * @pre This method can be called if SCIP is in one of the following stages:
32775  * - \ref SCIP_STAGE_INITSOLVE
32776  * - \ref SCIP_STAGE_SOLVING
32777  */
32779  SCIP* scip, /**< SCIP data structure */
32780  SCIP_NLROW* nlrow /**< NLP nonlinear row */
32781  )
32782 {
32783  SCIP_CALL( checkStage(scip, "SCIPrecalcNlRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32784 
32785  SCIP_CALL( SCIPnlrowRecalcPseudoActivity(nlrow, scip->set, scip->stat) );
32786 
32787  return SCIP_OKAY;
32788 }
32789 
32790 /** gives the activity of a nonlinear row for the current pseudo solution
32791  *
32792  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32793  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32794  *
32795  * @pre This method can be called if SCIP is in one of the following stages:
32796  * - \ref SCIP_STAGE_INITSOLVE
32797  * - \ref SCIP_STAGE_SOLVING
32798  */
32800  SCIP* scip, /**< SCIP data structure */
32801  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32802  SCIP_Real* pseudoactivity /**< pointer to store pseudo activity value */
32803  )
32804 {
32805  SCIP_CALL( checkStage(scip, "SCIPgetNlRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32806 
32807  SCIP_CALL( SCIPnlrowGetPseudoActivity(nlrow, scip->set, scip->stat, pseudoactivity) );
32808 
32809  return SCIP_OKAY;
32810 }
32811 
32812 /** gives the feasibility of a nonlinear row for the current pseudo solution: negative value means infeasibility
32813  *
32814  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32815  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32816  *
32817  * @pre This method can be called if SCIP is in one of the following stages:
32818  * - \ref SCIP_STAGE_INITSOLVE
32819  * - \ref SCIP_STAGE_SOLVING
32820  */
32822  SCIP* scip, /**< SCIP data structure */
32823  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32824  SCIP_Real* pseudofeasibility /**< pointer to store pseudo feasibility value */
32825  )
32826 {
32827  SCIP_CALL( checkStage(scip, "SCIPgetNlRowPseudoFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32828 
32829  SCIP_CALL( SCIPnlrowGetPseudoFeasibility(nlrow, scip->set, scip->stat, pseudofeasibility) );
32830 
32831  return SCIP_OKAY;
32832 }
32833 
32834 /** recalculates the activity of a nonlinear row in the last NLP or pseudo solution
32835  *
32836  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32837  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32838  *
32839  * @pre This method can be called if SCIP is in one of the following stages:
32840  * - \ref SCIP_STAGE_INITSOLVE
32841  * - \ref SCIP_STAGE_SOLVING
32842  */
32844  SCIP* scip, /**< SCIP data structure */
32845  SCIP_NLROW* nlrow /**< NLP nonlinear row */
32846  )
32847 {
32848  SCIP_CALL( checkStage(scip, "SCIPrecalcNlRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32849 
32850  if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
32851  {
32852  SCIP_CALL( SCIPnlrowRecalcNLPActivity(nlrow, scip->set, scip->stat, scip->nlp) );
32853  }
32854  else
32855  {
32856  SCIP_CALL( SCIPnlrowRecalcPseudoActivity(nlrow, scip->set, scip->stat) );
32857  }
32858 
32859  return SCIP_OKAY;
32860 }
32861 
32862 /** gives the activity of a nonlinear row in the last NLP or pseudo solution
32863  *
32864  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32865  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32866  *
32867  * @pre This method can be called if SCIP is in one of the following stages:
32868  * - \ref SCIP_STAGE_INITSOLVE
32869  * - \ref SCIP_STAGE_SOLVING
32870  */
32872  SCIP* scip, /**< SCIP data structure */
32873  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32874  SCIP_Real* activity /**< pointer to store activity value */
32875  )
32876 {
32877  SCIP_CALL( checkStage(scip, "SCIPgetNlRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32878 
32879  if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
32880  {
32881  SCIP_CALL( SCIPnlrowGetNLPActivity(nlrow, scip->set, scip->stat, scip->nlp, activity) );
32882  }
32883  else
32884  {
32885  SCIP_CALL( SCIPnlrowGetPseudoActivity(nlrow, scip->set, scip->stat, activity) );
32886  }
32887 
32888  return SCIP_OKAY;
32889 }
32890 
32891 /** gives the feasibility of a nonlinear row in the last NLP or pseudo solution
32892  *
32893  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32894  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32895  *
32896  * @pre This method can be called if SCIP is in one of the following stages:
32897  * - \ref SCIP_STAGE_INITSOLVE
32898  * - \ref SCIP_STAGE_SOLVING
32899  */
32901  SCIP* scip, /**< SCIP data structure */
32902  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32903  SCIP_Real* feasibility /**< pointer to store feasibility value */
32904  )
32905 {
32906  SCIP_CALL( checkStage(scip, "SCIPgetNlRowFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32907 
32908  if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
32909  {
32910  SCIP_CALL( SCIPnlrowGetNLPFeasibility(nlrow, scip->set, scip->stat, scip->nlp, feasibility) );
32911  }
32912  else
32913  {
32914  SCIP_CALL( SCIPnlrowGetPseudoFeasibility(nlrow, scip->set, scip->stat, feasibility) );
32915  }
32916 
32917  return SCIP_OKAY;
32918 }
32919 
32920 /** gives the activity of a nonlinear row for the given primal solution or NLP solution or pseudo solution
32921  *
32922  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32923  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32924  *
32925  * @pre This method can be called if SCIP is in one of the following stages:
32926  * - \ref SCIP_STAGE_INITSOLVE
32927  * - \ref SCIP_STAGE_SOLVING
32928  */
32930  SCIP* scip, /**< SCIP data structure */
32931  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32932  SCIP_SOL* sol, /**< primal CIP solution, or NULL for NLP solution of pseudo solution */
32933  SCIP_Real* activity /**< pointer to store activity value */
32934  )
32935 {
32936  SCIP_CALL( checkStage(scip, "SCIPgetNlRowSolActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32937 
32938  if( sol != NULL )
32939  {
32940  SCIP_CALL( SCIPnlrowGetSolActivity(nlrow, scip->set, scip->stat, sol, activity) );
32941  }
32942  else if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
32943  {
32944  SCIP_CALL( SCIPnlrowGetNLPActivity(nlrow, scip->set, scip->stat, scip->nlp, activity) );
32945  }
32946  else
32947  {
32948  SCIP_CALL( SCIPnlrowGetPseudoActivity(nlrow, scip->set, scip->stat, activity) );
32949  }
32950 
32951  return SCIP_OKAY;
32952 }
32953 
32954 /** gives the feasibility of a nonlinear row for the given primal solution
32955  *
32956  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32957  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32958  *
32959  * @pre This method can be called if SCIP is in one of the following stages:
32960  * - \ref SCIP_STAGE_INITSOLVE
32961  * - \ref SCIP_STAGE_SOLVING
32962  */
32964  SCIP* scip, /**< SCIP data structure */
32965  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32966  SCIP_SOL* sol, /**< primal CIP solution */
32967  SCIP_Real* feasibility /**< pointer to store feasibility value */
32968  )
32969 {
32970  SCIP_CALL( checkStage(scip, "SCIPgetNlRowSolFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32971 
32972  if( sol != NULL )
32973  {
32974  SCIP_CALL( SCIPnlrowGetSolFeasibility(nlrow, scip->set, scip->stat, sol, feasibility) );
32975  }
32976  else if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
32977  {
32978  SCIP_CALL( SCIPnlrowGetNLPFeasibility(nlrow, scip->set, scip->stat, scip->nlp, feasibility) );
32979  }
32980  else
32981  {
32982  SCIP_CALL( SCIPnlrowGetPseudoFeasibility(nlrow, scip->set, scip->stat, feasibility) );
32983  }
32984 
32985  return SCIP_OKAY;
32986 }
32987 
32988 /** gives the minimal and maximal activity of a nonlinear row w.r.t. the variable's bounds
32989  *
32990  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32991  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32992  *
32993  * @pre This method can be called if SCIP is in one of the following stages:
32994  * - \ref SCIP_STAGE_PRESOLVED
32995  * - \ref SCIP_STAGE_INITSOLVE
32996  * - \ref SCIP_STAGE_SOLVING
32997  */
32999  SCIP* scip, /**< SCIP data structure */
33000  SCIP_NLROW* nlrow, /**< NLP row */
33001  SCIP_Real* minactivity, /**< buffer to store minimal activity, or NULL */
33002  SCIP_Real* maxactivity /**< buffer to store maximal activity, or NULL */
33003  )
33004 {
33005  SCIP_CALL( checkStage(scip, "SCIPgetNlRowActivityBounds", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33006 
33007  SCIP_CALL( SCIPnlrowGetActivityBounds(nlrow, scip->set, scip->stat, minactivity, maxactivity) );
33008 
33009  return SCIP_OKAY;
33010 }
33011 
33012 /** output nonlinear row to file stream
33013  *
33014  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33015  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33016  *
33017  * @pre This method can be called if SCIP is in one of the following stages:
33018  * - \ref SCIP_STAGE_PRESOLVED
33019  * - \ref SCIP_STAGE_INITSOLVE
33020  * - \ref SCIP_STAGE_SOLVING
33021  */
33023  SCIP* scip, /**< SCIP data structure */
33024  SCIP_NLROW* nlrow, /**< NLP row */
33025  FILE* file /**< output file (or NULL for standard output) */
33026  )
33027 {
33028  assert(nlrow != NULL);
33029 
33030  SCIP_CALL( checkStage(scip, "SCIPprintNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33031 
33032  SCIP_CALL( SCIPnlrowPrint(nlrow, scip->messagehdlr, file) );
33033 
33034  return SCIP_OKAY;
33035 }
33036 
33037 /**@name Expression tree methods */
33038 /**@{ */
33039 
33040 /** translate from one value of infinity to another
33041  *
33042  * if val is >= infty1, then give infty2, else give val
33043  */
33044 #define infty2infty(infty1, infty2, val) (val >= infty1 ? infty2 : val)
33045 
33046 /** replaces array of variables in expression tree by corresponding transformed variables
33047  *
33048  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33049  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33050  *
33051  * @pre This method can be called if @p scip is in one of the following stages:
33052  * - \ref SCIP_STAGE_TRANSFORMING
33053  * - \ref SCIP_STAGE_TRANSFORMED
33054  * - \ref SCIP_STAGE_INITPRESOLVE
33055  * - \ref SCIP_STAGE_PRESOLVING
33056  * - \ref SCIP_STAGE_EXITPRESOLVE
33057  * - \ref SCIP_STAGE_PRESOLVED
33058  * - \ref SCIP_STAGE_INITSOLVE
33059  * - \ref SCIP_STAGE_SOLVING
33060  * - \ref SCIP_STAGE_SOLVED
33061  * - \ref SCIP_STAGE_EXITSOLVE
33062  * - \ref SCIP_STAGE_FREETRANS
33063  *
33064  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33065  */
33067  SCIP* scip, /**< SCIP data structure */
33068  SCIP_EXPRTREE* tree /**< expression tree */
33069  )
33070 {
33071  assert(scip != NULL);
33072  assert(tree != NULL);
33073 
33074  SCIP_CALL( checkStage(scip, "SCIPgetExprtreeTransformedVars", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
33075 
33076  if( SCIPexprtreeGetNVars(tree) == 0 )
33077  return SCIP_OKAY;
33078 
33080 
33081  return SCIP_OKAY;
33082 }
33083 
33084 /** evaluates an expression tree for a primal solution or LP solution
33085  *
33086  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33087  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33088  *
33089  * @pre This method can be called if @p scip is in one of the following stages:
33090  * - \ref SCIP_STAGE_PROBLEM
33091  * - \ref SCIP_STAGE_TRANSFORMING
33092  * - \ref SCIP_STAGE_TRANSFORMED
33093  * - \ref SCIP_STAGE_INITPRESOLVE
33094  * - \ref SCIP_STAGE_PRESOLVING
33095  * - \ref SCIP_STAGE_EXITPRESOLVE
33096  * - \ref SCIP_STAGE_PRESOLVED
33097  * - \ref SCIP_STAGE_INITSOLVE
33098  * - \ref SCIP_STAGE_SOLVING
33099  * - \ref SCIP_STAGE_SOLVED
33100  * - \ref SCIP_STAGE_EXITSOLVE
33101  * - \ref SCIP_STAGE_FREETRANS
33102  *
33103  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33104  */
33106  SCIP* scip, /**< SCIP data structure */
33107  SCIP_EXPRTREE* tree, /**< expression tree */
33108  SCIP_SOL* sol, /**< a solution, or NULL for current LP solution */
33109  SCIP_Real* val /**< buffer to store value */
33110  )
33111 {
33112  SCIP_Real* varvals;
33113  int nvars;
33114 
33115  assert(scip != NULL);
33116  assert(tree != NULL);
33117  assert(val != NULL);
33118 
33119  SCIP_CALL( checkStage(scip, "SCIPevalExprtreeSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
33120 
33121  nvars = SCIPexprtreeGetNVars(tree);
33122 
33123  if( nvars == 0 )
33124  {
33125  SCIP_CALL( SCIPexprtreeEval(tree, NULL, val) );
33126  return SCIP_OKAY;
33127  }
33128 
33129  SCIP_CALL( SCIPallocBufferArray(scip, &varvals, nvars) );
33130  SCIP_CALL( SCIPgetSolVals(scip, sol, nvars, SCIPexprtreeGetVars(tree), varvals) );
33131 
33132  SCIP_CALL( SCIPexprtreeEval(tree, varvals, val) );
33133 
33134  SCIPfreeBufferArray(scip, &varvals);
33135 
33136  return SCIP_OKAY;
33137 }
33138 
33139 /** evaluates an expression tree w.r.t. current global bounds
33140  *
33141  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33142  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33143  *
33144  * @pre This method can be called if @p scip is in one of the following stages:
33145  * - \ref SCIP_STAGE_PROBLEM
33146  * - \ref SCIP_STAGE_TRANSFORMING
33147  * - \ref SCIP_STAGE_TRANSFORMED
33148  * - \ref SCIP_STAGE_INITPRESOLVE
33149  * - \ref SCIP_STAGE_PRESOLVING
33150  * - \ref SCIP_STAGE_EXITPRESOLVE
33151  * - \ref SCIP_STAGE_PRESOLVED
33152  * - \ref SCIP_STAGE_INITSOLVE
33153  * - \ref SCIP_STAGE_SOLVING
33154  * - \ref SCIP_STAGE_SOLVED
33155  * - \ref SCIP_STAGE_EXITSOLVE
33156  * - \ref SCIP_STAGE_FREETRANS
33157  *
33158  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33159  */
33161  SCIP* scip, /**< SCIP data structure */
33162  SCIP_EXPRTREE* tree, /**< expression tree */
33163  SCIP_Real infinity, /**< value to use for infinity */
33164  SCIP_INTERVAL* val /**< buffer to store result */
33165  )
33166 {
33167  SCIP_INTERVAL* varvals;
33168  SCIP_VAR** vars;
33169  int nvars;
33170  int i;
33171 
33172  assert(scip != NULL);
33173  assert(tree != NULL);
33174  assert(val != NULL);
33175 
33176  SCIP_CALL( checkStage(scip, "SCIPevalExprtreeGlobalBounds", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
33177 
33178  nvars = SCIPexprtreeGetNVars(tree);
33179 
33180  if( nvars == 0 )
33181  {
33182  SCIP_CALL( SCIPexprtreeEvalInt(tree, infinity, NULL, val) );
33183  return SCIP_OKAY;
33184  }
33185 
33186  vars = SCIPexprtreeGetVars(tree);
33187  assert(vars != NULL);
33188 
33189  SCIP_CALL( SCIPallocBufferArray(scip, &varvals, nvars) );
33190  for( i = 0; i < nvars; ++i )
33191  {
33192  SCIPintervalSetBounds(&varvals[i],
33193  -infty2infty(SCIPinfinity(scip), infinity, -SCIPvarGetLbGlobal(vars[i])), /*lint !e666*/
33194  infty2infty(SCIPinfinity(scip), infinity, SCIPvarGetUbGlobal(vars[i]))); /*lint !e666*/
33195  }
33196 
33197  SCIP_CALL( SCIPexprtreeEvalInt(tree, infinity, varvals, val) );
33198 
33199  SCIPfreeBufferArray(scip, &varvals);
33200 
33201  return SCIP_OKAY;
33202 }
33203 
33204 /** evaluates an expression tree w.r.t. current local bounds
33205  *
33206  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33207  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33208  *
33209  * @pre This method can be called if @p scip is in one of the following stages:
33210  * - \ref SCIP_STAGE_PROBLEM
33211  * - \ref SCIP_STAGE_TRANSFORMING
33212  * - \ref SCIP_STAGE_TRANSFORMED
33213  * - \ref SCIP_STAGE_INITPRESOLVE
33214  * - \ref SCIP_STAGE_PRESOLVING
33215  * - \ref SCIP_STAGE_EXITPRESOLVE
33216  * - \ref SCIP_STAGE_PRESOLVED
33217  * - \ref SCIP_STAGE_INITSOLVE
33218  * - \ref SCIP_STAGE_SOLVING
33219  * - \ref SCIP_STAGE_SOLVED
33220  * - \ref SCIP_STAGE_EXITSOLVE
33221  * - \ref SCIP_STAGE_FREETRANS
33222  *
33223  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
33224  */
33226  SCIP* scip, /**< SCIP data structure */
33227  SCIP_EXPRTREE* tree, /**< expression tree */
33228  SCIP_Real infinity, /**< value to use for infinity */
33229  SCIP_INTERVAL* val /**< buffer to store result */
33230  )
33231 {
33232  SCIP_INTERVAL* varvals;
33233  SCIP_VAR** vars;
33234  int nvars;
33235  int i;
33236 
33237  assert(scip != NULL);
33238  assert(tree != NULL);
33239  assert(val != NULL);
33240 
33241  SCIP_CALL( checkStage(scip, "SCIPevalExprtreeLocalBounds", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
33242 
33243  nvars = SCIPexprtreeGetNVars(tree);
33244 
33245  if( nvars == 0 )
33246  {
33247  SCIP_CALL( SCIPexprtreeEvalInt(tree, infinity, NULL, val) );
33248  return SCIP_OKAY;
33249  }
33250 
33251  vars = SCIPexprtreeGetVars(tree);
33252  assert(vars != NULL);
33253 
33254  SCIP_CALL( SCIPallocBufferArray(scip, &varvals, nvars) );
33255  for( i = 0; i < nvars; ++i )
33256  {
33257  /* due to numerics, the lower bound on a variable in SCIP can be slightly higher than the upper bound
33258  * in this case, we take the most conservative way and switch the bounds
33259  * further, we translate SCIP's value for infinity to the users value for infinity
33260  */
33261  SCIPintervalSetBounds(&varvals[i],
33262  -infty2infty(SCIPinfinity(scip), infinity, -MIN(SCIPvarGetLbLocal(vars[i]), SCIPvarGetUbLocal(vars[i]))), /*lint !e666*/
33263  infty2infty(SCIPinfinity(scip), infinity, MAX(SCIPvarGetLbLocal(vars[i]), SCIPvarGetUbLocal(vars[i])))); /*lint !e666*/
33264  }
33265 
33266  SCIP_CALL( SCIPexprtreeEvalInt(tree, infinity, varvals, val) );
33267 
33268  SCIPfreeBufferArray(scip, &varvals);
33269 
33270  return SCIP_OKAY;
33271 }
33272 
33273 #undef infty2infty
33274 
33275 /**@} */
33276 
33277 /*
33278  * nonlinear methods
33279  */
33280 
33281 /**@name Nonlinear Methods */
33282 /**@{ */
33283 
33284 /** computes coefficients of linearization of a square term in a reference point */
33286  SCIP* scip, /**< SCIP data structure */
33287  SCIP_Real sqrcoef, /**< coefficient of square term */
33288  SCIP_Real refpoint, /**< point where to linearize */
33289  SCIP_Bool isint, /**< whether corresponding variable is a discrete variable, and thus linearization could be moved */
33290  SCIP_Real* lincoef, /**< buffer to add coefficient of linearization */
33291  SCIP_Real* linconstant, /**< buffer to add constant of linearization */
33292  SCIP_Bool* success /**< buffer to set to FALSE if linearization has failed due to large numbers */
33293  )
33294 {
33295  assert(scip != NULL);
33296  assert(lincoef != NULL);
33297  assert(linconstant != NULL);
33298  assert(success != NULL);
33299 
33300  if( sqrcoef == 0.0 )
33301  return;
33302 
33303  if( SCIPisInfinity(scip, REALABS(refpoint)) )
33304  {
33305  *success = FALSE;
33306  return;
33307  }
33308 
33309  if( !isint || SCIPisIntegral(scip, refpoint) )
33310  {
33311  SCIP_Real tmp;
33312 
33313  /* sqrcoef * x^2 -> tangent in refpoint = sqrcoef * 2 * refpoint * (x - refpoint) */
33314 
33315  tmp = sqrcoef * refpoint;
33316 
33317  if( SCIPisInfinity(scip, 2.0 * REALABS(tmp)) )
33318  {
33319  *success = FALSE;
33320  return;
33321  }
33322 
33323  *lincoef += 2.0 * tmp;
33324  tmp *= refpoint;
33325  *linconstant -= tmp;
33326  }
33327  else
33328  {
33329  /* sqrcoef * x^2 -> secant between f=floor(refpoint) and f+1 = sqrcoef * (f^2 + ((f+1)^2 - f^2) * (x-f))
33330  * = sqrcoef * (-f*(f+1) + (2*f+1)*x)
33331  */
33332  SCIP_Real f;
33333  SCIP_Real coef;
33334  SCIP_Real constant;
33335 
33336  f = SCIPfloor(scip, refpoint);
33337 
33338  coef = sqrcoef * (2.0 * f + 1.0);
33339  constant = -sqrcoef * f * (f + 1.0);
33340 
33341  if( SCIPisInfinity(scip, REALABS(coef)) || SCIPisInfinity(scip, REALABS(constant)) )
33342  {
33343  *success = FALSE;
33344  return;
33345  }
33346 
33347  *lincoef += coef;
33348  *linconstant += constant;
33349  }
33350 }
33351 
33352 /** computes coefficients of secant of a square term */
33354  SCIP* scip, /**< SCIP data structure */
33355  SCIP_Real sqrcoef, /**< coefficient of square term */
33356  SCIP_Real lb, /**< lower bound on variable */
33357  SCIP_Real ub, /**< upper bound on variable */
33358  SCIP_Real refpoint, /**< point for which to compute value of linearization */
33359  SCIP_Real* lincoef, /**< buffer to add coefficient of secant */
33360  SCIP_Real* linconstant, /**< buffer to add constant of secant */
33361  SCIP_Bool* success /**< buffer to set to FALSE if secant has failed due to large numbers or unboundedness */
33362  )
33363 {
33364  SCIP_Real coef;
33365  SCIP_Real constant;
33366 
33367  assert(scip != NULL);
33368  assert(!SCIPisInfinity(scip, lb));
33369  assert(!SCIPisInfinity(scip, -ub));
33370  assert(SCIPisLE(scip, lb, ub));
33371  assert(SCIPisLE(scip, lb, refpoint));
33372  assert(SCIPisGE(scip, ub, refpoint));
33373  assert(lincoef != NULL);
33374  assert(linconstant != NULL);
33375  assert(success != NULL);
33376 
33377  if( sqrcoef == 0.0 )
33378  return;
33379 
33380  if( SCIPisInfinity(scip, -lb) || SCIPisInfinity(scip, ub) )
33381  {
33382  /* unboundedness */
33383  *success = FALSE;
33384  return;
33385  }
33386 
33387  /* sqrcoef * x^2 -> sqrcoef * (lb * lb + (ub*ub - lb*lb)/(ub-lb) * (x-lb)) = sqrcoef * (lb*lb + (ub+lb)*(x-lb))
33388  * = sqrcoef * ((lb+ub)*x - lb*ub)
33389  */
33390  coef = sqrcoef * (lb + ub);
33391  constant = -sqrcoef * lb * ub;
33392  if( SCIPisInfinity(scip, REALABS(coef)) || SCIPisInfinity(scip, REALABS(constant)) )
33393  {
33394  *success = FALSE;
33395  return;
33396  }
33397 
33398  *lincoef += coef;
33399  *linconstant += constant;
33400 }
33401 
33402 /** computes coefficients of linearization of a bilinear term in a reference point */
33404  SCIP* scip, /**< SCIP data structure */
33405  SCIP_Real bilincoef, /**< coefficient of bilinear term */
33406  SCIP_Real refpointx, /**< point where to linearize first variable */
33407  SCIP_Real refpointy, /**< point where to linearize second variable */
33408  SCIP_Real* lincoefx, /**< buffer to add coefficient of first variable in linearization */
33409  SCIP_Real* lincoefy, /**< buffer to add coefficient of second variable in linearization */
33410  SCIP_Real* linconstant, /**< buffer to add constant of linearization */
33411  SCIP_Bool* success /**< buffer to set to FALSE if linearization has failed due to large numbers */
33412  )
33413 {
33414  SCIP_Real constant;
33415 
33416  assert(scip != NULL);
33417  assert(lincoefx != NULL);
33418  assert(lincoefy != NULL);
33419  assert(linconstant != NULL);
33420  assert(success != NULL);
33421 
33422  if( bilincoef == 0.0 )
33423  return;
33424 
33425  if( SCIPisInfinity(scip, REALABS(refpointx)) || SCIPisInfinity(scip, REALABS(refpointy)) )
33426  {
33427  *success = FALSE;
33428  return;
33429  }
33430 
33431  /* bilincoef * x * y -> bilincoef * (refpointx * refpointy + refpointy * (x - refpointx) + refpointx * (y - refpointy))
33432  * = -bilincoef * refpointx * refpointy + bilincoef * refpointy * x + bilincoef * refpointx * y
33433  */
33434 
33435  constant = -bilincoef * refpointx * refpointy;
33436 
33437  if( SCIPisInfinity(scip, REALABS(bilincoef * refpointx)) || SCIPisInfinity(scip, REALABS(bilincoef * refpointy))
33438  || SCIPisInfinity(scip, REALABS(constant)) )
33439  {
33440  *success = FALSE;
33441  return;
33442  }
33443 
33444  *lincoefx += bilincoef * refpointy;
33445  *lincoefy += bilincoef * refpointx;
33446  *linconstant += constant;
33447 }
33448 
33449 /** computes coefficients of McCormick under- or overestimation of a bilinear term */
33451  SCIP* scip, /**< SCIP data structure */
33452  SCIP_Real bilincoef, /**< coefficient of bilinear term */
33453  SCIP_Real lbx, /**< lower bound on first variable */
33454  SCIP_Real ubx, /**< upper bound on first variable */
33455  SCIP_Real refpointx, /**< reference point for first variable */
33456  SCIP_Real lby, /**< lower bound on second variable */
33457  SCIP_Real uby, /**< upper bound on second variable */
33458  SCIP_Real refpointy, /**< reference point for second variable */
33459  SCIP_Bool overestimate, /**< whether to compute an overestimator instead of an underestimator */
33460  SCIP_Real* lincoefx, /**< buffer to add coefficient of first variable in linearization */
33461  SCIP_Real* lincoefy, /**< buffer to add coefficient of second variable in linearization */
33462  SCIP_Real* linconstant, /**< buffer to add constant of linearization */
33463  SCIP_Bool* success /**< buffer to set to FALSE if linearization has failed due to large numbers */
33464  )
33465 {
33466  SCIP_Real constant;
33467  SCIP_Real coefx;
33468  SCIP_Real coefy;
33469 
33470  assert(scip != NULL);
33471  assert(!SCIPisInfinity(scip, lbx));
33472  assert(!SCIPisInfinity(scip, -ubx));
33473  assert(!SCIPisInfinity(scip, lby));
33474  assert(!SCIPisInfinity(scip, -uby));
33475  assert(SCIPisLE(scip, lbx, ubx));
33476  assert(SCIPisLE(scip, lby, uby));
33477  assert(SCIPisLE(scip, lbx, refpointx));
33478  assert(SCIPisGE(scip, ubx, refpointx));
33479  assert(SCIPisLE(scip, lby, refpointy));
33480  assert(SCIPisGE(scip, uby, refpointy));
33481  assert(lincoefx != NULL);
33482  assert(lincoefy != NULL);
33483  assert(linconstant != NULL);
33484  assert(success != NULL);
33485 
33486  if( bilincoef == 0.0 )
33487  return;
33488 
33489  if( overestimate )
33490  bilincoef = -bilincoef;
33491 
33492  if( SCIPisRelEQ(scip, lbx, ubx) && SCIPisRelEQ(scip, lby, uby) )
33493  {
33494  /* both x and y are mostly fixed */
33495  SCIP_Real cand1;
33496  SCIP_Real cand2;
33497  SCIP_Real cand3;
33498  SCIP_Real cand4;
33499 
33500  coefx = 0.0;
33501  coefy = 0.0;
33502 
33503  /* estimate x * y by constant */
33504  cand1 = lbx * lby;
33505  cand2 = lbx * uby;
33506  cand3 = ubx * lby;
33507  cand4 = ubx * uby;
33508 
33509  /* take most conservative value for underestimator */
33510  if( bilincoef < 0.0 )
33511  constant = bilincoef * MAX( MAX(cand1, cand2), MAX(cand3, cand4) );
33512  else
33513  constant = bilincoef * MIN( MIN(cand1, cand2), MIN(cand3, cand4) );
33514  }
33515  else if( bilincoef > 0.0 )
33516  {
33517  /* either x or y is not fixed and coef > 0.0 */
33518  if( !SCIPisInfinity(scip, -lbx) && !SCIPisInfinity(scip, -lby) &&
33519  (SCIPisInfinity(scip, ubx) || SCIPisInfinity(scip, uby)
33520  || (uby - refpointy) * (ubx - refpointx) >= (refpointy - lby) * (refpointx - lbx)) )
33521  {
33522  if( SCIPisRelEQ(scip, lbx, ubx) )
33523  {
33524  /* x*y = lbx * y + (x-lbx) * y >= lbx * y + (x-lbx) * lby >= lbx * y + min{(ubx-lbx) * lby, 0 * lby} */
33525  coefx = 0.0;
33526  coefy = bilincoef * lbx;
33527  constant = bilincoef * (lby < 0.0 ? (ubx-lbx) * lby : 0.0);
33528  }
33529  else if( SCIPisRelEQ(scip, lby, uby) )
33530  {
33531  /* x*y = lby * x + (y-lby) * x >= lby * x + (y-lby) * lbx >= lby * x + min{(uby-lby) * lbx, 0 * lbx} */
33532  coefx = bilincoef * lby;
33533  coefy = 0.0;
33534  constant = bilincoef * (lbx < 0.0 ? (uby-lby) * lbx : 0.0);
33535  }
33536  else
33537  {
33538  coefx = bilincoef * lby;
33539  coefy = bilincoef * lbx;
33540  constant = -bilincoef * lbx * lby;
33541  }
33542  }
33543  else if( !SCIPisInfinity(scip, ubx) && !SCIPisInfinity(scip, uby) )
33544  {
33545  if( SCIPisRelEQ(scip, lbx, ubx) )
33546  {
33547  /* x*y = ubx * y + (x-ubx) * y >= ubx * y + (x-ubx) * uby >= ubx * y + min{(lbx-ubx) * uby, 0 * uby} */
33548  coefx = 0.0;
33549  coefy = bilincoef * ubx;
33550  constant = bilincoef * (uby > 0.0 ? (lbx-ubx) * uby : 0.0);
33551  }
33552  else if( SCIPisRelEQ(scip, lby, uby) )
33553  {
33554  /* x*y = uby * x + (y-uby) * x >= uby * x + (y-uby) * ubx >= uby * x + min{(lby-uby) * ubx, 0 * ubx} */
33555  coefx = bilincoef * uby;
33556  coefy = 0.0;
33557  constant = bilincoef * (ubx > 0.0 ? (lby-uby) * ubx : 0.0);
33558  }
33559  else
33560  {
33561  coefx = bilincoef * uby;
33562  coefy = bilincoef * ubx;
33563  constant = -bilincoef * ubx * uby;
33564  }
33565  }
33566  else
33567  {
33568  *success = FALSE;
33569  return;
33570  }
33571  }
33572  else
33573  {
33574  /* either x or y is not fixed and coef < 0.0 */
33575  if( !SCIPisInfinity(scip, ubx) && !SCIPisInfinity(scip, -lby) &&
33576  (SCIPisInfinity(scip, -lbx) || SCIPisInfinity(scip, uby)
33577  || (ubx - lbx) * (refpointy - lby) <= (uby - lby) * (refpointx - lbx)) )
33578  {
33579  if( SCIPisRelEQ(scip, lbx, ubx) )
33580  {
33581  /* x*y = ubx * y + (x-ubx) * y <= ubx * y + (x-ubx) * lby <= ubx * y + max{(lbx-ubx) * lby, 0 * lby} */
33582  coefx = 0.0;
33583  coefy = bilincoef * ubx;
33584  constant = bilincoef * (lby < 0.0 ? (lbx - ubx) * lby : 0.0);
33585  }
33586  else if( SCIPisRelEQ(scip, lby, uby) )
33587  {
33588  /* x*y = lby * x + (y-lby) * x <= lby * x + (y-lby) * ubx <= lby * x + max{(uby-lby) * ubx, 0 * ubx} */
33589  coefx = bilincoef * lby;
33590  coefy = 0.0;
33591  constant = bilincoef * (ubx > 0.0 ? (uby - lby) * ubx : 0.0);
33592  }
33593  else
33594  {
33595  coefx = bilincoef * lby;
33596  coefy = bilincoef * ubx;
33597  constant = -bilincoef * ubx * lby;
33598  }
33599  }
33600  else if( !SCIPisInfinity(scip, -lbx) && !SCIPisInfinity(scip, uby) )
33601  {
33602  if( SCIPisRelEQ(scip, lbx, ubx) )
33603  {
33604  /* x*y = lbx * y + (x-lbx) * y <= lbx * y + (x-lbx) * uby <= lbx * y + max{(ubx-lbx) * uby, 0 * uby} */
33605  coefx = 0.0;
33606  coefy = bilincoef * lbx;
33607  constant = bilincoef * (uby > 0.0 ? (ubx-lbx) * uby : 0.0);
33608  }
33609  else if( SCIPisRelEQ(scip, lby, uby) )
33610  {
33611  /* x*y = uby * x + (y-uby) * x <= uby * x + (y-uby) * lbx <= uby * x + max{(lby-uby) * lbx, 0 * lbx} */
33612  coefx = bilincoef * uby;
33613  coefy = 0.0;
33614  constant = bilincoef * (lbx < 0.0 ? (lby-uby) * lbx : 0.0);
33615  }
33616  else
33617  {
33618  coefx = bilincoef * uby;
33619  coefy = bilincoef * lbx;
33620  constant = -bilincoef * lbx * uby;
33621  }
33622  }
33623  else
33624  {
33625  *success = FALSE;
33626  return;
33627  }
33628  }
33629 
33630  if( SCIPisInfinity(scip, REALABS(coefx)) || SCIPisInfinity(scip, REALABS(coefy))
33631  || SCIPisInfinity(scip, REALABS(constant)) )
33632  {
33633  *success = FALSE;
33634  return;
33635  }
33636 
33637  if( overestimate )
33638  {
33639  coefx = -coefx;
33640  coefy = -coefy;
33641  constant = -constant;
33642  }
33643 
33644  SCIPdebugMsg(scip, "%.20g * x[%.20g,%.20g] * y[%.20g,%.20g] %c= %.20g * x %+.20g * y %+.20g\n", bilincoef, lbx, ubx,
33645  lby, uby, overestimate ? '<' : '>', coefx, coefy, constant);
33646 
33647  *lincoefx += coefx;
33648  *lincoefy += coefy;
33649  *linconstant += constant;
33650 }
33651 
33652 
33653 /** computes coefficients of linearization of a bilinear term in a reference point when given a linear inequality
33654  * involving only the variables of the bilinear term
33655  *
33656  * @note the formulas are extracted from "Convex envelopes of bivariate functions through the solution of KKT systems"
33657  * by Marco Locatelli
33658  */
33660  SCIP* scip, /**< SCIP data structure */
33661  SCIP_Real bilincoef, /**< coefficient of bilinear term */
33662  SCIP_Real lbx, /**< lower bound on first variable */
33663  SCIP_Real ubx, /**< upper bound on first variable */
33664  SCIP_Real refpointx, /**< reference point for first variable */
33665  SCIP_Real lby, /**< lower bound on second variable */
33666  SCIP_Real uby, /**< upper bound on second variable */
33667  SCIP_Real refpointy, /**< reference point for second variable */
33668  SCIP_Bool overestimate, /**< whether to compute an overestimator instead of an underestimator */
33669  SCIP_Real xcoef, /**< x coefficient of linear inequality; must be in {-1,0,1} */
33670  SCIP_Real ycoef, /**< y coefficient of linear inequality */
33671  SCIP_Real constant, /**< constant of linear inequality */
33672  SCIP_Real* RESTRICT lincoefx, /**< buffer to store coefficient of first variable in linearization */
33673  SCIP_Real* RESTRICT lincoefy, /**< buffer to store coefficient of second variable in linearization */
33674  SCIP_Real* RESTRICT linconstant, /**< buffer to store constant of linearization */
33675  SCIP_Bool* RESTRICT success /**< buffer to store whether linearization was successful */
33676  )
33677 {
33678  SCIP_Real xs[2] = {lbx, ubx};
33679  SCIP_Real ys[2] = {lby, uby};
33680  SCIP_Real minx;
33681  SCIP_Real maxx;
33682  SCIP_Real miny;
33683  SCIP_Real maxy;
33684  SCIP_Real tmp;
33685  SCIP_Real mj;
33686  SCIP_Real qj;
33687  SCIP_Real xj;
33688  SCIP_Real yj;
33689  SCIP_Real vx;
33690  SCIP_Real vy;
33691  int n;
33692  int i;
33693 
33694  assert(scip != NULL);
33695  assert(!SCIPisInfinity(scip, lbx));
33696  assert(!SCIPisInfinity(scip, -ubx));
33697  assert(!SCIPisInfinity(scip, lby));
33698  assert(!SCIPisInfinity(scip, -uby));
33699  assert(SCIPisLE(scip, lbx, ubx));
33700  assert(SCIPisLE(scip, lby, uby));
33701  assert(SCIPisLE(scip, lbx, refpointx));
33702  assert(SCIPisGE(scip, ubx, refpointx));
33703  assert(SCIPisLE(scip, lby, refpointy));
33704  assert(SCIPisGE(scip, uby, refpointy));
33705  assert(lincoefx != NULL);
33706  assert(lincoefy != NULL);
33707  assert(linconstant != NULL);
33708  assert(success != NULL);
33709  assert(xcoef == 0.0 || xcoef == -1.0 || xcoef == 1.0); /*lint !e777*/
33710  assert(ycoef != SCIP_INVALID && ycoef != 0.0); /*lint !e777*/
33711  assert(constant != SCIP_INVALID); /*lint !e777*/
33712 
33713  *success = FALSE;
33714  *lincoefx = SCIP_INVALID;
33715  *lincoefy = SCIP_INVALID;
33716  *linconstant = SCIP_INVALID;
33717 
33718  /* reference point does not satisfy linear inequality */
33719  if( SCIPisFeasGT(scip, xcoef * refpointx - ycoef * refpointy - constant, 0.0) )
33720  return;
33721 
33722  /* compute minimal and maximal bounds on x and y for accepting the reference point */
33723  minx = lbx + 0.01 * (ubx-lbx);
33724  maxx = ubx - 0.01 * (ubx-lbx);
33725  miny = lby + 0.01 * (uby-lby);
33726  maxy = uby - 0.01 * (uby-lby);
33727 
33728  /* check whether the reference point is in [minx,maxx]x[miny,maxy] */
33729  if( SCIPisLE(scip, refpointx, minx) || SCIPisGE(scip, refpointx, maxx)
33730  || SCIPisLE(scip, refpointy, miny) || SCIPisGE(scip, refpointy, maxy) )
33731  return;
33732 
33733  /* always consider xy without the bilinear coefficient */
33734  if( bilincoef < 0.0 )
33735  overestimate = !overestimate;
33736 
33737  /* we use same notation as in "Convex envelopes of bivariate functions through the solution of KKT systems", 2016 */
33738  mj = xcoef / ycoef;
33739  qj = -constant / ycoef;
33740 
33741  /* mj > 0 => underestimate; mj < 0 => overestimate */
33742  if( SCIPisNegative(scip, mj) != overestimate )
33743  return;
33744 
33745  /* get the corner point that satisfies the linear inequality xcoef*x <= ycoef*y + constant */
33746  if( !overestimate )
33747  {
33748  ys[0] = uby;
33749  ys[1] = lby;
33750  }
33751 
33752  vx = SCIP_INVALID;
33753  vy = SCIP_INVALID;
33754  n = 0;
33755  for( i = 0; i < 2; ++i )
33756  {
33757  SCIP_Real activity = xcoef * xs[i] - ycoef * ys[i] - constant;
33758  if( SCIPisLE(scip, activity, 0.0) )
33759  {
33760  /* corner point is satisfies inequality */
33761  vx = xs[i];
33762  vy = ys[i];
33763  }
33764  else if( SCIPisFeasGT(scip, activity, 0.0) )
33765  /* corner point is clearly cut off */
33766  ++n;
33767  }
33768 
33769  /* 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]) */
33770  if( n != 1 || vx == SCIP_INVALID || vy == SCIP_INVALID ) /*lint !e777*/
33771  return;
33772 
33773  tmp = mj*(refpointx - vx) + vy - refpointy;
33774  if( SCIPisZero(scip, tmp) )
33775  return;
33776 
33777  /* (xj,yj) is the projection onto the line xcoef*x = ycoef*y + constant */
33778  xj = (refpointx*(vy - qj) - vx*(refpointy - qj)) / tmp;
33779  yj = mj * xj + qj;
33780 
33781  assert(SCIPisFeasEQ(scip, xcoef*xj - ycoef*yj - constant, 0.0));
33782 
33783  /* check whether the projection is in [minx,maxx] x [miny,maxy]; this avoids numerical difficulties when the
33784  * projection is close to the variable bounds
33785  */
33786  if( SCIPisLE(scip, xj, minx) || SCIPisGE(scip, xj, maxx) || SCIPisLE(scip, yj, miny) || SCIPisGE(scip, yj, maxy) )
33787  return;
33788 
33789  assert(vy - mj*vx - qj != 0.0);
33790 
33791  *lincoefy = (mj*SQR(xj) - 2.0*mj*vx*xj - qj*vx + vx*vy) / (vy - mj*vx - qj);
33792  *lincoefx = 2.0*mj*xj + qj - mj*(*lincoefy);
33793  *linconstant = -mj*SQR(xj) - (*lincoefy)*qj;
33794 
33795  /* consider the bilinear coefficient */
33796  *lincoefx *= bilincoef;
33797  *lincoefy *= bilincoef;
33798  *linconstant *= bilincoef;
33799 
33800  /* cut needs to be tight at (vx,vy) and (xj,yj); otherwise we consider the cut to be numerically bad */
33801  *success = SCIPisFeasEQ(scip, (*lincoefx)*vx + (*lincoefy)*vy + (*linconstant), bilincoef*vx*vy)
33802  && SCIPisFeasEQ(scip, (*lincoefx)*xj + (*lincoefy)*yj + (*linconstant), bilincoef*xj*yj);
33803 
33804 #ifndef NDEBUG
33805  {
33806  SCIP_Real activity = (*lincoefx)*refpointx + (*lincoefy)*refpointy + (*linconstant);
33807 
33808  /* cut needs to under- or overestimate the bilinear term at the reference point */
33809  if( bilincoef < 0.0 )
33810  overestimate = !overestimate;
33811 
33812  if( overestimate )
33813  assert(SCIPisFeasGE(scip, activity, bilincoef*refpointx*refpointy));
33814  else
33815  assert(SCIPisFeasLE(scip, activity, bilincoef*refpointx*refpointy));
33816  }
33817 #endif
33818 }
33819 
33820 /** helper function to compute the convex envelope of a bilinear term when two linear inequalities are given; we
33821  * use the same notation and formulas as in Locatelli 2016
33822  */
33823 static
33825  SCIP* scip, /**< SCIP data structure */
33826  SCIP_Real x, /**< reference point for x */
33827  SCIP_Real y, /**< reference point for y */
33828  SCIP_Real mi, /**< coefficient of x in the first linear inequality */
33829  SCIP_Real qi, /**< constant in the first linear inequality */
33830  SCIP_Real mj, /**< coefficient of x in the second linear inequality */
33831  SCIP_Real qj, /**< constant in the second linear inequality */
33832  SCIP_Real* RESTRICT xi, /**< buffer to store x coordinate of the first point */
33833  SCIP_Real* RESTRICT yi, /**< buffer to store y coordinate of the first point */
33834  SCIP_Real* RESTRICT xj, /**< buffer to store x coordinate of the second point */
33835  SCIP_Real* RESTRICT yj, /**< buffer to store y coordinate of the second point */
33836  SCIP_Real* RESTRICT xcoef, /**< buffer to store the x coefficient of the envelope */
33837  SCIP_Real* RESTRICT ycoef, /**< buffer to store the y coefficient of the envelope */
33838  SCIP_Real* RESTRICT constant /**< buffer to store the constant of the envelope */
33839  )
33840 {
33841  assert(xi != NULL);
33842  assert(yi != NULL);
33843  assert(xj != NULL);
33844  assert(yj != NULL);
33845  assert(xcoef != NULL);
33846  assert(ycoef != NULL);
33847  assert(constant != NULL);
33848 
33849  if( SCIPisEQ(scip, mi, mj) )
33850  {
33851  *xi = (x + mi * y - qi) / (2.0*mi);
33852  *yi = mi*(*xi) + qi;
33853  *xj = (*xi) + (qi - qj)/ (2.0*mi);
33854  *yj = mj * (*xj) + qj;
33855  *ycoef = (*xi) + (qi - qj) / (4.0*mi); /* note that this is wrong in Locatelli 2016 */
33856  *xcoef = 2.0*mi*(*xi) - mi * (*ycoef) + qi;
33857  *constant = -mj*SQR(*xj) - (*ycoef) * qj;
33858  }
33859  else if( mi > 0.0 )
33860  {
33861  assert(mj > 0.0);
33862 
33863  *xi = (y + SQRT(mi*mj)*x - qi) / (REALABS(mi) + SQRT(mi*mj));
33864  *yi = mi*(*xi) + qi;
33865  *xj = (y + SQRT(mi*mj)*x - qj) / (REALABS(mj) + SQRT(mi*mj));
33866  *yj = mj*(*xj) + qj;
33867  *ycoef = (2.0*mj*(*xj) + qj - 2.0*mi*(*xi) - qi) / (mj - mi);
33868  *xcoef = 2.0*mj*(*xj) + qj - mj*(*ycoef);
33869  *constant = -mj*SQR(*xj) - (*ycoef) * qj;
33870  }
33871  else
33872  {
33873  assert(mi < 0.0 && mj < 0.0);
33874 
33875  /* apply variable transformation x = -x in case for overestimation */
33876  computeBilinEnvelope2(scip, -x, y, -mi, qi, -mj, qj, xi, yi, xj, yj, xcoef, ycoef, constant);
33877 
33878  /* revert transformation; multiply cut by -1 and change -x by x */
33879  *xi = -(*xi);
33880  *xj = -(*xj);
33881  *ycoef = -(*ycoef);
33882  *constant = -(*constant);
33883  }
33884 }
33885 
33886 /** computes coefficients of linearization of a bilinear term in a reference point when given two linear inequality
33887  * involving only the variables of the bilinear term
33888  *
33889  * @note the formulas are extracted from "Convex envelopes of bivariate functions through the solution of KKT systems"
33890  * by Marco Locatelli
33891  *
33892  */
33894  SCIP* scip, /**< SCIP data structure */
33895  SCIP_Real bilincoef, /**< coefficient of bilinear term */
33896  SCIP_Real lbx, /**< lower bound on first variable */
33897  SCIP_Real ubx, /**< upper bound on first variable */
33898  SCIP_Real refpointx, /**< reference point for first variable */
33899  SCIP_Real lby, /**< lower bound on second variable */
33900  SCIP_Real uby, /**< upper bound on second variable */
33901  SCIP_Real refpointy, /**< reference point for second variable */
33902  SCIP_Bool overestimate, /**< whether to compute an overestimator instead of an underestimator */
33903  SCIP_Real xcoef1, /**< x coefficient of linear inequality; must be in {-1,0,1} */
33904  SCIP_Real ycoef1, /**< y coefficient of linear inequality */
33905  SCIP_Real constant1, /**< constant of linear inequality */
33906  SCIP_Real xcoef2, /**< x coefficient of linear inequality; must be in {-1,0,1} */
33907  SCIP_Real ycoef2, /**< y coefficient of linear inequality */
33908  SCIP_Real constant2, /**< constant of linear inequality */
33909  SCIP_Real* RESTRICT lincoefx, /**< buffer to store coefficient of first variable in linearization */
33910  SCIP_Real* RESTRICT lincoefy, /**< buffer to store coefficient of second variable in linearization */
33911  SCIP_Real* RESTRICT linconstant, /**< buffer to store constant of linearization */
33912  SCIP_Bool* RESTRICT success /**< buffer to store whether linearization was successful */
33913  )
33914 {
33915  SCIP_Real mi, mj, qi, qj, xi, xj, yi, yj;
33916  SCIP_Real xcoef, ycoef, constant;
33917  SCIP_Real minx, maxx, miny, maxy;
33918 
33919  assert(scip != NULL);
33920  assert(!SCIPisInfinity(scip, lbx));
33921  assert(!SCIPisInfinity(scip, -ubx));
33922  assert(!SCIPisInfinity(scip, lby));
33923  assert(!SCIPisInfinity(scip, -uby));
33924  assert(SCIPisLE(scip, lbx, ubx));
33925  assert(SCIPisLE(scip, lby, uby));
33926  assert(SCIPisLE(scip, lbx, refpointx));
33927  assert(SCIPisGE(scip, ubx, refpointx));
33928  assert(SCIPisLE(scip, lby, refpointy));
33929  assert(SCIPisGE(scip, uby, refpointy));
33930  assert(lincoefx != NULL);
33931  assert(lincoefy != NULL);
33932  assert(linconstant != NULL);
33933  assert(success != NULL);
33934  assert(xcoef1 != 0.0 && xcoef1 != SCIP_INVALID); /*lint !e777*/
33935  assert(ycoef1 != SCIP_INVALID && ycoef1 != 0.0); /*lint !e777*/
33936  assert(constant1 != SCIP_INVALID); /*lint !e777*/
33937  assert(xcoef2 != 0.0 && xcoef2 != SCIP_INVALID); /*lint !e777*/
33938  assert(ycoef2 != SCIP_INVALID && ycoef2 != 0.0); /*lint !e777*/
33939  assert(constant2 != SCIP_INVALID); /*lint !e777*/
33940 
33941  *success = FALSE;
33942  *lincoefx = SCIP_INVALID;
33943  *lincoefy = SCIP_INVALID;
33944  *linconstant = SCIP_INVALID;
33945 
33946  /* reference point does not satisfy linear inequalities */
33947  if( SCIPisFeasGT(scip, xcoef1 * refpointx - ycoef1 * refpointy - constant1, 0.0)
33948  || SCIPisFeasGT(scip, xcoef2 * refpointx - ycoef2 * refpointy - constant2, 0.0) )
33949  return;
33950 
33951  /* compute minimal and maximal bounds on x and y for accepting the reference point */
33952  minx = lbx + 0.01 * (ubx-lbx);
33953  maxx = ubx - 0.01 * (ubx-lbx);
33954  miny = lby + 0.01 * (uby-lby);
33955  maxy = uby - 0.01 * (uby-lby);
33956 
33957  /* check the reference point is in the interior of the domain */
33958  if( SCIPisLE(scip, refpointx, minx) || SCIPisGE(scip, refpointx, maxx)
33959  || SCIPisLE(scip, refpointy, miny) || SCIPisFeasGE(scip, refpointy, maxy) )
33960  return;
33961 
33962  /* the sign of the x-coefficients of the two inequalities must be different; otherwise the convex or concave
33963  * envelope can be computed via SCIPcomputeBilinEnvelope1 for each inequality separately
33964  */
33965  if( (xcoef1 > 0) == (xcoef2 > 0) )
33966  return;
33967 
33968  /* always consider xy without the bilinear coefficient */
33969  if( bilincoef < 0.0 )
33970  overestimate = !overestimate;
33971 
33972  /* we use same notation as in "Convex envelopes of bivariate functions through the solution of KKT systems", 2016 */
33973  mi = xcoef1 / ycoef1;
33974  qi = -constant1 / ycoef1;
33975  mj = xcoef2 / ycoef2;
33976  qj = -constant2 / ycoef2;
33977 
33978  /* mi, mj > 0 => underestimate; mi, mj < 0 => overestimate */
33979  if( SCIPisNegative(scip, mi) != overestimate || SCIPisNegative(scip, mj) != overestimate )
33980  return;
33981 
33982  /* compute cut according to Locatelli 2016 */
33983  computeBilinEnvelope2(scip, refpointx, refpointy, mi, qi, mj, qj, &xi, &yi, &xj, &yj, &xcoef, &ycoef, &constant);
33984  assert(SCIPisEQ(scip, mi*xi + qi, yi));
33985  assert(SCIPisEQ(scip, mj*xj + qj, yj));
33986 
33987  /* it might happen that (xi,yi) = (xj,yj) if the two lines intersect */
33988  if( SCIPisEQ(scip, xi, xj) && SCIPisEQ(scip, yi, yj) )
33989  return;
33990 
33991  /* check whether projected points are in the interior */
33992  if( SCIPisLE(scip, xi, minx) || SCIPisGE(scip, xi, maxx) || SCIPisLE(scip, yi, miny) || SCIPisGE(scip, yi, maxy) )
33993  return;
33994  if( SCIPisLE(scip, xj, minx) || SCIPisGE(scip, xj, maxx) || SCIPisLE(scip, yj, miny) || SCIPisGE(scip, yj, maxy) )
33995  return;
33996 
33997  *lincoefx = bilincoef * xcoef;
33998  *lincoefy = bilincoef * ycoef;
33999  *linconstant = bilincoef * constant;
34000 
34001  /* cut needs to be tight at (vx,vy) and (xj,yj) */
34002  *success = SCIPisFeasEQ(scip, (*lincoefx)*xi + (*lincoefy)*yi + (*linconstant), bilincoef*xi*yi)
34003  && SCIPisFeasEQ(scip, (*lincoefx)*xj + (*lincoefy)*yj + (*linconstant), bilincoef*xj*yj);
34004 
34005 #ifndef NDEBUG
34006  {
34007  SCIP_Real activity = (*lincoefx)*refpointx + (*lincoefy)*refpointy + (*linconstant);
34008 
34009  /* cut needs to under- or overestimate the bilinear term at the reference point */
34010  if( bilincoef < 0.0 )
34011  overestimate = !overestimate;
34012 
34013  if( overestimate )
34014  assert(SCIPisFeasGE(scip, activity, bilincoef*refpointx*refpointy));
34015  else
34016  assert(SCIPisFeasLE(scip, activity, bilincoef*refpointx*refpointy));
34017  }
34018 #endif
34019 }
34020 
34021 /** creates an NLP relaxation and stores it in a given NLPI problem; the function computes for each variable which the
34022  * number of non-linearly occurrences and stores it in the nlscore array
34023  *
34024  * @note the first row corresponds always to the cutoff row (even if cutoffbound is SCIPinfinity(scip))
34025  **/
34027  SCIP* scip, /**< SCIP data structure */
34028  SCIP_NLPI* nlpi, /**< interface to NLP solver */
34029  SCIP_NLROW** nlrows, /**< nonlinear rows */
34030  int nnlrows, /**< total number of nonlinear rows */
34031  SCIP_NLPIPROBLEM* nlpiprob, /**< empty nlpi problem */
34032  SCIP_HASHMAP* var2idx, /**< empty hash map to store mapping between variables and indices in nlpi
34033  * problem */
34034  SCIP_Real* nlscore, /**< array to store the score of each nonlinear variable (NULL if not
34035  * needed) */
34036  SCIP_Real cutoffbound, /**< cutoff bound */
34037  SCIP_Bool setobj, /**< should the objective function be set? */
34038  SCIP_Bool onlyconvex /**< filter only for convex constraints */
34039  )
34040 {
34041  SCIP_EXPRTREE** exprtrees;
34042  int** exprvaridxs;
34043  SCIP_QUADELEM** quadelems;
34044  int* nquadelems;
34045  SCIP_Real** linvals;
34046  int** lininds;
34047  int* nlininds;
34048  SCIP_Real* lhss;
34049  SCIP_Real* rhss;
34050  const char** names;
34051  SCIP_VAR** vars;
34052  int nvars;
34053  SCIP_Real* lbs;
34054  SCIP_Real* ubs;
34055  SCIP_Real* objvals = NULL;
34056  int* objinds = NULL;
34057  const char** varnames;
34058  int nobjinds;
34059  int nconss;
34060  int i;
34061 
34062  assert(nlpiprob != NULL);
34063  assert(var2idx != NULL);
34064  assert(nlrows != NULL);
34065  assert(nnlrows > 0);
34066  assert(nlpi != NULL);
34067 
34068  SCIPdebugMsg(scip, "call SCIPcreateConvexNlpNlobbt() with cutoffbound %g\n", cutoffbound);
34069 
34070  if( nlscore != NULL )
34071  {
34072  BMSclearMemoryArray(nlscore, SCIPgetNVars(scip));
34073  }
34074  vars = SCIPgetVars(scip);
34075  nvars = SCIPgetNVars(scip);
34076  nconss = 0;
34077 
34078  SCIP_CALL( SCIPallocBufferArray(scip, &exprtrees, nnlrows + 1) );
34079  SCIP_CALL( SCIPallocBufferArray(scip, &exprvaridxs, nnlrows + 1) );
34080  SCIP_CALL( SCIPallocBufferArray(scip, &quadelems, nnlrows + 1) );
34081  SCIP_CALL( SCIPallocBufferArray(scip, &nquadelems, nnlrows + 1) );
34082  SCIP_CALL( SCIPallocBufferArray(scip, &linvals, nnlrows + 1) );
34083  SCIP_CALL( SCIPallocBufferArray(scip, &lininds, nnlrows + 1) );
34084  SCIP_CALL( SCIPallocBufferArray(scip, &nlininds, nnlrows + 1) );
34085  SCIP_CALL( SCIPallocBufferArray(scip, &names, nnlrows + 1) );
34086  SCIP_CALL( SCIPallocBufferArray(scip, &lhss, nnlrows + 1) );
34087  SCIP_CALL( SCIPallocBufferArray(scip, &rhss, nnlrows + 1) );
34088 
34089  if( setobj )
34090  {
34091  SCIP_CALL( SCIPallocBufferArray(scip, &objvals, nvars) );
34092  SCIP_CALL( SCIPallocBufferArray(scip, &objinds, nvars) );
34093  }
34094 
34095  SCIP_CALL( SCIPallocBufferArray(scip, &lbs, nvars) );
34096  SCIP_CALL( SCIPallocBufferArray(scip, &ubs, nvars) );
34097  SCIP_CALL( SCIPallocBufferArray(scip, &varnames, nvars) );
34098 
34099  /* create a unique mapping between variables and {0,..,nvars-1} */
34100  nobjinds = 0;
34101  for( i = 0; i < nvars; ++i )
34102  {
34103  assert(vars[i] != NULL);
34104  SCIP_CALL( SCIPhashmapInsert(var2idx, (void*)vars[i], (void*)(size_t)i) );
34105 
34106  lbs[i] = SCIPvarGetLbLocal(vars[i]);
34107  ubs[i] = SCIPvarGetUbLocal(vars[i]);
34108  varnames[i] = SCIPvarGetName(vars[i]);
34109 
34110  /* collect non-zero objective coefficients */
34111  if( setobj && !SCIPisZero(scip, SCIPvarGetObj(vars[i])) )
34112  {
34113  assert(objvals != NULL);
34114  assert(objinds != NULL);
34115 
34116  objvals[nobjinds] = SCIPvarGetObj(vars[i]);
34117  objinds[nobjinds] = i;
34118  ++nobjinds;
34119  }
34120  }
34121 
34122  /* add variables */
34123  SCIP_CALL( SCIPnlpiAddVars(nlpi, nlpiprob, nvars, lbs, ubs, varnames) );
34124  SCIPfreeBufferArray(scip, &varnames);
34125  SCIPfreeBufferArray(scip, &ubs);
34126  SCIPfreeBufferArray(scip, &lbs);
34127 
34128  /* set the objective function */
34129  if( setobj )
34130  {
34131  if( nobjinds > 0 )
34132  {
34133  SCIP_CALL( SCIPnlpiSetObjective(nlpi, nlpiprob, nobjinds, objinds, objvals, 0, NULL, NULL, NULL, 0.0) );
34134  }
34135 
34136  SCIPfreeBufferArray(scip, &objinds);
34137  SCIPfreeBufferArray(scip, &objvals);
34138  }
34139 
34140  /* add row for cutoff bound even if cutoffbound == SCIPinfinity() */
34141  lhss[nconss] = -SCIPinfinity(scip);
34142  rhss[nconss] = cutoffbound;
34143  names[nconss] = "objcutoff";
34144  lininds[nconss] = NULL;
34145  linvals[nconss] = NULL;
34146  nlininds[nconss] = 0;
34147  nquadelems[nconss] = 0;
34148  quadelems[nconss] = NULL;
34149  exprtrees[nconss] = NULL;
34150  exprvaridxs[nconss] = NULL;
34151 
34152  SCIP_CALL( SCIPallocBufferArray(scip, &lininds[nconss], nvars) ); /*lint !e866*/
34153  SCIP_CALL( SCIPallocBufferArray(scip, &linvals[nconss], nvars) ); /*lint !e866*/
34154 
34155  for( i = 0; i < nvars; ++i )
34156  {
34157  if( !SCIPisZero(scip, SCIPvarGetObj(vars[i])) )
34158  {
34159  linvals[nconss][nlininds[nconss]] = SCIPvarGetObj(vars[i]);
34160  lininds[nconss][nlininds[nconss]] = i;
34161  ++nlininds[nconss];
34162  }
34163  }
34164  ++nconss;
34165 
34166  /* add convex nonlinear rows to NLPI problem */
34167  for( i = 0; i < nnlrows; ++i )
34168  {
34169  SCIP_Bool userhs;
34170  SCIP_Bool uselhs;
34171  int k;
34172 
34173  assert(nlrows[i] != NULL);
34174 
34175  uselhs = FALSE;
34176  userhs = FALSE;
34177 
34178  /* check curvature together with constraint sides of a nonlinear row */
34179  if( SCIPnlrowGetNQuadElems(nlrows[i]) == 0 && SCIPnlrowGetExprtree(nlrows[i]) == NULL )
34180  {
34181  uselhs = TRUE;
34182  userhs = TRUE;
34183  }
34184  else
34185  {
34186  if( (!onlyconvex || SCIPnlrowGetCurvature(nlrows[i]) == SCIP_EXPRCURV_CONVEX)
34187  && !SCIPisInfinity(scip, SCIPnlrowGetRhs(nlrows[i])) )
34188  userhs = TRUE;
34189  if( (!onlyconvex || SCIPnlrowGetCurvature(nlrows[i]) == SCIP_EXPRCURV_CONCAVE)
34190  && !SCIPisInfinity(scip, SCIPnlrowGetLhs(nlrows[i])) )
34191  uselhs = TRUE;
34192  }
34193 
34194  if( !uselhs && !userhs )
34195  continue;
34196 
34197  lhss[nconss] = uselhs ? SCIPnlrowGetLhs(nlrows[i]) - SCIPnlrowGetConstant(nlrows[i]) : -SCIPinfinity(scip);
34198  rhss[nconss] = userhs ? SCIPnlrowGetRhs(nlrows[i]) - SCIPnlrowGetConstant(nlrows[i]) : SCIPinfinity(scip);
34199  names[nconss] = SCIPnlrowGetName(nlrows[i]);
34200  nlininds[nconss] = 0;
34201  lininds[nconss] = NULL;
34202  linvals[nconss] = NULL;
34203  nquadelems[nconss] = 0;
34204  quadelems[nconss] = NULL;
34205  exprtrees[nconss] = NULL;
34206  exprvaridxs[nconss] = NULL;
34207 
34208  /* copy linear part */
34209  if( SCIPnlrowGetNLinearVars(nlrows[i]) > 0 )
34210  {
34211  SCIP_VAR* var;
34212 
34213  nlininds[nconss] = SCIPnlrowGetNLinearVars(nlrows[i]);
34214 
34215  SCIP_CALL( SCIPallocBufferArray(scip, &lininds[nconss], nlininds[nconss]) ); /*lint !e866*/
34216  SCIP_CALL( SCIPallocBufferArray(scip, &linvals[nconss], nlininds[nconss]) ); /*lint !e866*/
34217 
34218  for( k = 0; k < nlininds[nconss]; ++k )
34219  {
34220  var = SCIPnlrowGetLinearVars(nlrows[i])[k];
34221  assert(var != NULL);
34222  assert(SCIPhashmapExists(var2idx, (void*)var));
34223 
34224  lininds[nconss][k] = (int)(size_t)SCIPhashmapGetImage(var2idx, (void*)var);
34225  assert(var == vars[lininds[nconss][k]]);
34226  linvals[nconss][k] = SCIPnlrowGetLinearCoefs(nlrows[i])[k];
34227  }
34228  }
34229 
34230  /* copy quadratic part */
34231  if( SCIPnlrowGetNQuadElems(nlrows[i]) > 0 )
34232  {
34233  SCIP_QUADELEM quadelem;
34234  SCIP_VAR* var1;
34235  SCIP_VAR* var2;
34236 
34237  nquadelems[nconss] = SCIPnlrowGetNQuadElems(nlrows[i]);
34238  SCIP_CALL( SCIPallocBufferArray(scip, &quadelems[nconss], nquadelems[nconss]) ); /*lint !e866*/
34239 
34240  for( k = 0; k < nquadelems[nconss]; ++k )
34241  {
34242  quadelem = SCIPnlrowGetQuadElems(nlrows[i])[k];
34243 
34244  var1 = SCIPnlrowGetQuadVars(nlrows[i])[quadelem.idx1];
34245  assert(var1 != NULL);
34246  assert(SCIPhashmapExists(var2idx, (void*)var1));
34247 
34248  var2 = SCIPnlrowGetQuadVars(nlrows[i])[quadelem.idx2];
34249  assert(var2 != NULL);
34250  assert(SCIPhashmapExists(var2idx, (void*)var2));
34251 
34252  quadelems[nconss][k].coef = quadelem.coef;
34253  quadelems[nconss][k].idx1 = (int)(size_t)SCIPhashmapGetImage(var2idx, (void*)var1);
34254  quadelems[nconss][k].idx2 = (int)(size_t)SCIPhashmapGetImage(var2idx, (void*)var2);
34255 
34256  /* expr.c assumes that the indices are ordered */
34257  if( quadelems[nconss][k].idx1 > quadelems[nconss][k].idx2 )
34258  {
34259  SCIPswapInts(&quadelems[nconss][k].idx1, &quadelems[nconss][k].idx2);
34260  }
34261  assert(quadelems[nconss][k].idx1 <= quadelems[nconss][k].idx2);
34262 
34263  /* update nlscore */
34264  if( nlscore != NULL )
34265  {
34266  ++nlscore[quadelems[nconss][k].idx1];
34267  if( quadelems[nconss][k].idx1 != quadelems[nconss][k].idx2 )
34268  ++nlscore[quadelems[nconss][k].idx2];
34269  }
34270  }
34271  }
34272 
34273  /* copy expression tree */
34274  if( SCIPnlrowGetExprtree(nlrows[i]) != NULL )
34275  {
34276  SCIP_VAR* var;
34277 
34278  /* note that we don't need to copy the expression tree here since only the mapping between variables in the
34279  * tree and the corresponding indices change; this mapping is stored in the exprvaridxs array
34280  */
34281  exprtrees[nconss] = SCIPnlrowGetExprtree(nlrows[i]);
34282 
34283  SCIP_CALL( SCIPallocBufferArray(scip, &exprvaridxs[nconss], SCIPexprtreeGetNVars(exprtrees[nconss])) ); /*lint !e866*/
34284 
34285  for( k = 0; k < SCIPexprtreeGetNVars(exprtrees[nconss]); ++k )
34286  {
34287  var = SCIPexprtreeGetVars(exprtrees[nconss])[k];
34288  assert(var != NULL);
34289  assert(SCIPhashmapExists(var2idx, (void*)var));
34290 
34291  exprvaridxs[nconss][k] = (int)(size_t)SCIPhashmapGetImage(var2idx, (void*)var);
34292 
34293  /* update nlscore */
34294  if( nlscore != NULL )
34295  ++nlscore[exprvaridxs[nconss][k]];
34296  }
34297  }
34298 
34299  ++nconss;
34300  }
34301  assert(nconss > 0);
34302 
34303  /* pass all constraint information to nlpi */
34304  SCIP_CALL( SCIPnlpiAddConstraints(nlpi, nlpiprob, nconss, lhss, rhss, nlininds, lininds, linvals, nquadelems,
34305  quadelems, exprvaridxs, exprtrees, names) );
34306 
34307  /* free memory */
34308  for( i = nconss - 1; i > 0; --i )
34309  {
34310  if( exprtrees[i] != NULL )
34311  {
34312  assert(exprvaridxs[i] != NULL);
34313  SCIPfreeBufferArray(scip, &exprvaridxs[i]);
34314  }
34315 
34316  if( nquadelems[i] > 0 )
34317  {
34318  assert(quadelems[i] != NULL);
34319  SCIPfreeBufferArray(scip, &quadelems[i]);
34320  }
34321 
34322  if( nlininds[i] > 0 )
34323  {
34324  assert(linvals[i] != NULL);
34325  assert(lininds[i] != NULL);
34326  SCIPfreeBufferArray(scip, &linvals[i]);
34327  SCIPfreeBufferArray(scip, &lininds[i]);
34328  }
34329  }
34330  /* free row for cutoff bound even if objective is 0 */
34331  SCIPfreeBufferArray(scip, &linvals[i]);
34332  SCIPfreeBufferArray(scip, &lininds[i]);
34333 
34334  SCIPfreeBufferArray(scip, &rhss);
34335  SCIPfreeBufferArray(scip, &lhss);
34336  SCIPfreeBufferArray(scip, &names);
34337  SCIPfreeBufferArray(scip, &nlininds);
34338  SCIPfreeBufferArray(scip, &lininds);
34339  SCIPfreeBufferArray(scip, &linvals);
34340  SCIPfreeBufferArray(scip, &nquadelems);
34341  SCIPfreeBufferArray(scip, &quadelems);
34342  SCIPfreeBufferArray(scip, &exprvaridxs);
34343  SCIPfreeBufferArray(scip, &exprtrees);
34344 
34345  return SCIP_OKAY;
34346 }
34347 
34348 /** updates bounds of each variable and the cutoff row in the nlpiproblem */
34350  SCIP* scip, /**< SCIP data structure */
34351  SCIP_NLPI* nlpi, /**< interface to NLP solver */
34352  SCIP_NLPIPROBLEM* nlpiprob, /**< nlpi problem representing the convex NLP relaxation */
34353  SCIP_HASHMAP* var2nlpiidx, /**< mapping between variables and nlpi indices */
34354  SCIP_VAR** nlpivars, /**< array containing all variables of the nlpi */
34355  int nlpinvars, /**< total number of nlpi variables */
34356  SCIP_Real cutoffbound /**< new cutoff bound */
34357  )
34358 {
34359  SCIP_Real* lbs;
34360  SCIP_Real* ubs;
34361  SCIP_Real lhs;
34362  SCIP_Real rhs;
34363  int* inds;
34364  int i;
34365 
34366  SCIPdebugMsg(scip, "call SCIPupdateConvexNlpNlobbt()\n");
34367 
34368  /* update variable bounds */
34369  SCIP_CALL( SCIPallocBufferArray(scip, &lbs, nlpinvars) );
34370  SCIP_CALL( SCIPallocBufferArray(scip, &ubs, nlpinvars) );
34371  SCIP_CALL( SCIPallocBufferArray(scip, &inds, nlpinvars) );
34372 
34373  for( i = 0; i < nlpinvars; ++i )
34374  {
34375  assert(nlpivars[i] != NULL);
34376  assert(SCIPhashmapExists(var2nlpiidx, (void*)nlpivars[i]));
34377 
34378  lbs[i] = SCIPvarGetLbLocal(nlpivars[i]);
34379  ubs[i] = SCIPvarGetUbLocal(nlpivars[i]);
34380  inds[i] = (int)(uintptr_t)SCIPhashmapGetImage(var2nlpiidx, (void*)nlpivars[i]);
34381  assert(inds[i] >= 0 && inds[i] < nlpinvars);
34382  }
34383 
34384  SCIP_CALL( SCIPnlpiChgVarBounds(nlpi, nlpiprob, nlpinvars, inds, lbs, ubs) );
34385 
34386  SCIPfreeBufferArray(scip, &inds);
34387  SCIPfreeBufferArray(scip, &ubs);
34388  SCIPfreeBufferArray(scip, &lbs);
34389 
34390  /* update cutoff row */
34391  lhs = -SCIPinfinity(scip);
34392  rhs = cutoffbound;
34393  i = 0;
34394 
34395  SCIP_CALL( SCIPnlpiChgConsSides(nlpi, nlpiprob, 1, &i, &lhs, &rhs) );
34396 
34397  return SCIP_OKAY;
34398 }
34399 
34400 /** adds linear rows to the NLP relaxation */
34402  SCIP* scip, /**< SCIP data structure */
34403  SCIP_NLPI* nlpi, /**< interface to NLP solver */
34404  SCIP_NLPIPROBLEM* nlpiprob, /**< nlpi problem */
34405  SCIP_HASHMAP* var2idx, /**< empty hash map to store mapping between variables and indices in nlpi
34406  * problem */
34407  SCIP_ROW** rows, /**< rows to add */
34408  int nrows /**< total number of rows to add */
34409  )
34410 {
34411  const char** names;
34412  SCIP_Real* lhss;
34413  SCIP_Real* rhss;
34414  SCIP_Real** linvals;
34415  int** lininds;
34416  int* nlininds;
34417  int i;
34418 
34419  assert(nlpi != NULL);
34420  assert(nlpiprob != NULL);
34421  assert(var2idx != NULL);
34422  assert(nrows == 0 || rows != NULL);
34423 
34424  SCIPdebugMsg(scip, "call SCIPaddConvexNlpRowsNlobbt() with %d rows\n", nrows);
34425 
34426  if( nrows <= 0 )
34427  return SCIP_OKAY;
34428 
34429  SCIP_CALL( SCIPallocBufferArray(scip, &names, nrows) );
34430  SCIP_CALL( SCIPallocBufferArray(scip, &lhss, nrows) );
34431  SCIP_CALL( SCIPallocBufferArray(scip, &rhss, nrows) );
34432  SCIP_CALL( SCIPallocBufferArray(scip, &linvals, nrows) );
34433  SCIP_CALL( SCIPallocBufferArray(scip, &lininds, nrows) );
34434  SCIP_CALL( SCIPallocBufferArray(scip, &nlininds, nrows) );
34435 
34436  for( i = 0; i < nrows; ++i )
34437  {
34438  int k;
34439 
34440  assert(rows[i] != NULL);
34441  assert(SCIProwGetNNonz(rows[i]) <= SCIPgetNVars(scip));
34442 
34443  names[i] = SCIProwGetName(rows[i]);
34444  lhss[i] = SCIProwGetLhs(rows[i]) - SCIProwGetConstant(rows[i]);
34445  rhss[i] = SCIProwGetRhs(rows[i]) - SCIProwGetConstant(rows[i]);
34446  nlininds[i] = SCIProwGetNNonz(rows[i]);
34447  linvals[i] = SCIProwGetVals(rows[i]);
34448  lininds[i] = NULL;
34449 
34450  SCIP_CALL( SCIPallocBufferArray(scip, &lininds[i], SCIProwGetNNonz(rows[i])) ); /*lint !e866*/
34451 
34452  for( k = 0; k < SCIProwGetNNonz(rows[i]); ++k )
34453  {
34454  SCIP_VAR* var;
34455 
34456  var = SCIPcolGetVar(SCIProwGetCols(rows[i])[k]);
34457  assert(var != NULL);
34458  assert(SCIPhashmapExists(var2idx, (void*)var));
34459 
34460  lininds[i][k] = (int)(size_t)SCIPhashmapGetImage(var2idx, (void*)var);
34461  assert(lininds[i][k] >= 0 && lininds[i][k] < SCIPgetNVars(scip));
34462  }
34463  }
34464 
34465  /* pass all linear rows to the nlpi */
34466  SCIP_CALL( SCIPnlpiAddConstraints(nlpi, nlpiprob, nrows, lhss, rhss, nlininds, lininds, linvals, NULL,
34467  NULL, NULL, NULL, names) );
34468 
34469  /* free memory */
34470  for( i = nrows - 1; i >= 0; --i )
34471  {
34472  SCIPfreeBufferArray(scip, &lininds[i]);
34473  }
34474  SCIPfreeBufferArray(scip, &nlininds);
34475  SCIPfreeBufferArray(scip, &lininds);
34476  SCIPfreeBufferArray(scip, &linvals);
34477  SCIPfreeBufferArray(scip, &rhss);
34478  SCIPfreeBufferArray(scip, &lhss);
34479  SCIPfreeBufferArray(scip, &names);
34480 
34481  return SCIP_OKAY;
34482 }
34483 
34484 /**@} */
34485 
34486 /*
34487  * cutting plane methods
34488  */
34489 
34490 /** returns efficacy of the cut with respect to the given primal solution or the current LP solution:
34491  * e = -feasibility/norm
34492  *
34493  * @return the efficacy of the cut with respect to the given primal solution or the current LP solution:
34494  * e = -feasibility/norm
34495  *
34496  * @pre This method can be called if @p scip is in one of the following stages:
34497  * - \ref SCIP_STAGE_SOLVING
34498  */
34500  SCIP* scip, /**< SCIP data structure */
34501  SCIP_SOL* sol, /**< primal CIP solution, or NULL for current LP solution */
34502  SCIP_ROW* cut /**< separated cut */
34503  )
34504 {
34505  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCutEfficacy", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34506 
34507  if( sol == NULL )
34508  return SCIProwGetLPEfficacy(cut, scip->set, scip->stat, scip->lp);
34509  else
34510  return SCIProwGetSolEfficacy(cut, scip->set, scip->stat, sol);
34511 }
34512 
34513 /** returns whether the cut's efficacy with respect to the given primal solution or the current LP solution is greater
34514  * than the minimal cut efficacy
34515  *
34516  * @return TRUE if the cut's efficacy with respect to the given primal solution or the current LP solution is greater
34517  * than the minimal cut efficacy, otherwise FALSE
34518  *
34519  * @pre This method can be called if @p scip is in one of the following stages:
34520  * - \ref SCIP_STAGE_SOLVING
34521  */
34523  SCIP* scip, /**< SCIP data structure */
34524  SCIP_SOL* sol, /**< primal CIP solution, or NULL for current LP solution */
34525  SCIP_ROW* cut /**< separated cut */
34526  )
34527 {
34528  SCIP_CALL_ABORT( checkStage(scip, "SCIPisCutEfficacious", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34529 
34530  if( sol == NULL )
34531  return SCIProwIsLPEfficacious(cut, scip->set, scip->stat, scip->lp, (SCIPtreeGetCurrentDepth(scip->tree) == 0));
34532  else
34533  return SCIProwIsSolEfficacious(cut, scip->set, scip->stat, sol, (SCIPtreeGetCurrentDepth(scip->tree) == 0));
34534 }
34535 
34536 /** checks, if the given cut's efficacy is larger than the minimal cut efficacy
34537  *
34538  * @return TRUE if the given cut's efficacy is larger than the minimal cut efficacy, otherwise FALSE
34539  */
34541  SCIP* scip, /**< SCIP data structure */
34542  SCIP_Real efficacy /**< efficacy of the cut */
34543  )
34544 {
34545  assert(scip != NULL);
34546 
34547  return SCIPsetIsEfficacious(scip->set, (SCIPtreeGetCurrentDepth(scip->tree) == 0), efficacy);
34548 }
34549 
34550 /** calculates the efficacy norm of the given vector, which depends on the "separating/efficacynorm" parameter
34551  *
34552  * @return the efficacy norm of the given vector, which depends on the "separating/efficacynorm" parameter
34553  */
34555  SCIP* scip, /**< SCIP data structure */
34556  SCIP_Real* vals, /**< array of values */
34557  int nvals /**< number of values */
34558  )
34559 {
34560  SCIP_Real norm;
34561  int i;
34562 
34563  assert(scip != NULL);
34564  assert(scip->set != NULL);
34565 
34566  norm = 0.0;
34567  switch( scip->set->sepa_efficacynorm )
34568  {
34569  case 'e':
34570  for( i = 0; i < nvals; ++i )
34571  norm += SQR(vals[i]);
34572  norm = SQRT(norm);
34573  break;
34574  case 'm':
34575  for( i = 0; i < nvals; ++i )
34576  {
34577  SCIP_Real absval;
34578 
34579  absval = REALABS(vals[i]);
34580  norm = MAX(norm, absval);
34581  }
34582  break;
34583  case 's':
34584  for( i = 0; i < nvals; ++i )
34585  norm += REALABS(vals[i]);
34586  break;
34587  case 'd':
34588  for( i = 0; i < nvals; ++i )
34589  {
34590  if( !SCIPisZero(scip, vals[i]) )
34591  {
34592  norm = 1.0;
34593  break;
34594  }
34595  }
34596  break;
34597  default:
34598  SCIPerrorMessage("invalid efficacy norm parameter '%c'\n", scip->set->sepa_efficacynorm);
34599  assert(FALSE);
34600  }
34601 
34602  return norm;
34603 }
34604 
34605 /** indicates whether a cut is applicable, i.e., will modify the LP when applied
34606  *
34607  * @pre This method can be called if @p scip is in one of the following stages:
34608  * - \ref SCIP_STAGE_SOLVING
34609  *
34610  * @return whether the cut is modifiable, not a bound change, or a bound change that changes bounds by at least epsilon
34611  */
34613  SCIP* scip, /**< SCIP data structure */
34614  SCIP_ROW* cut /**< separated cut */
34615  )
34616 {
34617  SCIP_CALL_ABORT( checkStage(scip, "SCIPisCutApplicable", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34618 
34619  return SCIPsepastoreIsCutApplicable(scip->set, cut);
34620 }
34621 
34622 /** adds cut to separation storage
34623  *
34624  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34625  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34626  *
34627  * @pre This method can be called if @p scip is in one of the following stages:
34628  * - \ref SCIP_STAGE_SOLVING
34629  *
34630  * @deprecated Please use SCIPaddRow() instead, or, if the row is a global cut, add it only to the global cutpool.
34631  */
34633  SCIP* scip, /**< SCIP data structure */
34634  SCIP_SOL* sol, /**< primal solution that was separated, or NULL for LP solution */
34635  SCIP_ROW* cut, /**< separated cut */
34636  SCIP_Bool forcecut, /**< should the cut be forced to enter the LP? */
34637  SCIP_Bool* infeasible /**< pointer to store whether cut has been detected to be infeasible for local bounds */
34638  )
34639 {
34640  SCIP_CALL( checkStage(scip, "SCIPaddCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34641 
34642  SCIP_UNUSED(sol);
34643 
34644  return SCIPaddRow(scip, cut, forcecut, infeasible);
34645 }
34646 
34647 /** adds row to separation storage
34648  *
34649  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34650  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34651  *
34652  * @pre This method can be called if @p scip is in one of the following stages:
34653  * - \ref SCIP_STAGE_SOLVING
34654  */
34656  SCIP* scip, /**< SCIP data structure */
34657  SCIP_ROW* row, /**< row */
34658  SCIP_Bool forcecut, /**< should the row be forced to enter the LP? */
34659  SCIP_Bool* infeasible /**< pointer to store whether row has been detected to be infeasible for local bounds */
34660  )
34661 {
34662  SCIP_CALL( checkStage(scip, "SCIPaddRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34663 
34664  assert(SCIPtreeGetCurrentNode(scip->tree) != NULL);
34665 
34666  SCIP_CALL( SCIPsepastoreAddCut(scip->sepastore, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
34667  scip->eventfilter, scip->lp, row, forcecut, (SCIPtreeGetCurrentDepth(scip->tree) == 0), infeasible) );
34668 
34669  /* possibly run conflict analysis */
34670  if ( *infeasible && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && SCIPisConflictAnalysisApplicable(scip) )
34671  {
34672  SCIP_Real act;
34673  SCIP_VAR* var;
34674  SCIP_Real val;
34675  int ncols;
34676  int j;
34677 
34678  /* initialize conflict analysis */
34680 
34681  if ( ! SCIPisInfinity(scip, -row->lhs) )
34682  {
34683  act = SCIProwGetMaxActivity(row, scip->set, scip->stat);
34684  if ( SCIPisLT(scip, act, row->lhs) )
34685  {
34686  ncols = SCIProwGetNNonz(row);
34687  for (j = 0; j < ncols; ++j)
34688  {
34689  val = row->vals[j];
34690  if ( ! SCIPisZero(scip, val) )
34691  {
34692  var = SCIPcolGetVar(row->cols[j]);
34693  assert( var != NULL );
34694 
34695  if ( val > 0.0 )
34696  {
34697  SCIP_CALL( SCIPaddConflictUb(scip, var, NULL) );
34698  }
34699  else
34700  {
34701  SCIP_CALL( SCIPaddConflictLb(scip, var, NULL) );
34702  }
34703  }
34704  }
34705  }
34706  }
34707  else if ( ! SCIPisInfinity(scip, row->rhs) )
34708  {
34709  act = SCIProwGetMinActivity(row, scip->set, scip->stat);
34710  if ( SCIPisGT(scip, act, row->rhs) )
34711  {
34712  ncols = SCIProwGetNNonz(row);
34713  for (j = 0; j < ncols; ++j)
34714  {
34715  val = row->vals[j];
34716  if ( ! SCIPisZero(scip, val) )
34717  {
34718  var = SCIPcolGetVar(row->cols[j]);
34719  assert( var != NULL );
34720 
34721  if ( val > 0.0 )
34722  {
34723  SCIP_CALL( SCIPaddConflictLb(scip, var, NULL) );
34724  }
34725  else
34726  {
34727  SCIP_CALL( SCIPaddConflictUb(scip, var, NULL) );
34728  }
34729  }
34730  }
34731  }
34732  }
34733 
34734  /* analyze the conflict */
34735  SCIP_CALL( SCIPanalyzeConflict(scip, SCIPgetDepth(scip), NULL) );
34736  }
34737 
34738  return SCIP_OKAY;
34739 }
34740 
34741 /** checks if cut is already existing in global cutpool
34742  *
34743  * @return TRUE is returned if the cut is not already existing in the global cutpool, FALSE otherwise
34744  *
34745  * @pre This method can be called if @p scip is in one of the following stages:
34746  * - \ref SCIP_STAGE_SOLVING
34747  */
34749  SCIP* scip, /**< SCIP data structure */
34750  SCIP_ROW* row /**< cutting plane to add */
34751  )
34752 {
34753  SCIP_CALL_ABORT( checkStage(scip, "SCIPisCutNew", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34754 
34755  return SCIPcutpoolIsCutNew(scip->cutpool, scip->set, row);
34756 }
34757 
34758 /** if not already existing, adds row to global cut pool
34759  *
34760  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34761  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34762  *
34763  * @pre This method can be called if @p scip is in one of the following stages:
34764  * - \ref SCIP_STAGE_SOLVING
34765  */
34767  SCIP* scip, /**< SCIP data structure */
34768  SCIP_ROW* row /**< row to remove */
34769  )
34770 {
34771  SCIP_CALL( checkStage(scip, "SCIPaddPoolCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34772 
34773  SCIP_CALL( SCIPcutpoolAddRow(scip->cutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
34774 
34775  return SCIP_OKAY;
34776 }
34777 
34778 /** removes the row from the global cut pool
34779  *
34780  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34781  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34782  *
34783  * @pre This method can be called if @p scip is in one of the following stages:
34784  * - \ref SCIP_STAGE_SOLVING
34785  */
34787  SCIP* scip, /**< SCIP data structure */
34788  SCIP_ROW* row /**< cutting plane to add */
34789  )
34790 {
34791  SCIP_CALL( checkStage(scip, "SCIPdelPoolCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34792 
34793  SCIP_CALL( SCIPcutpoolDelRow(scip->cutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
34794 
34795  return SCIP_OKAY;
34796 }
34797 
34798 /** gets current cuts in the global cut pool
34799  *
34800  * @return the current cuts in the global cut pool
34801  *
34802  * @pre This method can be called if @p scip is in one of the following stages:
34803  * - \ref SCIP_STAGE_SOLVING
34804  * - \ref SCIP_STAGE_SOLVED
34805  * - \ref SCIP_STAGE_EXITSOLVE
34806  */
34808  SCIP* scip /**< SCIP data structure */
34809  )
34810 {
34811  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPoolCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
34812 
34813  return SCIPcutpoolGetCuts(scip->cutpool);
34814 }
34815 
34816 /** gets current number of rows in the global cut pool
34817  *
34818  * @return the current number of rows in the global cut pool
34819  *
34820  * @pre This method can be called if @p scip is in one of the following stages:
34821  * - \ref SCIP_STAGE_SOLVING
34822  * - \ref SCIP_STAGE_SOLVED
34823  * - \ref SCIP_STAGE_EXITSOLVE
34824  */
34826  SCIP* scip /**< SCIP data structure */
34827  )
34828 {
34829  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPoolCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
34830 
34831  return SCIPcutpoolGetNCuts(scip->cutpool);
34832 }
34833 
34834 /** gets the global cut pool used by SCIP
34835  *
34836  * @return the global cut pool used by SCIP
34837  *
34838  * @pre This method can be called if @p scip is in one of the following stages:
34839  * - \ref SCIP_STAGE_SOLVING
34840  * - \ref SCIP_STAGE_SOLVED
34841  * - \ref SCIP_STAGE_EXITSOLVE
34842  */
34844  SCIP* scip /**< SCIP data structure */
34845  )
34846 {
34847  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetGlobalCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
34848 
34849  return scip->cutpool;
34850 }
34851 
34852 /** creates a cut pool
34853  *
34854  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34855  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34856  *
34857  * @pre This method can be called if @p scip is in one of the following stages:
34858  * - \ref SCIP_STAGE_TRANSFORMING
34859  * - \ref SCIP_STAGE_TRANSFORMED
34860  * - \ref SCIP_STAGE_INITPRESOLVE
34861  * - \ref SCIP_STAGE_PRESOLVING
34862  * - \ref SCIP_STAGE_EXITPRESOLVE
34863  * - \ref SCIP_STAGE_PRESOLVED
34864  * - \ref SCIP_STAGE_INITSOLVE
34865  * - \ref SCIP_STAGE_SOLVING
34866  */
34868  SCIP* scip, /**< SCIP data structure */
34869  SCIP_CUTPOOL** cutpool, /**< pointer to store cut pool */
34870  int agelimit /**< maximum age a cut can reach before it is deleted from the pool */
34871  )
34872 {
34873  SCIP_CALL( checkStage(scip, "SCIPcreateCutpool", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34874 
34875  SCIP_CALL( SCIPcutpoolCreate(cutpool, scip->mem->probmem, scip->set, agelimit, FALSE) );
34876 
34877  return SCIP_OKAY;
34878 }
34879 
34880 /** frees a cut pool
34881  *
34882  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34883  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34884  *
34885  * @pre This method can be called if @p scip is in one of the following stages:
34886  * - \ref SCIP_STAGE_TRANSFORMING
34887  * - \ref SCIP_STAGE_TRANSFORMED
34888  * - \ref SCIP_STAGE_INITPRESOLVE
34889  * - \ref SCIP_STAGE_PRESOLVING
34890  * - \ref SCIP_STAGE_EXITPRESOLVE
34891  * - \ref SCIP_STAGE_PRESOLVED
34892  * - \ref SCIP_STAGE_INITSOLVE
34893  * - \ref SCIP_STAGE_SOLVING
34894  * - \ref SCIP_STAGE_SOLVED
34895  * - \ref SCIP_STAGE_EXITSOLVE
34896  * - \ref SCIP_STAGE_FREETRANS
34897  */
34899  SCIP* scip, /**< SCIP data structure */
34900  SCIP_CUTPOOL** cutpool /**< pointer to store cut pool */
34901  )
34902 {
34903  SCIP_CALL( checkStage(scip, "SCIPfreeCutpool", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
34904 
34905  SCIP_CALL( SCIPcutpoolFree(cutpool, scip->mem->probmem, scip->set, scip->lp) );
34906 
34907  return SCIP_OKAY;
34908 }
34909 
34910 /** if not already existing, adds row to a cut pool and captures it
34911  *
34912  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34913  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34914  *
34915  * @pre This method can be called if @p scip is in one of the following stages:
34916  * - \ref SCIP_STAGE_INITSOLVE
34917  * - \ref SCIP_STAGE_SOLVING
34918  */
34920  SCIP* scip, /**< SCIP data structure */
34921  SCIP_CUTPOOL* cutpool, /**< cut pool */
34922  SCIP_ROW* row /**< cutting plane to add */
34923  )
34924 {
34925  SCIP_CALL( checkStage(scip, "SCIPaddRowCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34926 
34927  SCIP_CALL( SCIPcutpoolAddRow(cutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
34928 
34929  return SCIP_OKAY;
34930 }
34931 
34932 /** adds row to a cut pool and captures it; doesn't check for multiple cuts
34933  *
34934  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34935  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34936  *
34937  * @pre This method can be called if @p scip is in one of the following stages:
34938  * - \ref SCIP_STAGE_INITSOLVE
34939  * - \ref SCIP_STAGE_SOLVING
34940  */
34942  SCIP* scip, /**< SCIP data structure */
34943  SCIP_CUTPOOL* cutpool, /**< cut pool */
34944  SCIP_ROW* row /**< cutting plane to add */
34945  )
34946 {
34947  SCIP_CALL( checkStage(scip, "SCIPaddNewRowCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34948 
34949  SCIP_CALL( SCIPcutpoolAddNewRow(cutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
34950 
34951  return SCIP_OKAY;
34952 }
34953 
34954 /** removes the LP row from a cut pool
34955  *
34956  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34957  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34958  *
34959  * @pre This method can be called if @p scip is in one of the following stages:
34960  * - \ref SCIP_STAGE_INITSOLVE
34961  * - \ref SCIP_STAGE_SOLVING
34962  * - \ref SCIP_STAGE_SOLVED
34963  */
34965  SCIP* scip, /**< SCIP data structure */
34966  SCIP_CUTPOOL* cutpool, /**< cut pool */
34967  SCIP_ROW* row /**< row to remove */
34968  )
34969 {
34970  SCIP_CALL( checkStage(scip, "SCIPdelRowCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
34971 
34972  SCIP_CALL( SCIPcutpoolDelRow(cutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
34973 
34974  return SCIP_OKAY;
34975 }
34976 
34977 /** separates cuts from a cut pool
34978  *
34979  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34980  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34981  *
34982  * @pre This method can be called if @p scip is in one of the following stages:
34983  * - \ref SCIP_STAGE_SOLVING
34984  */
34986  SCIP* scip, /**< SCIP data structure */
34987  SCIP_CUTPOOL* cutpool, /**< cut pool */
34988  SCIP_RESULT* result /**< pointer to store the result of the separation call */
34989  )
34990 {
34991  SCIP_CALL( checkStage(scip, "SCIPseparateCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34992 
34993  assert(SCIPtreeGetCurrentNode(scip->tree) != NULL);
34994 
34995  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
34996  {
34997  SCIPerrorMessage("cannot add cuts, because node LP is not processed\n");
34998  return SCIP_INVALIDCALL;
34999  }
35000 
35001  SCIP_CALL( SCIPcutpoolSeparate(cutpool, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->eventfilter,
35002  scip->lp, scip->sepastore, NULL, FALSE, (SCIPtreeGetCurrentDepth(scip->tree) == 0), result) );
35003 
35004  return SCIP_OKAY;
35005 }
35006 
35007 /** separates cuts w.r.t. given solution from a cut pool
35008  *
35009  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35010  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35011  *
35012  * @pre This method can be called if @p scip is in one of the following stages:
35013  * - \ref SCIP_STAGE_SOLVING
35014  */
35016  SCIP* scip, /**< SCIP data structure */
35017  SCIP_CUTPOOL* cutpool, /**< cut pool */
35018  SCIP_SOL* sol, /**< solution to be separated */
35019  SCIP_RESULT* result /**< pointer to store the result of the separation call */
35020  )
35021 {
35022  SCIP_CALL( checkStage(scip, "SCIPseparateSolCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35023 
35024  assert(SCIPtreeGetCurrentNode(scip->tree) != NULL);
35025 
35026  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
35027  {
35028  SCIPerrorMessage("cannot add cuts, because node LP is not processed\n");
35029  return SCIP_INVALIDCALL;
35030  }
35031 
35032  SCIP_CALL( SCIPcutpoolSeparate(cutpool, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->eventfilter,
35033  scip->lp, scip->sepastore, sol, FALSE, (SCIPtreeGetCurrentDepth(scip->tree) == 0), result) );
35034 
35035  return SCIP_OKAY;
35036 }
35037 
35038 /** if not already existing, adds row to delayed global cut pool
35039  *
35040  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35041  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35042  *
35043  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
35044  */
35046  SCIP* scip, /**< SCIP data structure */
35047  SCIP_ROW* row /**< cutting plane to add */
35048  )
35049 {
35050  SCIP_CALL( checkStage(scip, "SCIPaddDelayedPoolCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35051 
35052  SCIP_CALL( SCIPcutpoolAddRow(scip->delayedcutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
35053 
35054  return SCIP_OKAY;
35055 }
35056 
35057 /** removes the row from the delayed global cut pool
35058  *
35059  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35060  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35061  *
35062  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
35063  */
35065  SCIP* scip, /**< SCIP data structure */
35066  SCIP_ROW* row /**< cutting plane to add */
35067  )
35068 {
35069  SCIP_CALL( checkStage(scip, "SCIPdelDelayedPoolCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35070 
35071  SCIP_CALL( SCIPcutpoolDelRow(scip->delayedcutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
35072 
35073  return SCIP_OKAY;
35074 }
35075 
35076 /** gets current cuts in the delayed global cut pool
35077  *
35078  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35079  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35080  *
35081  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
35082  */
35084  SCIP* scip /**< SCIP data structure */
35085  )
35086 {
35087  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDelayedPoolCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
35088 
35089  return SCIPcutpoolGetCuts(scip->delayedcutpool);
35090 }
35091 
35092 /** gets current number of rows in the delayed global cut pool
35093  *
35094  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35095  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35096  *
35097  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
35098  */
35100  SCIP* scip /**< SCIP data structure */
35101  )
35102 {
35103  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDelayedPoolCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
35104 
35105  return SCIPcutpoolGetNCuts(scip->delayedcutpool);
35106 }
35107 
35108 /** gets the delayed global cut pool used by SCIP
35109  *
35110  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35111  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35112  *
35113  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
35114  */
35116  SCIP* scip /**< SCIP data structure */
35117  )
35118 {
35119  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDelayedGlobalCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
35120 
35121  return scip->delayedcutpool;
35122 }
35123 
35124 /** separates the given primal solution or the current LP solution by calling the separators and constraint handlers'
35125  * separation methods;
35126  * the generated cuts are stored in the separation storage and can be accessed with the methods SCIPgetCuts() and
35127  * SCIPgetNCuts();
35128  * after evaluating the cuts, you have to call SCIPclearCuts() in order to remove the cuts from the
35129  * separation storage;
35130  * it is possible to call SCIPseparateSol() multiple times with different solutions and evaluate the found cuts
35131  * afterwards
35132  *
35133  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35134  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35135  *
35136  * @pre This method can be called if @p scip is in one of the following stages:
35137  * - \ref SCIP_STAGE_SOLVING
35138  */
35140  SCIP* scip, /**< SCIP data structure */
35141  SCIP_SOL* sol, /**< primal solution that should be separated, or NULL for LP solution */
35142  SCIP_Bool pretendroot, /**< should the cut separators be called as if we are at the root node? */
35143  SCIP_Bool allowlocal, /**< should the separator be asked to separate local cuts */
35144  SCIP_Bool onlydelayed, /**< should only separators be called that were delayed in the previous round? */
35145  SCIP_Bool* delayed, /**< pointer to store whether a separator was delayed */
35146  SCIP_Bool* cutoff /**< pointer to store whether the node can be cut off */
35147  )
35148 {
35149  int actdepth;
35150 
35151  SCIP_CALL( checkStage(scip, "SCIPseparateSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35152 
35153  /* get current depth */
35154  actdepth = (pretendroot ? 0 : SCIPtreeGetCurrentDepth(scip->tree));
35155 
35156  /* apply separation round */
35157  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,
35158  sol, actdepth, allowlocal, onlydelayed, delayed, cutoff) );
35159 
35160  return SCIP_OKAY;
35161 }
35162 
35163 /** gets the array of cuts currently stored in the separation storage
35164  *
35165  * @return the array of cuts currently stored in the separation storage
35166  *
35167  * @pre This method can be called if @p scip is in one of the following stages:
35168  * - \ref SCIP_STAGE_PRESOLVED
35169  * - \ref SCIP_STAGE_SOLVING
35170  * - \ref SCIP_STAGE_SOLVED
35171  */
35173  SCIP* scip /**< SCIP data structure */
35174  )
35175 {
35176  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
35177 
35178  return SCIPsepastoreGetCuts(scip->sepastore);
35179 }
35180 
35181 /** get current number of cuts in the separation storage
35182  *
35183  * @return the current number of cuts in the separation storage
35184  *
35185  * @pre This method can be called if @p scip is in one of the following stages:
35186  * - \ref SCIP_STAGE_PRESOLVED
35187  * - \ref SCIP_STAGE_SOLVING
35188  * - \ref SCIP_STAGE_SOLVED
35189  */
35191  SCIP* scip /**< SCIP data structure */
35192  )
35193 {
35194  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
35195 
35196  return SCIPsepastoreGetNCuts(scip->sepastore);
35197 }
35198 
35199 /** clears the separation storage
35200  *
35201  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35202  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35203  *
35204  * @pre This method can be called if @p scip is in one of the following stages:
35205  * - \ref SCIP_STAGE_SOLVING
35206  */
35208  SCIP* scip /**< SCIP data structure */
35209  )
35210 {
35211  SCIP_CALL( checkStage(scip, "SCIPclearCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35212 
35213  SCIP_CALL( SCIPsepastoreClearCuts(scip->sepastore, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter, scip->lp) );
35214 
35215  return SCIP_OKAY;
35216 }
35217 
35218 /** removes cuts that are inefficacious w.r.t. the current LP solution from separation storage without adding the cuts to the LP
35219  *
35220  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35221  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35222  *
35223  * @pre This method can be called if @p scip is in one of the following stages:
35224  * - \ref SCIP_STAGE_SOLVING
35225  */
35227  SCIP* scip /**< SCIP data structure */
35228  )
35229 {
35230  SCIP_Bool isroot;
35231 
35232  SCIP_CALL( checkStage(scip, "SCIPremoveInefficaciousCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35233 
35234  isroot = FALSE;
35235  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 )
35236  isroot = TRUE;
35238  scip->eventqueue, scip->eventfilter, scip->lp, isroot, SCIP_EFFICIACYCHOICE_LP) );
35239 
35240  return SCIP_OKAY;
35241 }
35242 
35243 /*
35244  * LP diving methods
35245  */
35246 
35247 /** initiates LP diving, making methods SCIPchgVarObjDive(), SCIPchgVarLbDive(), and SCIPchgVarUbDive() available
35248  *
35249  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35250  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35251  *
35252  * @pre This method can be called if @p scip is in one of the following stages:
35253  * - \ref SCIP_STAGE_SOLVING
35254  *
35255  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35256  *
35257  * @note diving is allowed even if the current LP is not flushed, not solved, or not solved to optimality; be aware
35258  * that solving the (first) diving LP may take longer than expect and that the latter two cases could stem from
35259  * numerical troubles during the last LP solve; because of this, most users will want to call this method only if
35260  * SCIPgetLPSolstat(scip) == SCIP_LPSOLSTAT_OPTIMAL
35261  */
35263  SCIP* scip /**< SCIP data structure */
35264  )
35265 {
35266  assert(scip != NULL);
35267 
35268  SCIP_CALL( checkStage(scip, "SCIPstartDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35270 
35271  if( SCIPlpDiving(scip->lp) )
35272  {
35273  SCIPerrorMessage("already in diving mode\n");
35274  return SCIP_INVALIDCALL;
35275  }
35276 
35277  if( SCIPtreeProbing(scip->tree) )
35278  {
35279  SCIPerrorMessage("cannot start diving while being in probing mode\n");
35280  return SCIP_INVALIDCALL;
35281  }
35282 
35284  {
35285  SCIPerrorMessage("cannot start diving if LP has not been constructed\n");
35286  return SCIP_INVALIDCALL;
35287  }
35288  assert(SCIPtreeHasCurrentNodeLP(scip->tree));
35289 
35290  SCIP_CALL( SCIPlpStartDive(scip->lp, scip->mem->probmem, scip->set, scip->stat) );
35291 
35292  /* remember the relaxation solution to reset it later */
35293  if( SCIPisRelaxSolValid(scip) )
35294  {
35295  SCIP_CALL( SCIPtreeStoreRelaxSol(scip->tree, scip->set, scip->relaxation, scip->transprob) );
35296  }
35297 
35298  return SCIP_OKAY;
35299 }
35300 
35301 /** quits LP diving and resets bounds and objective values of columns to the current node's values
35302  *
35303  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35304  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35305  *
35306  * @pre This method can be called if @p scip is in one of the following stages:
35307  * - \ref SCIP_STAGE_SOLVING
35308  *
35309  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35310  */
35312  SCIP* scip /**< SCIP data structure */
35313  )
35314 {
35315  assert(scip != NULL);
35316 
35317  SCIP_CALL( checkStage(scip, "SCIPendDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35318 
35319  if( !SCIPlpDiving(scip->lp) )
35320  {
35321  SCIPerrorMessage("not in diving mode\n");
35322  return SCIP_INVALIDCALL;
35323  }
35324 
35325  /* unmark the diving flag in the LP and reset all variables' objective and bound values */
35326  SCIP_CALL( SCIPlpEndDive(scip->lp, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->eventqueue, scip->eventfilter,
35327  scip->transprob, scip->transprob->vars, scip->transprob->nvars) );
35328 
35329  /* the lower bound may have changed slightly due to LP resolve in SCIPlpEndDive() */
35330  if( !scip->lp->resolvelperror && scip->tree->focusnode != NULL && SCIPlpIsRelax(scip->lp) && SCIPlpIsSolved(scip->lp) )
35331  {
35332  assert(SCIPtreeIsFocusNodeLPConstructed(scip->tree));
35333  SCIP_CALL( SCIPnodeUpdateLowerboundLP(scip->tree->focusnode, scip->set, scip->stat, scip->tree, scip->transprob,
35334  scip->origprob, scip->lp) );
35335  }
35336  /* reset the probably changed LP's cutoff bound */
35337  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, scip->primal->cutoffbound) );
35338  assert(scip->lp->cutoffbound == scip->primal->cutoffbound); /*lint !e777*/
35339 
35340  /* if a new best solution was created, the cutoff of the tree was delayed due to diving;
35341  * the cutoff has to be done now.
35342  */
35343  if( scip->tree->cutoffdelayed )
35344  {
35345  SCIP_CALL( SCIPtreeCutoff(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
35346  scip->lp, scip->primal->cutoffbound) );
35347  }
35348 
35349  /* if a relaxation was stored before diving, restore it now */
35350  if( scip->tree->probdiverelaxstored )
35351  {
35352  SCIP_CALL( SCIPtreeRestoreRelaxSol(scip->tree, scip->set, scip->relaxation, scip->transprob) );
35353  }
35354 
35355  return SCIP_OKAY;
35356 }
35357 
35358 /** changes cutoffbound in current dive
35359  *
35360  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35361  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35362  *
35363  * @pre This method can be called if @p scip is in one of the following stages:
35364  * - \ref SCIP_STAGE_SOLVING
35365  *
35366  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35367  */
35369  SCIP* scip, /**< SCIP data structure */
35370  SCIP_Real newcutoffbound /**< new cutoffbound */
35371  )
35372 {
35373  assert(scip != NULL);
35374 
35375  SCIP_CALL( checkStage(scip, "SCIPchgCutoffboundDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35376 
35377  if( !SCIPlpDiving(scip->lp) )
35378  {
35379  SCIPerrorMessage("not in diving mode\n");
35380  return SCIP_INVALIDCALL;
35381  }
35382 
35383  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, newcutoffbound) );
35384 
35385  return SCIP_OKAY;
35386 }
35387 
35388 /** changes variable's objective value in current dive
35389  *
35390  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35391  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35392  *
35393  * @pre This method can be called if @p scip is in one of the following stages:
35394  * - \ref SCIP_STAGE_SOLVING
35395  *
35396  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35397  */
35399  SCIP* scip, /**< SCIP data structure */
35400  SCIP_VAR* var, /**< variable to change the objective value for */
35401  SCIP_Real newobj /**< new objective value */
35402  )
35403 {
35404  assert(scip != NULL);
35405  assert(var != NULL);
35406 
35407  SCIP_CALL( checkStage(scip, "SCIPchgVarObjDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35408 
35409  if( !SCIPlpDiving(scip->lp) )
35410  {
35411  SCIPerrorMessage("not in diving mode\n");
35412  return SCIP_INVALIDCALL;
35413  }
35414 
35415  /* invalidate the LP's cutoff bound, since this has nothing to do with the current objective value anymore;
35416  * the cutoff bound is reset in SCIPendDive()
35417  */
35418  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, SCIPsetInfinity(scip->set)) );
35419 
35420  /* mark the LP's objective function invalid */
35422 
35423  /* change the objective value of the variable in the diving LP */
35424  SCIP_CALL( SCIPvarChgObjDive(var, scip->set, scip->lp, newobj) );
35425 
35426  return SCIP_OKAY;
35427 }
35428 
35429 /** changes variable's lower bound in current dive
35430  *
35431  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35432  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35433  *
35434  * @pre This method can be called if @p scip is in one of the following stages:
35435  * - \ref SCIP_STAGE_SOLVING
35436  *
35437  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35438  */
35440  SCIP* scip, /**< SCIP data structure */
35441  SCIP_VAR* var, /**< variable to change the bound for */
35442  SCIP_Real newbound /**< new value for bound */
35443  )
35444 {
35445  assert(scip != NULL);
35446  assert(var != NULL);
35447 
35448  SCIP_CALL( checkStage(scip, "SCIPchgVarLbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35449 
35450  if( !SCIPlpDiving(scip->lp) )
35451  {
35452  SCIPerrorMessage("not in diving mode\n");
35453  return SCIP_INVALIDCALL;
35454  }
35455 
35456  SCIP_CALL( SCIPvarChgLbDive(var, scip->set, scip->lp, newbound) );
35457 
35458  return SCIP_OKAY;
35459 }
35460 
35461 /** changes variable's upper bound in current dive
35462  *
35463  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35464  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35465  *
35466  * @pre This method can be called if @p scip is in one of the following stages:
35467  * - \ref SCIP_STAGE_SOLVING
35468  *
35469  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35470  */
35472  SCIP* scip, /**< SCIP data structure */
35473  SCIP_VAR* var, /**< variable to change the bound for */
35474  SCIP_Real newbound /**< new value for bound */
35475  )
35476 {
35477  assert(scip != NULL);
35478  assert(var != NULL);
35479 
35480  SCIP_CALL( checkStage(scip, "SCIPchgVarUbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35481 
35482  if( !SCIPlpDiving(scip->lp) )
35483  {
35484  SCIPerrorMessage("not in diving mode\n");
35485  return SCIP_INVALIDCALL;
35486  }
35487 
35488  SCIP_CALL( SCIPvarChgUbDive(var, scip->set, scip->lp, newbound) );
35489 
35490  return SCIP_OKAY;
35491 }
35492 
35493 /** adds a row to the LP in current dive
35494  *
35495  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35496  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35497  *
35498  * @pre This method can be called if @p scip is in one of the following stages:
35499  * - \ref SCIP_STAGE_SOLVING
35500  *
35501  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35502  */
35504  SCIP* scip, /**< SCIP data structure */
35505  SCIP_ROW* row /**< row to be added */
35506  )
35507 {
35508  SCIP_NODE* node;
35509  int depth;
35510 
35511  assert(scip != NULL);
35512  assert(row != NULL);
35513 
35514  SCIP_CALL( checkStage(scip, "SCIPaddRowDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35515 
35516  if( !SCIPlpDiving(scip->lp) )
35517  {
35518  SCIPerrorMessage("not in diving mode\n");
35519  return SCIP_INVALIDCALL;
35520  }
35521 
35522  /* get depth of current node */
35523  node = SCIPtreeGetCurrentNode(scip->tree);
35524  assert(node != NULL);
35525  depth = SCIPnodeGetDepth(node);
35526 
35527  SCIP_CALL( SCIPlpAddRow(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter, row, depth) );
35528 
35529  return SCIP_OKAY;
35530 }
35531 
35532 /** changes row lhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowLhs()
35533  *
35534  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35535  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35536  *
35537  * @pre This method can be called if @p scip is in one of the following stages:
35538  * - \ref SCIP_STAGE_SOLVING
35539  *
35540  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35541  */
35543  SCIP* scip, /**< SCIP data structure */
35544  SCIP_ROW* row, /**< row to change the lhs for */
35545  SCIP_Real newlhs /**< new value for lhs */
35546  )
35547 {
35548  assert(scip != NULL);
35549  assert(row != NULL);
35550 
35551  SCIP_CALL( checkStage(scip, "SCIPchgRowLhsDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35552 
35553  if( !SCIPlpDiving(scip->lp) )
35554  {
35555  SCIPerrorMessage("not in diving mode\n");
35556  return SCIP_INVALIDCALL;
35557  }
35558 
35560  SCIP_CALL( SCIProwChgLhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, newlhs) );
35561 
35562  return SCIP_OKAY;
35563 }
35564 
35565 /** changes row rhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowRhs()
35566  *
35567  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35568  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35569  *
35570  * @pre This method can be called if @p scip is in one of the following stages:
35571  * - \ref SCIP_STAGE_SOLVING
35572  *
35573  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35574  */
35576  SCIP* scip, /**< SCIP data structure */
35577  SCIP_ROW* row, /**< row to change the lhs for */
35578  SCIP_Real newrhs /**< new value for rhs */
35579  )
35580 {
35581  assert(scip != NULL);
35582  assert(row != NULL);
35583 
35584  SCIP_CALL( checkStage(scip, "SCIPchgRowRhsDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35585 
35586  if( !SCIPlpDiving(scip->lp) )
35587  {
35588  SCIPerrorMessage("not in diving mode\n");
35589  return SCIP_INVALIDCALL;
35590  }
35591 
35593  SCIP_CALL( SCIProwChgRhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, newrhs) );
35594 
35595  return SCIP_OKAY;
35596 }
35597 
35598 /** gets variable's objective value in current dive
35599  *
35600  * @return the variable's objective value in current dive.
35601  *
35602  * @pre This method can be called if @p scip is in one of the following stages:
35603  * - \ref SCIP_STAGE_SOLVING
35604  *
35605  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35606  */
35608  SCIP* scip, /**< SCIP data structure */
35609  SCIP_VAR* var /**< variable to get the bound for */
35610  )
35611 {
35612  assert(scip != NULL);
35613  assert(var != NULL);
35614 
35615  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarObjDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35616 
35617  if( !SCIPlpDiving(scip->lp) )
35618  {
35619  SCIPerrorMessage("not in diving mode\n");
35620  SCIPABORT();
35621  return SCIP_INVALID; /*lint !e527*/
35622  }
35623 
35624  return SCIPvarGetObjLP(var);
35625 }
35626 
35627 /** gets variable's lower bound in current dive
35628  *
35629  * @return the variable's lower bound in current dive.
35630  *
35631  * @pre This method can be called if @p scip is in one of the following stages:
35632  * - \ref SCIP_STAGE_SOLVING
35633  *
35634  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35635  */
35637  SCIP* scip, /**< SCIP data structure */
35638  SCIP_VAR* var /**< variable to get the bound for */
35639  )
35640 {
35641  assert(scip != NULL);
35642  assert(var != NULL);
35643 
35644  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarLbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35645 
35646  if( !SCIPlpDiving(scip->lp) )
35647  {
35648  SCIPerrorMessage("not in diving mode\n");
35649  SCIPABORT();
35650  return SCIP_INVALID; /*lint !e527*/
35651  }
35652 
35653  return SCIPvarGetLbLP(var, scip->set);
35654 }
35655 
35656 /** gets variable's upper bound in current dive
35657  *
35658  * @return the variable's upper bound in current dive.
35659  *
35660  * @pre This method can be called if @p scip is in one of the following stages:
35661  * - \ref SCIP_STAGE_SOLVING
35662  *
35663  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35664  */
35666  SCIP* scip, /**< SCIP data structure */
35667  SCIP_VAR* var /**< variable to get the bound for */
35668  )
35669 {
35670  assert(scip != NULL);
35671  assert(var != NULL);
35672 
35673  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarUbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35674 
35675  if( !SCIPlpDiving(scip->lp) )
35676  {
35677  SCIPerrorMessage("not in diving mode\n");
35678  SCIPABORT();
35679  return SCIP_INVALID; /*lint !e527*/
35680  }
35681 
35682  return SCIPvarGetUbLP(var, scip->set);
35683 }
35684 
35685 /** solves the LP of the current dive; no separation or pricing is applied
35686  *
35687  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35688  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35689  *
35690  * @pre This method can be called if @p scip is in one of the following stages:
35691  * - \ref SCIP_STAGE_SOLVING
35692  *
35693  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35694  *
35695  * @note be aware that the LP solve may take longer than expected if SCIPgetLPSolstat(scip) != SCIP_LPSOLSTAT_OPTIMAL,
35696  * compare the explanation of SCIPstartDive()
35697  */
35699  SCIP* scip, /**< SCIP data structure */
35700  int itlim, /**< maximal number of LP iterations to perform, or -1 for no limit */
35701  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
35702  SCIP_Bool* cutoff /**< pointer to store whether the diving LP was infeasible or the objective
35703  * limit was reached (or NULL, if not needed) */
35704  )
35705 {
35706  assert(scip != NULL);
35707 
35708  SCIP_CALL( checkStage(scip, "SCIPsolveDiveLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35709 
35710  if( !SCIPlpDiving(scip->lp) )
35711  {
35712  SCIPerrorMessage("not in diving mode\n");
35713  return SCIP_INVALIDCALL;
35714  }
35715 
35716  if( cutoff != NULL )
35717  *cutoff = FALSE;
35718 
35719  /* solve diving LP */
35720  SCIP_CALL( SCIPlpSolveAndEval(scip->lp, scip->set, scip->messagehdlr, scip->mem->probmem, scip->stat,
35721  scip->eventqueue, scip->eventfilter, scip->transprob, (SCIP_Longint)itlim, FALSE, FALSE, FALSE, lperror) );
35722 
35723  /* the LP is infeasible or the objective limit was reached */
35725  || (SCIPlpGetSolstat(scip->lp) == SCIP_LPSOLSTAT_OPTIMAL &&
35726  SCIPisGE(scip, SCIPgetLPObjval(scip), SCIPgetCutoffbound(scip))) )
35727  {
35728  /* analyze the infeasible LP (only if the objective was not changed, all columns are in the LP, and no external
35729  * pricers exist)
35730  */
35731  if( !scip->set->misc_exactsolve && !(SCIPlpDivingObjChanged(scip->lp) || SCIPlpDivingRowsChanged(scip->lp))
35732  && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) )
35733  {
35734  SCIP_CALL( SCIPconflictAnalyzeLP(scip->conflict, scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
35735  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, NULL) );
35736  }
35737 
35738  if( cutoff != NULL )
35739  *cutoff = TRUE;
35740  }
35741 
35742  return SCIP_OKAY;
35743 }
35744 
35745 /** returns the number of the node in the current branch and bound run, where the last LP was solved in diving
35746  * or probing mode
35747  *
35748  * @return the number of the node in the current branch and bound run, where the last LP was solved in diving
35749  * or probing mode.
35750  *
35751  * @pre This method can be called if @p scip is in one of the following stages:
35752  * - \ref SCIP_STAGE_TRANSFORMING
35753  * - \ref SCIP_STAGE_TRANSFORMED
35754  * - \ref SCIP_STAGE_INITPRESOLVE
35755  * - \ref SCIP_STAGE_PRESOLVING
35756  * - \ref SCIP_STAGE_EXITPRESOLVE
35757  * - \ref SCIP_STAGE_PRESOLVED
35758  * - \ref SCIP_STAGE_INITSOLVE
35759  * - \ref SCIP_STAGE_SOLVING
35760  * - \ref SCIP_STAGE_SOLVED
35761  * - \ref SCIP_STAGE_EXITSOLVE
35762  * - \ref SCIP_STAGE_FREETRANS
35763  *
35764  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35765  */
35767  SCIP* scip /**< SCIP data structure */
35768  )
35769 {
35770  assert(scip != NULL);
35771 
35772  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLastDivenode", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
35773 
35774  return scip->stat->lastdivenode;
35775 }
35776 
35777 /** returns whether we are in diving mode
35778  *
35779  * @return whether we are in diving mode.
35780  *
35781  * @pre This method can be called if @p scip is in one of the following stages:
35782  * - \ref SCIP_STAGE_TRANSFORMING
35783  * - \ref SCIP_STAGE_TRANSFORMED
35784  * - \ref SCIP_STAGE_INITPRESOLVE
35785  * - \ref SCIP_STAGE_PRESOLVING
35786  * - \ref SCIP_STAGE_EXITPRESOLVE
35787  * - \ref SCIP_STAGE_PRESOLVED
35788  * - \ref SCIP_STAGE_INITSOLVE
35789  * - \ref SCIP_STAGE_SOLVING
35790  * - \ref SCIP_STAGE_SOLVED
35791  * - \ref SCIP_STAGE_EXITSOLVE
35792  * - \ref SCIP_STAGE_FREETRANS
35793  *
35794  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35795  */
35797  SCIP* scip /**< SCIP data structure */
35798  )
35799 {
35800  assert(scip != NULL);
35801 
35802  SCIP_CALL_ABORT( checkStage(scip, "SCIPinDive", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
35803 
35804  return SCIPlpDiving(scip->lp);
35805 }
35806 
35807 
35808 
35809 
35810 /*
35811  * probing methods
35812  */
35813 
35814 /** returns whether we are in probing mode; probing mode is activated via SCIPstartProbing() and stopped
35815  * via SCIPendProbing()
35816  *
35817  * @return TRUE, if SCIP is currently in probing mode, otherwise FALSE
35818  *
35819  * @pre This method can be called if @p scip is in one of the following stages:
35820  * - \ref SCIP_STAGE_TRANSFORMED
35821  * - \ref SCIP_STAGE_INITPRESOLVE
35822  * - \ref SCIP_STAGE_PRESOLVING
35823  * - \ref SCIP_STAGE_EXITPRESOLVE
35824  * - \ref SCIP_STAGE_PRESOLVED
35825  * - \ref SCIP_STAGE_INITSOLVE
35826  * - \ref SCIP_STAGE_SOLVING
35827  * - \ref SCIP_STAGE_SOLVED
35828  * - \ref SCIP_STAGE_EXITSOLVE
35829  */
35831  SCIP* scip /**< SCIP data structure */
35832  )
35833 {
35834  SCIP_CALL_ABORT( checkStage(scip, "SCIPinProbing", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
35835 
35836  return SCIPtreeProbing(scip->tree);
35837 }
35838 
35839 /** initiates probing, making methods SCIPnewProbingNode(), SCIPbacktrackProbing(), SCIPchgVarLbProbing(),
35840  * SCIPchgVarUbProbing(), SCIPfixVarProbing(), SCIPpropagateProbing(), and SCIPsolveProbingLP() available
35841  *
35842  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35843  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35844  *
35845  * @pre This method can be called if @p scip is in one of the following stages:
35846  * - \ref SCIP_STAGE_PRESOLVING
35847  * - \ref SCIP_STAGE_SOLVING
35848  *
35849  * @note The collection of variable statistics is turned off during probing. If these statistics should be collected
35850  * during probing use the method SCIPenableVarHistory() to turn the collection explicitly on.
35851  */
35853  SCIP* scip /**< SCIP data structure */
35854  )
35855 {
35856  SCIP_CALL( checkStage(scip, "SCIPstartProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35857 
35858  if( SCIPtreeProbing(scip->tree) )
35859  {
35860  SCIPerrorMessage("already in probing mode\n");
35861  return SCIP_INVALIDCALL;
35862  }
35863 
35864  if( scip->lp != NULL && SCIPlpDiving(scip->lp) )
35865  {
35866  SCIPerrorMessage("cannot start probing while in diving mode\n");
35867  return SCIP_INVALIDCALL;
35868  }
35869 
35870  /* use a different separation storage for probing mode; otherwise SCIP will remove the cuts that are currently in the
35871  * separation storage after solving an LP in probing mode
35872  */
35873  if( scip->sepastore != NULL )
35874  {
35875  assert(scip->sepastoreprobing != NULL);
35876  SCIPswapPointers((void**)&scip->sepastore, (void**)&scip->sepastoreprobing);
35877  }
35878 
35879  SCIP_CALL( SCIPtreeStartProbing(scip->tree, scip->mem->probmem, scip->set, scip->lp, scip->relaxation, scip->transprob, FALSE) );
35880 
35881  /* disables the collection of any statistic for a variable */
35883 
35884  return SCIP_OKAY;
35885 }
35886 
35887 /** creates a new probing sub node, whose changes can be undone by backtracking to a higher node in the probing path
35888  * with a call to SCIPbacktrackProbing();
35889  * using a sub node for each set of probing bound changes can improve conflict analysis
35890  *
35891  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35892  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35893  *
35894  * @pre This method can be called if @p scip is in one of the following stages:
35895  * - \ref SCIP_STAGE_PRESOLVING
35896  * - \ref SCIP_STAGE_SOLVING
35897  */
35899  SCIP* scip /**< SCIP data structure */
35900  )
35901 {
35902  SCIP_RETCODE retcode;
35903 
35904  SCIP_CALL( checkStage(scip, "SCIPnewProbingNode", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35905 
35906  if( !SCIPtreeProbing(scip->tree) )
35907  {
35908  SCIPerrorMessage("not in probing mode\n");
35909  return SCIP_INVALIDCALL;
35910  }
35911 
35912  retcode = SCIPtreeCreateProbingNode(scip->tree, scip->mem->probmem, scip->set, scip->lp);
35913 
35914  if( retcode == SCIP_MAXDEPTHLEVEL )
35915  {
35916  SCIPwarningMessage(scip, "probing reached maximal depth; it should be stopped\n");
35917  }
35918  SCIP_CALL( retcode );
35919 
35920  return SCIP_OKAY;
35921 }
35922 
35923 /** returns the current probing depth
35924  *
35925  * @return the probing depth, i.e. the number of probing sub nodes existing in the probing path
35926  *
35927  * @pre This method can be called if @p scip is in one of the following stages:
35928  * - \ref SCIP_STAGE_PRESOLVING
35929  * - \ref SCIP_STAGE_SOLVING
35930  */
35932  SCIP* scip /**< SCIP data structure */
35933  )
35934 {
35935  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetProbingDepth", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35936 
35937  if( !SCIPtreeProbing(scip->tree) )
35938  {
35939  SCIPerrorMessage("not in probing mode\n");
35940  SCIPABORT();
35941  return -1; /*lint !e527*/
35942  }
35943 
35944  return SCIPtreeGetProbingDepth(scip->tree);
35945 }
35946 
35947 /** undoes all changes to the problem applied in probing up to the given probing depth;
35948  * the changes of the probing node of the given probing depth are the last ones that remain active;
35949  * changes that were applied before calling SCIPnewProbingNode() cannot be undone
35950  *
35951  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35952  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35953  *
35954  * @pre This method can be called if @p scip is in one of the following stages:
35955  * - \ref SCIP_STAGE_PRESOLVING
35956  * - \ref SCIP_STAGE_SOLVING
35957  */
35959  SCIP* scip, /**< SCIP data structure */
35960  int probingdepth /**< probing depth of the node in the probing path that should be reactivated */
35961  )
35962 {
35963  SCIP_CALL( checkStage(scip, "SCIPbacktrackProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35964 
35965  if( !SCIPtreeProbing(scip->tree) )
35966  {
35967  SCIPerrorMessage("not in probing mode\n");
35968  return SCIP_INVALIDCALL;
35969  }
35970  if( probingdepth < 0 || probingdepth > SCIPtreeGetProbingDepth(scip->tree) )
35971  {
35972  SCIPerrorMessage("backtracking probing depth %d out of current probing range [0,%d]\n",
35973  probingdepth, SCIPtreeGetProbingDepth(scip->tree));
35974  return SCIP_INVALIDDATA;
35975  }
35976 
35977  SCIP_CALL( SCIPtreeBacktrackProbing(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
35978  scip->origprob, scip->lp, scip->primal, scip->branchcand, scip->eventqueue, scip->eventfilter,
35979  scip->cliquetable, probingdepth) );
35980 
35981  return SCIP_OKAY;
35982 }
35983 
35984 /** quits probing and resets bounds and constraints to the focus node's environment
35985  *
35986  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35987  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35988  *
35989  * @pre This method can be called if @p scip is in one of the following stages:
35990  * - \ref SCIP_STAGE_PRESOLVING
35991  * - \ref SCIP_STAGE_SOLVING
35992  */
35994  SCIP* scip /**< SCIP data structure */
35995  )
35996 {
35997  SCIP_CALL( checkStage(scip, "SCIPendProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35998 
35999  if( !SCIPtreeProbing(scip->tree) )
36000  {
36001  SCIPerrorMessage("not in probing mode\n");
36002  return SCIP_INVALIDCALL;
36003  }
36004 
36005  /* switch back from probing to normal operation mode and restore variables and constraints to focus node */
36006  SCIP_CALL( SCIPtreeEndProbing(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
36007  scip->transprob, scip->origprob, scip->lp, scip->relaxation, scip->primal,
36008  scip->branchcand, scip->eventqueue, scip->eventfilter, scip->cliquetable) );
36009 
36010  /* enables the collection of statistics for a variable */
36012 
36013  /* switch to the original separation storage */
36014  if( scip->sepastore != NULL )
36015  {
36016  assert(scip->sepastoreprobing != NULL);
36017  SCIPswapPointers((void**)&scip->sepastore, (void**)&scip->sepastoreprobing);
36018  assert(SCIPsepastoreGetNCuts(scip->sepastoreprobing) == 0);
36019  }
36020 
36021  return SCIP_OKAY;
36022 }
36023 
36024 /** injects a change of variable's lower bound into current probing node; the same can also be achieved with a call to
36025  * SCIPchgVarLb(), but in this case, the bound change would be treated like a deduction instead of a branching decision
36026  *
36027  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36028  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36029  *
36030  * @pre This method can be called if @p scip is in one of the following stages:
36031  * - \ref SCIP_STAGE_PRESOLVING
36032  * - \ref SCIP_STAGE_SOLVING
36033  */
36035  SCIP* scip, /**< SCIP data structure */
36036  SCIP_VAR* var, /**< variable to change the bound for */
36037  SCIP_Real newbound /**< new value for bound */
36038  )
36039 {
36040  SCIP_CALL( checkStage(scip, "SCIPchgVarLbProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36041 
36042  if( !SCIPtreeProbing(scip->tree) )
36043  {
36044  SCIPerrorMessage("not in probing mode\n");
36045  return SCIP_INVALIDCALL;
36046  }
36048 
36049  SCIPvarAdjustLb(var, scip->set, &newbound);
36050 
36051  /* ignore tightenings of lower bounds to +infinity during solving process */
36052  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
36053  {
36054 #ifndef NDEBUG
36055  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
36056  SCIPvarGetLbLocal(var));
36057 #endif
36058  return SCIP_OKAY;
36059  }
36060 
36062  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
36063  var, newbound, SCIP_BOUNDTYPE_LOWER, TRUE) );
36064 
36065  return SCIP_OKAY;
36066 }
36067 
36068 /** injects a change of variable's upper bound into current probing node; the same can also be achieved with a call to
36069  * SCIPchgVarUb(), but in this case, the bound change would be treated like a deduction instead of a branching decision
36070  *
36071  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36072  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36073  *
36074  * @pre This method can be called if @p scip is in one of the following stages:
36075  * - \ref SCIP_STAGE_PRESOLVING
36076  * - \ref SCIP_STAGE_SOLVING
36077  */
36079  SCIP* scip, /**< SCIP data structure */
36080  SCIP_VAR* var, /**< variable to change the bound for */
36081  SCIP_Real newbound /**< new value for bound */
36082  )
36083 {
36084  SCIP_CALL( checkStage(scip, "SCIPchgVarUbProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36085 
36086  if( !SCIPtreeProbing(scip->tree) )
36087  {
36088  SCIPerrorMessage("not in probing mode\n");
36089  return SCIP_INVALIDCALL;
36090  }
36092 
36093  SCIPvarAdjustUb(var, scip->set, &newbound);
36094 
36095  /* ignore tightenings of upper bounds to -infinity during solving process */
36096  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
36097  {
36098 #ifndef NDEBUG
36099  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
36100  SCIPvarGetUbLocal(var));
36101 #endif
36102  return SCIP_OKAY;
36103  }
36104 
36106  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
36107  var, newbound, SCIP_BOUNDTYPE_UPPER, TRUE) );
36108 
36109  return SCIP_OKAY;
36110 }
36111 
36112 /** gets variable's objective value in current probing
36113  *
36114  * @return the variable's objective value in current probing.
36115  *
36116  * @pre This method can be called if @p scip is in one of the following stages:
36117  * - \ref SCIP_STAGE_SOLVING
36118  *
36119  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36120  */
36122  SCIP* scip, /**< SCIP data structure */
36123  SCIP_VAR* var /**< variable to get the bound for */
36124  )
36125 {
36126  assert(scip != NULL);
36127  assert(var != NULL);
36128 
36129  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarObjProbing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36130 
36131  if( !SCIPtreeProbing(scip->tree) )
36132  {
36133  SCIPerrorMessage("not in probing mode\n");
36134  return SCIP_INVALID;
36135  }
36136 
36137  return SCIPvarGetObjLP(var);
36138 }
36139 
36140 /** injects a change of variable's bounds into current probing node to fix the variable to the specified value;
36141  * the same can also be achieved with a call to SCIPfixVar(), but in this case, the bound changes would be treated
36142  * like deductions instead of branching decisions
36143  *
36144  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36145  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36146  *
36147  * @pre This method can be called if @p scip is in one of the following stages:
36148  * - \ref SCIP_STAGE_PRESOLVING
36149  * - \ref SCIP_STAGE_SOLVING
36150  */
36152  SCIP* scip, /**< SCIP data structure */
36153  SCIP_VAR* var, /**< variable to change the bound for */
36154  SCIP_Real fixedval /**< value to fix variable to */
36155  )
36156 {
36157  SCIP_Real fixlb;
36158  SCIP_Real fixub;
36159 
36160  SCIP_CALL( checkStage(scip, "SCIPfixVarProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36161 
36162  if( !SCIPtreeProbing(scip->tree) )
36163  {
36164  SCIPerrorMessage("not in probing mode\n");
36165  return SCIP_INVALIDCALL;
36166  }
36168 
36169  /* we adjust the fixing value here and compare the old bound with the adjusted values because otherwise,
36170  * it might happen that the unadjusted value is better and we add the boundchange,
36171  * but within SCIPnodeAddBoundchg() the bounds are adjusted - using the feasibility epsilon for integer variables -
36172  * and it is asserted, that the bound is still better than the old one which might then be incorrect.
36173  */
36174  fixlb = fixedval;
36175  fixub = fixedval;
36176  SCIPvarAdjustLb(var, scip->set, &fixlb);
36177  SCIPvarAdjustUb(var, scip->set, &fixub);
36178  assert(SCIPsetIsEQ(scip->set, fixlb, fixub));
36179 
36180  if( SCIPsetIsGT(scip->set, fixlb, SCIPvarGetLbLocal(var)) )
36181  {
36183  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
36184  scip->cliquetable, var, fixlb, SCIP_BOUNDTYPE_LOWER, TRUE) );
36185  }
36186  if( SCIPsetIsLT(scip->set, fixub, SCIPvarGetUbLocal(var)) )
36187  {
36189  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
36190  var, fixub, SCIP_BOUNDTYPE_UPPER, TRUE) );
36191  }
36192 
36193  return SCIP_OKAY;
36194 }
36195 
36196 /** changes (column) variable's objective value during probing mode
36197  *
36198  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36199  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36200  *
36201  * @pre This method can be called if @p scip is in one of the following stages:
36202  * - \ref SCIP_STAGE_PRESOLVING
36203  * - \ref SCIP_STAGE_SOLVING
36204  *
36205  * @pre The variable needs to be a column variable.
36206  */
36208  SCIP* scip, /**< SCIP data structure */
36209  SCIP_VAR* var, /**< variable to change the objective for */
36210  SCIP_Real newobj /**< new objective function value */
36211  )
36212 {
36213  SCIP_NODE* node;
36214  SCIP_Real oldobj;
36215 
36216  SCIP_CALL( checkStage(scip, "SCIPchgVarObjProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36217 
36218  if( !SCIPtreeProbing(scip->tree) )
36219  {
36220  SCIPerrorMessage("not in probing mode\n");
36221  return SCIP_INVALIDCALL;
36222  }
36223 
36224  /* get current probing node */
36225  node = SCIPtreeGetCurrentNode(scip->tree);
36226  assert(SCIPnodeGetType(node) == SCIP_NODETYPE_PROBINGNODE);
36227 
36228  /* get old objective function value */
36229  oldobj = SCIPvarGetObj(var);
36230 
36231  if( SCIPisEQ(scip, oldobj, newobj) )
36232  return SCIP_OKAY;
36233 
36234  if( node->data.probingnode->nchgdobjs == 0 )
36235  {
36236  SCIP_CALL( SCIPallocMemoryArray(scip, &node->data.probingnode->origobjvars, 1) ); /*lint !e506*/
36237  SCIP_CALL( SCIPallocMemoryArray(scip, &node->data.probingnode->origobjvals, 1) ); /*lint !e506*/
36238  }
36239  else
36240  {
36241  SCIP_CALL( SCIPreallocMemoryArray(scip, &node->data.probingnode->origobjvars, node->data.probingnode->nchgdobjs + 1) ); /*lint !e776*/
36242  SCIP_CALL( SCIPreallocMemoryArray(scip, &node->data.probingnode->origobjvals, node->data.probingnode->nchgdobjs + 1) ); /*lint !e776*/
36243  }
36244 
36245  node->data.probingnode->origobjvars[node->data.probingnode->nchgdobjs] = var;
36246  node->data.probingnode->origobjvals[node->data.probingnode->nchgdobjs] = oldobj;
36247  ++node->data.probingnode->nchgdobjs;
36248  ++scip->tree->probingsumchgdobjs;
36249 
36250  assert(SCIPtreeProbingObjChanged(scip->tree) == SCIPlpDivingObjChanged(scip->lp));
36251 
36252  /* inform tree and LP that the objective was changed and invalidate the LP's cutoff bound, since this has nothing to
36253  * do with the current objective value anymore; the cutoff bound is reset in SCIPendProbing()
36254  */
36255  if( !SCIPtreeProbingObjChanged(scip->tree) )
36256  {
36257  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, SCIPsetInfinity(scip->set)) );
36258 
36261  }
36262  assert(SCIPisInfinity(scip, scip->lp->cutoffbound));
36263 
36264  /* perform the objective change */
36265  SCIP_CALL( SCIPvarChgObj(var, scip->mem->probmem, scip->set, scip->transprob, scip->primal, scip->lp, scip->eventqueue, newobj) );
36266 
36267  return SCIP_OKAY;
36268 }
36269 
36270 /** returns whether the objective function has changed during probing mode
36271  *
36272  * @return \ref TRUE if objective has changed, \ref FALSE otherwise
36273  *
36274  * @pre This method can be called if @p scip is in one of the following stages:
36275  * - \ref SCIP_STAGE_TRANSFORMED
36276  * - \ref SCIP_STAGE_INITPRESOLVE
36277  * - \ref SCIP_STAGE_PRESOLVING
36278  * - \ref SCIP_STAGE_EXITPRESOLVE
36279  * - \ref SCIP_STAGE_PRESOLVED
36280  * - \ref SCIP_STAGE_INITSOLVE
36281  * - \ref SCIP_STAGE_SOLVING
36282  * - \ref SCIP_STAGE_SOLVED
36283  * - \ref SCIP_STAGE_EXITSOLVE
36284  */
36286  SCIP* scip /**< SCIP data structure */
36287  )
36288 {
36289  assert(scip != NULL);
36290 
36291  SCIP_CALL_ABORT( checkStage(scip, "SCIPisObjChangedProbing", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
36292 
36293  return scip->tree != NULL && SCIPinProbing(scip) && SCIPtreeProbingObjChanged(scip->tree);
36294 }
36295 
36296 /** applies domain propagation on the probing sub problem, that was changed after SCIPstartProbing() was called;
36297  * the propagated domains of the variables can be accessed with the usual bound accessing calls SCIPvarGetLbLocal()
36298  * and SCIPvarGetUbLocal(); the propagation is only valid locally, i.e. the local bounds as well as the changed
36299  * bounds due to SCIPchgVarLbProbing(), SCIPchgVarUbProbing(), and SCIPfixVarProbing() are used for propagation
36300  *
36301  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36302  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36303  *
36304  * @pre This method can be called if @p scip is in one of the following stages:
36305  * - \ref SCIP_STAGE_PRESOLVING
36306  * - \ref SCIP_STAGE_SOLVING
36307  */
36309  SCIP* scip, /**< SCIP data structure */
36310  int maxproprounds, /**< maximal number of propagation rounds (-1: no limit, 0: parameter settings) */
36311  SCIP_Bool* cutoff, /**< pointer to store whether the probing node can be cut off */
36312  SCIP_Longint* ndomredsfound /**< pointer to store the number of domain reductions found, or NULL */
36313  )
36314 {
36315  SCIP_VAR** objchgvars;
36316  SCIP_Real* objchgvals;
36317  SCIP_Bool changedobj;
36318  int nobjchg;
36319 
36320  SCIP_CALL( checkStage(scip, "SCIPpropagateProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36321 
36322  if( !SCIPtreeProbing(scip->tree) )
36323  {
36324  SCIPerrorMessage("not in probing mode\n");
36325  return SCIP_INVALIDCALL;
36326  }
36327 
36328  objchgvars = NULL;
36329  objchgvals = NULL;
36330  changedobj = FALSE;
36331  nobjchg = 0;
36332 
36333  /* undo objective changes if we want to propagate during probing */
36334  if( scip->tree->probingobjchanged )
36335  {
36336  SCIP_VAR** vars;
36337  int nvars;
36338  int i;
36339 
36340  vars = SCIPgetVars(scip);
36341  nvars = SCIPgetNVars(scip);
36342 
36343  SCIP_CALL( SCIPallocBufferArray(scip, &objchgvals, MIN(nvars, scip->tree->probingsumchgdobjs)) );
36344  SCIP_CALL( SCIPallocBufferArray(scip, &objchgvars, MIN(nvars, scip->tree->probingsumchgdobjs)) );
36345  nobjchg = 0;
36346 
36347  for( i = 0; i < nvars; ++i )
36348  {
36349  if( !SCIPisEQ(scip, vars[i]->unchangedobj, SCIPgetVarObjProbing(scip, vars[i])) )
36350  {
36351  objchgvars[nobjchg] = vars[i];
36352  objchgvals[nobjchg] = SCIPgetVarObjProbing(scip, vars[i]);
36353  ++nobjchg;
36354 
36355  SCIP_CALL( SCIPvarChgObj(vars[i], scip->mem->probmem, scip->set, scip->transprob, scip->primal, scip->lp,
36356  scip->eventqueue, vars[i]->unchangedobj) );
36357  }
36358  }
36359  assert(nobjchg <= scip->tree->probingsumchgdobjs);
36360 
36362  scip->tree->probingobjchanged = FALSE;
36363  changedobj = TRUE;
36364  }
36365 
36366  if( ndomredsfound != NULL )
36367  *ndomredsfound = -(scip->stat->nprobboundchgs + scip->stat->nprobholechgs);
36368 
36369  SCIP_CALL( SCIPpropagateDomains(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
36370  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->conflict, scip->cliquetable,
36371  SCIPgetDepth(scip), maxproprounds, SCIP_PROPTIMING_ALWAYS, cutoff) );
36372 
36373  if( ndomredsfound != NULL )
36374  *ndomredsfound += scip->stat->nprobboundchgs + scip->stat->nprobholechgs;
36375 
36376  /* restore old objective function */
36377  if( changedobj )
36378  {
36379  int i;
36380 
36381  assert(objchgvars != NULL);
36382  assert(objchgvals != NULL);
36383 
36385  scip->tree->probingobjchanged = TRUE;
36386 
36387  for( i = 0; i < nobjchg; ++i )
36388  {
36389  SCIP_CALL( SCIPvarChgObj(objchgvars[i], scip->mem->probmem, scip->set, scip->transprob, scip->primal,
36390  scip->lp, scip->eventqueue, objchgvals[i]) );
36391  }
36392 
36393  SCIPfreeBufferArray(scip, &objchgvars);
36394  SCIPfreeBufferArray(scip, &objchgvals);
36395  }
36396 
36397  return SCIP_OKAY;
36398 }
36399 
36400 /** applies domain propagation on the probing sub problem, that was changed after SCIPstartProbing() was called;
36401  * only propagations of the binary variables fixed at the current probing node that are triggered by the implication
36402  * graph and the clique table are applied;
36403  * the propagated domains of the variables can be accessed with the usual bound accessing calls SCIPvarGetLbLocal()
36404  * and SCIPvarGetUbLocal(); the propagation is only valid locally, i.e. the local bounds as well as the changed
36405  * bounds due to SCIPchgVarLbProbing(), SCIPchgVarUbProbing(), and SCIPfixVarProbing() are used for propagation
36406  *
36407  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36408  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36409  *
36410  * @pre This method can be called if @p scip is in one of the following stages:
36411  * - \ref SCIP_STAGE_PRESOLVING
36412  * - \ref SCIP_STAGE_SOLVING
36413  */
36415  SCIP* scip, /**< SCIP data structure */
36416  SCIP_Bool* cutoff /**< pointer to store whether the probing node can be cut off */
36417  )
36418 {
36419  SCIP_CALL( checkStage(scip, "SCIPpropagateProbingImplications", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36420 
36421  if( !SCIPtreeProbing(scip->tree) )
36422  {
36423  SCIPerrorMessage("not in probing mode\n");
36424  return SCIP_INVALIDCALL;
36425  }
36426 
36428  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, cutoff) );
36429 
36430  return SCIP_OKAY;
36431 }
36432 
36433 /** solves the LP at the current probing node (cannot be applied at preprocessing stage) with or without pricing */
36434 static
36436  SCIP* scip, /**< SCIP data structure */
36437  int itlim, /**< maximal number of LP iterations to perform, or -1 for no limit */
36438  SCIP_Bool pricing, /**< should pricing be applied? */
36439  SCIP_Bool pretendroot, /**< should the pricers be called as if we are at the root node? */
36440  SCIP_Bool displayinfo, /**< should info lines be displayed after each pricing round? */
36441  int maxpricerounds, /**< maximal number of pricing rounds (-1: no limit) */
36442  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
36443  SCIP_Bool* cutoff /**< pointer to store whether the probing LP was infeasible or the objective
36444  * limit was reached (or NULL, if not needed) */
36445  )
36446 {
36447  SCIP_Bool initcutoff;
36448 
36449  assert(lperror != NULL);
36450  assert(SCIPtreeIsFocusNodeLPConstructed(scip->tree));
36451 
36452  if( !SCIPtreeProbing(scip->tree) )
36453  {
36454  SCIPerrorMessage("not in probing mode\n");
36455  return SCIP_INVALIDCALL;
36456  }
36457  assert(SCIPtreeGetCurrentDepth(scip->tree) > 0);
36458 
36459  SCIP_CALL( SCIPinitConssLP(scip->mem->probmem, scip->set, scip->sepastore, scip->cutpool, scip->stat, scip->transprob,
36460  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->eventfilter,
36461  scip->cliquetable, FALSE, FALSE, &initcutoff) );
36462 
36463  if( initcutoff )
36464  {
36465  if( cutoff != NULL )
36466  *cutoff = TRUE;
36467 
36468  return SCIP_OKAY;
36469  }
36470  else if( cutoff != NULL )
36471  *cutoff = FALSE;
36472 
36473  /* load the LP state (if necessary) */
36474  SCIP_CALL( SCIPtreeLoadProbingLPState(scip->tree, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
36475 
36476  SCIPlpSetIsRelax(scip->lp, TRUE);
36477 
36478  /* solve probing LP */
36479  SCIP_CALL( SCIPlpSolveAndEval(scip->lp, scip->set, scip->messagehdlr, scip->mem->probmem, scip->stat,
36480  scip->eventqueue, scip->eventfilter, scip->transprob, (SCIP_Longint)itlim, FALSE, FALSE, FALSE, lperror) );
36481 
36482  assert((*lperror) || SCIPlpGetSolstat(scip->lp) != SCIP_LPSOLSTAT_NOTSOLVED);
36483 
36484  /* mark the probing node to have a solved LP */
36485  if( !(*lperror) )
36486  {
36487  SCIP_CALL( SCIPtreeMarkProbingNodeHasLP(scip->tree, scip->mem->probmem, scip->lp) );
36488 
36489  /* call pricing */
36490  if( pricing )
36491  {
36492  SCIP_Bool mustsepa;
36493  int npricedcolvars;
36494  SCIP_Bool result;
36495 
36496  mustsepa = FALSE;
36497  SCIP_CALL( SCIPpriceLoop(scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->transprob,
36498  scip->origprob, scip->primal, scip->tree, scip->reopt, scip->lp, scip->pricestore, scip->sepastore, scip->cutpool,
36499  scip->branchcand, scip->eventqueue, scip->eventfilter, scip->cliquetable, pretendroot, displayinfo,
36500  maxpricerounds, &npricedcolvars, &mustsepa, lperror, &result) );
36501 
36502  /* mark the probing node again to update the LP size in the node and the tree path */
36503  if( !(*lperror) )
36504  {
36505  SCIP_CALL( SCIPtreeMarkProbingNodeHasLP(scip->tree, scip->mem->probmem, scip->lp) );
36506  }
36507  }
36508  }
36509 
36510  /* remember that probing might have changed the LPi state; this holds even if solving returned with an LP error */
36511  scip->tree->probingsolvedlp = TRUE;
36512 
36513  /* the LP is infeasible or the objective limit was reached */
36514  if( !(*lperror) && (SCIPlpGetSolstat(scip->lp) == SCIP_LPSOLSTAT_INFEASIBLE
36517  && SCIPisGE(scip, SCIPgetLPObjval(scip), SCIPgetCutoffbound(scip)))) )
36518  {
36519  /* analyze the infeasible LP (only if all columns are in the LP and no external pricers exist) */
36520  if( !scip->set->misc_exactsolve && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->tree->probingobjchanged )
36521  {
36522  SCIP_CALL( SCIPconflictAnalyzeLP(scip->conflict, scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
36523  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, NULL) );
36524  }
36525 
36526  if( cutoff != NULL )
36527  *cutoff = TRUE;
36528  }
36529 
36530  return SCIP_OKAY;
36531 }
36532 
36533 /** solves the LP at the current probing node (cannot be applied at preprocessing stage);
36534  * no separation or pricing is applied
36535  *
36536  * The LP has to be constructed before (you can use SCIPisLPConstructed() or SCIPconstructLP()).
36537  *
36538  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36539  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36540  *
36541  * @pre This method can be called if @p scip is in one of the following stages:
36542  * - \ref SCIP_STAGE_SOLVING
36543  */
36545  SCIP* scip, /**< SCIP data structure */
36546  int itlim, /**< maximal number of LP iterations to perform, or -1 for no limit */
36547  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
36548  SCIP_Bool* cutoff /**< pointer to store whether the probing LP was infeasible or the objective
36549  * limit was reached (or NULL, if not needed) */
36550  )
36551 {
36552  SCIP_CALL( checkStage(scip, "SCIPsolveProbingLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36553 
36554  SCIP_CALL( solveProbingLP(scip, itlim, FALSE, FALSE, FALSE, -1, lperror, cutoff) );
36555 
36556  return SCIP_OKAY;
36557 }
36558 
36559 /** solves the LP at the current probing node (cannot be applied at preprocessing stage) and applies pricing
36560  * until the LP is solved to optimality; no separation is applied
36561  *
36562  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36563  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36564  *
36565  * @pre This method can be called if @p scip is in one of the following stages:
36566  * - \ref SCIP_STAGE_SOLVING
36567  */
36569  SCIP* scip, /**< SCIP data structure */
36570  SCIP_Bool pretendroot, /**< should the pricers be called as if we were at the root node? */
36571  SCIP_Bool displayinfo, /**< should info lines be displayed after each pricing round? */
36572  int maxpricerounds, /**< maximal number of pricing rounds (-1: no limit);
36573  * a finite limit means that the LP might not be solved to optimality! */
36574  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
36575  SCIP_Bool* cutoff /**< pointer to store whether the probing LP was infeasible or the objective
36576  * limit was reached (or NULL, if not needed) */
36577  )
36578 {
36579  SCIP_CALL( checkStage(scip, "SCIPsolveProbingLPWithPricing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36580 
36581  SCIP_CALL( solveProbingLP(scip, -1, TRUE, pretendroot, displayinfo, maxpricerounds, lperror, cutoff) );
36582 
36583  return SCIP_OKAY;
36584 }
36585 
36586 /** sets the LP state for the current probing node
36587  *
36588  * @note state and norms are stored at the node and later released by SCIP; therefore, the pointers are set
36589  * to NULL by the method
36590  *
36591  * @note the pointers to state and norms must not be NULL; however, they may point to a NULL pointer if the
36592  * respective information should not be set
36593  *
36594  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36595  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36596  *
36597  * @pre This method can be called if @p scip is in one of the following stages:
36598  * - \ref SCIP_STAGE_PRESOLVING
36599  * - \ref SCIP_STAGE_SOLVING
36600  */
36602  SCIP* scip, /**< SCIP data structure */
36603  SCIP_LPISTATE** lpistate, /**< pointer to LP state information (like basis information) */
36604  SCIP_LPINORMS** lpinorms, /**< pointer to LP pricing norms information */
36605  SCIP_Bool primalfeas, /**< primal feasibility when LP state information was stored */
36606  SCIP_Bool dualfeas /**< dual feasibility when LP state information was stored */
36607  )
36608 {
36609  SCIP_CALL( checkStage(scip, "SCIPsetProbingLPState", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36610 
36611  if( !SCIPtreeProbing(scip->tree) )
36612  {
36613  SCIPerrorMessage("not in probing mode\n");
36614  return SCIP_INVALIDCALL;
36615  }
36616 
36617  SCIP_CALL( SCIPtreeSetProbingLPState(scip->tree, scip->mem->probmem, scip->lp, lpistate, lpinorms, primalfeas, dualfeas) );
36618 
36619  return SCIP_OKAY;
36620 }
36621 
36622 /** adds a row to the LP in the current probing node
36623  *
36624  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36625  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36626  *
36627  * @pre This method can be called if @p scip is in one of the following stages:
36628  * - \ref SCIP_STAGE_SOLVING
36629  *
36630  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36631  */
36633  SCIP* scip, /**< SCIP data structure */
36634  SCIP_ROW* row /**< row to be added */
36635  )
36636 {
36637  SCIP_NODE* node;
36638  int depth;
36639 
36640  assert(scip != NULL);
36641  assert(row != NULL);
36642 
36643  SCIP_CALL( checkStage(scip, "SCIPaddRowProbing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36644 
36645  if( !SCIPtreeProbing(scip->tree) )
36646  {
36647  SCIPerrorMessage("not in probing mode\n");
36648  return SCIP_INVALIDCALL;
36649  }
36650 
36651  /* get depth of current node */
36652  node = SCIPtreeGetCurrentNode(scip->tree);
36653  assert(node != NULL);
36654  depth = SCIPnodeGetDepth(node);
36655 
36656  SCIP_CALL( SCIPlpAddRow(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter, row, depth) );
36657 
36658  return SCIP_OKAY;
36659 }
36660 
36661 
36662 /** applies the cuts in the separation storage to the LP and clears the storage afterwards;
36663  * this method can only be applied during probing; the user should resolve the probing LP afterwards
36664  * in order to get a new solution
36665  *
36666  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36667  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36668  *
36669  * @pre This method can be called if @p scip is in one of the following stages:
36670  * - \ref SCIP_STAGE_SOLVING
36671  */
36673  SCIP* scip, /**< SCIP data structure */
36674  SCIP_Bool* cutoff /**< pointer to store whether an empty domain was created */
36675  )
36676 {
36677  SCIP_CALL( checkStage(scip, "SCIPapplyCutsProbing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36678 
36679  if( !SCIPtreeProbing(scip->tree) )
36680  {
36681  SCIPerrorMessage("not in probing mode\n");
36682  return SCIP_INVALIDCALL;
36683  }
36684 
36685  SCIP_CALL( SCIPsepastoreApplyCuts(scip->sepastore, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
36686  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->eventfilter,
36687  scip->cliquetable, FALSE, SCIP_EFFICIACYCHOICE_LP, cutoff) );
36688 
36689  return SCIP_OKAY;
36690 }
36691 
36692 /** solves relaxation(s) at the current probing node (cannot be applied at preprocessing stage);
36693  * no separation or pricing is applied
36694  *
36695  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36696  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36697  *
36698  * @pre This method can be called if @p scip is in one of the following stages:
36699  * - \ref SCIP_STAGE_SOLVING
36700  */
36702  SCIP* scip, /**< SCIP data structure */
36703  SCIP_Bool* cutoff /**< pointer to store whether a relaxation was infeasible or the objective
36704  * limit was reached (or NULL, if not needed) */
36705  )
36706 {
36707  SCIP_SET* set;
36708  int r;
36709 
36710  SCIP_CALL( checkStage(scip, "SCIPsolveProbingRelax", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36711 
36712  if ( ! SCIPtreeProbing(scip->tree) )
36713  {
36714  SCIPerrorMessage("not in probing mode\n");
36715  return SCIP_INVALIDCALL;
36716  }
36717  assert( SCIPtreeGetCurrentDepth(scip->tree) > 0 );
36718 
36719  assert( cutoff != NULL );
36720  *cutoff = FALSE;
36721 
36722  set = scip->set;
36723 
36724  /* sort relaxators by priority */
36725  SCIPsetSortRelaxs(set);
36726 
36727  /* solve relaxations */
36728  for (r = 0; r < set->nrelaxs && !(*cutoff); ++r)
36729  {
36730  SCIP_RELAX* relax;
36731  SCIP_Real lowerbound;
36732  SCIP_RESULT result;
36733 
36734  lowerbound = -SCIPinfinity(scip);
36735 
36736  relax = set->relaxs[r];
36737  assert( relax != NULL );
36738 
36739  SCIP_CALL( SCIPrelaxExec(relax, set, scip->stat, SCIPtreeGetCurrentDepth(scip->tree), &lowerbound, &result) );
36740 
36741  switch( result )
36742  {
36743  case SCIP_CUTOFF:
36744  *cutoff = TRUE;
36745  SCIPdebugMsg(scip, " -> relaxator <%s> detected cutoff\n", SCIPrelaxGetName(relax));
36746  break;
36747 
36748  case SCIP_CONSADDED:
36749  case SCIP_REDUCEDDOM:
36750  case SCIP_SEPARATED:
36751  case SCIP_SUSPENDED:
36752  SCIPerrorMessage("The relaxator should not return <%d> within probing mode.\n", result);
36753  break;
36754 
36755  case SCIP_SUCCESS:
36756  case SCIP_DIDNOTRUN:
36757  break;
36758 
36759  default:
36760  SCIPerrorMessage("Invalid result code <%d> of relaxator <%s>\n", result, SCIPrelaxGetName(relax));
36761  return SCIP_INVALIDRESULT;
36762  } /*lint !e788*/
36763  }
36764 
36765  return SCIP_OKAY;
36766 }
36767 
36768 /** gets the candidate score and preferred rounding direction for a candidate variable */
36770  SCIP* scip, /**< SCIP data structure */
36771  SCIP_DIVESET* diveset, /**< general diving settings */
36772  SCIP_DIVETYPE divetype, /**< represents different methods for a dive set to explore the next children */
36773  SCIP_VAR* divecand, /**< the candidate for which the branching direction is requested */
36774  SCIP_Real divecandsol, /**< LP solution value of the candidate */
36775  SCIP_Real divecandfrac, /**< fractionality of the candidate */
36776  SCIP_Real* candscore, /**< pointer to store the candidate score */
36777  SCIP_Bool* roundup /**< pointer to store whether preferred direction for diving is upwards */
36778  )
36779 {
36780  assert(scip != NULL);
36781  assert(candscore != NULL);
36782  assert(roundup != NULL);
36783  assert(divecand != NULL);
36784 
36785  SCIP_CALL( checkStage(scip, "SCIPgetDivesetScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36786 
36787  SCIP_CALL( SCIPdivesetGetScore(diveset, scip->set, divetype, divecand, divecandsol, divecandfrac, candscore,
36788  roundup) );
36789 
36790  return SCIP_OKAY;
36791 }
36792 
36793 /** update diveset LP statistics, should be called after every LP solved by this diving heuristic */
36795  SCIP* scip, /**< SCIP data structure */
36796  SCIP_DIVESET* diveset, /**< diving settings */
36797  SCIP_Longint niterstoadd /**< additional number of LP iterations to be added */
36798  )
36799 {
36800  assert(scip != NULL);
36801  assert(diveset != NULL);
36802 
36803  SCIPdivesetUpdateLPStats(diveset, scip->stat, niterstoadd);
36804 }
36805 
36806 /** update diveset statistics and global diveset statistics */
36808  SCIP* scip, /**< SCIP data structure */
36809  SCIP_DIVESET* diveset, /**< diveset to be reset */
36810  int nprobingnodes, /**< the number of probing nodes explored this time */
36811  int nbacktracks, /**< the number of backtracks during probing this time */
36812  SCIP_Longint nsolsfound, /**< the number of solutions found */
36813  SCIP_Longint nbestsolsfound, /**< the number of best solutions found */
36814  SCIP_Bool leavewassol /**< was a solution found at the leaf? */
36815  )
36816 {
36817  assert(scip != NULL);
36818  assert(diveset != NULL);
36819  assert(SCIPinProbing(scip));
36820 
36821  SCIPdivesetUpdateStats(diveset, scip->stat, SCIPgetDepth(scip), nprobingnodes, nbacktracks, nsolsfound, nbestsolsfound, leavewassol);
36822 }
36823 
36824 /** enforces a probing/diving solution by suggesting bound changes that maximize the score w.r.t. the current diving settings
36825  *
36826  * the process is guided by the enforcement priorities of the constraint handlers and the scoring mechanism provided by
36827  * the dive set.
36828  * Constraint handlers may suggest diving bound changes in decreasing order of their enforcement priority, based on the
36829  * solution values in the solution @p sol and the current local bounds of the variables. A diving bound change
36830  * is a triple (variable,branching direction,value) and is used inside SCIPperformGenericDivingAlgorithm().
36831  *
36832  * After a successful call, SCIP holds two arrays of suggested dive bound changes, one for the preferred child
36833  * and one for the alternative.
36834  *
36835  * @see SCIPgetDiveBoundChangeData() for retrieving the dive bound change suggestions.
36836  *
36837  * The method stops after the first constraint handler was successful
36838  *
36839  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36840  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36841  *
36842  * @pre This method can be called if @p scip is in one of the following stages:
36843  * - \ref SCIP_STAGE_SOLVING
36844  *
36845  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36846  */
36848  SCIP* scip, /**< SCIP data structure */
36849  SCIP_DIVESET* diveset, /**< diving settings to control scoring */
36850  SCIP_SOL* sol, /**< current solution of diving mode */
36851  SCIP_Bool* success, /**< pointer to store whether constraint handler successfully found a variable */
36852  SCIP_Bool* infeasible /**< pointer to store whether the current node was detected to be infeasible */
36853  )
36854 {
36855  int i;
36856 
36857  assert(scip != NULL);
36858  assert(diveset != NULL);
36859  assert(SCIPinProbing(scip));
36860  assert(infeasible != NULL);
36861  assert(success != NULL);
36862 
36863  SCIP_CALL( checkStage(scip, "SCIPgetDiveBoundChanges", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36864 
36865  *success = FALSE;
36866  *infeasible = FALSE;
36867 
36868  /* we invalidate the previously stored bound changes */
36870 
36871  /* loop over constraint handlers until a constraint handler successfully found a variable/value assignment for proceeding
36872  * or a constraint handler detected the infeasibility of the local node
36873  */
36874  for( i = 0; i < scip->set->nconshdlrs && !(*success || *infeasible); ++i )
36875  {
36876  SCIP_CALL( SCIPconshdlrGetDiveBoundChanges(scip->set->conshdlrs_enfo[i], scip->set, diveset, sol,
36877  success, infeasible) );
36878 
36879  }
36880 #ifndef NDEBUG
36881  /* check if the constraint handler correctly assigned values to the dive set */
36882  if( *success )
36883  {
36884  SCIP_VAR** bdchgvars;
36885  SCIP_BRANCHDIR* bdchgdirs;
36886  SCIP_Real* values;
36887  int nbdchanges;
36888  SCIPtreeGetDiveBoundChangeData(scip->tree, &bdchgvars, &bdchgdirs, &values, &nbdchanges, TRUE);
36889  assert(nbdchanges > 0);
36890  SCIPtreeGetDiveBoundChangeData(scip->tree, &bdchgvars, &bdchgdirs, &values, &nbdchanges, FALSE);
36891  assert(nbdchanges > 0);
36892  }
36893 #endif
36894 
36895  return SCIP_OKAY;
36896 }
36897 
36898 /** adds a diving bound change to the diving bound change storage of SCIP together with the information if this is a
36899  * bound change for the preferred direction or not
36900  *
36901  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36902  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36903  *
36904  * @pre This method can be called if @p scip is in one of the following stages:
36905  * - \ref SCIP_STAGE_SOLVING
36906  *
36907  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36908  */
36910  SCIP* scip, /**< SCIP data structure */
36911  SCIP_VAR* var, /**< variable to apply the bound change to */
36912  SCIP_BRANCHDIR dir, /**< direction of the bound change */
36913  SCIP_Real value, /**< value to adjust this variable bound to */
36914  SCIP_Bool preferred /**< is this a bound change for the preferred child? */
36915  )
36916 {
36917  assert(scip->tree != NULL);
36918  assert(scip->mem->probmem != NULL);
36919  assert(SCIPinProbing(scip));
36920 
36921  SCIP_CALL( checkStage(scip, "SCIPaddDiveBoundChange", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36922 
36923  SCIP_CALL( SCIPtreeAddDiveBoundChange(scip->tree, scip->mem->probmem, var, dir, value, preferred) );
36924 
36925  return SCIP_OKAY;
36926 }
36927 
36928 /** get the dive bound change data for the preferred or the alternative direction
36929  *
36930  * @pre This method can be called if @p scip is in one of the following stages:
36931  * - \ref SCIP_STAGE_SOLVING
36932  *
36933  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36934  */
36936  SCIP* scip, /**< SCIP data structure */
36937  SCIP_VAR*** variables, /**< pointer to store variables for the specified direction */
36938  SCIP_BRANCHDIR** directions, /**< pointer to store the branching directions */
36939  SCIP_Real** values, /**< pointer to store bound change values */
36940  int* ndivebdchgs, /**< pointer to store the number of dive bound changes */
36941  SCIP_Bool preferred /**< should the dive bound changes for the preferred child be output? */
36942  )
36943 {
36944  assert(variables != NULL);
36945  assert(directions != NULL);
36946  assert(values != NULL);
36947  assert(ndivebdchgs != NULL);
36948  assert(SCIPinProbing(scip));
36949 
36950  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDiveBoundChangeData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36951 
36952  SCIPtreeGetDiveBoundChangeData(scip->tree, variables, directions, values, ndivebdchgs, preferred);
36953 }
36954 
36955 /** clear the dive bound change data structures
36956  *
36957  * @pre This method can be called if @p scip is in one of the following stages:
36958  * - \ref SCIP_STAGE_SOLVING
36959  *
36960  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36961  */
36963  SCIP* scip /**< SCIP data structure */
36964  )
36965 {
36966  assert(scip->tree != NULL);
36967 
36968  SCIP_CALL_ABORT( checkStage(scip, "SCIPclearDiveBoundChanges", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36969 
36971 }
36972 
36973 
36974 /*
36975  * branching methods
36976  */
36977 
36978 /** gets branching candidates for LP solution branching (fractional variables) along with solution values,
36979  * fractionalities, and number of branching candidates; The number of branching candidates does NOT
36980  * account for fractional implicit integer variables which should not be used for branching decisions.
36981  *
36982  * Fractional implicit integer variables are stored at the positions *nlpcands to *nlpcands + *nfracimplvars - 1
36983  *
36984  * branching rules should always select the branching candidate among the first npriolpcands of the candidate
36985  * list
36986  *
36987  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36988  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36989  *
36990  * @pre This method can be called if @p scip is in one of the following stages:
36991  * - \ref SCIP_STAGE_SOLVING
36992  *
36993  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36994  */
36996  SCIP* scip, /**< SCIP data structure */
36997  SCIP_VAR*** lpcands, /**< pointer to store the array of LP branching candidates, or NULL */
36998  SCIP_Real** lpcandssol, /**< pointer to store the array of LP candidate solution values, or NULL */
36999  SCIP_Real** lpcandsfrac, /**< pointer to store the array of LP candidate fractionalities, or NULL */
37000  int* nlpcands, /**< pointer to store the number of LP branching candidates, or NULL */
37001  int* npriolpcands, /**< pointer to store the number of candidates with maximal priority, or NULL */
37002  int* nfracimplvars /**< pointer to store the number of fractional implicit integer variables, or NULL */
37003  )
37004 {
37005  SCIP_CALL( checkStage(scip, "SCIPgetLPBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37006 
37008  {
37009  SCIPerrorMessage("LP not solved to optimality - solstat=%d\n", SCIPlpGetSolstat(scip->lp));
37010  return SCIP_INVALIDDATA;
37011  }
37012 
37013  SCIP_CALL( SCIPbranchcandGetLPCands(scip->branchcand, scip->set, scip->stat, scip->lp,
37014  lpcands, lpcandssol, lpcandsfrac, nlpcands, npriolpcands, nfracimplvars) );
37015 
37016  return SCIP_OKAY;
37017 }
37018 
37019 /** gets number of branching candidates for LP solution branching (number of fractional variables)
37020  *
37021  * @return the number of branching candidates for LP solution branching (number of fractional variables).
37022  *
37023  * @pre This method can be called if @p scip is in one of the following stages:
37024  * - \ref SCIP_STAGE_SOLVING
37025  *
37026  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37027  */
37029  SCIP* scip /**< SCIP data structure */
37030  )
37031 {
37032  SCIP_RETCODE retcode;
37033  int nlpcands;
37034 
37035  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37036 
37038  {
37039  SCIPerrorMessage("LP not solved to optimality\n");
37040  SCIPABORT();
37041  return 0; /*lint !e527*/
37042  }
37043 
37044  retcode = SCIPbranchcandGetLPCands(scip->branchcand, scip->set, scip->stat, scip->lp,
37045  NULL, NULL, NULL, &nlpcands, NULL, NULL);
37046 
37047  if( retcode != SCIP_OKAY )
37048  {
37049  SCIPerrorMessage("Error <%u> during computation of the number of LP branching candidates\n", retcode);
37050  SCIPABORT();
37051  return 0; /*lint !e527*/
37052  }
37053 
37054  return nlpcands;
37055 }
37056 
37057 /** gets number of branching candidates with maximal priority for LP solution branching
37058  *
37059  * @return the number of branching candidates with maximal priority for LP solution branching.
37060  *
37061  * @pre This method can be called if @p scip is in one of the following stages:
37062  * - \ref SCIP_STAGE_SOLVING
37063  *
37064  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37065  */
37067  SCIP* scip /**< SCIP data structure */
37068  )
37069 {
37070  SCIP_RETCODE retcode;
37071  int npriolpcands;
37072 
37073  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioLPBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37074 
37076  {
37077  SCIPerrorMessage("LP not solved to optimality\n");
37078  SCIPABORT();
37079  return 0; /*lint !e527*/
37080  }
37081 
37082  retcode = SCIPbranchcandGetLPCands(scip->branchcand, scip->set, scip->stat, scip->lp,
37083  NULL, NULL, NULL, NULL, &npriolpcands, NULL);
37084 
37085  if( retcode != SCIP_OKAY )
37086  {
37087  SCIPerrorMessage("Error <%u> during computation of the number of LP branching candidates with maximal priority\n", retcode);
37088  SCIPABORT();
37089  return 0; /*lint !e527*/
37090  }
37091 
37092  return npriolpcands;
37093 }
37094 
37095 /** gets external branching candidates along with solution values, scores, and number of branching candidates;
37096  * these branching candidates can be used by relaxations or nonlinear constraint handlers;
37097  * branching rules should always select the branching candidate among the first nprioexterncands of the candidate
37098  * list
37099  *
37100  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37101  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37102  *
37103  * @pre This method can be called if @p scip is in one of the following stages:
37104  * - \ref SCIP_STAGE_SOLVING
37105  *
37106  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37107  *
37108  * @note Candidate variables with maximal priority are ordered: binaries first, then integers, implicit integers and
37109  * continuous last.
37110  */
37112  SCIP* scip, /**< SCIP data structure */
37113  SCIP_VAR*** externcands, /**< pointer to store the array of extern branching candidates, or NULL */
37114  SCIP_Real** externcandssol, /**< pointer to store the array of extern candidate solution values, or NULL */
37115  SCIP_Real** externcandsscore, /**< pointer to store the array of extern candidate scores, or NULL */
37116  int* nexterncands, /**< pointer to store the number of extern branching candidates, or NULL */
37117  int* nprioexterncands, /**< pointer to store the number of candidates with maximal priority, or NULL */
37118  int* nprioexternbins, /**< pointer to store the number of binary candidates with maximal priority, or NULL */
37119  int* nprioexternints, /**< pointer to store the number of integer candidates with maximal priority, or NULL */
37120  int* nprioexternimpls /**< pointer to store the number of implicit integer candidates with maximal priority,
37121  * or NULL */
37122  )
37123 {
37124  assert(scip != NULL);
37125 
37126  SCIP_CALL( checkStage(scip, "SCIPgetExternBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37127 
37128  SCIP_CALL( SCIPbranchcandGetExternCands(scip->branchcand, externcands, externcandssol, externcandsscore, nexterncands,
37129  nprioexterncands, nprioexternbins, nprioexternints, nprioexternimpls) );
37130 
37131  return SCIP_OKAY;
37132 }
37133 
37134 /** gets number of external branching candidates
37135  *
37136  * @return the number of external branching candidates.
37137  *
37138  * @pre This method can be called if @p scip is in one of the following stages:
37139  * - \ref SCIP_STAGE_SOLVING
37140  *
37141  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37142  */
37144  SCIP* scip /**< SCIP data structure */
37145  )
37146 {
37147  assert(scip != NULL);
37148 
37149  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNExternBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37150 
37152 }
37153 
37154 /** gets number of external branching candidates with maximal branch priority
37155  *
37156  * @return the number of external branching candidates with maximal branch priority.
37157  *
37158  * @pre This method can be called if @p scip is in one of the following stages:
37159  * - \ref SCIP_STAGE_SOLVING
37160  *
37161  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37162  */
37164  SCIP* scip /**< SCIP data structure */
37165  )
37166 {
37167  assert(scip != NULL);
37168 
37169  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37170 
37172 }
37173 
37174 /** gets number of binary external branching candidates with maximal branch priority
37175  *
37176  * @return the number of binary external branching candidates with maximal branch priority.
37177  *
37178  * @pre This method can be called if @p scip is in one of the following stages:
37179  * - \ref SCIP_STAGE_SOLVING
37180  *
37181  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37182  */
37184  SCIP* scip /**< SCIP data structure */
37185  )
37186 {
37187  assert(scip != NULL);
37188 
37189  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchBins", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37190 
37192 }
37193 
37194 
37195 /** gets number of integer external branching candidates with maximal branch priority
37196  *
37197  * @return the number of integer external branching candidates with maximal branch priority.
37198  *
37199  * @pre This method can be called if @p scip is in one of the following stages:
37200  * - \ref SCIP_STAGE_SOLVING
37201  *
37202  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37203  */
37205  SCIP* scip /**< SCIP data structure */
37206  )
37207 {
37208  assert(scip != NULL);
37209 
37210  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchInts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37211 
37213 }
37214 
37215 /** gets number of implicit integer external branching candidates with maximal branch priority
37216  *
37217  * @return the number of implicit integer external branching candidates with maximal branch priority.
37218  *
37219  * @pre This method can be called if @p scip is in one of the following stages:
37220  * - \ref SCIP_STAGE_SOLVING
37221  *
37222  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37223  */
37225  SCIP* scip /**< SCIP data structure */
37226  )
37227 {
37228  assert(scip != NULL);
37229 
37230  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchImpls", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37231 
37233 }
37234 
37235 /** gets number of continuous external branching candidates with maximal branch priority
37236  *
37237  * @return the number of continuous external branching candidates with maximal branch priority.
37238  *
37239  * @pre This method can be called if @p scip is in one of the following stages:
37240  * - \ref SCIP_STAGE_SOLVING
37241  *
37242  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37243  */
37245  SCIP* scip /**< SCIP data structure */
37246  )
37247 {
37248  assert(scip != NULL);
37249 
37250  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchConts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37251 
37253 }
37254 
37255 /** insert variable, its score and its solution value into the external branching candidate storage
37256  * the relative difference of the current lower and upper bounds of a continuous variable must be at least epsilon
37257  *
37258  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37259  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37260  *
37261  * @pre This method can be called if @p scip is in one of the following stages:
37262  * - \ref SCIP_STAGE_SOLVING
37263  *
37264  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37265  */
37267  SCIP* scip, /**< SCIP data structure */
37268  SCIP_VAR* var, /**< variable to insert */
37269  SCIP_Real score, /**< score of external candidate, e.g. infeasibility */
37270  SCIP_Real solval /**< value of the variable in the current solution */
37271  )
37272 {
37273  assert(scip != NULL);
37274  assert(var->scip == scip);
37275 
37276  SCIP_CALL( checkStage(scip, "SCIPaddExternBranchCand", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37277 
37278  SCIP_CALL( SCIPbranchcandAddExternCand(scip->branchcand, scip->set, var, score, solval) );
37279 
37280  return SCIP_OKAY;
37281 }
37282 
37283 /** removes all external candidates from the storage for external branching
37284  *
37285  * @pre This method can be called if @p scip is in one of the following stages:
37286  * - \ref SCIP_STAGE_SOLVING
37287  *
37288  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37289  */
37291  SCIP* scip /**< SCIP data structure */
37292  )
37293 {
37294  assert(scip != NULL);
37295 
37296  SCIP_CALL_ABORT( checkStage(scip, "SCIPclearExternBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37297 
37299 }
37300 
37301 /** checks whether the given variable is contained in the candidate storage for external branching
37302  *
37303  * @return whether the given variable is contained in the candidate storage for external branching.
37304  *
37305  * @pre This method can be called if @p scip is in one of the following stages:
37306  * - \ref SCIP_STAGE_SOLVING
37307  *
37308  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37309  */
37311  SCIP* scip, /**< SCIP data structure */
37312  SCIP_VAR* var /**< variable to look for */
37313  )
37314 {
37315  assert(scip != NULL);
37316  assert(var->scip == scip);
37317 
37318  SCIP_CALL_ABORT( checkStage(scip, "SCIPcontainsExternBranchCand", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37319 
37320  return SCIPbranchcandContainsExternCand(scip->branchcand, var);
37321 }
37322 
37323 /** gets branching candidates for pseudo solution branching (non-fixed variables) along with the number of candidates
37324  *
37325  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37326  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37327  *
37328  * @pre This method can be called if @p scip is in one of the following stages:
37329  * - \ref SCIP_STAGE_PRESOLVING
37330  * - \ref SCIP_STAGE_SOLVING
37331  *
37332  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37333  */
37335  SCIP* scip, /**< SCIP data structure */
37336  SCIP_VAR*** pseudocands, /**< pointer to store the array of pseudo branching candidates, or NULL */
37337  int* npseudocands, /**< pointer to store the number of pseudo branching candidates, or NULL */
37338  int* npriopseudocands /**< pointer to store the number of candidates with maximal priority, or NULL */
37339  )
37340 {
37341  SCIP_CALL( checkStage(scip, "SCIPgetPseudoBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37342 
37344  pseudocands, npseudocands, npriopseudocands) );
37345 
37346  return SCIP_OKAY;
37347 }
37348 
37349 /** gets number of branching candidates for pseudo solution branching (non-fixed variables)
37350  *
37351  * @return the number branching candidates for pseudo solution branching (non-fixed variables).
37352  *
37353  * @pre This method can be called if @p scip is in one of the following stages:
37354  * - \ref SCIP_STAGE_PRESOLVING
37355  * - \ref SCIP_STAGE_SOLVING
37356  *
37357  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37358  */
37360  SCIP* scip /**< SCIP data structure */
37361  )
37362 {
37363  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPseudoBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37364 
37366 }
37367 
37368 /** gets number of branching candidates with maximal branch priority for pseudo solution branching
37369  *
37370  * @return the number of branching candidates with maximal branch priority for pseudo solution branching.
37371  *
37372  * @pre This method can be called if @p scip is in one of the following stages:
37373  * - \ref SCIP_STAGE_PRESOLVING
37374  * - \ref SCIP_STAGE_SOLVING
37375  *
37376  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37377  */
37379  SCIP* scip /**< SCIP data structure */
37380  )
37381 {
37382  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioPseudoBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37383 
37385 }
37386 
37387 /** gets number of binary branching candidates with maximal branch priority for pseudo solution branching
37388  *
37389  * @return the number of binary branching candidates with maximal branch priority for pseudo solution branching.
37390  *
37391  * @pre This method can be called if @p scip is in one of the following stages:
37392  * - \ref SCIP_STAGE_SOLVING
37393  *
37394  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37395  */
37397  SCIP* scip /**< SCIP data structure */
37398  )
37399 {
37400  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioPseudoBranchBins", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37401 
37403 }
37404 
37405 /** gets number of integer branching candidates with maximal branch priority for pseudo solution branching
37406  *
37407  * @return the number of integer branching candidates with maximal branch priority for pseudo solution branching.
37408  *
37409  * @pre This method can be called if @p scip is in one of the following stages:
37410  * - \ref SCIP_STAGE_SOLVING
37411  *
37412  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37413  */
37415  SCIP* scip /**< SCIP data structure */
37416  )
37417 {
37418  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioPseudoBranchInts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37419 
37421 }
37422 
37423 /** gets number of implicit integer branching candidates with maximal branch priority for pseudo solution branching
37424  *
37425  * @return the number of implicit integer branching candidates with maximal branch priority for pseudo solution branching.
37426  *
37427  * @pre This method can be called if @p scip is in one of the following stages:
37428  * - \ref SCIP_STAGE_SOLVING
37429  *
37430  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37431  */
37433  SCIP* scip /**< SCIP data structure */
37434  )
37435 {
37436  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioPseudoBranchImpls", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37437 
37439 }
37440 
37441 /** calculates the branching score out of the gain predictions for a binary branching
37442  *
37443  * @return the branching score out of the gain predictions for a binary branching.
37444  *
37445  * @pre This method can be called if @p scip is in one of the following stages:
37446  * - \ref SCIP_STAGE_SOLVING
37447  *
37448  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37449  */
37451  SCIP* scip, /**< SCIP data structure */
37452  SCIP_VAR* var, /**< variable, of which the branching factor should be applied, or NULL */
37453  SCIP_Real downgain, /**< prediction of objective gain for rounding downwards */
37454  SCIP_Real upgain /**< prediction of objective gain for rounding upwards */
37455  )
37456 {
37457  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBranchScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37458 
37459  assert( var == NULL || var->scip == scip );
37460 
37461  return SCIPbranchGetScore(scip->set, var, downgain, upgain);
37462 }
37463 
37464 /** calculates the branching score out of the gain predictions for a branching with arbitrary many children
37465  *
37466  * @return the branching score out of the gain predictions for a branching with arbitrary many children.
37467  *
37468  * @pre This method can be called if @p scip is in one of the following stages:
37469  * - \ref SCIP_STAGE_SOLVING
37470  *
37471  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37472  */
37474  SCIP* scip, /**< SCIP data structure */
37475  SCIP_VAR* var, /**< variable, of which the branching factor should be applied, or NULL */
37476  int nchildren, /**< number of children that the branching will create */
37477  SCIP_Real* gains /**< prediction of objective gain for each child */
37478  )
37479 {
37480  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBranchScoreMultiple", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37481 
37482  assert( var->scip == scip );
37483 
37484  return SCIPbranchGetScoreMultiple(scip->set, var, nchildren, gains);
37485 }
37486 
37487 /** computes a branching point for a continuous or discrete variable
37488  *
37489  * @see SCIPbranchGetBranchingPoint
37490  *
37491  * @return the branching point for a continuous or discrete variable.
37492  *
37493  * @pre This method can be called if @p scip is in one of the following stages:
37494  * - \ref SCIP_STAGE_SOLVING
37495  *
37496  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37497  */
37499  SCIP* scip, /**< SCIP data structure */
37500  SCIP_VAR* var, /**< variable, of which the branching point should be computed */
37501  SCIP_Real suggestion /**< suggestion for branching point, or SCIP_INVALID if no suggestion */
37502  )
37503 {
37504  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBranchingPoint", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37505 
37506  assert( var->scip == scip );
37507 
37508  return SCIPbranchGetBranchingPoint(scip->set, scip->tree, var, suggestion);
37509 }
37510 
37511 /** calculates the node selection priority for moving the given variable's LP value to the given target value;
37512  * this node selection priority can be given to the SCIPcreateChild() call
37513  *
37514  * @return the node selection priority for moving the given variable's LP value to the given target value.
37515  *
37516  * @pre This method can be called if @p scip is in one of the following stages:
37517  * - \ref SCIP_STAGE_SOLVING
37518  *
37519  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37520  */
37522  SCIP* scip, /**< SCIP data structure */
37523  SCIP_VAR* var, /**< variable on which the branching is applied */
37524  SCIP_BRANCHDIR branchdir, /**< type of branching that was performed: upwards, downwards, or fixed;
37525  * fixed should only be used, when both bounds changed
37526  */
37527  SCIP_Real targetvalue /**< new value of the variable in the child node */
37528  )
37529 {
37530  SCIP_CALL_ABORT( checkStage(scip, "SCIPcalcNodeselPriority", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37531 
37532  assert( var->scip == scip );
37533 
37534  return SCIPtreeCalcNodeselPriority(scip->tree, scip->set, scip->stat, var, branchdir, targetvalue);
37535 }
37536 
37537 /** calculates an estimate for the objective of the best feasible solution contained in the subtree after applying the given
37538  * branching; this estimate can be given to the SCIPcreateChild() call
37539  *
37540  * @return the estimate for the objective of the best feasible solution contained in the subtree after applying the given
37541  * branching.
37542  *
37543  * @pre This method can be called if @p scip is in one of the following stages:
37544  * - \ref SCIP_STAGE_SOLVING
37545  *
37546  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37547  */
37549  SCIP* scip, /**< SCIP data structure */
37550  SCIP_VAR* var, /**< variable on which the branching is applied */
37551  SCIP_Real targetvalue /**< new value of the variable in the child node */
37552  )
37553 {
37554  SCIP_CALL_ABORT( checkStage(scip, "SCIPcalcChildEstimate", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37555 
37556  assert( var->scip == scip );
37557 
37558  return SCIPtreeCalcChildEstimate(scip->tree, scip->set, scip->stat, var, targetvalue);
37559 }
37560 
37561 /** creates a child node of the focus node
37562  *
37563  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37564  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37565  *
37566  * @pre This method can be called if @p scip is in one of the following stages:
37567  * - \ref SCIP_STAGE_SOLVING
37568  *
37569  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37570  */
37572  SCIP* scip, /**< SCIP data structure */
37573  SCIP_NODE** node, /**< pointer to node data structure */
37574  SCIP_Real nodeselprio, /**< node selection priority of new node */
37575  SCIP_Real estimate /**< estimate for(transformed) objective value of best feasible solution in subtree */
37576  )
37577 {
37578  assert(node != NULL);
37579 
37580  SCIP_CALL( checkStage(scip, "SCIPcreateChild", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37581 
37582  SCIP_CALL( SCIPnodeCreateChild(node, scip->mem->probmem, scip->set, scip->stat, scip->tree, nodeselprio, estimate) );
37583 
37584  return SCIP_OKAY;
37585 }
37586 
37587 /** branches on a non-continuous variable v using the current LP or pseudo solution;
37588  * if solution value x' is fractional, two child nodes will be created
37589  * (x <= floor(x'), x >= ceil(x')),
37590  * if solution value is integral, the x' is equal to lower or upper bound of the branching
37591  * variable and the bounds of v are finite, then two child nodes will be created
37592  * (x <= x'', x >= x''+1 with x'' = floor((lb + ub)/2)),
37593  * otherwise (up to) three child nodes will be created
37594  * (x <= x'-1, x == x', x >= x'+1)
37595  *
37596  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37597  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37598  *
37599  * @pre This method can be called if @p scip is in one of the following stages:
37600  * - \ref SCIP_STAGE_SOLVING
37601  *
37602  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37603  */
37605  SCIP* scip, /**< SCIP data structure */
37606  SCIP_VAR* var, /**< variable to branch on */
37607  SCIP_NODE** downchild, /**< pointer to return the left child with variable rounded down, or NULL */
37608  SCIP_NODE** eqchild, /**< pointer to return the middle child with variable fixed, or NULL */
37609  SCIP_NODE** upchild /**< pointer to return the right child with variable rounded up, or NULL */
37610  )
37611 {
37612  SCIP_CALL( checkStage(scip, "SCIPbranchVar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37613 
37614  assert( var->scip == scip );
37615 
37617  {
37618  SCIPerrorMessage("cannot branch on continuous variable <%s>\n", SCIPvarGetName(var));
37619  return SCIP_INVALIDDATA;
37620  }
37621 
37622  if( SCIPsetIsEQ(scip->set, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) )
37623  {
37624  SCIPerrorMessage("cannot branch on variable <%s> with fixed domain [%.15g,%.15g]\n",
37626  return SCIP_INVALIDDATA;
37627  }
37628 
37629  SCIP_CALL( SCIPtreeBranchVar(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
37630  scip->lp, scip->branchcand, scip->eventqueue, var, SCIP_INVALID, downchild, eqchild, upchild) );
37631 
37632  return SCIP_OKAY;
37633 }
37634 
37635 /** branches a variable x using a given domain hole; two child nodes (x <= left, x >= right) are created
37636  *
37637  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37638  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37639  *
37640  * @pre This method can be called if @p scip is in one of the following stages:
37641  * - \ref SCIP_STAGE_SOLVING
37642  *
37643  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37644  */
37646  SCIP* scip, /**< SCIP data structure */
37647  SCIP_VAR* var, /**< variable to branch on */
37648  SCIP_Real left, /**< left side of the domain hole */
37649  SCIP_Real right, /**< right side of the domain hole */
37650  SCIP_NODE** downchild, /**< pointer to return the left child (x <= left), or NULL */
37651  SCIP_NODE** upchild /**< pointer to return the right child (x >= right), or NULL */
37652  )
37653 {
37654  SCIP_CALL( checkStage(scip, "SCIPbranchVarHole", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37655 
37656  assert( var->scip == scip );
37657 
37658  SCIP_CALL( SCIPtreeBranchVarHole(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
37659  scip->origprob, scip->lp, scip->branchcand, scip->eventqueue, var, left, right, downchild, upchild) );
37660 
37661  return SCIP_OKAY;
37662 }
37663 
37664 /** branches on a variable x using a given value x';
37665  * for continuous variables with relative domain width larger epsilon, x' must not be one of the bounds;
37666  * two child nodes (x <= x', x >= x') are created;
37667  * for integer variables, if solution value x' is fractional, two child nodes are created
37668  * (x <= floor(x'), x >= ceil(x')),
37669  * if x' is integral, three child nodes are created
37670  * (x <= x'-1, x == x', x >= x'+1)
37671  *
37672  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37673  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37674  *
37675  * @pre This method can be called if @p scip is in one of the following stages:
37676  * - \ref SCIP_STAGE_SOLVING
37677  *
37678  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37679  */
37681  SCIP* scip, /**< SCIP data structure */
37682  SCIP_VAR* var, /**< variable to branch on */
37683  SCIP_Real val, /**< value to branch on */
37684  SCIP_NODE** downchild, /**< pointer to return the left child with variable rounded down, or NULL */
37685  SCIP_NODE** eqchild, /**< pointer to return the middle child with variable fixed, or NULL */
37686  SCIP_NODE** upchild /**< pointer to return the right child with variable rounded up, or NULL */
37687  )
37688 {
37689  SCIP_CALL( checkStage(scip, "SCIPbranchVarVal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37690 
37691  assert( var->scip == scip );
37692 
37693  /* A continuous variable will be fixed if SCIPisRelEQ(lb,ub) is true. Otherwise, the given branching value should be
37694  * 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
37695  * 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
37696  * branching value that is at least eps away from both bounds. However, if the variable bounds are below/above
37697  * -/+infinity * 2.1, then SCIPisLT will give an assert, so we omit the check in this case.
37698  */
37699  assert(SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS ||
37700  SCIPisRelEQ(scip, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) ||
37701  SCIPisInfinity(scip, -2.1*SCIPvarGetLbLocal(var)) || SCIPisInfinity(scip, 2.1*SCIPvarGetUbLocal(var)) ||
37702  (SCIPisLT(scip, 2.1*SCIPvarGetLbLocal(var), 2.1*val) && SCIPisLT(scip, 2.1*val, 2.1*SCIPvarGetUbLocal(var)) ) );
37703 
37704  if( SCIPsetIsEQ(scip->set, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) )
37705  {
37706  SCIPerrorMessage("cannot branch on variable <%s> with fixed domain [%.15g,%.15g]\n",
37708  return SCIP_INVALIDDATA;
37709  }
37710 
37711  SCIP_CALL( SCIPtreeBranchVar(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
37712  scip->lp, scip->branchcand, scip->eventqueue, var, val, downchild, eqchild, upchild) );
37713 
37714  return SCIP_OKAY;
37715 }
37716 
37717 /** n-ary branching on a variable x using a given value
37718  *
37719  * Branches on variable x such that up to n/2 children are created on each side of the usual branching value.
37720  * The branching value is selected as in SCIPbranchVarVal().
37721  * The parameters minwidth and widthfactor determine the domain width of the branching variable in the child nodes.
37722  * If n is odd, one child with domain width 'width' and having the branching value in the middle is created.
37723  * Otherwise, two children with domain width 'width' and being left and right of the branching value are created.
37724  * Next further nodes to the left and right are created, where width is multiplied by widthfactor with increasing distance
37725  * from the first nodes.
37726  * The initial width is calculated such that n/2 nodes are created to the left and to the right of the branching value.
37727  * If this value is below minwidth, the initial width is set to minwidth, which may result in creating less than n nodes.
37728  *
37729  * Giving a large value for widthfactor results in creating children with small domain when close to the branching value
37730  * and large domain when closer to the current variable bounds. That is, setting widthfactor to a very large value and n to 3
37731  * results in a ternary branching where the branching variable is mostly fixed in the middle child.
37732  * Setting widthfactor to 1.0 results in children where the branching variable always has the same domain width
37733  * (except for one child if the branching value is not in the middle).
37734  *
37735  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37736  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37737  *
37738  * @pre This method can be called if @p scip is in one of the following stages:
37739  * - \ref SCIP_STAGE_SOLVING
37740  *
37741  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37742  */
37744  SCIP* scip, /**< SCIP data structure */
37745  SCIP_VAR* var, /**< variable to branch on */
37746  SCIP_Real val, /**< value to branch on */
37747  int n, /**< attempted number of children to be created, must be >= 2 */
37748  SCIP_Real minwidth, /**< minimal domain width in children */
37749  SCIP_Real widthfactor, /**< multiplier for children domain width with increasing distance from val, must be >= 1.0 */
37750  int* nchildren /**< pointer to store number of created children, or NULL */
37751  )
37752 {
37753  SCIP_CALL( checkStage(scip, "SCIPbranchVarValNary", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37754 
37755  assert( var->scip == scip );
37756 
37757  /* see comment in SCIPbranchVarVal */
37758  assert(SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS ||
37759  SCIPisRelEQ(scip, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) ||
37760  SCIPisInfinity(scip, -2.1*SCIPvarGetLbLocal(var)) || SCIPisInfinity(scip, 2.1*SCIPvarGetUbLocal(var)) ||
37761  (SCIPisLT(scip, 2.1*SCIPvarGetLbLocal(var), 2.1*val) && SCIPisLT(scip, 2.1*val, 2.1*SCIPvarGetUbLocal(var)) ) );
37762 
37763  if( SCIPsetIsEQ(scip->set, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) )
37764  {
37765  SCIPerrorMessage("cannot branch on variable <%s> with fixed domain [%.15g,%.15g]\n",
37767  return SCIP_INVALIDDATA;
37768  }
37769 
37770  SCIP_CALL( SCIPtreeBranchVarNary(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
37771  scip->origprob, scip->lp, scip->branchcand, scip->eventqueue, var, val, n, minwidth, widthfactor, nchildren) );
37772 
37773  return SCIP_OKAY;
37774 }
37775 
37776 /** calls branching rules to branch on an LP solution; if no fractional variables exist, the result is SCIP_DIDNOTRUN;
37777  * if the branch priority of an unfixed variable is larger than the maximal branch priority of the fractional
37778  * variables, pseudo solution branching is applied on the unfixed variables with maximal branch priority
37779  *
37780  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37781  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37782  *
37783  * @pre This method can be called if @p scip is in one of the following stages:
37784  * - \ref SCIP_STAGE_SOLVING
37785  *
37786  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37787  */
37789  SCIP* scip, /**< SCIP data structure */
37790  SCIP_RESULT* result /**< pointer to store the result of the branching (s. branch.h) */
37791  )
37792 {
37793  SCIP_CALL( checkStage(scip, "SCIPbranchLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37794 
37795  SCIP_CALL( SCIPbranchExecLP(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
37796  scip->tree, scip->reopt, scip->lp, scip->sepastore, scip->branchcand, scip->eventqueue, scip->primal->cutoffbound,
37797  TRUE, result) );
37798 
37799  return SCIP_OKAY;
37800 }
37801 
37802 /** calls branching rules to branch on a external candidates; if no such candidates exist, the result is SCIP_DIDNOTRUN
37803  *
37804  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37805  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37806  *
37807  * @pre This method can be called if @p scip is in one of the following stages:
37808  * - \ref SCIP_STAGE_SOLVING
37809  *
37810  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37811  */
37813  SCIP* scip, /**< SCIP data structure */
37814  SCIP_RESULT* result /**< pointer to store the result of the branching (s. branch.h) */
37815  )
37816 {
37817  SCIP_CALL( checkStage(scip, "SCIPbranchExtern", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37818 
37819  SCIP_CALL( SCIPbranchExecExtern(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
37820  scip->tree, scip->reopt, scip->lp, scip->sepastore, scip->branchcand, scip->eventqueue, scip->primal->cutoffbound,
37821  TRUE, result) );
37822 
37823  return SCIP_OKAY;
37824 }
37825 
37826 /** calls branching rules to branch on a pseudo solution; if no unfixed variables exist, the result is SCIP_DIDNOTRUN
37827  *
37828  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37829  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37830  *
37831  * @pre This method can be called if @p scip is in one of the following stages:
37832  * - \ref SCIP_STAGE_SOLVING
37833  *
37834  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
37835  */
37837  SCIP* scip, /**< SCIP data structure */
37838  SCIP_RESULT* result /**< pointer to store the result of the branching (s. branch.h) */
37839  )
37840 {
37841  SCIP_CALL( checkStage(scip, "SCIPbranchPseudo", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37842 
37843  SCIP_CALL( SCIPbranchExecPseudo(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
37844  scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->primal->cutoffbound, TRUE, result) );
37845 
37846  return SCIP_OKAY;
37847 }
37848 
37849 
37850 
37851 
37852 /*
37853  * primal solutions
37854  */
37855 
37856 /** creates a primal solution, initialized to zero
37857  *
37858  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37859  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37860  *
37861  * @pre This method can be called if SCIP is in one of the following stages:
37862  * - \ref SCIP_STAGE_PROBLEM
37863  * - \ref SCIP_STAGE_TRANSFORMING
37864  * - \ref SCIP_STAGE_TRANSFORMED
37865  * - \ref SCIP_STAGE_INITPRESOLVE
37866  * - \ref SCIP_STAGE_PRESOLVING
37867  * - \ref SCIP_STAGE_EXITPRESOLVE
37868  * - \ref SCIP_STAGE_PRESOLVED
37869  * - \ref SCIP_STAGE_INITSOLVE
37870  * - \ref SCIP_STAGE_SOLVING
37871  */
37873  SCIP* scip, /**< SCIP data structure */
37874  SCIP_SOL** sol, /**< pointer to store the solution */
37875  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
37876  )
37877 {
37878  SCIP_CALL( checkStage(scip, "SCIPcreateSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37879 
37880  switch( scip->set->stage )
37881  {
37882  case SCIP_STAGE_PROBLEM:
37883  SCIP_CALL( SCIPsolCreateOriginal(sol, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->origprimal, NULL, heur) );
37884  return SCIP_OKAY;
37885 
37889  case SCIP_STAGE_PRESOLVING:
37891  case SCIP_STAGE_PRESOLVED:
37892  case SCIP_STAGE_INITSOLVE:
37893  case SCIP_STAGE_SOLVING:
37894  SCIP_CALL( SCIPsolCreate(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, heur) );
37895  return SCIP_OKAY;
37896 
37897  case SCIP_STAGE_SOLVED:
37898  case SCIP_STAGE_EXITSOLVE:
37899  case SCIP_STAGE_FREETRANS:
37900  default:
37901  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
37902  return SCIP_INVALIDDATA;
37903  } /*lint !e788*/
37904 }
37905 
37906 /** creates a primal solution, initialized to the current LP solution
37907  *
37908  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37909  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37910  *
37911  * @pre This method can be called if SCIP is in one of the following stages:
37912  * - \ref SCIP_STAGE_SOLVING
37913  */
37915  SCIP* scip, /**< SCIP data structure */
37916  SCIP_SOL** sol, /**< pointer to store the solution */
37917  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
37918  )
37919 {
37920  SCIP_CALL( checkStage(scip, "SCIPcreateLPSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37921 
37922  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
37923  {
37924  SCIPerrorMessage("LP solution does not exist\n");
37925  return SCIP_INVALIDCALL;
37926  }
37927 
37928  SCIP_CALL( SCIPsolCreateLPSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
37929  scip->tree, scip->lp, heur) );
37930 
37931  return SCIP_OKAY;
37932 }
37933 
37934 /** creates a primal solution, initialized to the current NLP solution
37935  *
37936  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37937  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37938  *
37939  * @pre This method can be called if SCIP is in one of the following stages:
37940  * - \ref SCIP_STAGE_SOLVING
37941  */
37943  SCIP* scip, /**< SCIP data structure */
37944  SCIP_SOL** sol, /**< pointer to store the solution */
37945  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
37946  )
37947 {
37948  SCIP_CALL( checkStage(scip, "SCIPcreateNLPSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37949 
37950  if( !SCIPisNLPConstructed(scip) )
37951  {
37952  SCIPerrorMessage("NLP does not exist\n");
37953  return SCIP_INVALIDCALL;
37954  }
37955  assert(scip->nlp != NULL);
37956 
37957  if( !SCIPnlpHasSolution(scip->nlp) )
37958  {
37959  SCIPerrorMessage("NLP solution does not exist\n");
37960  return SCIP_INVALIDCALL;
37961  }
37962 
37963  SCIP_CALL( SCIPsolCreateNLPSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, scip->nlp,
37964  heur) );
37965 
37966  return SCIP_OKAY;
37967 }
37968 
37969 /** creates a primal solution, initialized to the current relaxation solution
37970  *
37971  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37972  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37973  *
37974  * @pre This method can be called if SCIP is in one of the following stages:
37975  * - \ref SCIP_STAGE_SOLVING
37976  */
37978  SCIP* scip, /**< SCIP data structure */
37979  SCIP_SOL** sol, /**< pointer to store the solution */
37980  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
37981  )
37982 {
37983  SCIP_CALL( checkStage(scip, "SCIPcreateRelaxSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37984 
37985  if( !SCIPrelaxationIsSolValid(scip->relaxation) )
37986  {
37987  SCIPerrorMessage("relaxation solution is not valid\n");
37988  return SCIP_INVALIDCALL;
37989  }
37990 
37991  SCIP_CALL( SCIPsolCreateRelaxSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, scip->relaxation, heur) );
37992 
37993  return SCIP_OKAY;
37994 }
37995 
37996 /** creates a primal solution, initialized to the current pseudo solution
37997  *
37998  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37999  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38000  *
38001  * @pre This method can be called if SCIP is in one of the following stages:
38002  * - \ref SCIP_STAGE_SOLVING
38003  */
38005  SCIP* scip, /**< SCIP data structure */
38006  SCIP_SOL** sol, /**< pointer to store the solution */
38007  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
38008  )
38009 {
38010  SCIP_CALL( checkStage(scip, "SCIPcreatePseudoSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38011 
38012  SCIP_CALL( SCIPsolCreatePseudoSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
38013  scip->tree, scip->lp, heur) );
38014 
38015  return SCIP_OKAY;
38016 }
38017 
38018 /** creates a primal solution, initialized to the current LP or pseudo solution, depending on whether the LP was solved
38019  * at the current node
38020  *
38021  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38022  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38023  *
38024  * @pre This method can be called if SCIP is in one of the following stages:
38025  * - \ref SCIP_STAGE_SOLVING
38026  */
38028  SCIP* scip, /**< SCIP data structure */
38029  SCIP_SOL** sol, /**< pointer to store the solution */
38030  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
38031  )
38032 {
38033  SCIP_CALL( checkStage(scip, "SCIPcreateCurrentSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38034 
38035  SCIP_CALL( SCIPsolCreateCurrentSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
38036  scip->tree, scip->lp, heur) );
38037 
38038  return SCIP_OKAY;
38039 }
38040 
38041 /** creates a partial primal solution, initialized to unknown values
38042  *
38043  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38044  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38045  *
38046  * @pre This method can be called if SCIP is in one of the following stages:
38047  * - \ref SCIP_STAGE_PROBLEM
38048  */
38050  SCIP* scip, /**< SCIP data structure */
38051  SCIP_SOL** sol, /**< pointer to store the solution */
38052  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
38053  )
38054 {
38055  SCIP_CALL( checkStage(scip, "SCIPcreatePartialSol", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
38056 
38057  SCIP_CALL( SCIPsolCreatePartial(sol, scip->mem->probmem, scip->set, scip->stat, scip->origprimal, heur) );
38058 
38059  return SCIP_OKAY;
38060 }
38061 
38062 /** creates a primal solution, initialized to unknown values
38063  *
38064  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38065  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38066  *
38067  * @pre This method can be called if SCIP is in one of the following stages:
38068  * - \ref SCIP_STAGE_TRANSFORMING
38069  * - \ref SCIP_STAGE_TRANSFORMED
38070  * - \ref SCIP_STAGE_INITPRESOLVE
38071  * - \ref SCIP_STAGE_PRESOLVING
38072  * - \ref SCIP_STAGE_EXITPRESOLVE
38073  * - \ref SCIP_STAGE_PRESOLVED
38074  * - \ref SCIP_STAGE_INITSOLVE
38075  * - \ref SCIP_STAGE_SOLVING
38076  */
38078  SCIP* scip, /**< SCIP data structure */
38079  SCIP_SOL** sol, /**< pointer to store the solution */
38080  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
38081  )
38082 {
38083  SCIP_CALL( checkStage(scip, "SCIPcreateUnknownSol", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38084 
38085  SCIP_CALL( SCIPsolCreateUnknown(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, heur) );
38086 
38087  return SCIP_OKAY;
38088 }
38089 
38090 /** creates a primal solution living in the original problem space, initialized to zero;
38091  * a solution in original space allows to set original variables to values that would be invalid in the
38092  * transformed problem due to preprocessing fixings or aggregations
38093  *
38094  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38095  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38096  *
38097  * @pre This method can be called if SCIP is in one of the following stages:
38098  * - \ref SCIP_STAGE_PROBLEM
38099  * - \ref SCIP_STAGE_TRANSFORMING
38100  * - \ref SCIP_STAGE_TRANSFORMED
38101  * - \ref SCIP_STAGE_INITPRESOLVE
38102  * - \ref SCIP_STAGE_PRESOLVING
38103  * - \ref SCIP_STAGE_EXITPRESOLVE
38104  * - \ref SCIP_STAGE_PRESOLVED
38105  * - \ref SCIP_STAGE_INITSOLVE
38106  * - \ref SCIP_STAGE_SOLVING
38107  * - \ref SCIP_STAGE_SOLVED
38108  */
38110  SCIP* scip, /**< SCIP data structure */
38111  SCIP_SOL** sol, /**< pointer to store the solution */
38112  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
38113  )
38114 {
38115  SCIP_CALL( checkStage(scip, "SCIPcreateOrigSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38116 
38117  switch( scip->set->stage )
38118  {
38119  case SCIP_STAGE_PROBLEM:
38120  SCIP_CALL( SCIPsolCreateOriginal(sol, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->origprimal, NULL, heur) );
38121  return SCIP_OKAY;
38122 
38126  case SCIP_STAGE_PRESOLVING:
38128  case SCIP_STAGE_PRESOLVED:
38129  case SCIP_STAGE_INITSOLVE:
38130  case SCIP_STAGE_SOLVING:
38131  case SCIP_STAGE_SOLVED:
38132  SCIP_CALL( SCIPsolCreateOriginal(sol, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->primal, scip->tree, heur) );
38133  return SCIP_OKAY;
38134 
38135  case SCIP_STAGE_EXITSOLVE:
38136  case SCIP_STAGE_FREETRANS:
38137  default:
38138  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
38139  return SCIP_INVALIDCALL;
38140  } /*lint !e788*/
38141 }
38142 
38143 /** creates a copy of a primal solution; note that a copy of a linked solution is also linked and needs to be unlinked
38144  * if it should stay unaffected from changes in the LP or pseudo solution
38145  *
38146  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38147  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38148  *
38149  * @pre This method can be called if SCIP is in one of the following stages:
38150  * - \ref SCIP_STAGE_PROBLEM
38151  * - \ref SCIP_STAGE_FREETRANS
38152  * - \ref SCIP_STAGE_TRANSFORMING
38153  * - \ref SCIP_STAGE_TRANSFORMED
38154  * - \ref SCIP_STAGE_INITPRESOLVE
38155  * - \ref SCIP_STAGE_PRESOLVING
38156  * - \ref SCIP_STAGE_EXITPRESOLVE
38157  * - \ref SCIP_STAGE_PRESOLVED
38158  * - \ref SCIP_STAGE_INITSOLVE
38159  * - \ref SCIP_STAGE_SOLVING
38160  * - \ref SCIP_STAGE_SOLVED
38161  */
38163  SCIP* scip, /**< SCIP data structure */
38164  SCIP_SOL** sol, /**< pointer to store the solution */
38165  SCIP_SOL* sourcesol /**< primal CIP solution to copy */
38166  )
38167 {
38168  SCIP_CALL( checkStage(scip, "SCIPcreateSolCopy", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38169 
38170  /* check if we want to copy the current solution, which is the same as creating a current solution */
38171  if( sourcesol == NULL )
38172  {
38173  SCIP_CALL( SCIPcreateCurrentSol(scip, sol, NULL) );
38174  }
38175  else
38176  {
38177  SCIP_CALL( SCIPsolCopy(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, sourcesol) );
38178  }
38179 
38180  return SCIP_OKAY;
38181 }
38182 
38183 /** creates a copy of a solution in the original primal solution space
38184  *
38185  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38186  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38187  *
38188  * @pre This method can be called if SCIP is in one of the following stages:
38189  * - \ref SCIP_STAGE_PROBLEM
38190  * - \ref SCIP_STAGE_TRANSFORMING
38191  * - \ref SCIP_STAGE_TRANSFORMED
38192  * - \ref SCIP_STAGE_INITPRESOLVE
38193  * - \ref SCIP_STAGE_PRESOLVING
38194  * - \ref SCIP_STAGE_EXITPRESOLVE
38195  * - \ref SCIP_STAGE_PRESOLVED
38196  * - \ref SCIP_STAGE_INITSOLVE
38197  * - \ref SCIP_STAGE_SOLVING
38198  * - \ref SCIP_STAGE_SOLVED
38199  * - \ref SCIP_STAGE_EXITSOLVE
38200  * - \ref SCIP_STAGE_FREETRANS
38201  */
38203  SCIP* scip, /**< SCIP data structure */
38204  SCIP_SOL** sol, /**< pointer to store the solution */
38205  SCIP_SOL* sourcesol /**< primal CIP solution to copy */
38206  )
38207 {
38208  SCIP_CALL( checkStage(scip, "SCIPcreateSolCopyOrig", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38209 
38210  /* check if we want to copy the current solution, which is the same as creating a current solution */
38211  if( sourcesol == NULL )
38212  {
38213  SCIP_CALL( SCIPcreateCurrentSol(scip, sol, NULL) );
38214  }
38215  else
38216  {
38217  switch( scip->set->stage )
38218  {
38219  case SCIP_STAGE_PROBLEM:
38220  case SCIP_STAGE_FREETRANS:
38221  case SCIP_STAGE_SOLVED:
38225  case SCIP_STAGE_PRESOLVING:
38227  case SCIP_STAGE_PRESOLVED:
38228  case SCIP_STAGE_INITSOLVE:
38229  case SCIP_STAGE_SOLVING:
38230  SCIP_CALL( SCIPsolCopy(sol, scip->mem->probmem, scip->set, scip->stat, scip->origprimal, sourcesol) );
38231  break;
38232  default:
38233  assert(FALSE);
38234  } /*lint !e788*/
38235  }
38236 
38237  return SCIP_OKAY;
38238 }
38239 
38240 /** helper method that sets up and solves the sub-SCIP for removing infinite values from solutions */
38241 static
38243  SCIP* scip, /**< SCIP data structure */
38244  SCIP* subscip, /**< SCIP data structure of sub-SCIP*/
38245  SCIP_VAR** origvars, /**< original problem variables of main SCIP */
38246  int norigvars, /**< number of original problem variables of main SCIP */
38247  SCIP_Real* solvals, /**< array with solution values of variables; infinite ones are replaced */
38248  SCIP_Bool* success /**< pointer to store if removing infinite values was successful */
38249  )
38250 {
38251  SCIP_HASHMAP* varmap;
38252  SCIP_VAR* varcopy;
38253  SCIP_Real fixval;
38254  SCIP_Bool valid;
38255  SCIP_SOL* bestsol;
38256  int v;
38257 
38258  assert(scip != NULL);
38259  assert(subscip != NULL);
38260  assert(origvars != NULL);
38261  assert(solvals != NULL);
38262  assert(success != NULL);
38263 
38264  /* copy the original problem to the sub-SCIP */
38265  SCIP_CALL( SCIPhashmapCreate(&varmap, SCIPblkmem(scip), norigvars) );
38266  SCIP_CALL( SCIPcopyOrig(scip, subscip, varmap, NULL, "removeinffixings", TRUE, TRUE, &valid) );
38267 
38268  SCIP_CALL( SCIPsetIntParam(subscip, "display/verblevel", (int)SCIP_VERBLEVEL_NONE) );
38269 
38270  /* in the sub-SCIP, we try to minimize the absolute values of all variables with infinite values in the solution
38271  * and fix all other variables to the value they have in the solution
38272  */
38273  for( v = 0; v < norigvars; ++v )
38274  {
38275  varcopy = (SCIP_VAR*) SCIPhashmapGetImage(varmap, (void*)origvars[v]);
38276  assert(varcopy != NULL);
38277 
38278  fixval = solvals[v];
38279 
38280  if( SCIPisInfinity(scip, fixval) || SCIPisInfinity(scip, -fixval) )
38281  {
38282  /* If a variable with a finite finite lower bound was set to +infinity, we just change its objective to 1.0
38283  * to minimize its value; if a variable with a finite finite upper bound was set to -infinity, we just
38284  * change its objective to -1.0 to maximize its value; if a variable is free, we split the variable into
38285  * positive and negative part by creating two new non-negative variables and one constraint linking those
38286  * variables.
38287  */
38288  if( SCIPisInfinity(scip, fixval) && !SCIPisInfinity(scip, -SCIPvarGetLbLocal(varcopy)) )
38289  {
38290  SCIP_CALL( SCIPchgVarObj(subscip, varcopy, 1.0) );
38291  }
38292  else if( SCIPisInfinity(scip, -fixval) && !SCIPisInfinity(scip, SCIPvarGetUbLocal(varcopy)) )
38293  {
38294  SCIP_CALL( SCIPchgVarObj(subscip, varcopy, -1.0) );
38295  }
38296  else
38297  {
38298  char name[SCIP_MAXSTRLEN];
38299  SCIP_VAR* posvar;
38300  SCIP_VAR* negvar;
38301  SCIP_CONS* linkcons;
38302 
38303  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%s", SCIPvarGetName(varcopy), "run");
38304  SCIP_CALL( SCIPcreateVar(subscip, &posvar, name, 0.0, SCIPinfinity(scip), 1.0,
38305  SCIP_VARTYPE_CONTINUOUS, TRUE, FALSE, NULL, NULL, NULL, NULL, NULL) );
38306  SCIP_CALL( SCIPaddVar(subscip, posvar) );
38307 
38308  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%s", SCIPvarGetName(varcopy), "neg");
38309  SCIP_CALL( SCIPcreateVar(subscip, &negvar, name, 0.0, SCIPinfinity(scip), 1.0,
38310  SCIP_VARTYPE_CONTINUOUS, TRUE, FALSE, NULL, NULL, NULL, NULL, NULL) );
38311  SCIP_CALL( SCIPaddVar(subscip, negvar) );
38312 
38313  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%s", SCIPvarGetName(varcopy), "linkcons");
38314  SCIP_CALL( SCIPcreateConsBasicLinear(subscip, &linkcons, name, 0, NULL, NULL, 0.0, 0.0 ) );
38315  SCIP_CALL( SCIPaddCoefLinear(subscip, linkcons, varcopy, 1.0) );
38316  SCIP_CALL( SCIPaddCoefLinear(subscip, linkcons, posvar, -1.0) );
38317  SCIP_CALL( SCIPaddCoefLinear(subscip, linkcons, negvar, 1.0) );
38318  SCIP_CALL( SCIPaddCons(subscip, linkcons) );
38319 
38320  SCIP_CALL( SCIPreleaseCons(subscip, &linkcons) );
38321  SCIP_CALL( SCIPreleaseVar(subscip, &posvar) );
38322  SCIP_CALL( SCIPreleaseVar(subscip, &negvar) );
38323 
38324  SCIP_CALL( SCIPchgVarObj(subscip, varcopy, 0.0) );
38325  }
38326  }
38327  else
38328  {
38329  SCIP_Bool infeasible;
38330  SCIP_Bool fixed;
38331 
38332  if( SCIPisFeasLT(scip, solvals[v], SCIPvarGetLbLocal(varcopy)) || SCIPisFeasGT(scip, solvals[v], SCIPvarGetUbLocal(varcopy)) )
38333  {
38334  SCIP_CALL( SCIPchgVarType(subscip, varcopy, SCIP_VARTYPE_CONTINUOUS, &infeasible) );
38335  assert(!infeasible);
38336  }
38337 
38338  /* fix variable to its value in the solution */
38339  SCIP_CALL( SCIPfixVar(subscip, varcopy, fixval, &infeasible, &fixed) );
38340  assert(!infeasible);
38341  }
38342  }
38343 
38344  SCIP_CALL( SCIPsolve(subscip) );
38345 
38346  bestsol = SCIPgetBestSol(subscip);
38347 
38348  if( bestsol != NULL )
38349  {
38350  /* change the stored solution values for variables fixed to infinite values */
38351  for( v = 0; v < norigvars; ++v )
38352  {
38353  varcopy = (SCIP_VAR*) SCIPhashmapGetImage(varmap, (void*)origvars[v]);
38354  assert(varcopy != NULL);
38355 
38356  if( (SCIPisInfinity(scip, solvals[v]) || SCIPisInfinity(scip, -solvals[v])) )
38357  {
38358  solvals[v] = SCIPgetSolVal(subscip, bestsol, varcopy);
38359  }
38360  }
38361  }
38362  else
38363  {
38364  *success = FALSE;
38365  }
38366 
38367  SCIPhashmapFree(&varmap);
38368 
38369  return SCIP_OKAY;
38370 }
38371 
38372 
38373 /** creates a copy of a primal solution, thereby replacing infinite fixings of variables by finite values;
38374  * the copy is always defined in the original variable space;
38375  * success indicates whether the objective value of the solution was changed by removing infinite values
38376  *
38377  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38378  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38379  *
38380  * @pre This method can be called if SCIP is in one of the following stages:
38381  * - \ref SCIP_STAGE_PROBLEM
38382  * - \ref SCIP_STAGE_TRANSFORMING
38383  * - \ref SCIP_STAGE_TRANSFORMED
38384  * - \ref SCIP_STAGE_INITPRESOLVE
38385  * - \ref SCIP_STAGE_PRESOLVING
38386  * - \ref SCIP_STAGE_EXITPRESOLVE
38387  * - \ref SCIP_STAGE_PRESOLVED
38388  * - \ref SCIP_STAGE_INITSOLVE
38389  * - \ref SCIP_STAGE_SOLVING
38390  * - \ref SCIP_STAGE_SOLVED
38391  * - \ref SCIP_STAGE_EXITSOLVE
38392  */
38394  SCIP* scip, /**< SCIP data structure */
38395  SCIP_SOL** sol, /**< pointer to store the solution */
38396  SCIP_SOL* sourcesol, /**< primal CIP solution to copy */
38397  SCIP_Bool* success /**< does the finite solution have the same objective value? */
38398  )
38399 {
38400  SCIP_VAR** fixedvars;
38401  SCIP_VAR** origvars;
38402  SCIP_Real* solvals;
38403  SCIP_VAR* var;
38404  int nfixedvars;
38405  int norigvars;
38406  int v;
38407 
38408  SCIP_CALL( checkStage(scip, "SCIPcreateFiniteSolCopy", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38409 
38410  assert(scip != NULL);
38411  assert(sol != NULL);
38412  assert(sourcesol != NULL);
38413  assert(success != NULL);
38414 
38415  *success = TRUE;
38416  *sol = NULL;
38417 
38418  fixedvars = SCIPgetFixedVars(scip);
38419  nfixedvars = SCIPgetNFixedVars(scip);
38420  assert(fixedvars != NULL || nfixedvars == 0);
38421 
38422  /* get original variables and their values in the optimal solution */
38423  SCIP_CALL( SCIPgetOrigVarsData(scip, &origvars, &norigvars, NULL, NULL, NULL, NULL) );
38424  SCIP_CALL( SCIPallocBufferArray(scip, &solvals, norigvars) );
38425  SCIP_CALL( SCIPgetSolVals(scip, sourcesol, norigvars, origvars, solvals) );
38426 
38427  /* check whether there are variables fixed to an infinite value */
38428  for( v = 0; v < nfixedvars; ++v )
38429  {
38430  var = fixedvars[v]; /*lint !e613*/
38431 
38432  /* skip (multi-)aggregated variables */
38434  continue;
38435 
38436  assert(SCIPisEQ(scip, SCIPvarGetLbGlobal(var), SCIPvarGetUbGlobal(var)));
38437 
38438  if( (SCIPisInfinity(scip, SCIPvarGetLbGlobal(var)) || SCIPisInfinity(scip, -SCIPvarGetLbGlobal(var))) )
38439  {
38440  SCIPdebugMsg(scip, "var <%s> is fixed to infinite value %g\n", SCIPvarGetName(var), SCIPvarGetLbGlobal(var));
38441  break;
38442  }
38443  }
38444 
38445  /* there were variables fixed to infinite values */
38446  if( v < nfixedvars )
38447  {
38448  SCIP* subscip;
38449  SCIP_RETCODE retcode;
38450 
38451  /* if one of the variables was fixed to infinity in the original problem, we stop here */
38452  for( v = 0; v < norigvars; ++v )
38453  {
38454  var = origvars[v];
38455 
38457  {
38458  assert(SCIPisEQ(scip, SCIPvarGetLbOriginal(var), SCIPvarGetUbOriginal(var)));
38459 
38460  SCIPdebugMsg(scip, "--> var <%s> is fixed to infinite value %g in the original problem, stop making solution finite\n",
38462 
38463  *success = FALSE;
38464 
38465  goto TERMINATE;
38466  }
38467  }
38468 
38469  /* create sub-SCIP */
38470  SCIP_CALL( SCIPcreate(&subscip) );
38471 
38472  retcode = setupAndSolveFiniteSolSubscip(scip, subscip, origvars, norigvars, solvals, success);
38473 
38474  /* free sub-SCIP */
38475  SCIP_CALL( SCIPfree(&subscip) );
38476 
38477  SCIP_CALL( retcode );
38478  }
38479 
38480  /* create original solution and set the solution values */
38481  if( *success )
38482  {
38483  SCIP_CALL( SCIPcreateOrigSol(scip, sol, NULL) );
38484  for( v = 0; v < norigvars; ++v )
38485  {
38486  SCIP_CALL( SCIPsetSolVal(scip, *sol, origvars[v], solvals[v]) );
38487  }
38488  }
38489 
38490 #ifdef SCIP_DEBUG
38491  SCIPdebugMsg(scip, "created finites solution copy:\n");
38492  SCIP_CALL( SCIPprintSol(scip, *sol, NULL, FALSE) );
38493 #endif
38494 
38495  /* the solution of the sub-SCIP should have the same objective value */
38496  if( *success && !SCIPisEQ(scip, SCIPgetSolOrigObj(scip, *sol), SCIPgetSolOrigObj(scip, sourcesol)) )
38497  {
38498  /* @todo how should we avoid numerical trobles here for large objective values? */
38499  if( (SCIPgetSolOrigObj(scip, *sol) / SCIPepsilon(scip)) < 1e+15 ||
38500  REALABS(SCIPgetSolOrigObj(scip, *sol) - SCIPgetSolOrigObj(scip, sourcesol)) > 1e-12 * SCIPgetSolOrigObj(scip, *sol) )
38501  *success = FALSE;
38502  }
38503 
38504  TERMINATE:
38505  SCIPfreeBufferArray(scip, &solvals);
38506 
38507  return SCIP_OKAY;
38508 }
38509 
38510 /** frees primal CIP solution
38511  *
38512  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38513  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38514  *
38515  * @pre This method can be called if SCIP is in one of the following stages:
38516  * - \ref SCIP_STAGE_PROBLEM
38517  * - \ref SCIP_STAGE_TRANSFORMING
38518  * - \ref SCIP_STAGE_TRANSFORMED
38519  * - \ref SCIP_STAGE_INITPRESOLVE
38520  * - \ref SCIP_STAGE_PRESOLVING
38521  * - \ref SCIP_STAGE_EXITPRESOLVE
38522  * - \ref SCIP_STAGE_PRESOLVED
38523  * - \ref SCIP_STAGE_INITSOLVE
38524  * - \ref SCIP_STAGE_SOLVING
38525  * - \ref SCIP_STAGE_SOLVED
38526  * - \ref SCIP_STAGE_EXITSOLVE
38527  * - \ref SCIP_STAGE_FREETRANS
38528  */
38530  SCIP* scip, /**< SCIP data structure */
38531  SCIP_SOL** sol /**< pointer to the solution */
38532  )
38533 {
38534  SCIP_CALL( checkStage(scip, "SCIPfreeSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38535 
38536  switch( scip->set->stage )
38537  {
38538  case SCIP_STAGE_PROBLEM:
38539  SCIP_CALL( SCIPsolFree(sol, scip->mem->probmem, scip->origprimal) );
38540  break;
38541  case SCIP_STAGE_FREETRANS:
38544  case SCIP_STAGE_PRESOLVING:
38546  case SCIP_STAGE_PRESOLVED:
38547  case SCIP_STAGE_SOLVING:
38549  case SCIP_STAGE_INITSOLVE:
38550  case SCIP_STAGE_SOLVED:
38551  case SCIP_STAGE_EXITSOLVE:
38552  SCIP_CALL( SCIPsolFree(sol, scip->mem->probmem, scip->primal) );
38553  break;
38554  default:
38555  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
38556  return SCIP_INVALIDCALL;
38557  } /*lint !e788*/
38558 
38559  return SCIP_OKAY;
38560 }
38561 
38562 /** links a primal solution to the current LP solution
38563  *
38564  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38565  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38566  *
38567  * @pre This method can be called if SCIP is in one of the following stages:
38568  * - \ref SCIP_STAGE_SOLVING
38569  */
38571  SCIP* scip, /**< SCIP data structure */
38572  SCIP_SOL* sol /**< primal solution */
38573  )
38574 {
38575  SCIP_CALL( checkStage(scip, "SCIPlinkLPSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38576 
38577  if( !SCIPlpIsSolved(scip->lp) )
38578  {
38579  SCIPerrorMessage("LP solution does not exist\n");
38580  return SCIP_INVALIDCALL;
38581  }
38582 
38583  SCIP_CALL( SCIPsolLinkLPSol(sol, scip->set, scip->stat, scip->transprob, scip->tree, scip->lp) );
38584 
38585  return SCIP_OKAY;
38586 }
38587 
38588 /** links a primal solution to the current NLP solution
38589  *
38590  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38591  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38592  *
38593  * @pre This method can be called if SCIP is in one of the following stages:
38594  * - \ref SCIP_STAGE_SOLVING
38595  */
38597  SCIP* scip, /**< SCIP data structure */
38598  SCIP_SOL* sol /**< primal solution */
38599  )
38600 {
38601  SCIP_CALL( checkStage(scip, "SCIPlinkNLPSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38602 
38603  if( scip->nlp == NULL )
38604  {
38605  SCIPerrorMessage("NLP does not exist\n");
38606  return SCIP_INVALIDCALL;
38607  }
38608 
38610  {
38611  SCIPerrorMessage("NLP solution does not exist\n");
38612  return SCIP_INVALIDCALL;
38613  }
38614 
38615  SCIP_CALL( SCIPsolLinkNLPSol(sol, scip->stat, scip->tree, scip->nlp) );
38616 
38617  return SCIP_OKAY;
38618 }
38619 
38620 /** links a primal solution to the current relaxation solution
38621  *
38622  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38623  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38624  *
38625  * @pre This method can be called if SCIP is in one of the following stages:
38626  * - \ref SCIP_STAGE_SOLVING
38627  */
38629  SCIP* scip, /**< SCIP data structure */
38630  SCIP_SOL* sol /**< primal solution */
38631  )
38632 {
38633  SCIP_CALL( checkStage(scip, "SCIPlinkRelaxSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38634 
38635  if( !SCIPrelaxationIsSolValid(scip->relaxation) )
38636  {
38637  SCIPerrorMessage("relaxation solution is not valid\n");
38638  return SCIP_INVALIDCALL;
38639  }
38640 
38641  SCIP_CALL( SCIPsolLinkRelaxSol(sol, scip->set, scip->stat, scip->tree, scip->relaxation) );
38642 
38643  return SCIP_OKAY;
38644 }
38645 
38646 /** links a primal solution to the current pseudo solution
38647  *
38648  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38649  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38650  *
38651  * @pre This method can be called if SCIP is in one of the following stages:
38652  * - \ref SCIP_STAGE_PRESOLVING
38653  * - \ref SCIP_STAGE_SOLVING
38654  */
38656  SCIP* scip, /**< SCIP data structure */
38657  SCIP_SOL* sol /**< primal solution */
38658  )
38659 {
38660  SCIP_CALL( checkStage(scip, "SCIPlinkPseudoSol", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38661 
38662  SCIP_CALL( SCIPsolLinkPseudoSol(sol, scip->set, scip->stat, scip->transprob, scip->tree, scip->lp) );
38663 
38664  return SCIP_OKAY;
38665 }
38666 
38667 /** links a primal solution to the current LP or pseudo solution
38668  *
38669  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38670  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38671  *
38672  * @pre This method can be called if SCIP is in one of the following stages:
38673  * - \ref SCIP_STAGE_SOLVING
38674  */
38676  SCIP* scip, /**< SCIP data structure */
38677  SCIP_SOL* sol /**< primal solution */
38678  )
38679 {
38680  SCIP_CALL( checkStage(scip, "SCIPlinkCurrentSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38681 
38682  SCIP_CALL( SCIPsolLinkCurrentSol(sol, scip->set, scip->stat, scip->transprob, scip->tree, scip->lp) );
38683 
38684  return SCIP_OKAY;
38685 }
38686 
38687 /** clears a primal solution
38688  *
38689  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38690  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38691  *
38692  * @pre This method can be called if SCIP is in one of the following stages:
38693  * - \ref SCIP_STAGE_PROBLEM
38694  * - \ref SCIP_STAGE_TRANSFORMING
38695  * - \ref SCIP_STAGE_TRANSFORMED
38696  * - \ref SCIP_STAGE_INITPRESOLVE
38697  * - \ref SCIP_STAGE_PRESOLVING
38698  * - \ref SCIP_STAGE_EXITPRESOLVE
38699  * - \ref SCIP_STAGE_PRESOLVED
38700  * - \ref SCIP_STAGE_INITSOLVE
38701  * - \ref SCIP_STAGE_SOLVING
38702  * - \ref SCIP_STAGE_SOLVED
38703  * - \ref SCIP_STAGE_EXITSOLVE
38704  * - \ref SCIP_STAGE_FREETRANS
38705  */
38707  SCIP* scip, /**< SCIP data structure */
38708  SCIP_SOL* sol /**< primal solution */
38709  )
38710 {
38711  SCIP_CALL( checkStage(scip, "SCIPclearSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38712 
38713  SCIP_CALL( SCIPsolClear(sol, scip->stat, scip->tree) );
38714 
38715  return SCIP_OKAY;
38716 }
38717 
38718 /** stores solution values of variables in solution's own array
38719  *
38720  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38721  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38722  *
38723  * @pre This method can be called if SCIP is in one of the following stages:
38724  * - \ref SCIP_STAGE_TRANSFORMING
38725  * - \ref SCIP_STAGE_TRANSFORMED
38726  * - \ref SCIP_STAGE_PRESOLVING
38727  * - \ref SCIP_STAGE_PRESOLVED
38728  * - \ref SCIP_STAGE_INITSOLVE
38729  * - \ref SCIP_STAGE_SOLVING
38730  * - \ref SCIP_STAGE_SOLVED
38731  * - \ref SCIP_STAGE_EXITSOLVE
38732  * - \ref SCIP_STAGE_FREETRANS
38733  */
38735  SCIP* scip, /**< SCIP data structure */
38736  SCIP_SOL* sol /**< primal solution */
38737  )
38738 {
38739  SCIP_CALL( checkStage(scip, "SCIPunlinkSol", FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38740 
38741  SCIP_CALL( SCIPsolUnlink(sol, scip->set, scip->transprob) );
38742 
38743  return SCIP_OKAY;
38744 }
38745 
38746 /** sets value of variable in primal CIP solution
38747  *
38748  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38749  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38750  *
38751  * @pre This method can be called if SCIP is in one of the following stages:
38752  * - \ref SCIP_STAGE_PROBLEM
38753  * - \ref SCIP_STAGE_TRANSFORMING
38754  * - \ref SCIP_STAGE_TRANSFORMED
38755  * - \ref SCIP_STAGE_INITPRESOLVE
38756  * - \ref SCIP_STAGE_PRESOLVING
38757  * - \ref SCIP_STAGE_EXITPRESOLVE
38758  * - \ref SCIP_STAGE_PRESOLVED
38759  * - \ref SCIP_STAGE_INITSOLVE
38760  * - \ref SCIP_STAGE_SOLVING
38761  * - \ref SCIP_STAGE_SOLVED
38762  * - \ref SCIP_STAGE_EXITSOLVE
38763  * - \ref SCIP_STAGE_FREETRANS
38764  */
38766  SCIP* scip, /**< SCIP data structure */
38767  SCIP_SOL* sol, /**< primal solution */
38768  SCIP_VAR* var, /**< variable to add to solution */
38769  SCIP_Real val /**< solution value of variable */
38770  )
38771 {
38772  SCIP_CALL( checkStage(scip, "SCIPsetSolVal", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38773 
38774  assert( var->scip == scip );
38775 
38776  if( SCIPsolIsOriginal(sol) && SCIPvarIsTransformed(var) )
38777  {
38778  SCIPerrorMessage("cannot set value of transformed variable <%s> in original space solution\n",
38779  SCIPvarGetName(var));
38780  return SCIP_INVALIDCALL;
38781  }
38782 
38783  SCIP_CALL( SCIPsolSetVal(sol, scip->set, scip->stat, scip->tree, var, val) );
38784 
38785  return SCIP_OKAY;
38786 }
38787 
38788 /** sets values of multiple variables in primal CIP solution
38789  *
38790  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38791  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38792  *
38793  * @pre This method can be called if SCIP is in one of the following stages:
38794  * - \ref SCIP_STAGE_PROBLEM
38795  * - \ref SCIP_STAGE_TRANSFORMING
38796  * - \ref SCIP_STAGE_TRANSFORMED
38797  * - \ref SCIP_STAGE_INITPRESOLVE
38798  * - \ref SCIP_STAGE_PRESOLVING
38799  * - \ref SCIP_STAGE_EXITPRESOLVE
38800  * - \ref SCIP_STAGE_PRESOLVED
38801  * - \ref SCIP_STAGE_INITSOLVE
38802  * - \ref SCIP_STAGE_SOLVING
38803  * - \ref SCIP_STAGE_SOLVED
38804  * - \ref SCIP_STAGE_EXITSOLVE
38805  * - \ref SCIP_STAGE_FREETRANS
38806  */
38808  SCIP* scip, /**< SCIP data structure */
38809  SCIP_SOL* sol, /**< primal solution */
38810  int nvars, /**< number of variables to set solution value for */
38811  SCIP_VAR** vars, /**< array with variables to add to solution */
38812  SCIP_Real* vals /**< array with solution values of variables */
38813  )
38814 {
38815  int v;
38816 
38817  assert(nvars == 0 || vars != NULL);
38818  assert(nvars == 0 || vals != NULL);
38819 
38820  SCIP_CALL( checkStage(scip, "SCIPsetSolVals", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38821 
38822  if( SCIPsolIsOriginal(sol) )
38823  {
38824  for( v = 0; v < nvars; ++v )
38825  {
38826  if( SCIPvarIsTransformed(vars[v]) )
38827  {
38828  SCIPerrorMessage("cannot set value of transformed variable <%s> in original space solution\n",
38829  SCIPvarGetName(vars[v]));
38830  return SCIP_INVALIDCALL;
38831  }
38832  }
38833  }
38834 
38835  for( v = 0; v < nvars; ++v )
38836  {
38837  SCIP_CALL( SCIPsolSetVal(sol, scip->set, scip->stat, scip->tree, vars[v], vals[v]) );
38838  }
38839 
38840  return SCIP_OKAY;
38841 }
38842 
38843 /** increases value of variable in primal CIP solution
38844  *
38845  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38846  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38847  *
38848  * @pre This method can be called if SCIP is in one of the following stages:
38849  * - \ref SCIP_STAGE_PROBLEM
38850  * - \ref SCIP_STAGE_TRANSFORMING
38851  * - \ref SCIP_STAGE_TRANSFORMED
38852  * - \ref SCIP_STAGE_INITPRESOLVE
38853  * - \ref SCIP_STAGE_PRESOLVING
38854  * - \ref SCIP_STAGE_EXITPRESOLVE
38855  * - \ref SCIP_STAGE_PRESOLVED
38856  * - \ref SCIP_STAGE_INITSOLVE
38857  * - \ref SCIP_STAGE_SOLVING
38858  * - \ref SCIP_STAGE_SOLVED
38859  * - \ref SCIP_STAGE_EXITSOLVE
38860  * - \ref SCIP_STAGE_FREETRANS
38861  */
38863  SCIP* scip, /**< SCIP data structure */
38864  SCIP_SOL* sol, /**< primal solution */
38865  SCIP_VAR* var, /**< variable to increase solution value for */
38866  SCIP_Real incval /**< increment for solution value of variable */
38867  )
38868 {
38869  SCIP_CALL( checkStage(scip, "SCIPincSolVal", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38870 
38871  assert( var->scip == scip );
38872 
38873  if( SCIPsolIsOriginal(sol) && SCIPvarIsTransformed(var) )
38874  {
38875  SCIPerrorMessage("cannot increase value of transformed variable <%s> in original space solution\n",
38876  SCIPvarGetName(var));
38877  return SCIP_INVALIDCALL;
38878  }
38879 
38880  SCIP_CALL( SCIPsolIncVal(sol, scip->set, scip->stat, scip->tree, var, incval) );
38881 
38882  return SCIP_OKAY;
38883 }
38884 
38885 /** returns value of variable in primal CIP solution, or in current LP/pseudo solution
38886  *
38887  * @return value of variable in primal CIP solution, or in current LP/pseudo solution
38888  *
38889  * @pre In case the solution pointer @p sol is @b NULL, that means it is asked for the LP or pseudo solution, this method
38890  * can only be called if @p scip is in the solving stage \ref SCIP_STAGE_SOLVING. In any other case, this method
38891  * can be called if @p scip is in one of the following stages:
38892  * - \ref SCIP_STAGE_PROBLEM
38893  * - \ref SCIP_STAGE_TRANSFORMING
38894  * - \ref SCIP_STAGE_TRANSFORMED
38895  * - \ref SCIP_STAGE_INITPRESOLVE
38896  * - \ref SCIP_STAGE_PRESOLVING
38897  * - \ref SCIP_STAGE_EXITPRESOLVE
38898  * - \ref SCIP_STAGE_PRESOLVED
38899  * - \ref SCIP_STAGE_INITSOLVE
38900  * - \ref SCIP_STAGE_SOLVING
38901  * - \ref SCIP_STAGE_SOLVED
38902  * - \ref SCIP_STAGE_EXITSOLVE
38903  * - \ref SCIP_STAGE_FREETRANS
38904  */
38906  SCIP* scip, /**< SCIP data structure */
38907  SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
38908  SCIP_VAR* var /**< variable to get value for */
38909  )
38910 {
38911  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolVal", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38912 
38913  assert( var->scip == scip );
38914 
38915  if( sol != NULL )
38916  return SCIPsolGetVal(sol, scip->set, scip->stat, var);
38917 
38918  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolVal(sol==NULL)", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38919 
38920  return SCIPvarGetSol(var, SCIPtreeHasCurrentNodeLP(scip->tree));
38921 }
38922 
38923 /** gets values of multiple variables in primal CIP solution
38924  *
38925  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38926  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38927  *
38928  * @pre This method can be called if SCIP is in one of the following stages:
38929  * - \ref SCIP_STAGE_PROBLEM
38930  * - \ref SCIP_STAGE_TRANSFORMING
38931  * - \ref SCIP_STAGE_TRANSFORMED
38932  * - \ref SCIP_STAGE_INITPRESOLVE
38933  * - \ref SCIP_STAGE_PRESOLVING
38934  * - \ref SCIP_STAGE_EXITPRESOLVE
38935  * - \ref SCIP_STAGE_PRESOLVED
38936  * - \ref SCIP_STAGE_INITSOLVE
38937  * - \ref SCIP_STAGE_SOLVING
38938  * - \ref SCIP_STAGE_SOLVED
38939  * - \ref SCIP_STAGE_EXITSOLVE
38940  * - \ref SCIP_STAGE_FREETRANS
38941  */
38943  SCIP* scip, /**< SCIP data structure */
38944  SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
38945  int nvars, /**< number of variables to get solution value for */
38946  SCIP_VAR** vars, /**< array with variables to get value for */
38947  SCIP_Real* vals /**< array to store solution values of variables */
38948  )
38949 {
38950  assert(nvars == 0 || vars != NULL);
38951  assert(nvars == 0 || vals != NULL);
38952 
38953  SCIP_CALL( checkStage(scip, "SCIPgetSolVals", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38954 
38955  if( sol != NULL )
38956  {
38957  int v;
38958 
38959  for( v = 0; v < nvars; ++v )
38960  vals[v] = SCIPsolGetVal(sol, scip->set, scip->stat, vars[v]);
38961  }
38962  else
38963  {
38964  SCIP_CALL( SCIPgetVarSols(scip, nvars, vars, vals) );
38965  }
38966 
38967  return SCIP_OKAY;
38968 }
38969 
38970 /** returns objective value of primal CIP solution w.r.t. original problem, or current LP/pseudo objective value
38971  *
38972  * @return objective value of primal CIP solution w.r.t. original problem, or current LP/pseudo objective value
38973  *
38974  * @pre This method can be called if SCIP is in one of the following stages:
38975  * - \ref SCIP_STAGE_PROBLEM
38976  * - \ref SCIP_STAGE_TRANSFORMING
38977  * - \ref SCIP_STAGE_TRANSFORMED
38978  * - \ref SCIP_STAGE_INITPRESOLVE
38979  * - \ref SCIP_STAGE_PRESOLVING
38980  * - \ref SCIP_STAGE_EXITPRESOLVE
38981  * - \ref SCIP_STAGE_PRESOLVED
38982  * - \ref SCIP_STAGE_INITSOLVE
38983  * - \ref SCIP_STAGE_SOLVING
38984  * - \ref SCIP_STAGE_SOLVED
38985  * - \ref SCIP_STAGE_EXITSOLVE
38986  * - \ref SCIP_STAGE_FREETRANS
38987  */
38989  SCIP* scip, /**< SCIP data structure */
38990  SCIP_SOL* sol /**< primal solution, or NULL for current LP/pseudo objective value */
38991  )
38992 {
38993  /* for original solutions, an original objective value is already available in SCIP_STAGE_PROBLEM
38994  * for all other solutions, we should be at least in SCIP_STAGE_TRANSFORMING
38995  */
38996  if( sol != NULL && SCIPsolIsOriginal(sol) )
38997  {
38998  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolOrigObj", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38999 
39000  return SCIPsolGetOrigObj(sol);
39001  }
39002 
39003  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolOrigObj", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
39004 
39005  if( sol != NULL )
39006  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
39007  else
39008  {
39009  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolOrigObj(sol==NULL)", \
39011  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
39012  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPlpGetObjval(scip->lp, scip->set, scip->transprob));
39013  else
39014  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPlpGetPseudoObjval(scip->lp, scip->set, scip->transprob));
39015  }
39016 }
39017 
39018 /** returns transformed objective value of primal CIP solution, or transformed current LP/pseudo objective value
39019  *
39020  * @return transformed objective value of primal CIP solution, or transformed current LP/pseudo objective value
39021  *
39022  * @pre This method can be called if SCIP is in one of the following stages:
39023  * - \ref SCIP_STAGE_TRANSFORMING
39024  * - \ref SCIP_STAGE_TRANSFORMED
39025  * - \ref SCIP_STAGE_INITPRESOLVE
39026  * - \ref SCIP_STAGE_PRESOLVING
39027  * - \ref SCIP_STAGE_EXITPRESOLVE
39028  * - \ref SCIP_STAGE_PRESOLVED
39029  * - \ref SCIP_STAGE_INITSOLVE
39030  * - \ref SCIP_STAGE_SOLVING
39031  * - \ref SCIP_STAGE_SOLVED
39032  * - \ref SCIP_STAGE_EXITSOLVE
39033  * - \ref SCIP_STAGE_FREETRANS
39034  */
39036  SCIP* scip, /**< SCIP data structure */
39037  SCIP_SOL* sol /**< primal solution, or NULL for current LP/pseudo objective value */
39038  )
39039 {
39040  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolTransObj", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
39041 
39042  if( sol != NULL )
39043  return SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob);
39044  else
39045  {
39046  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolTransObj(sol==NULL)", \
39048  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
39049  return SCIPlpGetObjval(scip->lp, scip->set, scip->transprob);
39050  else
39051  return SCIPlpGetPseudoObjval(scip->lp, scip->set, scip->transprob);
39052  }
39053 }
39054 
39055 /** recomputes the objective value of an original solution, e.g., when transferring solutions
39056  * from the solution pool (objective coefficients might have changed in the meantime)
39057  *
39058  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39059  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39060  *
39061  * @pre This method can be called if SCIP is in one of the following stages:
39062  * - \ref SCIP_STAGE_PRESOLVING
39063  * - \ref SCIP_STAGE_SOLVING
39064  *
39065  */
39067  SCIP* scip,
39068  SCIP_SOL* sol
39069  )
39070 {
39071  assert(scip != NULL);
39072 
39073  SCIP_CALL( checkStage(scip, "SCIPrecomputeSolObj", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
39074 
39075  SCIPsolRecomputeObj(sol, scip->set, scip->stat, scip->origprob);
39076 
39077  return SCIP_OKAY;
39078 }
39079 
39080 /** maps original space objective value into transformed objective value
39081  *
39082  * @return transformed objective value
39083  *
39084  * @pre This method can be called if SCIP is in one of the following stages:
39085  * - \ref SCIP_STAGE_TRANSFORMING
39086  * - \ref SCIP_STAGE_TRANSFORMED
39087  * - \ref SCIP_STAGE_INITPRESOLVE
39088  * - \ref SCIP_STAGE_PRESOLVING
39089  * - \ref SCIP_STAGE_EXITPRESOLVE
39090  * - \ref SCIP_STAGE_PRESOLVED
39091  * - \ref SCIP_STAGE_INITSOLVE
39092  * - \ref SCIP_STAGE_SOLVING
39093  * - \ref SCIP_STAGE_SOLVED
39094  */
39096  SCIP* scip, /**< SCIP data structure */
39097  SCIP_Real obj /**< original space objective value to transform */
39098  )
39099 {
39100  SCIP_CALL_ABORT( checkStage(scip, "SCIPtransformObj", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
39101 
39102  return SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, obj);
39103 }
39104 
39105 /** maps transformed objective value into original space
39106  *
39107  * @return objective value into original space
39108  *
39109  * @pre This method can be called if SCIP is in one of the following stages:
39110  * - \ref SCIP_STAGE_TRANSFORMING
39111  * - \ref SCIP_STAGE_TRANSFORMED
39112  * - \ref SCIP_STAGE_INITPRESOLVE
39113  * - \ref SCIP_STAGE_PRESOLVING
39114  * - \ref SCIP_STAGE_EXITPRESOLVE
39115  * - \ref SCIP_STAGE_PRESOLVED
39116  * - \ref SCIP_STAGE_INITSOLVE
39117  * - \ref SCIP_STAGE_SOLVING
39118  * - \ref SCIP_STAGE_SOLVED
39119  */
39121  SCIP* scip, /**< SCIP data structure */
39122  SCIP_Real obj /**< transformed objective value to retransform in original space */
39123  )
39124 {
39125  SCIP_CALL_ABORT( checkStage(scip, "SCIPretransformObj", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
39126 
39127  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, obj);
39128 }
39129 
39130 /** gets clock time, when this solution was found
39131  *
39132  * @return clock time, when this solution was found
39133  *
39134  * @pre This method can be called if SCIP is in one of the following stages:
39135  * - \ref SCIP_STAGE_TRANSFORMING
39136  * - \ref SCIP_STAGE_TRANSFORMED
39137  * - \ref SCIP_STAGE_INITPRESOLVE
39138  * - \ref SCIP_STAGE_PRESOLVING
39139  * - \ref SCIP_STAGE_EXITPRESOLVE
39140  * - \ref SCIP_STAGE_PRESOLVED
39141  * - \ref SCIP_STAGE_INITSOLVE
39142  * - \ref SCIP_STAGE_SOLVING
39143  * - \ref SCIP_STAGE_SOLVED
39144  * - \ref SCIP_STAGE_EXITSOLVE
39145  * - \ref SCIP_STAGE_FREETRANS
39146  */
39148  SCIP* scip, /**< SCIP data structure */
39149  SCIP_SOL* sol /**< primal solution */
39150  )
39151 {
39152  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolTime", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
39153 
39154  return SCIPsolGetTime(sol);
39155 }
39156 
39157 /** gets branch and bound run number, where this solution was found
39158  *
39159  * @return branch and bound run number, where this solution was found
39160  *
39161  * @pre This method can be called if SCIP is in one of the following stages:
39162  * - \ref SCIP_STAGE_TRANSFORMING
39163  * - \ref SCIP_STAGE_TRANSFORMED
39164  * - \ref SCIP_STAGE_INITPRESOLVE
39165  * - \ref SCIP_STAGE_PRESOLVING
39166  * - \ref SCIP_STAGE_EXITPRESOLVE
39167  * - \ref SCIP_STAGE_PRESOLVED
39168  * - \ref SCIP_STAGE_INITSOLVE
39169  * - \ref SCIP_STAGE_SOLVING
39170  * - \ref SCIP_STAGE_SOLVED
39171  * - \ref SCIP_STAGE_EXITSOLVE
39172  * - \ref SCIP_STAGE_FREETRANS
39173  */
39175  SCIP* scip, /**< SCIP data structure */
39176  SCIP_SOL* sol /**< primal solution */
39177  )
39178 {
39179  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolRunnum", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
39180 
39181  return SCIPsolGetRunnum(sol);
39182 }
39183 
39184 /** gets node number of the specific branch and bound run, where this solution was found
39185  *
39186  * @return node number of the specific branch and bound run, where this solution was found
39187  *
39188  * @pre This method can be called if SCIP is in one of the following stages:
39189  * - \ref SCIP_STAGE_TRANSFORMING
39190  * - \ref SCIP_STAGE_TRANSFORMED
39191  * - \ref SCIP_STAGE_INITPRESOLVE
39192  * - \ref SCIP_STAGE_PRESOLVING
39193  * - \ref SCIP_STAGE_EXITPRESOLVE
39194  * - \ref SCIP_STAGE_PRESOLVED
39195  * - \ref SCIP_STAGE_INITSOLVE
39196  * - \ref SCIP_STAGE_SOLVING
39197  * - \ref SCIP_STAGE_SOLVED
39198  * - \ref SCIP_STAGE_EXITSOLVE
39199  * - \ref SCIP_STAGE_FREETRANS
39200  */
39202  SCIP* scip, /**< SCIP data structure */
39203  SCIP_SOL* sol /**< primal solution */
39204  )
39205 {
39206  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolNodenum", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
39207 
39208  return SCIPsolGetNodenum(sol);
39209 }
39210 
39211 /** gets heuristic, that found this solution (or NULL if it's from the tree)
39212  *
39213  * @return heuristic, that found this solution (or NULL if it's from the tree)
39214  *
39215  * @pre This method can be called if SCIP is in one of the following stages:
39216  * - \ref SCIP_STAGE_TRANSFORMING
39217  * - \ref SCIP_STAGE_TRANSFORMED
39218  * - \ref SCIP_STAGE_INITPRESOLVE
39219  * - \ref SCIP_STAGE_PRESOLVING
39220  * - \ref SCIP_STAGE_EXITPRESOLVE
39221  * - \ref SCIP_STAGE_PRESOLVED
39222  * - \ref SCIP_STAGE_INITSOLVE
39223  * - \ref SCIP_STAGE_SOLVING
39224  * - \ref SCIP_STAGE_SOLVED
39225  * - \ref SCIP_STAGE_EXITSOLVE
39226  * - \ref SCIP_STAGE_FREETRANS
39227  */
39229  SCIP* scip, /**< SCIP data structure */
39230  SCIP_SOL* sol /**< primal solution */
39231  )
39232 {
39233  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolHeur", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
39234 
39235  return SCIPsolGetHeur(sol);
39236 }
39237 
39238 /** returns whether two given solutions are exactly equal
39239  *
39240  * @return returns whether two given solutions are exactly equal
39241  *
39242  * @pre This method can be called if SCIP is in one of the following stages:
39243  * - \ref SCIP_STAGE_PROBLEM
39244  * - \ref SCIP_STAGE_TRANSFORMING
39245  * - \ref SCIP_STAGE_TRANSFORMED
39246  * - \ref SCIP_STAGE_INITPRESOLVE
39247  * - \ref SCIP_STAGE_PRESOLVING
39248  * - \ref SCIP_STAGE_EXITPRESOLVE
39249  * - \ref SCIP_STAGE_PRESOLVED
39250  * - \ref SCIP_STAGE_INITSOLVE
39251  * - \ref SCIP_STAGE_SOLVING
39252  * - \ref SCIP_STAGE_SOLVED
39253  * - \ref SCIP_STAGE_EXITSOLVE
39254  * - \ref SCIP_STAGE_FREETRANS
39255  */
39257  SCIP* scip, /**< SCIP data structure */
39258  SCIP_SOL* sol1, /**< first primal CIP solution */
39259  SCIP_SOL* sol2 /**< second primal CIP solution */
39260  )
39261 {
39262  SCIP_CALL_ABORT( checkStage(scip, "SCIPareSolsEqual", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
39263 
39264  return SCIPsolsAreEqual(sol1, sol2, scip->set, scip->stat, scip->origprob, scip->transprob);
39265 }
39266 
39267 /** adjusts solution values of implicit integer variables in handed solution. Solution objective value is not
39268  * deteriorated by this method.
39269  *
39270  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39271  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39272  *
39273  * @pre This method can be called if SCIP is in one of the following stages:
39274  * - \ref SCIP_STAGE_SOLVING
39275  */
39277  SCIP* scip, /**< SCIP data structure */
39278  SCIP_SOL* sol, /**< primal CIP solution */
39279  SCIP_Bool uselprows /**< should LP row information be considered for none-objective variables */
39280  )
39281 {
39282  assert(scip != NULL);
39283  SCIP_CALL( checkStage(scip, "SCIPadjustImplicitSolVals", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
39284 
39285  assert(sol != NULL);
39286  SCIP_CALL( SCIPsolAdjustImplicitSolVals(sol, scip->set, scip->stat, scip->transprob, scip->tree, uselprows) );
39287 
39288  return SCIP_OKAY;
39289 }
39290 
39291 /** outputs non-zero variables of solution in original problem space to the given file stream
39292  *
39293  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39294  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39295  *
39296  * @pre In case the solution pointer @p sol is NULL (asking for the current LP/pseudo solution), this method can be
39297  * called if @p scip is in one of the following stages:
39298  * - \ref SCIP_STAGE_PRESOLVING
39299  * - \ref SCIP_STAGE_EXITPRESOLVE
39300  * - \ref SCIP_STAGE_PRESOLVED
39301  * - \ref SCIP_STAGE_INITSOLVE
39302  * - \ref SCIP_STAGE_SOLVING
39303  * - \ref SCIP_STAGE_SOLVED
39304  * - \ref SCIP_STAGE_EXITSOLVE
39305  *
39306  * @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
39307  * following stages:
39308  * - \ref SCIP_STAGE_PROBLEM
39309  * - \ref SCIP_STAGE_TRANSFORMED
39310  * - \ref SCIP_STAGE_INITPRESOLVE
39311  * - \ref SCIP_STAGE_PRESOLVING
39312  * - \ref SCIP_STAGE_EXITPRESOLVE
39313  * - \ref SCIP_STAGE_PRESOLVED
39314  * - \ref SCIP_STAGE_INITSOLVE
39315  * - \ref SCIP_STAGE_SOLVING
39316  * - \ref SCIP_STAGE_SOLVED
39317  * - \ref SCIP_STAGE_EXITSOLVE
39318  */
39320  SCIP* scip, /**< SCIP data structure */
39321  SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
39322  FILE* file, /**< output file (or NULL for standard output) */
39323  SCIP_Bool printzeros /**< should variables set to zero be printed? */
39324  )
39325 {
39326  SCIP_Real objvalue;
39327  SCIP_Bool currentsol;
39328  SCIP_Bool oldquiet = FALSE;
39329 
39330  assert(SCIPisTransformed(scip) || sol != NULL);
39331 
39332  SCIP_CALL( checkStage(scip, "SCIPprintSol", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39333 
39334  currentsol = (sol == NULL);
39335  if( currentsol )
39336  {
39337  SCIP_CALL( checkStage(scip, "SCIPprintSol(sol==NULL)", \
39339 
39340  /* create a temporary solution that is linked to the current solution */
39341  SCIP_CALL( SCIPsolCreateCurrentSol(&sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
39342  scip->tree, scip->lp, NULL) );
39343  }
39344 
39345  if( file != NULL && scip->messagehdlr != NULL )
39346  {
39347  oldquiet = SCIPmessagehdlrIsQuiet(scip->messagehdlr);
39349  }
39350 
39351  SCIPmessageFPrintInfo(scip->messagehdlr, file, "objective value: ");
39352 
39353  if( SCIPsolIsPartial(sol) )
39354  {
39355  SCIPmessageFPrintInfo(scip->messagehdlr, file, "unknown\n");
39356  }
39357  else
39358  {
39359  if( SCIPsolIsOriginal(sol) )
39360  objvalue = SCIPsolGetOrigObj(sol);
39361  else
39362  objvalue = SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
39363 
39364  SCIPprintReal(scip, file, objvalue, 20, 15);
39365  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
39366  }
39367 
39368  SCIP_CALL( SCIPsolPrint(sol, scip->set, scip->messagehdlr, scip->stat, scip->origprob, scip->transprob, file, FALSE,
39369  printzeros) );
39370 
39371  if( file != NULL && scip->messagehdlr != NULL )
39372  {
39373  SCIPmessagehdlrSetQuiet(scip->messagehdlr, oldquiet);
39374  }
39375 
39376  if( currentsol )
39377  {
39378  /* free temporary solution */
39379  SCIP_CALL( SCIPsolFree(&sol, scip->mem->probmem, scip->primal) );
39380  }
39381 
39382  return SCIP_OKAY;
39383 }
39384 
39385 /** outputs non-zero variables of solution in transformed problem space to file stream
39386  *
39387  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39388  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39389  *
39390  * @pre This method can be called if SCIP is in one of the following stages:
39391  * - \ref SCIP_STAGE_TRANSFORMED
39392  * - \ref SCIP_STAGE_INITPRESOLVE
39393  * - \ref SCIP_STAGE_PRESOLVING
39394  * - \ref SCIP_STAGE_EXITPRESOLVE
39395  * - \ref SCIP_STAGE_PRESOLVED
39396  * - \ref SCIP_STAGE_INITSOLVE
39397  * - \ref SCIP_STAGE_SOLVING
39398  * - \ref SCIP_STAGE_SOLVED
39399  * - \ref SCIP_STAGE_EXITSOLVE
39400  */
39402  SCIP* scip, /**< SCIP data structure */
39403  SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
39404  FILE* file, /**< output file (or NULL for standard output) */
39405  SCIP_Bool printzeros /**< should variables set to zero be printed? */
39406  )
39407 {
39408  SCIP_Bool currentsol;
39409 
39410  SCIP_CALL( checkStage(scip, "SCIPprintTransSol", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39411 
39412  currentsol = (sol == NULL);
39413  if( currentsol )
39414  {
39415  /* create a temporary solution that is linked to the current solution */
39416  SCIP_CALL( SCIPsolCreateCurrentSol(&sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
39417  scip->tree, scip->lp, NULL) );
39418  }
39419 
39420  if( SCIPsolIsOriginal(sol) )
39421  {
39422  SCIPerrorMessage("cannot print original space solution as transformed solution\n");
39423  return SCIP_INVALIDCALL;
39424  }
39425 
39426  SCIPmessageFPrintInfo(scip->messagehdlr, file, "objective value: ");
39427  SCIPprintReal(scip, file, SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob), 20, 9);
39428  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
39429 
39430  SCIP_CALL( SCIPsolPrint(sol, scip->set, scip->messagehdlr, scip->stat, scip->transprob, NULL, file, FALSE, printzeros) );
39431 
39432  if( currentsol )
39433  {
39434  /* free temporary solution */
39435  SCIP_CALL( SCIPsolFree(&sol, scip->mem->probmem, scip->primal) );
39436  }
39437 
39438  return SCIP_OKAY;
39439 }
39440 
39441 /** outputs discrete variables of solution in original problem space to the given file stream
39442  *
39443  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39444  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39445  *
39446  * @pre This method can be called if @p scip is in one of the following stages:
39447  * - \ref SCIP_STAGE_PROBLEM
39448  * - \ref SCIP_STAGE_TRANSFORMED
39449  * - \ref SCIP_STAGE_INITPRESOLVE
39450  * - \ref SCIP_STAGE_PRESOLVING
39451  * - \ref SCIP_STAGE_EXITPRESOLVE
39452  * - \ref SCIP_STAGE_PRESOLVED
39453  * - \ref SCIP_STAGE_INITSOLVE
39454  * - \ref SCIP_STAGE_SOLVING
39455  * - \ref SCIP_STAGE_SOLVED
39456  * - \ref SCIP_STAGE_EXITSOLVE
39457  */
39459  SCIP* scip, /**< SCIP data structure */
39460  SCIP_SOL* sol, /**< primal solution */
39461  FILE* file /**< output file (or NULL for standard output) */
39462  )
39463 {
39464  SCIP_Real objvalue;
39465  SCIP_Bool oldquiet = FALSE;
39466 
39467  assert(SCIPisTransformed(scip) || sol != NULL);
39468  assert(sol != NULL);
39469  assert(!SCIPsolIsPartial(sol));
39470 
39471  SCIP_CALL( checkStage(scip, "SCIPprintMIPStart", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39472 
39473  if( file != NULL && scip->messagehdlr != NULL )
39474  {
39475  oldquiet = SCIPmessagehdlrIsQuiet(scip->messagehdlr);
39477  }
39478 
39479  SCIPmessageFPrintInfo(scip->messagehdlr, file, "objective value: ");
39480 
39481  if( SCIPsolIsOriginal(sol) )
39482  objvalue = SCIPsolGetOrigObj(sol);
39483  else
39484  objvalue = SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
39485 
39486  SCIPprintReal(scip, file, objvalue, 20, 15);
39487  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
39488 
39489  SCIP_CALL( SCIPsolPrint(sol, scip->set, scip->messagehdlr, scip->stat, scip->origprob, scip->transprob, file, TRUE,
39490  TRUE) );
39491 
39492  if( file != NULL && scip->messagehdlr != NULL )
39493  {
39494  SCIPmessagehdlrSetQuiet(scip->messagehdlr, oldquiet);
39495  }
39496 
39497  return SCIP_OKAY;
39498 }
39499 
39500 /** returns dual solution value of a constraint */
39502  SCIP* scip, /**< SCIP data structure */
39503  SCIP_CONS* cons, /**< constraint for which the dual solution should be returned */
39504  SCIP_Real* dualsolval, /**< pointer to store the dual solution value */
39505  SCIP_Bool* boundconstraint /**< pointer to store whether the constraint is a bound constraint (or NULL) */
39506  )
39507 {
39508  SCIP_CONS* transcons;
39509  int nvars;
39510  SCIP_Bool success;
39511 #ifndef NDEBUG
39512  SCIP_CONSHDLR* conshdlr;
39513 #endif
39514 
39515  assert(scip != NULL);
39516  assert(cons != NULL);
39517  assert(dualsolval != NULL);
39518 
39519 #ifndef NDEBUG
39520  conshdlr = SCIPconsGetHdlr(cons);
39521  assert(conshdlr != NULL);
39522  assert(strcmp(SCIPconshdlrGetName(conshdlr), "linear" ) == 0);
39523 #endif
39524 
39525  SCIP_CALL( SCIPconsGetNVars(cons, scip->set, &nvars, &success) );
39526 
39527  if( boundconstraint != NULL )
39528  *boundconstraint = (nvars == 1);
39529 
39530  if( SCIPconsIsTransformed(cons) )
39531  transcons = cons;
39532  else
39533  transcons = SCIPconsGetTransformed(cons);
39534 
39535  /* it can happen that a transformed constraints gets deleted due to redundancy. by complementary slackness the
39536  * corresponding dual solution value would be zero. however, if the constraint contains exactly one variable we need
39537  * to check the reduced costs of the variable.
39538  */
39539  if( nvars > 1 && transcons == NULL )
39540  (*dualsolval) = 0.0;
39541  else
39542  {
39543  if( !success )
39544  {
39545  SCIPABORT();
39546  return SCIP_INVALIDCALL;
39547  }
39548 
39549  if( nvars > 1 )
39550  (*dualsolval) = SCIPgetDualsolLinear(scip, transcons);
39551 
39552  /* the constraint is a bound constraint */
39553  else
39554  {
39555  SCIP_VAR** vars;
39556  SCIP_Real varsolval;
39557 
39558  /* allocate buffer memory */
39559  SCIP_CALL( SCIPallocBufferArray(scip, &vars, 1) );
39560 
39561  assert(vars != NULL);
39562  SCIP_CALL( SCIPconsGetVars(cons, scip->set, vars, 1, &success) );
39563 
39564  varsolval = SCIPvarGetLPSol(vars[0]);
39565 
39566  /* return the reduced cost of the variable if the constraint would be tight */
39567  if( SCIPsetIsEQ(scip->set, varsolval, SCIPgetRhsLinear(scip, cons))
39568  || SCIPsetIsEQ(scip->set, varsolval, SCIPgetLhsLinear(scip, cons)) )
39569  (*dualsolval) = SCIPgetVarRedcost(scip, vars[0]);
39570  else
39571  (*dualsolval) = 0.0;
39572 
39573  /* free buffer memory */
39574  SCIPfreeBufferArray(scip, &vars);
39575  }
39576  }
39577  assert(*dualsolval != SCIP_INVALID); /*lint !e777*/
39578 
39579  /* dual values are coming from the LP solver that is always solving a minimization problem */
39581  (*dualsolval) *= -1.0;
39582 
39583  return SCIP_OKAY;
39584 }
39585 
39586 /** outputs dual solution from LP solver to file stream */
39587 static
39589  SCIP* scip, /**< SCIP data structure */
39590  FILE* file, /**< output file (or NULL for standard output) */
39591  SCIP_Bool printzeros /**< should variables set to zero be printed? */
39592  )
39593 {
39594  SCIP_Bool boundconstraint;
39595  int c;
39596 
39597  assert(scip->lp != NULL);
39598  assert(scip->lp->solved);
39599  assert(scip->lp->dualfeasible);
39600 
39601  /* print dual solution values of all constraints */
39602  for( c = 0; c < scip->origprob->nconss; ++c )
39603  {
39604  SCIP_CONS* cons;
39605  SCIP_Real solval;
39606 
39607  cons = scip->origprob->conss[c];
39608  assert(cons != NULL);
39609 
39610  SCIP_CALL( SCIPgetDualSolVal(scip, cons, &solval, &boundconstraint) );
39611 
39612  if( printzeros || !SCIPisZero(scip, solval) )
39613  {
39614  SCIP_MESSAGEHDLR* messagehdlr = scip->messagehdlr;
39615 
39616  SCIPmessageFPrintInfo(messagehdlr, file, "%-32s", SCIPconsGetName(cons));
39617 
39618  if( SCIPisInfinity(scip, solval) )
39619  SCIPmessageFPrintInfo(messagehdlr, file, " +infinity\n");
39620  else if( SCIPisInfinity(scip, -solval) )
39621  SCIPmessageFPrintInfo(messagehdlr, file, " -infinity\n");
39622  else
39623  {
39624  if( boundconstraint )
39625  SCIPmessageFPrintInfo(messagehdlr, file, " %20.15g*\n", solval);
39626  else
39627  SCIPmessageFPrintInfo(messagehdlr, file, " %20.15g\n", solval);
39628  }
39629  }
39630 
39631  }
39632 
39633  return SCIP_OKAY;
39634 }
39635 
39636 /** check whether the dual solution is available
39637  *
39638  * @note This is used when calling \ref SCIPprintDualSol()
39639  *
39640  * @return is dual solution available?
39641  *
39642  * @pre This method can be called if SCIP is in one of the following stages:
39643  * - \ref SCIP_STAGE_SOLVED
39644  */
39646  SCIP* scip, /**< SCIP data structure */
39647  SCIP_Bool printreason /**< print warning message if dualsol is not available? */
39648  )
39649 {
39650  int c;
39651 
39652  assert(scip != NULL);
39653 
39654  SCIP_CALL_ABORT( checkStage(scip, "SCIPisDualSolAvailable", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
39655 
39656  if( SCIPgetStage(scip) != SCIP_STAGE_SOLVED )
39657  {
39658  if( printreason )
39659  SCIPmessageFPrintInfo(scip->messagehdlr, NULL, "No dual solution available.\n");
39660  return FALSE;
39661  }
39662 
39663  assert(scip->stat != NULL);
39664  assert(scip->transprob != NULL);
39665 
39666  /* dual solution only useful when no presolving was performed */
39667  if( scip->stat->performpresol )
39668  {
39669  if( printreason )
39670  SCIPwarningMessage(scip, "No dual information available when presolving was performed.\n");
39671  return FALSE;
39672  }
39673 
39674  /* dual solution is created by LP solver and therefore only available for pure LPs */
39675  if( scip->transprob->nvars != scip->transprob->ncontvars )
39676  {
39677  if( printreason )
39678  SCIPwarningMessage(scip, "Dual information only available for pure LPs (only continuous variables).\n");
39679  return FALSE;
39680  }
39681 
39682  /* dual solution is created by LP solver and therefore only available for linear constraints */
39683  for( c = scip->transprob->nconss - 1; c >= 0; --c )
39684  {
39685  SCIP_CONSHDLR* conshdlr;
39686 
39687  conshdlr = SCIPconsGetHdlr(scip->transprob->conss[c]);
39688  assert(conshdlr != NULL);
39689 
39690  if( strcmp(SCIPconshdlrGetName(conshdlr), "linear" ) != 0 )
39691  {
39692  if( printreason )
39693  SCIPwarningMessage(scip, "Dual information only available for pure LPs (only linear constraints).\n");
39694  return FALSE;
39695  }
39696  }
39697 
39698  return TRUE;
39699 }
39700 
39701 /** outputs dual solution from LP solver to file stream
39702  *
39703  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39704  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39705  *
39706  * @pre This method can be called in all stages but only prints dual information when called in \ref SCIP_STAGE_SOLVED
39707  */
39709  SCIP* scip, /**< SCIP data structure */
39710  FILE* file, /**< output file (or NULL for standard output) */
39711  SCIP_Bool printzeros /**< should variables set to zero be printed? */
39712  )
39713 {
39714  if( SCIPisDualSolAvailable(scip, TRUE) )
39715  {
39716  /* print dual solution */
39717  SCIP_CALL( printDualSol(scip, file, printzeros) );
39718  }
39719 
39720  return SCIP_OKAY;
39721 }
39722 
39723 
39724 /** outputs non-zero variables of solution representing a ray in original problem space to file stream
39725  *
39726  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39727  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39728  *
39729  * @pre This method can be called if SCIP is in one of the following stages:
39730  * - \ref SCIP_STAGE_PROBLEM
39731  * - \ref SCIP_STAGE_TRANSFORMED
39732  * - \ref SCIP_STAGE_INITPRESOLVE
39733  * - \ref SCIP_STAGE_PRESOLVING
39734  * - \ref SCIP_STAGE_EXITPRESOLVE
39735  * - \ref SCIP_STAGE_PRESOLVED
39736  * - \ref SCIP_STAGE_INITSOLVE
39737  * - \ref SCIP_STAGE_SOLVING
39738  * - \ref SCIP_STAGE_SOLVED
39739  * - \ref SCIP_STAGE_EXITSOLVE
39740  */
39742  SCIP* scip, /**< SCIP data structure */
39743  SCIP_SOL* sol, /**< primal solution representing ray */
39744  FILE* file, /**< output file (or NULL for standard output) */
39745  SCIP_Bool printzeros /**< should variables set to zero be printed? */
39746  )
39747 {
39748  assert(scip != NULL);
39749  assert(sol != NULL);
39750 
39751  SCIP_CALL( checkStage(scip, "SCIPprintRay", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39752 
39753  SCIP_CALL( SCIPsolPrintRay(sol, scip->set, scip->messagehdlr, scip->stat, scip->origprob, scip->transprob, file, printzeros) );
39754 
39755  return SCIP_OKAY;
39756 }
39757 
39758 /** gets number of feasible primal solutions stored in the solution storage in case the problem is transformed;
39759  * in case the problem stage is SCIP_STAGE_PROBLEM, the number of solution in the original solution candidate
39760  * storage is returned
39761  *
39762  * @return number of feasible primal solutions stored in the solution storage in case the problem is transformed; or
39763  * number of solution in the original solution candidate storage if the problem stage is SCIP_STAGE_PROBLEM
39764  *
39765  * @pre This method can be called if SCIP is in one of the following stages:
39766  * - \ref SCIP_STAGE_PROBLEM
39767  * - \ref SCIP_STAGE_TRANSFORMED
39768  * - \ref SCIP_STAGE_INITPRESOLVE
39769  * - \ref SCIP_STAGE_PRESOLVING
39770  * - \ref SCIP_STAGE_EXITPRESOLVE
39771  * - \ref SCIP_STAGE_PRESOLVED
39772  * - \ref SCIP_STAGE_INITSOLVE
39773  * - \ref SCIP_STAGE_SOLVING
39774  * - \ref SCIP_STAGE_SOLVED
39775  * - \ref SCIP_STAGE_EXITSOLVE
39776  */
39778  SCIP* scip /**< SCIP data structure */
39779  )
39780 {
39781  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNSols", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39782 
39783  switch( scip->set->stage )
39784  {
39785  case SCIP_STAGE_PROBLEM:
39786  return scip->origprimal->nsols;
39787 
39790  case SCIP_STAGE_PRESOLVING:
39792  case SCIP_STAGE_PRESOLVED:
39793  case SCIP_STAGE_INITSOLVE:
39794  case SCIP_STAGE_SOLVING:
39795  case SCIP_STAGE_SOLVED:
39796  case SCIP_STAGE_EXITSOLVE:
39797  return scip->primal->nsols;
39798 
39799  case SCIP_STAGE_INIT:
39801  case SCIP_STAGE_FREETRANS:
39802  default:
39803  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
39804  SCIPABORT();
39805  return -1; /*lint !e527*/
39806  } /*lint !e788*/
39807 }
39808 
39809 /** gets array of feasible primal solutions stored in the solution storage in case the problem is transformed; in case
39810  * if the problem stage is in SCIP_STAGE_PROBLEM, it returns the number array of solution candidate stored
39811  *
39812  * @return array of feasible primal solutions
39813  *
39814  * @pre This method can be called if SCIP is in one of the following stages:
39815  * - \ref SCIP_STAGE_PROBLEM
39816  * - \ref SCIP_STAGE_TRANSFORMED
39817  * - \ref SCIP_STAGE_INITPRESOLVE
39818  * - \ref SCIP_STAGE_PRESOLVING
39819  * - \ref SCIP_STAGE_EXITPRESOLVE
39820  * - \ref SCIP_STAGE_PRESOLVED
39821  * - \ref SCIP_STAGE_INITSOLVE
39822  * - \ref SCIP_STAGE_SOLVING
39823  * - \ref SCIP_STAGE_SOLVED
39824  * - \ref SCIP_STAGE_EXITSOLVE
39825  */
39827  SCIP* scip /**< SCIP data structure */
39828  )
39829 {
39830  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSols", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39831 
39832  switch( scip->set->stage )
39833  {
39834  case SCIP_STAGE_PROBLEM:
39835  return scip->origprimal->sols;
39836 
39839  case SCIP_STAGE_PRESOLVING:
39841  case SCIP_STAGE_PRESOLVED:
39842  case SCIP_STAGE_INITSOLVE:
39843  case SCIP_STAGE_SOLVING:
39844  case SCIP_STAGE_SOLVED:
39845  case SCIP_STAGE_EXITSOLVE:
39846  return scip->primal->sols;
39847 
39848  case SCIP_STAGE_INIT:
39850  case SCIP_STAGE_FREETRANS:
39851  case SCIP_STAGE_FREE:
39852  default:
39853  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
39854  return NULL;
39855  } /*lint !e788*/
39856 }
39857 
39858 /** gets best feasible primal solution found so far if the problem is transformed; in case the problem is in
39859  * SCIP_STAGE_PROBLEM it returns the best solution candidate, or NULL if no solution has been found or the candidate
39860  * store is empty;
39861  *
39862  * @return best feasible primal solution so far
39863  *
39864  * @pre This method can be called if SCIP is in one of the following stages:
39865  * - \ref SCIP_STAGE_PROBLEM
39866  * - \ref SCIP_STAGE_TRANSFORMED
39867  * - \ref SCIP_STAGE_INITPRESOLVE
39868  * - \ref SCIP_STAGE_PRESOLVING
39869  * - \ref SCIP_STAGE_EXITPRESOLVE
39870  * - \ref SCIP_STAGE_PRESOLVED
39871  * - \ref SCIP_STAGE_INITSOLVE
39872  * - \ref SCIP_STAGE_SOLVING
39873  * - \ref SCIP_STAGE_SOLVED
39874  * - \ref SCIP_STAGE_EXITSOLVE
39875  */
39877  SCIP* scip /**< SCIP data structure */
39878  )
39879 {
39880  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestSol", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39881  switch( scip->set->stage )
39882  {
39883  case SCIP_STAGE_INIT:
39884  return NULL;
39885  case SCIP_STAGE_PROBLEM:
39886  assert(scip->origprimal != NULL);
39887  if( scip->origprimal->nsols > 0 )
39888  {
39889  assert(scip->origprimal->sols != NULL);
39890  assert(scip->origprimal->sols[0] != NULL);
39891  return scip->origprimal->sols[0];
39892  }
39893  break;
39894 
39897  case SCIP_STAGE_PRESOLVING:
39899  case SCIP_STAGE_PRESOLVED:
39900  case SCIP_STAGE_INITSOLVE:
39901  case SCIP_STAGE_SOLVING:
39902  case SCIP_STAGE_SOLVED:
39903  case SCIP_STAGE_EXITSOLVE:
39904  assert(scip->primal != NULL);
39905  if( scip->primal->nsols > 0 )
39906  {
39907  assert(scip->primal->sols != NULL);
39908  assert(scip->primal->sols[0] != NULL);
39909  return scip->primal->sols[0];
39910  }
39911  break;
39912 
39914  case SCIP_STAGE_FREETRANS:
39915  case SCIP_STAGE_FREE:
39916  default:
39917  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
39918  return NULL;
39919  }
39920 
39921  return NULL;
39922 }
39923 
39924 /** outputs best feasible primal solution found so far to file stream
39925  *
39926  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39927  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39928  *
39929  * @pre This method can be called if SCIP is in one of the following stages:
39930  * - \ref SCIP_STAGE_INIT
39931  * - \ref SCIP_STAGE_PROBLEM
39932  * - \ref SCIP_STAGE_TRANSFORMED
39933  * - \ref SCIP_STAGE_INITPRESOLVE
39934  * - \ref SCIP_STAGE_PRESOLVING
39935  * - \ref SCIP_STAGE_EXITPRESOLVE
39936  * - \ref SCIP_STAGE_PRESOLVED
39937  * - \ref SCIP_STAGE_INITSOLVE
39938  * - \ref SCIP_STAGE_SOLVING
39939  * - \ref SCIP_STAGE_SOLVED
39940  * - \ref SCIP_STAGE_EXITSOLVE
39941  */
39943  SCIP* scip, /**< SCIP data structure */
39944  FILE* file, /**< output file (or NULL for standard output) */
39945  SCIP_Bool printzeros /**< should variables set to zero be printed? */
39946  )
39947 {
39948  SCIP_SOL* sol;
39949 
39950  SCIP_CALL( checkStage(scip, "SCIPprintBestSol", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39951 
39952  sol = SCIPgetBestSol(scip);
39953 
39954  if( sol == NULL )
39955  SCIPmessageFPrintInfo(scip->messagehdlr, file, "no solution available\n");
39956  else
39957  {
39958  SCIP_CALL( SCIPprintSol(scip, sol, file, printzeros) );
39959  }
39960 
39961  return SCIP_OKAY;
39962 }
39963 
39964 /** outputs best feasible primal solution found so far in transformed variables to file stream
39965  *
39966  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39967  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39968  *
39969  * @pre This method can be called if SCIP is in one of the following stages:
39970  * - \ref SCIP_STAGE_INIT
39971  * - \ref SCIP_STAGE_PROBLEM
39972  * - \ref SCIP_STAGE_TRANSFORMED
39973  * - \ref SCIP_STAGE_INITPRESOLVE
39974  * - \ref SCIP_STAGE_PRESOLVING
39975  * - \ref SCIP_STAGE_EXITPRESOLVE
39976  * - \ref SCIP_STAGE_PRESOLVED
39977  * - \ref SCIP_STAGE_INITSOLVE
39978  * - \ref SCIP_STAGE_SOLVING
39979  * - \ref SCIP_STAGE_SOLVED
39980  * - \ref SCIP_STAGE_EXITSOLVE
39981  */
39983  SCIP* scip, /**< SCIP data structure */
39984  FILE* file, /**< output file (or NULL for standard output) */
39985  SCIP_Bool printzeros /**< should variables set to zero be printed? */
39986  )
39987 {
39988  SCIP_SOL* sol;
39989 
39990  SCIP_CALL( checkStage(scip, "SCIPprintBestTransSol", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39991 
39992  sol = SCIPgetBestSol(scip);
39993 
39994  if( sol != NULL && SCIPsolIsOriginal(sol) )
39995  {
39996  SCIPerrorMessage("best solution is defined in original space - cannot print it as transformed solution\n");
39997  return SCIP_INVALIDCALL;
39998  }
39999 
40000  if( sol == NULL )
40001  SCIPmessageFPrintInfo(scip->messagehdlr, file, "no solution available\n");
40002  else
40003  {
40004  SCIP_CALL( SCIPprintTransSol(scip, sol, file, printzeros) );
40005  }
40006 
40007  return SCIP_OKAY;
40008 }
40009 
40010 /** try to round given solution
40011  *
40012  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40013  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40014  *
40015  * @pre This method can be called if SCIP is in one of the following stages:
40016  * - \ref SCIP_STAGE_SOLVING
40017  */
40019  SCIP* scip, /**< SCIP data structure */
40020  SCIP_SOL* sol, /**< primal solution */
40021  SCIP_Bool* success /**< pointer to store whether rounding was successful */
40022  )
40023 {
40024  SCIP_CALL( checkStage(scip, "SCIProundSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40025 
40026  if( SCIPsolIsOriginal(sol) )
40027  {
40028  SCIPerrorMessage("cannot round original space solution\n");
40029  return SCIP_INVALIDCALL;
40030  }
40031 
40032  SCIP_CALL( SCIPsolRound(sol, scip->set, scip->stat, scip->transprob, scip->tree, success) );
40033 
40034  return SCIP_OKAY;
40035 }
40036 
40037 /** retransforms solution to original problem space
40038  *
40039  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40040  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40041  *
40042  * @pre This method can be called if SCIP is in one of the following stages:
40043  * - \ref SCIP_STAGE_TRANSFORMED
40044  * - \ref SCIP_STAGE_INITPRESOLVE
40045  * - \ref SCIP_STAGE_PRESOLVING
40046  * - \ref SCIP_STAGE_EXITPRESOLVE
40047  * - \ref SCIP_STAGE_PRESOLVED
40048  * - \ref SCIP_STAGE_INITSOLVE
40049  * - \ref SCIP_STAGE_SOLVING
40050  * - \ref SCIP_STAGE_SOLVED
40051  * - \ref SCIP_STAGE_EXITSOLVE
40052  * - \ref SCIP_STAGE_FREETRANS
40053  */
40055  SCIP* scip, /**< SCIP data structure */
40056  SCIP_SOL* sol /**< primal CIP solution */
40057  )
40058 {
40059  SCIP_CALL( checkStage(scip, "SCIPretransformSol", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
40060 
40061  switch ( SCIPsolGetOrigin(sol) )
40062  {
40064  /* nothing to do */
40065  return SCIP_OKAY;
40066 
40067  case SCIP_SOLORIGIN_LPSOL:
40068  case SCIP_SOLORIGIN_NLPSOL:
40071 
40072  /* first unlink solution */
40073  SCIP_CALL( SCIPunlinkSol(scip, sol) );
40074 
40075  /*lint -fallthrough*/
40076  case SCIP_SOLORIGIN_ZERO:
40077  {
40078  SCIP_Bool hasinfval;
40079 
40080  SCIP_CALL( SCIPsolRetransform(sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
40081  break;
40082  }
40085  SCIPerrorMessage("unknown solution origin.\n");
40086  return SCIP_INVALIDCALL;
40087 
40088  default:
40089  /* note that this is in an internal SCIP error since all solution origins are covert in the switch above */
40090  SCIPerrorMessage("invalid solution origin <%d>\n", SCIPsolGetOrigin(sol));
40091  return SCIP_ERROR;
40092  }
40093 
40094  return SCIP_OKAY;
40095 }
40096 
40097 /** reads a given solution file, problem has to be transformed in advance
40098  *
40099  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40100  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40101  *
40102  * @pre This method can be called if SCIP is in one of the following stages:
40103  * - \ref SCIP_STAGE_PROBLEM
40104  * - \ref SCIP_STAGE_TRANSFORMED
40105  * - \ref SCIP_STAGE_INITPRESOLVE
40106  * - \ref SCIP_STAGE_PRESOLVING
40107  * - \ref SCIP_STAGE_EXITPRESOLVE
40108  * - \ref SCIP_STAGE_PRESOLVED
40109  * - \ref SCIP_STAGE_INITSOLVE
40110  * - \ref SCIP_STAGE_SOLVING
40111  */
40113  SCIP* scip, /**< SCIP data structure */
40114  const char* filename /**< name of the input file */
40115  )
40116 {
40117  SCIP_CALL( checkStage(scip, "SCIPreadSol", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40118 
40119  /* we pass the reading of the solution file on to reader_sol via the following call */
40120  SCIP_CALL( SCIPreadProb(scip, filename, "sol") );
40121 
40122  return SCIP_OKAY;
40123 }
40124 
40125 /** reads a given solution file and store the solution values in the given solution pointer */
40126 static
40128  SCIP* scip, /**< SCIP data structure */
40129  const char* filename, /**< name of the input file */
40130  SCIP_SOL* sol, /**< solution pointer */
40131  SCIP_Bool* partial, /**< pointer to store if the solution is partial (or NULL, if not needed) */
40132  SCIP_Bool* error /**< pointer store if an error occured */
40133  )
40134 {
40135  SCIP_FILE* file;
40136  SCIP_Bool unknownvariablemessage;
40137  SCIP_Bool localpartial;
40138  int lineno;
40139 
40140  assert(scip != NULL);
40141  assert(sol != NULL);
40142  assert(error != NULL);
40143 
40144  /* open input file */
40145  file = SCIPfopen(filename, "r");
40146  if( file == NULL )
40147  {
40148  SCIPerrorMessage("cannot open file <%s> for reading\n", filename);
40149  SCIPprintSysError(filename);
40150  return SCIP_NOFILE;
40151  }
40152 
40153  *error = FALSE;
40154  localpartial = SCIPsolIsPartial(sol);
40155 
40156  unknownvariablemessage = FALSE;
40157  lineno = 0;
40158 
40159  /* read the file */
40160  while( !SCIPfeof(file) && !(*error) )
40161  {
40162  char buffer[SCIP_MAXSTRLEN];
40163  char varname[SCIP_MAXSTRLEN];
40164  char valuestring[SCIP_MAXSTRLEN];
40165  char objstring[SCIP_MAXSTRLEN];
40166  SCIP_VAR* var;
40167  SCIP_Real value;
40168  int nread;
40169 
40170  /* get next line */
40171  if( SCIPfgets(buffer, (int) sizeof(buffer), file) == NULL )
40172  break;
40173  lineno++;
40174 
40175  /* there are some lines which may preceed the solution information */
40176  if( strncasecmp(buffer, "solution status:", 16) == 0 || strncasecmp(buffer, "objective value:", 16) == 0 ||
40177  strncasecmp(buffer, "Log started", 11) == 0 || strncasecmp(buffer, "Variable Name", 13) == 0 ||
40178  strncasecmp(buffer, "All other variables", 19) == 0 || strncasecmp(buffer, "\n", 1) == 0 ||
40179  strncasecmp(buffer, "NAME", 4) == 0 || strncasecmp(buffer, "ENDATA", 6) == 0 ) /* allow parsing of SOL-format on the MIPLIB 2003 pages */
40180  continue;
40181 
40182  /* parse the line */
40183  /* cppcheck-suppress invalidscanf */
40184  nread = sscanf(buffer, "%s %s %s\n", varname, valuestring, objstring);
40185  if( nread < 2 )
40186  {
40187  SCIPerrorMessage("Invalid input line %d in solution file <%s>: <%s>.\n", lineno, filename, buffer);
40188  *error = TRUE;
40189  break;
40190  }
40191 
40192  /* find the variable */
40193  var = SCIPfindVar(scip, varname);
40194  if( var == NULL )
40195  {
40196  if( !unknownvariablemessage )
40197  {
40198  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "unknown variable <%s> in line %d of solution file <%s>\n",
40199  varname, lineno, filename);
40200  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, " (further unknown variables are ignored)\n");
40201  unknownvariablemessage = TRUE;
40202  }
40203  continue;
40204  }
40205 
40206  /* cast the value */
40207  if( strncasecmp(valuestring, "inv", 3) == 0 )
40208  continue;
40209  else if( strncasecmp(valuestring, "+inf", 4) == 0 || strncasecmp(valuestring, "inf", 3) == 0 )
40210  value = SCIPinfinity(scip);
40211  else if( strncasecmp(valuestring, "-inf", 4) == 0 )
40212  value = -SCIPinfinity(scip);
40213  else if( strncasecmp(valuestring, "unknown", 7) == 0 )
40214  {
40215  value = SCIP_UNKNOWN;
40216  localpartial = TRUE;
40217  }
40218  else
40219  {
40220  nread = sscanf(valuestring, "%lf", &value);
40221  if( nread != 1 )
40222  {
40223  SCIPerrorMessage("Invalid solution value <%s> for variable <%s> in line %d of solution file <%s>.\n",
40224  valuestring, varname, lineno, filename);
40225  *error = TRUE;
40226  break;
40227  }
40228  }
40229 
40230  /* set the solution value of the variable, if not multiaggregated */
40232  {
40233  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "ignored solution value for multiaggregated variable <%s>\n", SCIPvarGetName(var));
40234  }
40235  else
40236  {
40237  SCIP_RETCODE retcode;
40238 
40239  retcode = SCIPsetSolVal(scip, sol, var, value);
40240 
40241  if( retcode == SCIP_INVALIDDATA )
40242  {
40244  {
40245  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "ignored conflicting solution value for fixed variable <%s>\n",
40246  SCIPvarGetName(var));
40247  }
40248  else
40249  {
40250  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "ignored solution value for multiaggregated variable <%s>\n",
40251  SCIPvarGetName(var));
40252  }
40253  }
40254  else
40255  {
40256  SCIP_CALL_FINALLY( retcode, SCIPfclose(file) );
40257  }
40258  }
40259  }
40260 
40261  /* close input file */
40262  SCIPfclose(file);
40263 
40264  if( localpartial && !SCIPsolIsPartial(sol) )
40265  {
40266  if( SCIPgetStage(scip) == SCIP_STAGE_PROBLEM )
40267  {
40268  SCIP_CALL( SCIPsolMarkPartial(sol, scip->set, scip->stat, scip->origprob->vars, scip->origprob->nvars) );
40269  }
40270  else
40271  *error = TRUE;
40272  }
40273 
40274  if( partial != NULL )
40275  *partial = localpartial;
40276 
40277  return SCIP_OKAY;
40278 }
40279 
40280 /** reads a given xml solution file and store the solution values in the given solution pointer */
40281 static
40283  SCIP* scip, /**< SCIP data structure */
40284  const char* filename, /**< name of the input file */
40285  SCIP_SOL* sol, /**< solution pointer */
40286  SCIP_Bool* partial, /**< pointer to store if the solution is partial (or NULL if not needed) */
40287  SCIP_Bool* error /**< pointer store if an error occured */
40288  )
40289 {
40290  SCIP_Bool unknownvariablemessage;
40291  SCIP_Bool localpartial;
40292  XML_NODE* start;
40293  const XML_NODE* varsnode;
40294  const XML_NODE* varnode;
40295  const char* tag;
40296 
40297  assert(scip != NULL);
40298  assert(sol != NULL);
40299  assert(error != NULL);
40300 
40301  /* read xml file */
40302  start = xmlProcess(filename);
40303 
40304  if( start == NULL )
40305  {
40306  SCIPerrorMessage("Some error occured during parsing the XML solution file.\n");
40307  return SCIP_READERROR;
40308  }
40309 
40310  *error = FALSE;
40311  localpartial = SCIPsolIsPartial(sol);
40312 
40313  /* find variable sections */
40314  tag = "variables";
40315  varsnode = xmlFindNodeMaxdepth(start, tag, 0, 3);
40316  if( varsnode == NULL )
40317  {
40318  /* free xml data */
40319  xmlFreeNode(start);
40320 
40321  SCIPerrorMessage("Variable section not found.\n");
40322  return SCIP_READERROR;
40323  }
40324 
40325  /* loop through all variables */
40326  unknownvariablemessage = FALSE;
40327  for( varnode = xmlFirstChild(varsnode); varnode != NULL; varnode = xmlNextSibl(varnode) )
40328  {
40329  SCIP_VAR* var;
40330  const char* varname;
40331  const char* valuestring;
40332  SCIP_Real value;
40333  int nread;
40334 
40335  /* find variable name */
40336  varname = xmlGetAttrval(varnode, "name");
40337  if( varname == NULL )
40338  {
40339  SCIPerrorMessage("Attribute \"name\" of variable not found.\n");
40340  *error = TRUE;
40341  break;
40342  }
40343 
40344  /* find the variable */
40345  var = SCIPfindVar(scip, varname);
40346  if( var == NULL )
40347  {
40348  if( !unknownvariablemessage )
40349  {
40350  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "unknown variable <%s> of solution file <%s>\n",
40351  varname, filename);
40352  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, " (further unknown variables are ignored)\n");
40353  unknownvariablemessage = TRUE;
40354  }
40355  continue;
40356  }
40357 
40358  /* find value of variable */
40359  valuestring = xmlGetAttrval(varnode, "value");
40360  if( valuestring == NULL )
40361  {
40362  SCIPerrorMessage("Attribute \"value\" of variable not found.\n");
40363  *error = TRUE;
40364  break;
40365  }
40366 
40367  /* cast the value */
40368  if( strncasecmp(valuestring, "inv", 3) == 0 )
40369  continue;
40370  else if( strncasecmp(valuestring, "+inf", 4) == 0 || strncasecmp(valuestring, "inf", 3) == 0 )
40371  value = SCIPinfinity(scip);
40372  else if( strncasecmp(valuestring, "-inf", 4) == 0 )
40373  value = -SCIPinfinity(scip);
40374  else if( strncasecmp(valuestring, "unknown", 7) == 0 )
40375  {
40376  value = SCIP_UNKNOWN;
40377  localpartial = TRUE;
40378  }
40379  else
40380  {
40381  nread = sscanf(valuestring, "%lf", &value);
40382  if( nread != 1 )
40383  {
40384  SCIPwarningMessage(scip, "invalid solution value <%s> for variable <%s> in XML solution file <%s>\n", valuestring, varname, filename);
40385  *error = TRUE;
40386  break;
40387  }
40388  }
40389 
40390  /* set the solution value of the variable, if not multiaggregated */
40392  {
40393  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "ignored solution value for multiaggregated variable <%s>\n", SCIPvarGetName(var));
40394  }
40395  else
40396  {
40397  SCIP_RETCODE retcode;
40398  retcode = SCIPsetSolVal(scip, sol, var, value);
40399 
40400  if( retcode == SCIP_INVALIDDATA )
40401  {
40403  {
40404  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "ignored conflicting solution value for fixed variable <%s>\n",
40405  SCIPvarGetName(var));
40406  }
40407  else
40408  {
40409  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "ignored solution value for multiaggregated variable <%s>\n",
40410  SCIPvarGetName(var));
40411  }
40412  }
40413  else
40414  {
40415  SCIP_CALL( retcode );
40416  }
40417  }
40418  }
40419 
40420  /* free xml data */
40421  xmlFreeNode(start);
40422 
40423  if( localpartial && !SCIPsolIsPartial(sol) )
40424  {
40425  if( SCIPgetStage(scip) == SCIP_STAGE_PROBLEM )
40426  {
40427  SCIP_CALL( SCIPsolMarkPartial(sol, scip->set, scip->stat, scip->origprob->vars, scip->origprob->nvars) );
40428  }
40429  else
40430  *error = TRUE;
40431  }
40432 
40433  if( partial != NULL )
40434  *partial = localpartial;
40435 
40436  return SCIP_OKAY;
40437 }
40438 
40439 /** reads a given solution file and store the solution values in the given solution pointer
40440  *
40441  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40442  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40443  *
40444  * @pre This method can be called if SCIP is in one of the following stages:
40445  * - \ref SCIP_STAGE_PROBLEM
40446  * - \ref SCIP_STAGE_TRANSFORMED
40447  * - \ref SCIP_STAGE_INITPRESOLVE
40448  * - \ref SCIP_STAGE_PRESOLVING
40449  * - \ref SCIP_STAGE_EXITPRESOLVE
40450  * - \ref SCIP_STAGE_PRESOLVED
40451  * - \ref SCIP_STAGE_INITSOLVE
40452  * - \ref SCIP_STAGE_SOLVING
40453  */
40455  SCIP* scip, /**< SCIP data structure */
40456  const char* filename, /**< name of the input file */
40457  SCIP_SOL* sol, /**< solution pointer */
40458  SCIP_Bool xml, /**< true, iff the given solution in written in XML */
40459  SCIP_Bool* partial, /**< pointer to store if the solution is partial */
40460  SCIP_Bool* error /**< pointer store if an error occured */
40461  )
40462 {
40463  SCIP_CALL( checkStage(scip, "SCIPreadSolFile", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40464 
40465  if( xml )
40466  {
40467  SCIP_CALL( readXmlSolFile(scip, filename, sol, partial, error) );
40468  }
40469  else
40470  {
40471  SCIP_CALL( readSolFile(scip, filename, sol, partial, error) );
40472  }
40473 
40474  return SCIP_OKAY;
40475 }
40476 
40477 /** adds feasible primal solution to solution storage by copying it
40478  *
40479  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40480  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40481  *
40482  * @pre This method can be called if SCIP is in one of the following stages:
40483  * - \ref SCIP_STAGE_PROBLEM
40484  * - \ref SCIP_STAGE_TRANSFORMED
40485  * - \ref SCIP_STAGE_INITPRESOLVE
40486  * - \ref SCIP_STAGE_PRESOLVING
40487  * - \ref SCIP_STAGE_EXITPRESOLVE
40488  * - \ref SCIP_STAGE_PRESOLVED
40489  * - \ref SCIP_STAGE_SOLVING
40490  * - \ref SCIP_STAGE_FREETRANS
40491  *
40492  * @note Do not call during propagation, use heur_trysol instead.
40493  */
40495  SCIP* scip, /**< SCIP data structure */
40496  SCIP_SOL* sol, /**< primal CIP solution */
40497  SCIP_Bool* stored /**< stores whether given solution was good enough to keep */
40498  )
40499 {
40500  SCIP_CALL( checkStage(scip, "SCIPaddSol", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE) );
40501 
40502  switch( scip->set->stage )
40503  {
40504  case SCIP_STAGE_PROBLEM:
40505  case SCIP_STAGE_FREETRANS:
40506  assert(SCIPsolIsOriginal(sol));
40507  SCIP_CALL( SCIPprimalAddOrigSol(scip->origprimal, scip->mem->probmem, scip->set, scip->stat, scip->origprob, sol, stored) );
40508  return SCIP_OKAY;
40509 
40512  case SCIP_STAGE_PRESOLVING:
40514  /* if the solution is added during presolving and it is not defined on original variables,
40515  * presolving operations will destroy its validity, so we retransform it to the original space
40516  */
40517  if( !SCIPsolIsOriginal(sol) )
40518  {
40519  SCIP_SOL* bestsol = SCIPgetBestSol(scip);
40520  SCIP_SOL* tmpsol = sol;
40521  SCIP_Bool hasinfval;
40522 
40523  SCIP_CALL( SCIPcreateSolCopy(scip, &tmpsol, sol) );
40524 
40525  SCIP_CALL( SCIPsolUnlink(tmpsol, scip->set, scip->transprob) );
40526  SCIP_CALL( SCIPsolRetransform(tmpsol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
40527 
40528  SCIP_CALL( SCIPprimalAddSolFree(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
40529  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter,
40530  &tmpsol, stored) );
40531 
40532  if( *stored && (bestsol != SCIPgetBestSol(scip)) )
40533  {
40534  SCIPstoreSolutionGap(scip);
40535  }
40536 
40537  return SCIP_OKAY;
40538  }
40539  /*lint -fallthrough*/
40540  case SCIP_STAGE_PRESOLVED:
40541  case SCIP_STAGE_SOLVING:
40542  {
40543  SCIP_SOL* bestsol = SCIPgetBestSol(scip);
40544 
40545  SCIP_CALL( SCIPprimalAddSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
40546  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, sol,
40547  stored) );
40548 
40549  /* @todo use solution index rather than pointer */
40550  if( *stored && (bestsol != SCIPgetBestSol(scip)) )
40551  {
40552  SCIPstoreSolutionGap(scip);
40553  }
40554 
40555  return SCIP_OKAY;
40556  }
40558  case SCIP_STAGE_INITSOLVE:
40559  case SCIP_STAGE_SOLVED:
40560  case SCIP_STAGE_EXITSOLVE:
40561  default:
40562  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
40563  return SCIP_INVALIDCALL;
40564  } /*lint !e788*/
40565 }
40566 
40567 /** adds primal solution to solution storage, frees the solution afterwards
40568  *
40569  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40570  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40571  *
40572  * @pre This method can be called if SCIP is in one of the following stages:
40573  * - \ref SCIP_STAGE_PROBLEM
40574  * - \ref SCIP_STAGE_TRANSFORMED
40575  * - \ref SCIP_STAGE_INITPRESOLVE
40576  * - \ref SCIP_STAGE_PRESOLVING
40577  * - \ref SCIP_STAGE_EXITPRESOLVE
40578  * - \ref SCIP_STAGE_PRESOLVED
40579  * - \ref SCIP_STAGE_SOLVING
40580  * - \ref SCIP_STAGE_FREETRANS
40581  *
40582  * @note Do not call during propagation, use heur_trysol instead.
40583  */
40585  SCIP* scip, /**< SCIP data structure */
40586  SCIP_SOL** sol, /**< pointer to primal CIP solution; is cleared in function call */
40587  SCIP_Bool* stored /**< stores whether given solution was good enough to keep */
40588  )
40589 {
40590  SCIP_CALL( checkStage(scip, "SCIPaddSolFree", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE) );
40591 
40592  switch( scip->set->stage )
40593  {
40594  case SCIP_STAGE_PROBLEM:
40595  case SCIP_STAGE_FREETRANS:
40596  assert(SCIPsolIsOriginal(*sol));
40597  SCIP_CALL( SCIPprimalAddOrigSolFree(scip->origprimal, scip->mem->probmem, scip->set, scip->stat, scip->origprob, sol, stored) );
40598  return SCIP_OKAY;
40599 
40602  case SCIP_STAGE_PRESOLVING:
40604  /* if the solution is added during presolving and it is not defined on original variables,
40605  * presolving operations will destroy its validity, so we retransform it to the original space
40606  */
40607  if( !SCIPsolIsOriginal(*sol) )
40608  {
40609  SCIP_Bool hasinfval;
40610 
40611  SCIP_CALL( SCIPsolUnlink(*sol, scip->set, scip->transprob) );
40612  SCIP_CALL( SCIPsolRetransform(*sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
40613  }
40614  /*lint -fallthrough*/
40615  case SCIP_STAGE_PRESOLVED:
40616  case SCIP_STAGE_SOLVING:
40617  {
40618  SCIP_SOL* bestsol = SCIPgetBestSol(scip);
40619 
40620  SCIP_CALL( SCIPprimalAddSolFree(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
40621  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter,
40622  sol, stored) );
40623 
40624  if( *stored )
40625  {
40626  if( bestsol != SCIPgetBestSol(scip) )
40627  {
40628  assert(SCIPgetBestSol(scip) != NULL);
40629  SCIPstoreSolutionGap(scip);
40630  }
40631  }
40632 
40633  return SCIP_OKAY;
40634  }
40636  case SCIP_STAGE_INITSOLVE:
40637  case SCIP_STAGE_SOLVED:
40638  case SCIP_STAGE_EXITSOLVE:
40639  default:
40640  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
40641  return SCIP_INVALIDCALL;
40642  } /*lint !e788*/
40643 }
40644 
40645 /** adds current LP/pseudo solution to solution storage
40646  *
40647  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40648  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40649  *
40650  * @pre This method can be called if SCIP is in one of the following stages:
40651  * - \ref SCIP_STAGE_PRESOLVED
40652  * - \ref SCIP_STAGE_SOLVING
40653  */
40655  SCIP* scip, /**< SCIP data structure */
40656  SCIP_HEUR* heur, /**< heuristic that found the solution */
40657  SCIP_Bool* stored /**< stores whether given solution was good enough to keep */
40658  )
40659 {
40660  SCIP_SOL* bestsol;
40661 
40662  SCIP_CALL( checkStage(scip, "SCIPaddCurrentSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40663 
40664  bestsol = SCIPgetBestSol(scip);
40665 
40666  SCIP_CALL( SCIPprimalAddCurrentSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
40667  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, heur,
40668  stored) );
40669 
40670  if( *stored )
40671  {
40672  if( bestsol != SCIPgetBestSol(scip) )
40673  SCIPstoreSolutionGap(scip);
40674  }
40675 
40676  return SCIP_OKAY;
40677 }
40678 
40679 /** checks solution for feasibility; if possible, adds it to storage by copying
40680  *
40681  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40682  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40683  *
40684  * @pre This method can be called if SCIP is in one of the following stages:
40685  * - \ref SCIP_STAGE_TRANSFORMED
40686  * - \ref SCIP_STAGE_INITPRESOLVE
40687  * - \ref SCIP_STAGE_PRESOLVING
40688  * - \ref SCIP_STAGE_EXITPRESOLVE
40689  * - \ref SCIP_STAGE_PRESOLVED
40690  * - \ref SCIP_STAGE_SOLVING
40691  *
40692  * @note Do not call during propagation, use heur_trysol instead.
40693  */
40695  SCIP* scip, /**< SCIP data structure */
40696  SCIP_SOL* sol, /**< primal CIP solution */
40697  SCIP_Bool printreason, /**< Should all reasons of violation be printed? */
40698  SCIP_Bool completely, /**< Should all violations be checked? */
40699  SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
40700  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
40701  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
40702  SCIP_Bool* stored /**< stores whether given solution was feasible and good enough to keep */
40703  )
40704 {
40705  SCIP_SOL* bestsol;
40706 
40707  assert(sol != NULL);
40708  assert(stored != NULL);
40709 
40710  SCIP_CALL( checkStage(scip, "SCIPtrySol", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40711 
40712  bestsol = SCIPgetBestSol(scip);
40713 
40714  if( !printreason )
40715  completely = FALSE;
40716 
40717  /* we cannot check partial solutions */
40718  if( SCIPsolIsPartial(sol) )
40719  {
40720  SCIPerrorMessage("Cannot check feasibility of partial solutions.\n");
40721  return SCIP_INVALIDDATA;
40722  }
40723 
40724  /* if the solution is added during presolving and it is not defined on original variables,
40725  * presolving operations will destroy its validity, so we retransform it to the original space
40726  */
40727  if( scip->set->stage == SCIP_STAGE_PRESOLVING && !SCIPsolIsOriginal(sol) )
40728  {
40729  SCIP_Bool hasinfval;
40730 
40731  SCIP_CALL( SCIPsolUnlink(sol, scip->set, scip->transprob) );
40732  SCIP_CALL( SCIPsolRetransform(sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
40733  }
40734 
40735  if( SCIPsolIsOriginal(sol) )
40736  {
40737  SCIP_Bool feasible;
40738 
40739  /* SCIPprimalTrySol() can only be called on transformed solutions; therefore check solutions in original problem
40740  * including modifiable constraints */
40741  SCIP_CALL( checkSolOrig(scip, sol, &feasible, printreason, completely, checkbounds, checkintegrality, checklprows, TRUE) );
40742  if( feasible )
40743  {
40744  SCIP_CALL( SCIPprimalAddSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
40745  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter,
40746  sol, stored) );
40747 
40748  if( *stored )
40749  {
40750  if( bestsol != SCIPgetBestSol(scip) )
40751  SCIPstoreSolutionGap(scip);
40752  }
40753  }
40754  else
40755  *stored = FALSE;
40756  }
40757  else
40758  {
40759  SCIP_CALL( SCIPprimalTrySol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->origprob,
40760  scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, sol, printreason,
40761  completely, checkbounds, checkintegrality, checklprows, stored) );
40762 
40763  if( *stored )
40764  {
40765  if( bestsol != SCIPgetBestSol(scip) )
40766  SCIPstoreSolutionGap(scip);
40767  }
40768  }
40769 
40770  return SCIP_OKAY;
40771 }
40772 
40773 /** checks primal solution; if feasible, adds it to storage; solution is freed afterwards
40774  *
40775  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40776  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40777  *
40778  * @pre This method can be called if SCIP is in one of the following stages:
40779  * - \ref SCIP_STAGE_TRANSFORMED
40780  * - \ref SCIP_STAGE_INITPRESOLVE
40781  * - \ref SCIP_STAGE_PRESOLVING
40782  * - \ref SCIP_STAGE_EXITPRESOLVE
40783  * - \ref SCIP_STAGE_PRESOLVED
40784  * - \ref SCIP_STAGE_SOLVING
40785  *
40786  * @note Do not call during propagation, use heur_trysol instead.
40787  */
40789  SCIP* scip, /**< SCIP data structure */
40790  SCIP_SOL** sol, /**< pointer to primal CIP solution; is cleared in function call */
40791  SCIP_Bool printreason, /**< Should all reasons of violations be printed */
40792  SCIP_Bool completely, /**< Should all violation be checked? */
40793  SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
40794  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
40795  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
40796  SCIP_Bool* stored /**< stores whether solution was feasible and good enough to keep */
40797  )
40798 {
40799  SCIP_SOL* bestsol;
40800 
40801  assert(stored != NULL);
40802  assert(sol != NULL);
40803 
40804  SCIP_CALL( checkStage(scip, "SCIPtrySolFree", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40805 
40806  bestsol = SCIPgetBestSol(scip);
40807 
40808  if( !printreason )
40809  completely = FALSE;
40810 
40811  /* we cannot check partial solutions */
40812  if( SCIPsolIsPartial(*sol) )
40813  {
40814  SCIPerrorMessage("Cannot check feasibility of partial solutions.\n");
40815  return SCIP_INVALIDDATA;
40816  }
40817 
40818  /* if the solution is added during presolving and it is not defined on original variables,
40819  * presolving operations will destroy its validity, so we retransform it to the original space
40820  */
40821  if( scip->set->stage == SCIP_STAGE_PRESOLVING && !SCIPsolIsOriginal(*sol) )
40822  {
40823  SCIP_Bool hasinfval;
40824 
40825  SCIP_CALL( SCIPsolUnlink(*sol, scip->set, scip->transprob) );
40826  SCIP_CALL( SCIPsolRetransform(*sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
40827  }
40828 
40829  if( SCIPsolIsOriginal(*sol) )
40830  {
40831  SCIP_Bool feasible;
40832 
40833  /* SCIPprimalTrySol() can only be called on transformed solutions; therefore check solutions in original problem
40834  * including modifiable constraints
40835  */
40836  SCIP_CALL( checkSolOrig(scip, *sol, &feasible, printreason, completely, checkbounds, checkintegrality, checklprows, TRUE) );
40837 
40838  if( feasible )
40839  {
40840  SCIP_CALL( SCIPprimalAddSolFree(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
40841  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter,
40842  sol, stored) );
40843 
40844  if( *stored )
40845  {
40846  if( bestsol != SCIPgetBestSol(scip) )
40847  SCIPstoreSolutionGap(scip);
40848  }
40849  }
40850  else
40851  {
40852  SCIP_CALL( SCIPsolFree(sol, scip->mem->probmem, scip->primal) );
40853  *stored = FALSE;
40854  }
40855  }
40856  else
40857  {
40858  SCIP_CALL( SCIPprimalTrySolFree(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
40859  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter,
40860  sol, printreason, completely, checkbounds, checkintegrality, checklprows, stored) );
40861 
40862  if( *stored )
40863  {
40864  if( bestsol != SCIPgetBestSol(scip) )
40865  SCIPstoreSolutionGap(scip);
40866  }
40867  }
40868 
40869  return SCIP_OKAY;
40870 }
40871 
40872 /** checks current LP/pseudo solution for feasibility; if possible, adds it to storage
40873  *
40874  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40875  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40876  *
40877  * @pre This method can be called if SCIP is in one of the following stages:
40878  * - \ref SCIP_STAGE_PRESOLVED
40879  * - \ref SCIP_STAGE_SOLVING
40880  */
40882  SCIP* scip, /**< SCIP data structure */
40883  SCIP_HEUR* heur, /**< heuristic that found the solution */
40884  SCIP_Bool printreason, /**< Should all reasons of violations be printed? */
40885  SCIP_Bool completely, /**< Should all violation be checked? */
40886  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
40887  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
40888  SCIP_Bool* stored /**< stores whether given solution was feasible and good enough to keep */
40889  )
40890 {
40891  SCIP_SOL* bestsol;
40892 
40893  SCIP_CALL( checkStage(scip, "SCIPtryCurrentSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40894 
40895  bestsol = SCIPgetBestSol(scip);
40896 
40897  if( !printreason )
40898  completely = FALSE;
40899 
40900  SCIP_CALL( SCIPprimalTryCurrentSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
40901  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, heur,
40902  printreason, completely, checkintegrality, checklprows, stored) );
40903 
40904  if( *stored )
40905  {
40906  if( bestsol != SCIPgetBestSol(scip) )
40907  SCIPstoreSolutionGap(scip);
40908  }
40909 
40910  return SCIP_OKAY;
40911 }
40912 
40913 /** returns all partial solutions
40914  *
40915  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40916  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40917  *
40918  * @pre This method can be called if SCIP is in one of the following stages:
40919  * - \ref SCIP_STAGE_PROBLEM
40920  * - \ref SCIP_STAGE_PRESOLVING
40921  * - \ref SCIP_STAGE_SOLVING
40922  * - \ref SCIP_STAGE_SOLVED
40923  */
40925  SCIP* scip /**< SCIP data structure */
40926  )
40927 {
40928  assert(scip != NULL);
40929 
40930  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPartialSols", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40931 
40932  return scip->origprimal->partialsols;
40933 
40934 }
40935 
40936 /** returns number of partial solutions
40937  *
40938  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40939  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40940  *
40941  * @pre This method can be called if SCIP is in one of the following stages:
40942  * - \ref SCIP_STAGE_PROBLEM
40943  * - \ref SCIP_STAGE_PRESOLVING
40944  * - \ref SCIP_STAGE_SOLVING
40945  * - \ref SCIP_STAGE_SOLVED
40946  */
40948  SCIP* scip /**< SCIP data structure */
40949  )
40950 {
40951  assert(scip != NULL);
40952 
40953  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPartialSols", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40954 
40955  return scip->origprimal->npartialsols;
40956 }
40957 
40958 /** checks solution for feasibility without adding it to the solution store
40959  *
40960  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40961  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40962  *
40963  * @pre This method can be called if SCIP is in one of the following stages:
40964  * - \ref SCIP_STAGE_PROBLEM
40965  * - \ref SCIP_STAGE_TRANSFORMED
40966  * - \ref SCIP_STAGE_INITPRESOLVE
40967  * - \ref SCIP_STAGE_PRESOLVING
40968  * - \ref SCIP_STAGE_EXITPRESOLVE
40969  * - \ref SCIP_STAGE_PRESOLVED
40970  * - \ref SCIP_STAGE_INITSOLVE
40971  * - \ref SCIP_STAGE_SOLVING
40972  * - \ref SCIP_STAGE_SOLVED
40973  */
40975  SCIP* scip, /**< SCIP data structure */
40976  SCIP_SOL* sol, /**< primal CIP solution */
40977  SCIP_Bool printreason, /**< Should all reasons of violations be printed? */
40978  SCIP_Bool completely, /**< Should all violation be checked? */
40979  SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
40980  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
40981  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
40982  SCIP_Bool* feasible /**< stores whether given solution is feasible */
40983  )
40984 {
40985  SCIP_CALL( checkStage(scip, "SCIPcheckSol", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40986 
40987  /* return immediately if the solution is of type partial */
40988  if( SCIPsolIsPartial(sol) )
40989  {
40990  SCIPerrorMessage("Cannot check feasibility of partial solutions.");
40991  return SCIP_INVALIDDATA;
40992  }
40993 
40994  /* if we want to solve exactly, the constraint handlers cannot rely on the LP's feasibility */
40995  checklprows = checklprows || scip->set->misc_exactsolve;
40996 
40997  if( !printreason )
40998  completely = FALSE;
40999 
41000  if( SCIPsolIsOriginal(sol) )
41001  {
41002  /* SCIPsolCheck() can only be called on transformed solutions */
41003  SCIP_CALL( checkSolOrig(scip, sol, feasible, printreason, completely, checkbounds, checkintegrality, checklprows, FALSE) );
41004  }
41005  else
41006  {
41007  SCIP_CALL( SCIPsolCheck(sol, scip->set, scip->messagehdlr, scip->mem->probmem, scip->stat, scip->transprob,
41008  printreason, completely, checkbounds, checkintegrality, checklprows, feasible) );
41009  }
41010 
41011  return SCIP_OKAY;
41012 }
41013 
41014 /** checks solution for feasibility in original problem without adding it to the solution store;
41015  * this method is used to double check a solution in order to validate the presolving process
41016  *
41017  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41018  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41019  *
41020  * @pre This method can be called if SCIP is in one of the following stages:
41021  * - \ref SCIP_STAGE_PROBLEM
41022  * - \ref SCIP_STAGE_TRANSFORMED
41023  * - \ref SCIP_STAGE_INITPRESOLVE
41024  * - \ref SCIP_STAGE_PRESOLVING
41025  * - \ref SCIP_STAGE_EXITPRESOLVE
41026  * - \ref SCIP_STAGE_PRESOLVED
41027  * - \ref SCIP_STAGE_INITSOLVE
41028  * - \ref SCIP_STAGE_SOLVING
41029  * - \ref SCIP_STAGE_SOLVED
41030  */
41032  SCIP* scip, /**< SCIP data structure */
41033  SCIP_SOL* sol, /**< primal CIP solution */
41034  SCIP_Bool* feasible, /**< stores whether given solution is feasible */
41035  SCIP_Bool printreason, /**< should the reason for the violation be printed? */
41036  SCIP_Bool completely /**< should all violation be checked? */
41037  )
41038 {
41039  assert(scip != NULL);
41040  assert(sol != NULL);
41041  assert(feasible != NULL);
41042 
41043  SCIP_CALL( checkStage(scip, "SCIPcheckSolOrig", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41044 
41045  /* return immediately if the solution is of type partial */
41046  if( SCIPsolIsPartial(sol) )
41047  {
41048  SCIPerrorMessage("Cannot check feasibility of partial solutions.");
41049  return SCIP_INVALIDDATA;
41050  }
41051 
41052  if( !printreason )
41053  completely = FALSE;
41054 
41055  /* check solution in original problem; that includes bounds, integrality, and non modifiable constraints */
41056  SCIP_CALL( checkSolOrig(scip, sol, feasible, printreason, completely, TRUE, TRUE, TRUE, FALSE) );
41057 
41058  return SCIP_OKAY;
41059 }
41060 
41061 /** return whether a primal ray is stored that proves unboundedness of the LP relaxation
41062  *
41063  * @return return whether a primal ray is stored that proves unboundedness of the LP relaxation
41064  *
41065  * @pre This method can be called if SCIP is in one of the following stages:
41066  * - \ref SCIP_STAGE_SOLVING
41067  * - \ref SCIP_STAGE_SOLVED
41068  */
41070  SCIP* scip /**< SCIP data structure */
41071  )
41072 {
41073  SCIP_CALL_ABORT( checkStage(scip, "SCIPhasPrimalRay", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41074 
41075  return scip->primal->primalray != NULL;
41076 }
41077 
41078 /** gets value of given variable in primal ray causing unboundedness of the LP relaxation;
41079  * should only be called if such a ray is stored (check with SCIPhasPrimalRay())
41080  *
41081  * @return value of given variable in primal ray causing unboundedness of the LP relaxation
41082  *
41083  * @pre This method can be called if SCIP is in one of the following stages:
41084  * - \ref SCIP_STAGE_SOLVING
41085  * - \ref SCIP_STAGE_SOLVED
41086  */
41088  SCIP* scip, /**< SCIP data structure */
41089  SCIP_VAR* var /**< variable to get value for */
41090  )
41091 {
41092  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPrimalRayVal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41093 
41094  assert(var != NULL);
41095  assert(scip->primal->primalray != NULL);
41096  assert(var->scip == scip);
41097 
41098  return SCIPsolGetRayVal(scip->primal->primalray, scip->set, scip->stat, var);
41099 }
41100 
41101 /** updates the primal ray thats proves unboundedness
41102  *
41103  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41104  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41105  *
41106  * @pre This method can be called if @p scip is in one of the following stages:
41107  * - \ref SCIP_STAGE_PRESOLVING
41108  * - \ref SCIP_STAGE_PRESOLVED
41109  * - \ref SCIP_STAGE_SOLVING
41110  * - \ref SCIP_STAGE_SOLVED
41111  *
41112  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
41113  */
41115  SCIP* scip, /**< SCIP data structure */
41116  SCIP_SOL* primalray /**< the new primal ray */
41117  )
41118 {
41119  assert(scip != NULL);
41120  assert(primalray != NULL);
41121 
41122  SCIP_CALL( checkStage(scip, "SCIPupdatePrimalRay", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41123 
41124  SCIP_CALL( SCIPprimalUpdateRay(scip->primal, scip->set, scip->stat, primalray, scip->mem->probmem) );
41125 
41126  return SCIP_OKAY;
41127 }
41128 
41129 
41130 /*
41131  * event methods
41132  */
41133 
41134 /** catches a global (not variable or row dependent) event
41135  *
41136  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41137  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41138  *
41139  * @pre This method can be called if @p scip is in one of the following stages:
41140  * - \ref SCIP_STAGE_TRANSFORMING
41141  * - \ref SCIP_STAGE_TRANSFORMED
41142  * - \ref SCIP_STAGE_INITPRESOLVE
41143  * - \ref SCIP_STAGE_PRESOLVING
41144  * - \ref SCIP_STAGE_EXITPRESOLVE
41145  * - \ref SCIP_STAGE_PRESOLVED
41146  * - \ref SCIP_STAGE_INITSOLVE
41147  * - \ref SCIP_STAGE_SOLVING
41148  * - \ref SCIP_STAGE_SOLVED
41149  * - \ref SCIP_STAGE_EXITSOLVE
41150  * - \ref SCIP_STAGE_FREETRANS
41151  */
41153  SCIP* scip, /**< SCIP data structure */
41154  SCIP_EVENTTYPE eventtype, /**< event type mask to select events to catch */
41155  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
41156  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
41157  int* filterpos /**< pointer to store position of event filter entry, or NULL */
41158  )
41159 {
41160  SCIP_CALL( checkStage(scip, "SCIPcatchEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41161 
41162  SCIP_CALL( SCIPeventfilterAdd(scip->eventfilter, scip->mem->probmem, scip->set,
41163  eventtype, eventhdlr, eventdata, filterpos) );
41164 
41165  return SCIP_OKAY;
41166 }
41167 
41168 /** drops a global event (stops to track event)
41169  *
41170  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41171  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41172  *
41173  * @pre This method can be called if @p scip is in one of the following stages:
41174  * - \ref SCIP_STAGE_TRANSFORMING
41175  * - \ref SCIP_STAGE_TRANSFORMED
41176  * - \ref SCIP_STAGE_INITPRESOLVE
41177  * - \ref SCIP_STAGE_PRESOLVING
41178  * - \ref SCIP_STAGE_EXITPRESOLVE
41179  * - \ref SCIP_STAGE_PRESOLVED
41180  * - \ref SCIP_STAGE_INITSOLVE
41181  * - \ref SCIP_STAGE_SOLVING
41182  * - \ref SCIP_STAGE_SOLVED
41183  * - \ref SCIP_STAGE_EXITSOLVE
41184  * - \ref SCIP_STAGE_FREETRANS
41185  */
41187  SCIP* scip, /**< SCIP data structure */
41188  SCIP_EVENTTYPE eventtype, /**< event type mask of dropped event */
41189  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
41190  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
41191  int filterpos /**< position of event filter entry returned by SCIPcatchEvent(), or -1 */
41192  )
41193 {
41194  SCIP_CALL( checkStage(scip, "SCIPdropEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41195 
41196  SCIP_CALL( SCIPeventfilterDel(scip->eventfilter, scip->mem->probmem, scip->set,
41197  eventtype, eventhdlr, eventdata, filterpos) );
41198 
41199  return SCIP_OKAY;
41200 }
41201 
41202 /** catches an objective value or domain change event on the given transformed variable
41203  *
41204  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41205  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41206  *
41207  * @pre This method can be called if @p scip is in one of the following stages:
41208  * - \ref SCIP_STAGE_TRANSFORMING
41209  * - \ref SCIP_STAGE_TRANSFORMED
41210  * - \ref SCIP_STAGE_INITPRESOLVE
41211  * - \ref SCIP_STAGE_PRESOLVING
41212  * - \ref SCIP_STAGE_EXITPRESOLVE
41213  * - \ref SCIP_STAGE_PRESOLVED
41214  * - \ref SCIP_STAGE_INITSOLVE
41215  * - \ref SCIP_STAGE_SOLVING
41216  * - \ref SCIP_STAGE_SOLVED
41217  * - \ref SCIP_STAGE_EXITSOLVE
41218  * - \ref SCIP_STAGE_FREETRANS
41219  */
41221  SCIP* scip, /**< SCIP data structure */
41222  SCIP_VAR* var, /**< transformed variable to catch event for */
41223  SCIP_EVENTTYPE eventtype, /**< event type mask to select events to catch */
41224  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
41225  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
41226  int* filterpos /**< pointer to store position of event filter entry, or NULL */
41227  )
41228 {
41229  SCIP_CALL( checkStage(scip, "SCIPcatchVarEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41230 
41231  if( (eventtype & SCIP_EVENTTYPE_VARCHANGED) == 0 )
41232  {
41233  SCIPerrorMessage("event does not operate on a single variable\n");
41234  return SCIP_INVALIDDATA;
41235  }
41236 
41237  if( SCIPvarIsOriginal(var) )
41238  {
41239  SCIPerrorMessage("cannot catch events on original variable <%s>\n", SCIPvarGetName(var));
41240  return SCIP_INVALIDDATA;
41241  }
41242 
41243  SCIP_CALL( SCIPvarCatchEvent(var, scip->mem->probmem, scip->set, eventtype, eventhdlr, eventdata, filterpos) );
41244 
41245  return SCIP_OKAY;
41246 }
41247 
41248 /** drops an objective value or domain change event (stops to track event) on the given transformed variable
41249  *
41250  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41251  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41252  *
41253  * @pre This method can be called if @p scip is in one of the following stages:
41254  * - \ref SCIP_STAGE_TRANSFORMING
41255  * - \ref SCIP_STAGE_TRANSFORMED
41256  * - \ref SCIP_STAGE_INITPRESOLVE
41257  * - \ref SCIP_STAGE_PRESOLVING
41258  * - \ref SCIP_STAGE_EXITPRESOLVE
41259  * - \ref SCIP_STAGE_PRESOLVED
41260  * - \ref SCIP_STAGE_INITSOLVE
41261  * - \ref SCIP_STAGE_SOLVING
41262  * - \ref SCIP_STAGE_SOLVED
41263  * - \ref SCIP_STAGE_EXITSOLVE
41264  * - \ref SCIP_STAGE_FREETRANS
41265  */
41267  SCIP* scip, /**< SCIP data structure */
41268  SCIP_VAR* var, /**< transformed variable to drop event for */
41269  SCIP_EVENTTYPE eventtype, /**< event type mask of dropped event */
41270  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
41271  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
41272  int filterpos /**< position of event filter entry returned by SCIPcatchVarEvent(), or -1 */
41273  )
41274 {
41275  SCIP_CALL( checkStage(scip, "SCIPdropVarEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41276 
41277  if( SCIPvarIsOriginal(var) )
41278  {
41279  SCIPerrorMessage("cannot drop events on original variable <%s>\n", SCIPvarGetName(var));
41280  return SCIP_INVALIDDATA;
41281  }
41282 
41283  SCIP_CALL( SCIPvarDropEvent(var, scip->mem->probmem, scip->set, eventtype, eventhdlr, eventdata, filterpos) );
41284 
41285  return SCIP_OKAY;
41286 }
41287 
41288 /** catches a row coefficient, constant, or side change event on the given row
41289  *
41290  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41291  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41292  *
41293  * @pre This method can be called if @p scip is in one of the following stages:
41294  * - \ref SCIP_STAGE_TRANSFORMING
41295  * - \ref SCIP_STAGE_TRANSFORMED
41296  * - \ref SCIP_STAGE_INITPRESOLVE
41297  * - \ref SCIP_STAGE_PRESOLVING
41298  * - \ref SCIP_STAGE_EXITPRESOLVE
41299  * - \ref SCIP_STAGE_PRESOLVED
41300  * - \ref SCIP_STAGE_INITSOLVE
41301  * - \ref SCIP_STAGE_SOLVING
41302  * - \ref SCIP_STAGE_SOLVED
41303  * - \ref SCIP_STAGE_EXITSOLVE
41304  * - \ref SCIP_STAGE_FREETRANS
41305  */
41307  SCIP* scip, /**< SCIP data structure */
41308  SCIP_ROW* row, /**< linear row to catch event for */
41309  SCIP_EVENTTYPE eventtype, /**< event type mask to select events to catch */
41310  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
41311  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
41312  int* filterpos /**< pointer to store position of event filter entry, or NULL */
41313  )
41314 {
41315  SCIP_CALL( checkStage(scip, "SCIPcatchRowEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41316 
41317  if( (eventtype & SCIP_EVENTTYPE_ROWCHANGED) == 0 )
41318  {
41319  SCIPerrorMessage("event does not operate on a single row\n");
41320  return SCIP_INVALIDDATA;
41321  }
41322 
41323  SCIP_CALL( SCIProwCatchEvent(row, scip->mem->probmem, scip->set, eventtype, eventhdlr, eventdata, filterpos) );
41324 
41325  return SCIP_OKAY;
41326 }
41327 
41328 /** drops a row coefficient, constant, or side change event (stops to track event) on the given row
41329  *
41330  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41331  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41332  *
41333  * @pre This method can be called if @p scip is in one of the following stages:
41334  * - \ref SCIP_STAGE_TRANSFORMING
41335  * - \ref SCIP_STAGE_TRANSFORMED
41336  * - \ref SCIP_STAGE_INITPRESOLVE
41337  * - \ref SCIP_STAGE_PRESOLVING
41338  * - \ref SCIP_STAGE_EXITPRESOLVE
41339  * - \ref SCIP_STAGE_PRESOLVED
41340  * - \ref SCIP_STAGE_INITSOLVE
41341  * - \ref SCIP_STAGE_SOLVING
41342  * - \ref SCIP_STAGE_SOLVED
41343  * - \ref SCIP_STAGE_EXITSOLVE
41344  * - \ref SCIP_STAGE_FREETRANS
41345  */
41347  SCIP* scip, /**< SCIP data structure */
41348  SCIP_ROW* row, /**< linear row to drop event for */
41349  SCIP_EVENTTYPE eventtype, /**< event type mask of dropped event */
41350  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
41351  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
41352  int filterpos /**< position of event filter entry returned by SCIPcatchVarEvent(), or -1 */
41353  )
41354 {
41355  SCIP_CALL( checkStage(scip, "SCIPdropRowEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41356 
41357  SCIP_CALL( SCIProwDropEvent(row, scip->mem->probmem, scip->set, eventtype, eventhdlr, eventdata, filterpos) );
41358 
41359  return SCIP_OKAY;
41360 }
41361 
41362 
41363 /*
41364  * tree methods
41365  */
41366 
41367 /** gets focus node in the tree
41368  *
41369  * if we are in probing/diving mode this method returns the node in the tree where the probing/diving mode was started.
41370  *
41371  * @return the current node of the search tree
41372  *
41373  * @pre This method can be called if @p scip is in one of the following stages:
41374  * - \ref SCIP_STAGE_INITPRESOLVE
41375  * - \ref SCIP_STAGE_PRESOLVING
41376  * - \ref SCIP_STAGE_EXITPRESOLVE
41377  * - \ref SCIP_STAGE_SOLVING
41378  */
41380  SCIP* scip /**< SCIP data structure */
41381  )
41382 {
41383  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFocusNode", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41384 
41385  return SCIPtreeGetFocusNode(scip->tree);
41386 }
41387 
41388 /** gets current node in the tree
41389  *
41390  * @return the current node of the search tree
41391  *
41392  * @pre This method can be called if @p scip is in one of the following stages:
41393  * - \ref SCIP_STAGE_INITPRESOLVE
41394  * - \ref SCIP_STAGE_PRESOLVING
41395  * - \ref SCIP_STAGE_EXITPRESOLVE
41396  * - \ref SCIP_STAGE_SOLVING
41397  */
41399  SCIP* scip /**< SCIP data structure */
41400  )
41401 {
41402  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCurrentNode", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41403 
41404  return SCIPtreeGetCurrentNode(scip->tree);
41405 }
41406 
41407 /** gets the root node of the tree
41408  *
41409  * @return the root node of the search tree
41410  *
41411  * @pre This method can be called if @p scip is in one of the following stages:
41412  * - \ref SCIP_STAGE_INITPRESOLVE
41413  * - \ref SCIP_STAGE_PRESOLVING
41414  * - \ref SCIP_STAGE_EXITPRESOLVE
41415  * - \ref SCIP_STAGE_SOLVING
41416  */
41418  SCIP* scip /**< SCIP data structure */
41419  )
41420 {
41421  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRootNode", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41422 
41423  return SCIPtreeGetRootNode(scip->tree);
41424 }
41425 
41426 /** gets the effective root depth, i.e., the depth of the deepest node which is part of all paths from the root node
41427  * to the unprocessed nodes.
41428  *
41429  * @return effective root depth
41430  *
41431  * @pre This method can be called if @p scip is in one of the following stages:
41432  * - \ref SCIP_STAGE_SOLVING
41433  */
41435  SCIP* scip /**< SCIP data structure */
41436  )
41437 {
41438  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetEffectiveRootDepth", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41439 
41440  return SCIPtreeGetEffectiveRootDepth(scip->tree);
41441 }
41442 
41443 /** returns whether the current node is already solved and only propagated again
41444  *
41445  * @return TRUE is returned if \SCIP performance repropagation, otherwise FALSE.
41446  *
41447  * @pre This method can be called if @p scip is in one of the following stages:
41448  * - \ref SCIP_STAGE_INITPRESOLVE
41449  * - \ref SCIP_STAGE_PRESOLVING
41450  * - \ref SCIP_STAGE_EXITPRESOLVE
41451  * - \ref SCIP_STAGE_SOLVING
41452  */
41454  SCIP* scip /**< SCIP data structure */
41455  )
41456 {
41457  SCIP_CALL_ABORT( checkStage(scip, "SCIPinRepropagation", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41458 
41459  return SCIPtreeInRepropagation(scip->tree);
41460 }
41461 
41462 /** gets children of focus node along with the number of children
41463  *
41464  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41465  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41466  *
41467  * @pre This method can be called if @p scip is in one of the following stages:
41468  * - \ref SCIP_STAGE_SOLVING
41469  * - \ref SCIP_STAGE_SOLVED
41470  */
41472  SCIP* scip, /**< SCIP data structure */
41473  SCIP_NODE*** children, /**< pointer to store children array, or NULL if not needed */
41474  int* nchildren /**< pointer to store number of children, or NULL if not needed */
41475  )
41476 {
41477  SCIP_CALL( checkStage(scip, "SCIPgetChildren", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41478 
41479  if( children != NULL )
41480  *children = scip->tree->children;
41481  if( nchildren != NULL )
41482  *nchildren = scip->tree->nchildren;
41483 
41484  return SCIP_OKAY;
41485 }
41486 
41487 /** gets number of children of focus node
41488  *
41489  * @return number of children of the focus node
41490  *
41491  * @pre This method can be called if @p scip is in one of the following stages:
41492  * - \ref SCIP_STAGE_SOLVING
41493  * - \ref SCIP_STAGE_SOLVED
41494  */
41496  SCIP* scip /**< SCIP data structure */
41497  )
41498 {
41499  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNChildren", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41500 
41501  return scip->tree->nchildren;
41502 }
41503 
41504 /** gets siblings of focus node along with the number of siblings
41505  *
41506  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41507  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41508  *
41509  * @pre This method can be called if @p scip is in one of the following stages:
41510  * - \ref SCIP_STAGE_SOLVING
41511  * - \ref SCIP_STAGE_SOLVED
41512  */
41514  SCIP* scip, /**< SCIP data structure */
41515  SCIP_NODE*** siblings, /**< pointer to store siblings array, or NULL if not needed */
41516  int* nsiblings /**< pointer to store number of siblings, or NULL if not needed */
41517  )
41518 {
41519  SCIP_CALL( checkStage(scip, "SCIPgetSiblings", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41520 
41521  if( siblings != NULL )
41522  *siblings = scip->tree->siblings;
41523  if( nsiblings != NULL )
41524  *nsiblings = scip->tree->nsiblings;
41525 
41526  return SCIP_OKAY;
41527 }
41528 
41529 /** gets number of siblings of focus node
41530  *
41531  * @return the number of siblings of focus node
41532  *
41533  * @pre This method can be called if @p scip is in one of the following stages:
41534  * - \ref SCIP_STAGE_SOLVING
41535  * - \ref SCIP_STAGE_SOLVED
41536  */
41538  SCIP* scip /**< SCIP data structure */
41539  )
41540 {
41541  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNSiblings", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41542 
41543  return scip->tree->nsiblings;
41544 }
41545 
41546 /** gets leaves of the tree along with the number of leaves
41547  *
41548  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41549  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41550  *
41551  * @pre This method can be called if @p scip is in one of the following stages:
41552  * - \ref SCIP_STAGE_SOLVING
41553  * - \ref SCIP_STAGE_SOLVED
41554  */
41556  SCIP* scip, /**< SCIP data structure */
41557  SCIP_NODE*** leaves, /**< pointer to store leaves array, or NULL if not needed */
41558  int* nleaves /**< pointer to store number of leaves, or NULL if not needed */
41559  )
41560 {
41561  SCIP_CALL( checkStage(scip, "SCIPgetLeaves", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41562 
41563  if( leaves != NULL )
41564  *leaves = SCIPnodepqNodes(scip->tree->leaves);
41565  if( nleaves != NULL )
41566  *nleaves = SCIPnodepqLen(scip->tree->leaves);
41567 
41568  return SCIP_OKAY;
41569 }
41570 
41571 /** gets number of leaves in the tree
41572  *
41573  * @return the number of leaves in the tree
41574  *
41575  * @pre This method can be called if @p scip is in one of the following stages:
41576  * - \ref SCIP_STAGE_SOLVING
41577  * - \ref SCIP_STAGE_SOLVED
41578  */
41580  SCIP* scip /**< SCIP data structure */
41581  )
41582 {
41583  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLeaves", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41584 
41585  return SCIPnodepqLen(scip->tree->leaves);
41586 }
41587 
41588 /** gets the best child of the focus node w.r.t. the node selection priority assigned by the branching rule
41589  *
41590  * @return the best child of the focus node w.r.t. the node selection priority assigned by the branching rule
41591  *
41592  * @pre This method can be called if @p scip is in one of the following stages:
41593  * - \ref SCIP_STAGE_SOLVING
41594  */
41596  SCIP* scip /**< SCIP data structure */
41597  )
41598 {
41599  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPrioChild", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41600 
41601  return SCIPtreeGetPrioChild(scip->tree);
41602 }
41603 
41604 /** gets the best sibling of the focus node w.r.t. the node selection priority assigned by the branching rule
41605  *
41606  * @return the best sibling of the focus node w.r.t. the node selection priority assigned by the branching rule
41607  *
41608  * @pre This method can be called if @p scip is in one of the following stages:
41609  * - \ref SCIP_STAGE_SOLVING
41610  */
41612  SCIP* scip /**< SCIP data structure */
41613  )
41614 {
41615  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPrioSibling", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41616 
41617  return SCIPtreeGetPrioSibling(scip->tree);
41618 }
41619 
41620 /** gets the best child of the focus node w.r.t. the node selection strategy
41621  *
41622  * @return the best child of the focus node w.r.t. the node selection strategy
41623  *
41624  * @pre This method can be called if @p scip is in one of the following stages:
41625  * - \ref SCIP_STAGE_SOLVING
41626  */
41628  SCIP* scip /**< SCIP data structure */
41629  )
41630 {
41631  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestChild", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41632 
41633  return SCIPtreeGetBestChild(scip->tree, scip->set);
41634 }
41635 
41636 /** gets the best sibling of the focus node w.r.t. the node selection strategy
41637  *
41638  * @return the best sibling of the focus node w.r.t. the node selection strategy
41639  *
41640  * @pre This method can be called if @p scip is in one of the following stages:
41641  * - \ref SCIP_STAGE_SOLVING
41642  */
41644  SCIP* scip /**< SCIP data structure */
41645  )
41646 {
41647  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestSibling", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41648 
41649  return SCIPtreeGetBestSibling(scip->tree, scip->set);
41650 }
41651 
41652 /** gets the best leaf from the node queue w.r.t. the node selection strategy
41653  *
41654  * @return the best leaf from the node queue w.r.t. the node selection strategy
41655  *
41656  * @pre This method can be called if @p scip is in one of the following stages:
41657  * - \ref SCIP_STAGE_SOLVING
41658  */
41660  SCIP* scip /**< SCIP data structure */
41661  )
41662 {
41663  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestLeaf", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41664 
41665  return SCIPtreeGetBestLeaf(scip->tree);
41666 }
41667 
41668 /** gets the best node from the tree (child, sibling, or leaf) w.r.t. the node selection strategy
41669  *
41670  * @return the best node from the tree (child, sibling, or leaf) w.r.t. the node selection strategy
41671  *
41672  * @pre This method can be called if @p scip is in one of the following stages:
41673  * - \ref SCIP_STAGE_SOLVING
41674  */
41676  SCIP* scip /**< SCIP data structure */
41677  )
41678 {
41679  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41680 
41681  return SCIPtreeGetBestNode(scip->tree, scip->set);
41682 }
41683 
41684 /** gets the node with smallest lower bound from the tree (child, sibling, or leaf)
41685  *
41686  * @return the node with smallest lower bound from the tree (child, sibling, or leaf)
41687  *
41688  * @pre This method can be called if @p scip is in one of the following stages:
41689  * - \ref SCIP_STAGE_SOLVING
41690  */
41692  SCIP* scip /**< SCIP data structure */
41693  )
41694 {
41695  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestboundNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41696 
41697  return SCIPtreeGetLowerboundNode(scip->tree, scip->set);
41698 }
41699 
41700 /** access to all data of open nodes (leaves, children, and siblings)
41701  *
41702  * @pre This method can be called if @p scip is in one of the following stages:
41703  * - \ref SCIP_STAGE_SOLVING
41704  */
41706  SCIP* scip, /**< SCIP data structure */
41707  SCIP_NODE*** leaves, /**< pointer to store the leaves, or NULL if not needed */
41708  SCIP_NODE*** children, /**< pointer to store the children, or NULL if not needed */
41709  SCIP_NODE*** siblings, /**< pointer to store the siblings, or NULL if not needed */
41710  int* nleaves, /**< pointer to store the number of leaves, or NULL */
41711  int* nchildren, /**< pointer to store the number of children, or NULL */
41712  int* nsiblings /**< pointer to store the number of siblings, or NULL */
41713  )
41714 {
41715  SCIP_CALL( checkStage(scip, "SCIPgetOpenNodesData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41716 
41717  if( leaves != NULL )
41718  *leaves = SCIPnodepqNodes(scip->tree->leaves);
41719  if( children != NULL )
41720  *children = scip->tree->children;
41721  if( siblings != NULL )
41722  *siblings = scip->tree->siblings;
41723  if( nleaves != NULL )
41724  *nleaves = SCIPnodepqLen(scip->tree->leaves);
41725  if( nchildren != NULL )
41726  *nchildren = SCIPtreeGetNChildren(scip->tree);
41727  if( nsiblings != NULL )
41728  *nsiblings = SCIPtreeGetNSiblings(scip->tree);
41729 
41730  return SCIP_OKAY;
41731 }
41732 
41733 /** cuts off node and whole sub tree from branch and bound tree
41734  *
41735  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41736  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41737  *
41738  * @pre This method can be called if @p scip is in one of the following stages:
41739  * - \ref SCIP_STAGE_SOLVING
41740  */
41742  SCIP* scip, /**< SCIP data structure */
41743  SCIP_NODE* node /**< node that should be cut off */
41744  )
41745 {
41746  SCIP_CALL( checkStage(scip, "SCIPcutoffNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41747 
41748  SCIP_CALL( SCIPnodeCutoff(node, scip->set, scip->stat, scip->tree, scip->transprob, scip->origprob, scip->reopt,
41749  scip->lp, scip->mem->probmem) );
41750 
41751  return SCIP_OKAY;
41752 }
41753 
41754 /** marks the given node to be propagated again the next time a node of its subtree is processed
41755  *
41756  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41757  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41758  *
41759  * @pre This method can be called if @p scip is in one of the following stages:
41760  * - \ref SCIP_STAGE_SOLVING
41761  */
41763  SCIP* scip, /**< SCIP data structure */
41764  SCIP_NODE* node /**< node that should be propagated again */
41765  )
41766 {
41767  SCIP_CALL( checkStage(scip, "SCIPrepropagateNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41768 
41769  SCIPnodePropagateAgain(node, scip->set, scip->stat, scip->tree);
41770 
41771  return SCIP_OKAY;
41772 }
41773 
41774 /** returns depth of first node in active path that is marked being cutoff
41775  *
41776  * @return depth of first node in active path that is marked being cutoff
41777  *
41778  * @pre This method can be called if @p scip is in one of the following stages:
41779  * - \ref SCIP_STAGE_SOLVING
41780  */
41782  SCIP* scip /**< SCIP data structure */
41783  )
41784 {
41785  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCutoffdepth", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41786 
41787  return scip->tree->cutoffdepth;
41788 }
41789 
41790 /** returns depth of first node in active path that has to be propagated again
41791  *
41792  * @return depth of first node in active path that has to be propagated again
41793  *
41794  * @pre This method can be called if @p scip is in one of the following stages:
41795  * - \ref SCIP_STAGE_SOLVING
41796  */
41798  SCIP* scip /**< SCIP data structure */
41799  )
41800 {
41801  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRepropdepth", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41802 
41803  return scip->tree->repropdepth;
41804 }
41805 
41806 /** prints all branching decisions on variables from the root to the given node
41807  *
41808  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41809  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41810  *
41811  * @pre This method can be called if @p scip is in one of the following stages:
41812  * - \ref SCIP_STAGE_SOLVING
41813  */
41815  SCIP* scip, /**< SCIP data structure */
41816  SCIP_NODE* node, /**< node data */
41817  FILE* file /**< output file (or NULL for standard output) */
41818  )
41819 {
41820  SCIP_VAR** branchvars; /* array of variables on which the branchings has been performed in all ancestors */
41821  SCIP_Real* branchbounds; /* array of bounds which the branchings in all ancestors set */
41822  SCIP_BOUNDTYPE* boundtypes; /* array of boundtypes which the branchings in all ancestors set */
41823  int* nodeswitches; /* marks, where in the arrays the branching decisions of the next node on the path start
41824  * branchings performed at the parent of node always start at position 0. For single variable branching,
41825  * nodeswitches[i] = i holds */
41826  int nbranchvars; /* number of variables on which branchings have been performed in all ancestors
41827  * if this is larger than the array size, arrays should be reallocated and method should be called again */
41828  int branchvarssize; /* available slots in arrays */
41829  int nnodes; /* number of nodes in the nodeswitch array */
41830  int nodeswitchsize; /* available slots in node switch array */
41831 
41832  branchvarssize = SCIPnodeGetDepth(node);
41833  nodeswitchsize = branchvarssize;
41834 
41835  /* memory allocation */
41836  SCIP_CALL( SCIPallocBufferArray(scip, &branchvars, branchvarssize) );
41837  SCIP_CALL( SCIPallocBufferArray(scip, &branchbounds, branchvarssize) );
41838  SCIP_CALL( SCIPallocBufferArray(scip, &boundtypes, branchvarssize) );
41839  SCIP_CALL( SCIPallocBufferArray(scip, &nodeswitches, nodeswitchsize) );
41840 
41841  SCIPnodeGetAncestorBranchingPath(node, branchvars, branchbounds, boundtypes, &nbranchvars, branchvarssize, nodeswitches, &nnodes, nodeswitchsize );
41842 
41843  /* if the arrays were to small, we have to reallocate them and recall SCIPnodeGetAncestorBranchingPath */
41844  if( nbranchvars > branchvarssize || nnodes > nodeswitchsize )
41845  {
41846  branchvarssize = nbranchvars;
41847  nodeswitchsize = nnodes;
41848 
41849  /* memory reallocation */
41850  SCIP_CALL( SCIPreallocBufferArray(scip, &branchvars, branchvarssize) );
41851  SCIP_CALL( SCIPreallocBufferArray(scip, &branchbounds, branchvarssize) );
41852  SCIP_CALL( SCIPreallocBufferArray(scip, &boundtypes, branchvarssize) );
41853  SCIP_CALL( SCIPreallocBufferArray(scip, &nodeswitches, nodeswitchsize) );
41854 
41855  SCIPnodeGetAncestorBranchingPath(node, branchvars, branchbounds, boundtypes, &nbranchvars, branchvarssize, nodeswitches, &nnodes, nodeswitchsize);
41856  assert(nbranchvars == branchvarssize);
41857  }
41858 
41859  /* we only want to create output, if branchings were performed */
41860  if( nbranchvars >= 1 )
41861  {
41862  int i;
41863  int j;
41864 
41865  /* print all nodes, starting from the root, which is last in the arrays */
41866  for( j = nnodes-1; j >= 0; --j)
41867  {
41868  int end;
41869  if(j == nnodes-1)
41870  end = nbranchvars;
41871  else
41872  end = nodeswitches[j+1];
41873 
41874  for( i = nodeswitches[j]; i < end; ++i )
41875  {
41876  if( i > nodeswitches[j] )
41877  SCIPmessageFPrintInfo(scip->messagehdlr, file, " AND ");
41878  SCIPmessageFPrintInfo(scip->messagehdlr, file, "<%s> %s %.1f",SCIPvarGetName(branchvars[i]), boundtypes[i] == SCIP_BOUNDTYPE_LOWER ? ">=" : "<=", branchbounds[i]);
41879  }
41880  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
41881  if( j > 0 )
41882  {
41883  if( nodeswitches[j]-nodeswitches[j-1] != 1 )
41884  SCIPmessageFPrintInfo(scip->messagehdlr, file, " |\n |\n");
41885  else if( boundtypes[i-1] == SCIP_BOUNDTYPE_LOWER )
41886  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\\ \n \\\n");
41887  else
41888  SCIPmessageFPrintInfo(scip->messagehdlr, file, " /\n/ \n");
41889  }
41890  }
41891  }
41892 
41893  /* free all local memory */
41894  SCIPfreeBufferArray(scip, &nodeswitches);
41895  SCIPfreeBufferArray(scip, &boundtypes);
41896  SCIPfreeBufferArray(scip, &branchbounds);
41897  SCIPfreeBufferArray(scip, &branchvars);
41898 
41899  return SCIP_OKAY;
41900 }
41901 
41902 /** sets whether the LP should be solved at the focus node
41903  *
41904  * @note In order to have an effect, this method needs to be called after a node is focused but before the LP is
41905  * solved.
41906  *
41907  * @pre This method can be called if @p scip is in one of the following stages:
41908  * - \ref SCIP_STAGE_SOLVING
41909  */
41911  SCIP* scip, /**< SCIP data structure */
41912  SCIP_Bool solvelp /**< should the LP be solved? */
41913  )
41914 {
41915  SCIP_CALL_ABORT( checkStage(scip, "SCIPsetFocusnodeLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41916 
41917  SCIPtreeSetFocusNodeLP(scip->tree, solvelp);
41918 }
41919 
41920 
41921 /*
41922  * parallel interface methods
41923  */
41924 
41925 /** Constructs the parallel interface to execute processes concurrently.
41926  *
41927  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41928  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41929  *
41930  * @pre This method can be called if @p scip is in one of the following stages:
41931  * - \ref SCIP_STAGE_PROBLEM
41932  * - \ref SCIP_STAGE_TRANSFORMING
41933  * - \ref SCIP_STAGE_TRANSFORMED
41934  * - \ref SCIP_STAGE_INITPRESOLVE
41935  * - \ref SCIP_STAGE_PRESOLVING
41936  * - \ref SCIP_STAGE_EXITPRESOLVE
41937  * - \ref SCIP_STAGE_PRESOLVED
41938  * - \ref SCIP_STAGE_INITSOLVE
41939  * - \ref SCIP_STAGE_SOLVING
41940  * - \ref SCIP_STAGE_SOLVED
41941  * - \ref SCIP_STAGE_EXITSOLVE
41942  * - \ref SCIP_STAGE_FREETRANS
41943  *
41944  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
41945  */
41947  SCIP* scip /**< SCIP data structure */
41948  )
41949 {
41950  SCIP_CALL( checkStage(scip, "SCIPconstructSyncstore", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41951 
41953 
41954  return SCIP_OKAY;
41955 }
41956 
41957 /** releases the current parallel interface
41958  *
41959  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41960  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41961  *
41962  * @pre This method can be called if @p scip is in one of the following stages:
41963  * - \ref SCIP_STAGE_PROBLEM
41964  * - \ref SCIP_STAGE_TRANSFORMING
41965  * - \ref SCIP_STAGE_TRANSFORMED
41966  * - \ref SCIP_STAGE_INITPRESOLVE
41967  * - \ref SCIP_STAGE_PRESOLVING
41968  * - \ref SCIP_STAGE_EXITPRESOLVE
41969  * - \ref SCIP_STAGE_PRESOLVED
41970  * - \ref SCIP_STAGE_INITSOLVE
41971  * - \ref SCIP_STAGE_SOLVING
41972  * - \ref SCIP_STAGE_SOLVED
41973  * - \ref SCIP_STAGE_EXITSOLVE
41974  * - \ref SCIP_STAGE_FREETRANS
41975  * - \ref SCIP_STAGE_FREE
41976  *
41977  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
41978  */
41980  SCIP* scip /**< SCIP data structure */
41981  )
41982 {
41983  SCIP_CALL( checkStage(scip, "SCIPfreeSyncstore", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
41984 
41986 
41987  return SCIP_OKAY;
41988 }
41989 
41990 /** Gets the parallel interface to execute processes concurrently.
41991  *
41992  * @return the \ref SCIP_SYNCSTORE parallel interface pointer to submit jobs for concurrent processing.
41993  *
41994  * @pre This method can be called if @p scip is in one of the following stages:
41995  * - \ref SCIP_STAGE_INIT
41996  * - \ref SCIP_STAGE_PROBLEM
41997  * - \ref SCIP_STAGE_TRANSFORMING
41998  * - \ref SCIP_STAGE_TRANSFORMED
41999  * - \ref SCIP_STAGE_INITPRESOLVE
42000  * - \ref SCIP_STAGE_PRESOLVING
42001  * - \ref SCIP_STAGE_EXITPRESOLVE
42002  * - \ref SCIP_STAGE_PRESOLVED
42003  * - \ref SCIP_STAGE_INITSOLVE
42004  * - \ref SCIP_STAGE_SOLVING
42005  * - \ref SCIP_STAGE_SOLVED
42006  * - \ref SCIP_STAGE_EXITSOLVE
42007  * - \ref SCIP_STAGE_FREETRANS
42008  *
42009  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
42010  */
42012  SCIP* scip /**< SCIP data structure */
42013  )
42014 {
42015  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSyncstore", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42016 
42017  return scip->syncstore;
42018 }
42019 
42020 
42021 
42022 /*
42023  * statistic methods
42024  */
42025 
42026 /** gets number of branch and bound runs performed, including the current run
42027  *
42028  * @return the number of branch and bound runs performed, including the current run
42029  *
42030  * @pre This method can be called if SCIP is in one of the following stages:
42031  * - \ref SCIP_STAGE_PROBLEM
42032  * - \ref SCIP_STAGE_TRANSFORMING
42033  * - \ref SCIP_STAGE_TRANSFORMED
42034  * - \ref SCIP_STAGE_INITPRESOLVE
42035  * - \ref SCIP_STAGE_PRESOLVING
42036  * - \ref SCIP_STAGE_EXITPRESOLVE
42037  * - \ref SCIP_STAGE_PRESOLVED
42038  * - \ref SCIP_STAGE_INITSOLVE
42039  * - \ref SCIP_STAGE_SOLVING
42040  * - \ref SCIP_STAGE_SOLVED
42041  * - \ref SCIP_STAGE_EXITSOLVE
42042  * - \ref SCIP_STAGE_FREETRANS
42043  */
42045  SCIP* scip /**< SCIP data structure */
42046  )
42047 {
42048  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRuns", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42049 
42050  return scip->stat->nruns;
42051 }
42052 
42053 /** gets number of reoptimization runs performed, including the current run
42054  *
42055  * @return the number of reoptimization runs performed, including the current run
42056  *
42057  * @pre This method can be called if SCIP is in one of the following stages:
42058  * - \ref SCIP_STAGE_PROBLEM
42059  * - \ref SCIP_STAGE_TRANSFORMING
42060  * - \ref SCIP_STAGE_TRANSFORMED
42061  * - \ref SCIP_STAGE_INITPRESOLVE
42062  * - \ref SCIP_STAGE_PRESOLVING
42063  * - \ref SCIP_STAGE_EXITPRESOLVE
42064  * - \ref SCIP_STAGE_PRESOLVED
42065  * - \ref SCIP_STAGE_INITSOLVE
42066  * - \ref SCIP_STAGE_SOLVING
42067  * - \ref SCIP_STAGE_SOLVED
42068  * - \ref SCIP_STAGE_EXITSOLVE
42069  * - \ref SCIP_STAGE_FREETRANS
42070  */
42072  SCIP* scip /**< SCIP data structure */
42073  )
42074 {
42075  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNReoptRuns", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42076 
42077  return scip->stat->nreoptruns;
42078 }
42079 
42080 /** add given number to the number of processed nodes in current run and in all runs, including the focus node
42081  *
42082  * @return the number of processed nodes in current run, including the focus node
42083  *
42084  * @pre This method can be called if SCIP is in one of the following stages:
42085  * - \ref SCIP_STAGE_PROBLEM
42086  * - \ref SCIP_STAGE_TRANSFORMING
42087  * - \ref SCIP_STAGE_TRANSFORMED
42088  * - \ref SCIP_STAGE_INITPRESOLVE
42089  * - \ref SCIP_STAGE_PRESOLVING
42090  * - \ref SCIP_STAGE_EXITPRESOLVE
42091  * - \ref SCIP_STAGE_PRESOLVED
42092  * - \ref SCIP_STAGE_INITSOLVE
42093  * - \ref SCIP_STAGE_SOLVING
42094  * - \ref SCIP_STAGE_SOLVED
42095  * - \ref SCIP_STAGE_EXITSOLVE
42096  * - \ref SCIP_STAGE_FREETRANS
42097  */
42099  SCIP* scip, /**< SCIP data structure */
42100  SCIP_Longint nnodes /**< number of processed nodes to add to the statistics */
42101  )
42102 {
42103  SCIP_CALL_ABORT( checkStage(scip, "SCIPaddNNodes", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42104 
42105  scip->stat->nnodes += nnodes;
42106  scip->stat->ntotalnodes += nnodes;
42107 }
42108 
42109 /** gets number of processed nodes in current run, including the focus node
42110  *
42111  * @return the number of processed nodes in current run, including the focus node
42112  *
42113  * @pre This method can be called if SCIP is in one of the following stages:
42114  * - \ref SCIP_STAGE_PROBLEM
42115  * - \ref SCIP_STAGE_TRANSFORMING
42116  * - \ref SCIP_STAGE_TRANSFORMED
42117  * - \ref SCIP_STAGE_INITPRESOLVE
42118  * - \ref SCIP_STAGE_PRESOLVING
42119  * - \ref SCIP_STAGE_EXITPRESOLVE
42120  * - \ref SCIP_STAGE_PRESOLVED
42121  * - \ref SCIP_STAGE_INITSOLVE
42122  * - \ref SCIP_STAGE_SOLVING
42123  * - \ref SCIP_STAGE_SOLVED
42124  * - \ref SCIP_STAGE_EXITSOLVE
42125  * - \ref SCIP_STAGE_FREETRANS
42126  */
42128  SCIP* scip /**< SCIP data structure */
42129  )
42130 {
42131  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodes", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42132 
42133  return scip->stat->nnodes;
42134 }
42135 
42136 /** gets total number of processed nodes in all runs, including the focus node
42137  *
42138  * @return the total number of processed nodes in all runs, including the focus node
42139  *
42140  * @pre This method can be called if SCIP is in one of the following stages:
42141  * - \ref SCIP_STAGE_PROBLEM
42142  * - \ref SCIP_STAGE_TRANSFORMING
42143  * - \ref SCIP_STAGE_TRANSFORMED
42144  * - \ref SCIP_STAGE_INITPRESOLVE
42145  * - \ref SCIP_STAGE_PRESOLVING
42146  * - \ref SCIP_STAGE_EXITPRESOLVE
42147  * - \ref SCIP_STAGE_PRESOLVED
42148  * - \ref SCIP_STAGE_INITSOLVE
42149  * - \ref SCIP_STAGE_SOLVING
42150  * - \ref SCIP_STAGE_SOLVED
42151  * - \ref SCIP_STAGE_EXITSOLVE
42152  * - \ref SCIP_STAGE_FREETRANS
42153  */
42155  SCIP* scip /**< SCIP data structure */
42156  )
42157 {
42158  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNTotalNodes", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42159 
42160  return scip->stat->ntotalnodes;
42161 }
42162 
42163 /** gets number of nodes left in the tree (children + siblings + leaves)
42164  *
42165  * @return the number of nodes left in the tree (children + siblings + leaves)
42166  *
42167  * @pre This method can be called if SCIP is in one of the following stages:
42168  * - \ref SCIP_STAGE_PRESOLVED
42169  * - \ref SCIP_STAGE_SOLVING
42170  * - \ref SCIP_STAGE_SOLVED
42171  */
42173  SCIP* scip /**< SCIP data structure */
42174  )
42175 {
42176  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodesLeft", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42177 
42178  return SCIPtreeGetNNodes(scip->tree);
42179 }
42180 
42181 /** gets number of leaf nodes processed with feasible relaxation solution
42182  *
42183  * @return number of leaf nodes processed with feasible relaxation solution
42184  *
42185  * @pre This method can be called if SCIP is in one of the following stages:
42186  * - \ref SCIP_STAGE_PROBLEM
42187  * - \ref SCIP_STAGE_TRANSFORMING
42188  * - \ref SCIP_STAGE_TRANSFORMED
42189  * - \ref SCIP_STAGE_INITPRESOLVE
42190  * - \ref SCIP_STAGE_PRESOLVING
42191  * - \ref SCIP_STAGE_EXITPRESOLVE
42192  * - \ref SCIP_STAGE_PRESOLVED
42193  * - \ref SCIP_STAGE_INITSOLVE
42194  * - \ref SCIP_STAGE_SOLVING
42195  * - \ref SCIP_STAGE_SOLVED
42196  * - \ref SCIP_STAGE_EXITSOLVE
42197  * - \ref SCIP_STAGE_FREETRANS
42198  */
42200  SCIP* scip /**< SCIP data structure */
42201  )
42202 {
42203  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNFeasibleLeaves", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42204 
42205  return scip->stat->nfeasleaves;
42206 }
42207 
42208 /** gets number of infeasible leaf nodes processed
42209  *
42210  * @return number of infeasible leaf nodes processed
42211  *
42212  * @pre This method can be called if SCIP is in one of the following stages:
42213  * - \ref SCIP_STAGE_PROBLEM
42214  * - \ref SCIP_STAGE_TRANSFORMING
42215  * - \ref SCIP_STAGE_TRANSFORMED
42216  * - \ref SCIP_STAGE_INITPRESOLVE
42217  * - \ref SCIP_STAGE_PRESOLVING
42218  * - \ref SCIP_STAGE_EXITPRESOLVE
42219  * - \ref SCIP_STAGE_PRESOLVED
42220  * - \ref SCIP_STAGE_INITSOLVE
42221  * - \ref SCIP_STAGE_SOLVING
42222  * - \ref SCIP_STAGE_SOLVED
42223  * - \ref SCIP_STAGE_EXITSOLVE
42224  * - \ref SCIP_STAGE_FREETRANS
42225  */
42227  SCIP* scip /**< SCIP data structure */
42228  )
42229 {
42230  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNInfeasibleLeaves", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42231 
42232  return scip->stat->ninfeasleaves;
42233 }
42234 
42235 /** gets number of processed leaf nodes that hit LP objective limit
42236  *
42237  * @return number of processed leaf nodes that hit LP objective limit
42238  *
42239  * @pre This method can be called if SCIP is in one of the following stages:
42240  * - \ref SCIP_STAGE_PROBLEM
42241  * - \ref SCIP_STAGE_TRANSFORMING
42242  * - \ref SCIP_STAGE_TRANSFORMED
42243  * - \ref SCIP_STAGE_INITPRESOLVE
42244  * - \ref SCIP_STAGE_PRESOLVING
42245  * - \ref SCIP_STAGE_EXITPRESOLVE
42246  * - \ref SCIP_STAGE_PRESOLVED
42247  * - \ref SCIP_STAGE_INITSOLVE
42248  * - \ref SCIP_STAGE_SOLVING
42249  * - \ref SCIP_STAGE_SOLVED
42250  * - \ref SCIP_STAGE_EXITSOLVE
42251  * - \ref SCIP_STAGE_FREETRANS
42252  */
42254  SCIP* scip /**< Scip data structure */
42255  )
42256 {
42257  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNObjlimLeaves", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42258 
42259  return scip->stat->nobjleaves;
42260 }
42261 
42262 
42263 /** gets number of times a selected node was from a cut off subtree
42264  *
42265  * @return number of times a selected node was from a cut off subtree
42266  *
42267  * @pre This method can be called if SCIP is in one of the following stages:
42268  * - \ref SCIP_STAGE_PROBLEM
42269  * - \ref SCIP_STAGE_TRANSFORMING
42270  * - \ref SCIP_STAGE_TRANSFORMED
42271  * - \ref SCIP_STAGE_INITPRESOLVE
42272  * - \ref SCIP_STAGE_PRESOLVING
42273  * - \ref SCIP_STAGE_EXITPRESOLVE
42274  * - \ref SCIP_STAGE_PRESOLVED
42275  * - \ref SCIP_STAGE_INITSOLVE
42276  * - \ref SCIP_STAGE_SOLVING
42277  * - \ref SCIP_STAGE_SOLVED
42278  * - \ref SCIP_STAGE_EXITSOLVE
42279  * - \ref SCIP_STAGE_FREETRANS
42280  */
42282  SCIP* scip /**< SCIP data structure */
42283  )
42284 {
42285  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDelayedCutoffs", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42286 
42287  return scip->stat->ndelayedcutoffs;
42288 }
42289 
42290 /** gets total number of LPs solved so far
42291  *
42292  * @return the total number of LPs solved so far
42293  *
42294  * @pre This method can be called if SCIP is in one of the following stages:
42295  * - \ref SCIP_STAGE_PROBLEM
42296  * - \ref SCIP_STAGE_TRANSFORMING
42297  * - \ref SCIP_STAGE_TRANSFORMED
42298  * - \ref SCIP_STAGE_INITPRESOLVE
42299  * - \ref SCIP_STAGE_PRESOLVING
42300  * - \ref SCIP_STAGE_EXITPRESOLVE
42301  * - \ref SCIP_STAGE_PRESOLVED
42302  * - \ref SCIP_STAGE_INITSOLVE
42303  * - \ref SCIP_STAGE_SOLVING
42304  * - \ref SCIP_STAGE_SOLVED
42305  * - \ref SCIP_STAGE_EXITSOLVE
42306  * - \ref SCIP_STAGE_FREETRANS
42307  */
42309  SCIP* scip /**< SCIP data structure */
42310  )
42311 {
42312  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPs", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
42313 
42314  return scip->stat->nlps;
42315 }
42316 
42317 /** gets total number of iterations used so far in primal and dual simplex and barrier algorithm
42318  *
42319  * @return the total number of iterations used so far in primal and dual simplex and barrier algorithm
42320  *
42321  * @pre This method can be called if SCIP is in one of the following stages:
42322  * - \ref SCIP_STAGE_PRESOLVING
42323  * - \ref SCIP_STAGE_PRESOLVED
42324  * - \ref SCIP_STAGE_SOLVING
42325  * - \ref SCIP_STAGE_SOLVED
42326  */
42328  SCIP* scip /**< SCIP data structure */
42329  )
42330 {
42331  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42332 
42333  return scip->stat->nlpiterations;
42334 }
42335 
42336 /** gets number of active non-zeros in the current transformed problem
42337  *
42338  * @return the number of active non-zeros in the current transformed problem
42339  *
42340  * @pre This method can be called if SCIP is in one of the following stages:
42341  * - \ref SCIP_STAGE_PROBLEM
42342  * - \ref SCIP_STAGE_TRANSFORMING
42343  * - \ref SCIP_STAGE_TRANSFORMED
42344  * - \ref SCIP_STAGE_INITPRESOLVE
42345  * - \ref SCIP_STAGE_PRESOLVING
42346  * - \ref SCIP_STAGE_EXITPRESOLVE
42347  * - \ref SCIP_STAGE_PRESOLVED
42348  * - \ref SCIP_STAGE_INITSOLVE
42349  * - \ref SCIP_STAGE_SOLVING
42350  * - \ref SCIP_STAGE_SOLVED
42351  * - \ref SCIP_STAGE_EXITSOLVE
42352  */
42354  SCIP* scip /**< SCIP data structure */
42355  )
42356 {
42357  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNZs", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42358 
42359  return scip->stat->nnz;
42360 }
42361 
42362 /** gets total number of iterations used so far in primal and dual simplex and barrier algorithm for the root node
42363  *
42364  * @return the total number of iterations used so far in primal and dual simplex and barrier algorithm for the root node
42365  *
42366  * @pre This method can be called if SCIP is in one of the following stages:
42367  * - \ref SCIP_STAGE_PRESOLVED
42368  * - \ref SCIP_STAGE_SOLVING
42369  * - \ref SCIP_STAGE_SOLVED
42370  */
42372  SCIP* scip /**< SCIP data structure */
42373  )
42374 {
42375  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRootLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42376 
42377  return scip->stat->nrootlpiterations;
42378 }
42379 
42380 /** gets total number of iterations used in primal and dual simplex and barrier algorithm for the first LP at the root
42381  * node
42382  *
42383  * @return the total number of iterations used in primal and dual simplex and barrier algorithm for the first root LP
42384  *
42385  * @pre This method can be called if SCIP is in one of the following stages:
42386  * - \ref SCIP_STAGE_PRESOLVED
42387  * - \ref SCIP_STAGE_SOLVING
42388  * - \ref SCIP_STAGE_SOLVED
42389  */
42391  SCIP* scip /**< SCIP data structure */
42392  )
42393 {
42394  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRootFirstLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42395 
42396  return scip->stat->nrootfirstlpiterations;
42397 }
42398 
42399 /** gets total number of primal LPs solved so far
42400  *
42401  * @return the total number of primal LPs solved so far
42402  *
42403  * @pre This method can be called if SCIP is in one of the following stages:
42404  * - \ref SCIP_STAGE_PRESOLVED
42405  * - \ref SCIP_STAGE_SOLVING
42406  * - \ref SCIP_STAGE_SOLVED
42407  */
42409  SCIP* scip /**< SCIP data structure */
42410  )
42411 {
42412  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrimalLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42413 
42414  return scip->stat->nprimallps;
42415 }
42416 
42417 /** gets total number of iterations used so far in primal simplex
42418  *
42419  * @return total number of iterations used so far in primal simplex
42420  *
42421  * @pre This method can be called if SCIP is in one of the following stages:
42422  * - \ref SCIP_STAGE_PRESOLVED
42423  * - \ref SCIP_STAGE_SOLVING
42424  * - \ref SCIP_STAGE_SOLVED
42425  */
42427  SCIP* scip /**< SCIP data structure */
42428  )
42429 {
42430  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrimalLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42431 
42432  return scip->stat->nprimallpiterations;
42433 }
42434 
42435 /** gets total number of dual LPs solved so far
42436  *
42437  * @return the total number of dual LPs solved so far
42438  *
42439  * @pre This method can be called if SCIP is in one of the following stages:
42440  * - \ref SCIP_STAGE_PRESOLVED
42441  * - \ref SCIP_STAGE_SOLVING
42442  * - \ref SCIP_STAGE_SOLVED
42443  */
42445  SCIP* scip /**< SCIP data structure */
42446  )
42447 {
42448  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDualLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42449 
42450  return scip->stat->nduallps;
42451 }
42452 
42453 /** gets total number of iterations used so far in dual simplex
42454  *
42455  * @return the total number of iterations used so far in dual simplex
42456  *
42457  * @pre This method can be called if SCIP is in one of the following stages:
42458  * - \ref SCIP_STAGE_PRESOLVED
42459  * - \ref SCIP_STAGE_SOLVING
42460  * - \ref SCIP_STAGE_SOLVED
42461  */
42463  SCIP* scip /**< SCIP data structure */
42464  )
42465 {
42466  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDualLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42467 
42468  return scip->stat->nduallpiterations;
42469 }
42470 
42471 /** gets total number of barrier LPs solved so far
42472  *
42473  * @return the total number of barrier LPs solved so far
42474  *
42475  * @pre This method can be called if SCIP is in one of the following stages:
42476  * - \ref SCIP_STAGE_PRESOLVED
42477  * - \ref SCIP_STAGE_SOLVING
42478  * - \ref SCIP_STAGE_SOLVED
42479  */
42481  SCIP* scip /**< SCIP data structure */
42482  )
42483 {
42484  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBarrierLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42485 
42486  return scip->stat->nbarrierlps;
42487 }
42488 
42489 /** gets total number of iterations used so far in barrier algorithm
42490  *
42491  * @return the total number of iterations used so far in barrier algorithm
42492  *
42493  * @pre This method can be called if SCIP is in one of the following stages:
42494  * - \ref SCIP_STAGE_PRESOLVED
42495  * - \ref SCIP_STAGE_SOLVING
42496  * - \ref SCIP_STAGE_SOLVED
42497  */
42499  SCIP* scip /**< SCIP data structure */
42500  )
42501 {
42502  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBarrierLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42503 
42504  return scip->stat->nbarrierlpiterations;
42505 }
42506 
42507 /** gets total number of LPs solved so far that were resolved from an advanced start basis
42508  *
42509  * @return the total number of LPs solved so far that were resolved from an advanced start basis
42510  *
42511  * @pre This method can be called if SCIP is in one of the following stages:
42512  * - \ref SCIP_STAGE_PRESOLVED
42513  * - \ref SCIP_STAGE_SOLVING
42514  * - \ref SCIP_STAGE_SOLVED
42515  */
42517  SCIP* scip /**< SCIP data structure */
42518  )
42519 {
42520  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNResolveLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42521 
42522  return scip->stat->nprimalresolvelps + scip->stat->ndualresolvelps;
42523 }
42524 
42525 /** gets total number of simplex iterations used so far in primal and dual simplex calls where an advanced start basis
42526  * was available
42527  *
42528  * @return the total number of simplex iterations used so far in primal and dual simplex calls where an advanced start
42529  * basis was available
42530  *
42531  * @pre This method can be called if SCIP is in one of the following stages:
42532  * - \ref SCIP_STAGE_PRESOLVED
42533  * - \ref SCIP_STAGE_SOLVING
42534  * - \ref SCIP_STAGE_SOLVED
42535  */
42537  SCIP* scip /**< SCIP data structure */
42538  )
42539 {
42540  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNResolveLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42541 
42543 }
42544 
42545 /** gets total number of primal LPs solved so far that were resolved from an advanced start basis
42546  *
42547  * @return the total number of primal LPs solved so far that were resolved from an advanced start basis
42548  *
42549  * @pre This method can be called if SCIP is in one of the following stages:
42550  * - \ref SCIP_STAGE_PRESOLVED
42551  * - \ref SCIP_STAGE_SOLVING
42552  * - \ref SCIP_STAGE_SOLVED
42553  */
42555  SCIP* scip /**< SCIP data structure */
42556  )
42557 {
42558  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrimalResolveLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42559 
42560  return scip->stat->nprimalresolvelps;
42561 }
42562 
42563 /** gets total number of simplex iterations used so far in primal simplex calls where an advanced start basis
42564  * was available
42565  *
42566  * @return the total number of simplex iterations used so far in primal simplex calls where an advanced start
42567  * basis was available
42568  *
42569  * @pre This method can be called if SCIP is in one of the following stages:
42570  * - \ref SCIP_STAGE_PRESOLVED
42571  * - \ref SCIP_STAGE_SOLVING
42572  * - \ref SCIP_STAGE_SOLVED
42573  */
42575  SCIP* scip /**< SCIP data structure */
42576  )
42577 {
42578  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrimalResolveLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42579 
42580  return scip->stat->nprimalresolvelpiterations;
42581 }
42582 
42583 /** gets total number of dual LPs solved so far that were resolved from an advanced start basis
42584  *
42585  * @return the total number of dual LPs solved so far that were resolved from an advanced start basis
42586  *
42587  * @pre This method can be called if SCIP is in one of the following stages:
42588  * - \ref SCIP_STAGE_PRESOLVED
42589  * - \ref SCIP_STAGE_SOLVING
42590  * - \ref SCIP_STAGE_SOLVED
42591  */
42593  SCIP* scip /**< SCIP data structure */
42594  )
42595 {
42596  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDualResolveLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42597 
42598  return scip->stat->ndualresolvelps;
42599 }
42600 
42601 /** gets total number of simplex iterations used so far in dual simplex calls where an advanced start basis
42602  * was available
42603  *
42604  * @return the total number of simplex iterations used so far in dual simplex calls where an advanced start
42605  * basis was available
42606  *
42607  * @pre This method can be called if SCIP is in one of the following stages:
42608  * - \ref SCIP_STAGE_PRESOLVED
42609  * - \ref SCIP_STAGE_SOLVING
42610  * - \ref SCIP_STAGE_SOLVED
42611  */
42613  SCIP* scip /**< SCIP data structure */
42614  )
42615 {
42616  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDualResolveLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42617 
42618  return scip->stat->ndualresolvelpiterations;
42619 }
42620 
42621 /** gets total number of LPs solved so far for node relaxations
42622  *
42623  * @return the total number of LPs solved so far for node relaxations
42624  *
42625  * @pre This method can be called if SCIP is in one of the following stages:
42626  * - \ref SCIP_STAGE_PRESOLVED
42627  * - \ref SCIP_STAGE_SOLVING
42628  * - \ref SCIP_STAGE_SOLVED
42629  */
42631  SCIP* scip /**< SCIP data structure */
42632  )
42633 {
42634  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodeLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42635 
42636  return scip->stat->nnodelps;
42637 }
42638 
42639 /** gets total number of simplex iterations used so far for node relaxations
42640  *
42641  * @return the total number of simplex iterations used so far for node relaxations
42642  *
42643  * @pre This method can be called if SCIP is in one of the following stages:
42644  * - \ref SCIP_STAGE_PRESOLVED
42645  * - \ref SCIP_STAGE_SOLVING
42646  * - \ref SCIP_STAGE_SOLVED
42647  */
42649  SCIP* scip /**< SCIP data structure */
42650  )
42651 {
42652  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodeLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42653 
42654  return scip->stat->nnodelpiterations;
42655 }
42656 
42657 /** gets total number of LPs solved so far for initial LP in node relaxations
42658  *
42659  * @return the total number of LPs solved so far for initial LP in node relaxations
42660  *
42661  * @pre This method can be called if SCIP is in one of the following stages:
42662  * - \ref SCIP_STAGE_PRESOLVED
42663  * - \ref SCIP_STAGE_SOLVING
42664  * - \ref SCIP_STAGE_SOLVED
42665  */
42667  SCIP* scip /**< SCIP data structure */
42668  )
42669 {
42670  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodeInitLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42671 
42672  return scip->stat->ninitlps;
42673 }
42674 
42675 /** gets total number of simplex iterations used so far for initial LP in node relaxations
42676  *
42677  * @return the total number of simplex iterations used so far for initial LP in node relaxations
42678  *
42679  * @pre This method can be called if SCIP is in one of the following stages:
42680  * - \ref SCIP_STAGE_PRESOLVED
42681  * - \ref SCIP_STAGE_SOLVING
42682  * - \ref SCIP_STAGE_SOLVED
42683  */
42685  SCIP* scip /**< SCIP data structure */
42686  )
42687 {
42688  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodeInitLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42689 
42690  return scip->stat->ninitlpiterations;
42691 }
42692 
42693 /** gets total number of LPs solved so far during diving and probing
42694  *
42695  * @return total number of LPs solved so far during diving and probing
42696  *
42697  * @pre This method can be called if SCIP is in one of the following stages:
42698  * - \ref SCIP_STAGE_PRESOLVED
42699  * - \ref SCIP_STAGE_SOLVING
42700  * - \ref SCIP_STAGE_SOLVED
42701  */
42703  SCIP* scip /**< SCIP data structure */
42704  )
42705 {
42706  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDivingLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42707 
42708  return scip->stat->ndivinglps;
42709 }
42710 
42711 /** gets total number of simplex iterations used so far during diving and probing
42712  *
42713  * @return the total number of simplex iterations used so far during diving and probing
42714  *
42715  * @pre This method can be called if SCIP is in one of the following stages:
42716  * - \ref SCIP_STAGE_PRESOLVED
42717  * - \ref SCIP_STAGE_SOLVING
42718  * - \ref SCIP_STAGE_SOLVED
42719  */
42721  SCIP* scip /**< SCIP data structure */
42722  )
42723 {
42724  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDivingLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42725 
42726  return scip->stat->ndivinglpiterations;
42727 }
42728 
42729 /** gets total number of times, strong branching was called (each call represents solving two LPs)
42730  *
42731  * @return the total number of times, strong branching was called (each call represents solving two LPs)
42732  *
42733  * @pre This method can be called if SCIP is in one of the following stages:
42734  * - \ref SCIP_STAGE_PRESOLVED
42735  * - \ref SCIP_STAGE_SOLVING
42736  * - \ref SCIP_STAGE_SOLVED
42737  */
42739  SCIP* scip /**< SCIP data structure */
42740  )
42741 {
42742  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNStrongbranchs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42743 
42744  return scip->stat->nstrongbranchs;
42745 }
42746 
42747 /** gets total number of simplex iterations used so far in strong branching
42748  *
42749  * @return the total number of simplex iterations used so far in strong branching
42750  *
42751  * @pre This method can be called if SCIP is in one of the following stages:
42752  * - \ref SCIP_STAGE_PRESOLVED
42753  * - \ref SCIP_STAGE_SOLVING
42754  * - \ref SCIP_STAGE_SOLVED
42755  */
42757  SCIP* scip /**< SCIP data structure */
42758  )
42759 {
42760  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNStrongbranchLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42761 
42762  return scip->stat->nsblpiterations;
42763 }
42764 
42765 /** gets total number of times, strong branching was called at the root node (each call represents solving two LPs)
42766  *
42767  * @return the total number of times, strong branching was called at the root node (each call represents solving two LPs)
42768  *
42769  * @pre This method can be called if SCIP is in one of the following stages:
42770  * - \ref SCIP_STAGE_PRESOLVED
42771  * - \ref SCIP_STAGE_SOLVING
42772  * - \ref SCIP_STAGE_SOLVED
42773  */
42775  SCIP* scip /**< SCIP data structure */
42776  )
42777 {
42778  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRootStrongbranchs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42779 
42780  return scip->stat->nrootstrongbranchs;
42781 }
42782 
42783 /** gets total number of simplex iterations used so far in strong branching at the root node
42784  *
42785  * @return the total number of simplex iterations used so far in strong branching at the root node
42786  *
42787  * @pre This method can be called if SCIP is in one of the following stages:
42788  * - \ref SCIP_STAGE_PRESOLVED
42789  * - \ref SCIP_STAGE_SOLVING
42790  * - \ref SCIP_STAGE_SOLVED
42791  */
42793  SCIP* scip /**< SCIP data structure */
42794  )
42795 {
42796  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRootStrongbranchLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42797 
42798  return scip->stat->nrootsblpiterations;
42799 }
42800 
42801 /** gets number of pricing rounds performed so far at the current node
42802  *
42803  * @return the number of pricing rounds performed so far at the current node
42804  *
42805  * @pre This method can be called if SCIP is in one of the following stages:
42806  * - \ref SCIP_STAGE_SOLVING
42807  */
42809  SCIP* scip /**< SCIP data structure */
42810  )
42811 {
42812  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPriceRounds", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
42813 
42814  return scip->stat->npricerounds;
42815 }
42816 
42817 /** get current number of variables in the pricing store
42818  *
42819  * @return the current number of variables in the pricing store
42820  *
42821  * @pre This method can be called if SCIP is in one of the following stages:
42822  * - \ref SCIP_STAGE_PRESOLVED
42823  * - \ref SCIP_STAGE_SOLVING
42824  * - \ref SCIP_STAGE_SOLVED
42825  */
42827  SCIP* scip /**< SCIP data structure */
42828  )
42829 {
42830  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPricevars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42831 
42832  return SCIPpricestoreGetNVars(scip->pricestore);
42833 }
42834 
42835 /** get total number of pricing variables found so far
42836  *
42837  * @return the total number of pricing variables found so far
42838  *
42839  * @pre This method can be called if SCIP is in one of the following stages:
42840  * - \ref SCIP_STAGE_PRESOLVED
42841  * - \ref SCIP_STAGE_SOLVING
42842  * - \ref SCIP_STAGE_SOLVED
42843  */
42845  SCIP* scip /**< SCIP data structure */
42846  )
42847 {
42848  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPricevarsFound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42849 
42851 }
42852 
42853 /** get total number of pricing variables applied to the LPs
42854  *
42855  * @return the total number of pricing variables applied to the LPs
42856  *
42857  * @pre This method can be called if SCIP is in one of the following stages:
42858  * - \ref SCIP_STAGE_PRESOLVED
42859  * - \ref SCIP_STAGE_SOLVING
42860  * - \ref SCIP_STAGE_SOLVED
42861  */
42863  SCIP* scip /**< SCIP data structure */
42864  )
42865 {
42866  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPricevarsApplied", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42867 
42869 }
42870 
42871 /** gets number of separation rounds performed so far at the current node
42872  *
42873  * @return the number of separation rounds performed so far at the current node
42874  *
42875  * @pre This method can be called if SCIP is in one of the following stages:
42876  * - \ref SCIP_STAGE_SOLVING
42877  */
42879  SCIP* scip /**< SCIP data structure */
42880  )
42881 {
42882  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNSepaRounds", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
42883 
42884  return scip->stat->nseparounds;
42885 }
42886 
42887 /** get total number of cuts found so far
42888  *
42889  * @return the total number of cuts found so far
42890  *
42891  * @pre This method can be called if SCIP is in one of the following stages:
42892  * - \ref SCIP_STAGE_PRESOLVED
42893  * - \ref SCIP_STAGE_SOLVING
42894  * - \ref SCIP_STAGE_SOLVED
42895  */
42897  SCIP* scip /**< SCIP data structure */
42898  )
42899 {
42900  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCutsFound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42901 
42902  return SCIPsepastoreGetNCutsFound(scip->sepastore);
42903 }
42904 
42905 /** get number of cuts found so far in current separation round
42906  *
42907  * @return the number of cuts found so far in current separation round
42908  *
42909  * @pre This method can be called if SCIP is in one of the following stages:
42910  * - \ref SCIP_STAGE_PRESOLVED
42911  * - \ref SCIP_STAGE_SOLVING
42912  * - \ref SCIP_STAGE_SOLVED
42913  */
42915  SCIP* scip /**< SCIP data structure */
42916  )
42917 {
42918  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCutsFoundRound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42919 
42921 }
42922 
42923 /** get total number of cuts applied to the LPs
42924  *
42925  * @return the total number of cuts applied to the LPs
42926  *
42927  * @pre This method can be called if SCIP is in one of the following stages:
42928  * - \ref SCIP_STAGE_PRESOLVED
42929  * - \ref SCIP_STAGE_SOLVING
42930  * - \ref SCIP_STAGE_SOLVED
42931  */
42933  SCIP* scip /**< SCIP data structure */
42934  )
42935 {
42936  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCutsApplied", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42937 
42939 }
42940 
42941 /** get total number of constraints found in conflict analysis (conflict and reconvergence constraints)
42942  *
42943  * @return the total number of constraints found in conflict analysis (conflict and reconvergence constraints)
42944  *
42945  * @pre This method can be called if SCIP is in one of the following stages:
42946  * - \ref SCIP_STAGE_TRANSFORMED
42947  * - \ref SCIP_STAGE_INITPRESOLVE
42948  * - \ref SCIP_STAGE_PRESOLVING
42949  * - \ref SCIP_STAGE_EXITPRESOLVE
42950  * - \ref SCIP_STAGE_PRESOLVED
42951  * - \ref SCIP_STAGE_INITSOLVE
42952  * - \ref SCIP_STAGE_SOLVING
42953  * - \ref SCIP_STAGE_SOLVED
42954  * - \ref SCIP_STAGE_EXITSOLVE
42955  */
42957  SCIP* scip /**< SCIP data structure */
42958  )
42959 {
42960  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNConflictConssFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42961 
42972 }
42973 
42974 /** get number of conflict constraints found so far at the current node
42975  *
42976  * @return the number of conflict constraints found so far at the current node
42977  *
42978  * @pre This method can be called if SCIP is in one of the following stages:
42979  * - \ref SCIP_STAGE_TRANSFORMED
42980  * - \ref SCIP_STAGE_INITPRESOLVE
42981  * - \ref SCIP_STAGE_PRESOLVING
42982  * - \ref SCIP_STAGE_EXITPRESOLVE
42983  * - \ref SCIP_STAGE_PRESOLVED
42984  * - \ref SCIP_STAGE_INITSOLVE
42985  * - \ref SCIP_STAGE_SOLVING
42986  * - \ref SCIP_STAGE_SOLVED
42987  * - \ref SCIP_STAGE_EXITSOLVE
42988  */
42990  SCIP* scip /**< SCIP data structure */
42991  )
42992 {
42993  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNConflictConssFoundNode", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42994 
42995  return SCIPconflictGetNConflicts(scip->conflict);
42996 }
42997 
42998 /** get total number of conflict constraints added to the problem
42999  *
43000  * @return the total number of conflict constraints added to the problem
43001  *
43002  * @pre This method can be called if SCIP is in one of the following stages:
43003  * - \ref SCIP_STAGE_TRANSFORMED
43004  * - \ref SCIP_STAGE_INITPRESOLVE
43005  * - \ref SCIP_STAGE_PRESOLVING
43006  * - \ref SCIP_STAGE_EXITPRESOLVE
43007  * - \ref SCIP_STAGE_PRESOLVED
43008  * - \ref SCIP_STAGE_INITSOLVE
43009  * - \ref SCIP_STAGE_SOLVING
43010  * - \ref SCIP_STAGE_SOLVED
43011  * - \ref SCIP_STAGE_EXITSOLVE
43012  */
43014  SCIP* scip /**< SCIP data structure */
43015  )
43016 {
43017  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNConflictConssApplied", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43018 
43019  return SCIPconflictGetNAppliedConss(scip->conflict);
43020 }
43021 
43022 /** gets depth of current node, or -1 if no current node exists; in probing, the current node is the last probing node,
43023  * such that the depth includes the probing path
43024  *
43025  * @return the depth of current node, or -1 if no current node exists; in probing, the current node is the last probing node,
43026  * such that the depth includes the probing path
43027  *
43028  * @pre This method can be called if SCIP is in one of the following stages:
43029  * - \ref SCIP_STAGE_TRANSFORMED
43030  * - \ref SCIP_STAGE_INITPRESOLVE
43031  * - \ref SCIP_STAGE_PRESOLVING
43032  * - \ref SCIP_STAGE_EXITPRESOLVE
43033  * - \ref SCIP_STAGE_PRESOLVED
43034  * - \ref SCIP_STAGE_INITSOLVE
43035  * - \ref SCIP_STAGE_SOLVING
43036  * - \ref SCIP_STAGE_SOLVED
43037  * - \ref SCIP_STAGE_EXITSOLVE
43038  */
43040  SCIP* scip /**< SCIP data structure */
43041  )
43042 {
43043  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDepth", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43044 
43045  return SCIPtreeGetCurrentDepth(scip->tree);
43046 }
43047 
43048 /** gets depth of the focus node, or -1 if no focus node exists; the focus node is the currently processed node in the
43049  * branching tree, excluding the nodes of the probing path
43050  *
43051  * @return the depth of the focus node, or -1 if no focus node exists; the focus node is the currently processed node in the
43052  * branching tree, excluding the nodes of the probing path
43053  *
43054  * @pre This method can be called if SCIP is in one of the following stages:
43055  * - \ref SCIP_STAGE_TRANSFORMED
43056  * - \ref SCIP_STAGE_INITPRESOLVE
43057  * - \ref SCIP_STAGE_PRESOLVING
43058  * - \ref SCIP_STAGE_EXITPRESOLVE
43059  * - \ref SCIP_STAGE_PRESOLVED
43060  * - \ref SCIP_STAGE_INITSOLVE
43061  * - \ref SCIP_STAGE_SOLVING
43062  * - \ref SCIP_STAGE_SOLVED
43063  * - \ref SCIP_STAGE_EXITSOLVE
43064  */
43066  SCIP* scip /**< SCIP data structure */
43067  )
43068 {
43069  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFocusDepth", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43070 
43071  return SCIPtreeGetFocusDepth(scip->tree);
43072 }
43073 
43074 /** gets maximal depth of all processed nodes in current branch and bound run (excluding probing nodes)
43075  *
43076  * @return the maximal depth of all processed nodes in current branch and bound run (excluding probing nodes)
43077  *
43078  * @pre This method can be called if SCIP is in one of the following stages:
43079  * - \ref SCIP_STAGE_TRANSFORMED
43080  * - \ref SCIP_STAGE_INITPRESOLVE
43081  * - \ref SCIP_STAGE_PRESOLVING
43082  * - \ref SCIP_STAGE_EXITPRESOLVE
43083  * - \ref SCIP_STAGE_PRESOLVED
43084  * - \ref SCIP_STAGE_INITSOLVE
43085  * - \ref SCIP_STAGE_SOLVING
43086  * - \ref SCIP_STAGE_SOLVED
43087  * - \ref SCIP_STAGE_EXITSOLVE
43088  */
43090  SCIP* scip /**< SCIP data structure */
43091  )
43092 {
43093  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetMaxDepth", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43094 
43095  return scip->stat->maxdepth;
43096 }
43097 
43098 /** gets maximal depth of all processed nodes over all branch and bound runs
43099  *
43100  * @return the maximal depth of all processed nodes over all branch and bound runs
43101  *
43102  * @pre This method can be called if SCIP is in one of the following stages:
43103  * - \ref SCIP_STAGE_TRANSFORMED
43104  * - \ref SCIP_STAGE_INITPRESOLVE
43105  * - \ref SCIP_STAGE_PRESOLVING
43106  * - \ref SCIP_STAGE_EXITPRESOLVE
43107  * - \ref SCIP_STAGE_PRESOLVED
43108  * - \ref SCIP_STAGE_INITSOLVE
43109  * - \ref SCIP_STAGE_SOLVING
43110  * - \ref SCIP_STAGE_SOLVED
43111  * - \ref SCIP_STAGE_EXITSOLVE
43112  */
43114  SCIP* scip /**< SCIP data structure */
43115  )
43116 {
43117  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetMaxTotalDepth", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43118 
43119  return scip->stat->maxtotaldepth;
43120 }
43121 
43122 /** gets total number of backtracks, i.e. number of times, the new node was selected from the leaves queue
43123  *
43124  * @return the total number of backtracks, i.e. number of times, the new node was selected from the leaves queue
43125  *
43126  * @pre This method can be called if SCIP is in one of the following stages:
43127  * - \ref SCIP_STAGE_TRANSFORMED
43128  * - \ref SCIP_STAGE_INITPRESOLVE
43129  * - \ref SCIP_STAGE_PRESOLVING
43130  * - \ref SCIP_STAGE_EXITPRESOLVE
43131  * - \ref SCIP_STAGE_PRESOLVED
43132  * - \ref SCIP_STAGE_INITSOLVE
43133  * - \ref SCIP_STAGE_SOLVING
43134  * - \ref SCIP_STAGE_SOLVED
43135  * - \ref SCIP_STAGE_EXITSOLVE
43136  */
43138  SCIP* scip /**< SCIP data structure */
43139  )
43140 {
43141  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBacktracks", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43142 
43143  return scip->stat->nbacktracks;
43144 }
43145 
43146 /** gets current plunging depth (successive times, a child was selected as next node)
43147  *
43148  * @return the current plunging depth (successive times, a child was selected as next node)
43149  *
43150  * @pre This method can be called if SCIP is in one of the following stages:
43151  * - \ref SCIP_STAGE_PRESOLVED
43152  * - \ref SCIP_STAGE_SOLVING
43153  */
43155  SCIP* scip /**< SCIP data structure */
43156  )
43157 {
43158  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPlungeDepth", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
43159 
43160  return scip->stat->plungedepth;
43161 }
43162 
43163 /** gets total number of active constraints at the current node
43164  *
43165  * @return the total number of active constraints at the current node
43166  *
43167  * @pre This method can be called if SCIP is in one of the following stages:
43168  * - \ref SCIP_STAGE_INITPRESOLVE
43169  * - \ref SCIP_STAGE_PRESOLVING
43170  * - \ref SCIP_STAGE_EXITPRESOLVE
43171  * - \ref SCIP_STAGE_PRESOLVED
43172  * - \ref SCIP_STAGE_SOLVING
43173  */
43175  SCIP* scip /**< SCIP data structure */
43176  )
43177 {
43178  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNActiveConss", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
43179 
43180  return scip->stat->nactiveconss;
43181 }
43182 
43183 /** gets total number of enabled constraints at the current node
43184  *
43185  * @return the total number of enabled constraints at the current node
43186  *
43187  * @pre This method can be called if SCIP is in one of the following stages:
43188  * - \ref SCIP_STAGE_PRESOLVED
43189  * - \ref SCIP_STAGE_SOLVING
43190  */
43192  SCIP* scip /**< SCIP data structure */
43193  )
43194 {
43195  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNEnabledConss", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
43196 
43197  return scip->stat->nenabledconss;
43198 }
43199 
43200 /** gets average dual bound of all unprocessed nodes for original problem
43201  *
43202  * @return the average dual bound of all unprocessed nodes for original problem
43203  *
43204  * @pre This method can be called if SCIP is in one of the following stages:
43205  * - \ref SCIP_STAGE_PRESOLVED
43206  * - \ref SCIP_STAGE_SOLVING
43207  * - \ref SCIP_STAGE_SOLVED
43208  */
43210  SCIP* scip /**< SCIP data structure */
43211  )
43212 {
43213  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43214 
43215  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set,
43217 }
43218 
43219 /** gets average lower (dual) bound of all unprocessed nodes in transformed problem
43220  *
43221  * @return the average lower (dual) bound of all unprocessed nodes in transformed problem
43222  *
43223  * @pre This method can be called if SCIP is in one of the following stages:
43224  * - \ref SCIP_STAGE_PRESOLVED
43225  * - \ref SCIP_STAGE_SOLVING
43226  * - \ref SCIP_STAGE_SOLVED
43227  */
43229  SCIP* scip /**< SCIP data structure */
43230  )
43231 {
43232  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43233 
43234  return SCIPtreeGetAvgLowerbound(scip->tree, scip->primal->cutoffbound);
43235 }
43236 
43237 /** gets global dual bound
43238  *
43239  * @return the global dual bound
43240  *
43241  * @pre This method can be called if SCIP is in one of the following stages:
43242  * - \ref SCIP_STAGE_PRESOLVING
43243  * - \ref SCIP_STAGE_EXITPRESOLVE
43244  * - \ref SCIP_STAGE_PRESOLVED
43245  * - \ref SCIP_STAGE_INITSOLVE
43246  * - \ref SCIP_STAGE_SOLVING
43247  * - \ref SCIP_STAGE_SOLVED
43248  * - \ref SCIP_STAGE_EXITSOLVE
43249  */
43251  SCIP* scip /**< SCIP data structure */
43252  )
43253 {
43254  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43255 
43256  return getDualbound(scip);
43257 }
43258 
43259 /** gets global lower (dual) bound in transformed problem
43260  *
43261  * @return the global lower (dual) bound in transformed problem
43262  *
43263  * @pre This method can be called if SCIP is in one of the following stages:
43264  * - \ref SCIP_STAGE_PRESOLVING
43265  * - \ref SCIP_STAGE_EXITPRESOLVE
43266  * - \ref SCIP_STAGE_PRESOLVED
43267  * - \ref SCIP_STAGE_INITSOLVE
43268  * - \ref SCIP_STAGE_SOLVING
43269  * - \ref SCIP_STAGE_SOLVED
43270  */
43272  SCIP* scip /**< SCIP data structure */
43273  )
43274 {
43275  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43276 
43277  return getLowerbound(scip);
43278 }
43279 
43280 /** gets dual bound of the root node for the original problem
43281  *
43282  * @return the dual bound of the root node for the original problem
43283  *
43284  * @pre This method can be called if SCIP is in one of the following stages:
43285  * - \ref SCIP_STAGE_PRESOLVING
43286  * - \ref SCIP_STAGE_EXITPRESOLVE
43287  * - \ref SCIP_STAGE_PRESOLVED
43288  * - \ref SCIP_STAGE_INITSOLVE
43289  * - \ref SCIP_STAGE_SOLVING
43290  * - \ref SCIP_STAGE_SOLVED
43291  */
43293  SCIP* scip /**< SCIP data structure */
43294  )
43295 {
43296  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDualboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43297 
43298  if( SCIPsetIsInfinity(scip->set, scip->stat->rootlowerbound) )
43299  return getPrimalbound(scip);
43300  else
43301  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, scip->stat->rootlowerbound);
43302 }
43303 
43304 /** gets lower (dual) bound in transformed problem of the root node
43305  *
43306  * @return the lower (dual) bound in transformed problem of the root node
43307  *
43308  * @pre This method can be called if SCIP is in one of the following stages:
43309  * - \ref SCIP_STAGE_PRESOLVING
43310  * - \ref SCIP_STAGE_EXITPRESOLVE
43311  * - \ref SCIP_STAGE_PRESOLVED
43312  * - \ref SCIP_STAGE_INITSOLVE
43313  * - \ref SCIP_STAGE_SOLVING
43314  * - \ref SCIP_STAGE_SOLVED
43315  */
43317  SCIP* scip /**< SCIP data structure */
43318  )
43319 {
43320  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLowerboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43321 
43322  if( SCIPsetIsInfinity(scip->set, scip->stat->rootlowerbound) )
43323  return getUpperbound(scip);
43324  else
43325  return scip->stat->rootlowerbound;
43326 }
43327 
43328 /** gets dual bound for the original problem obtained by the first LP solve at the root node
43329  *
43330  * @return the dual bound for the original problem of the first LP solve at the root node
43331  *
43332  * @pre This method can be called if SCIP is in one of the following stages:
43333  * - \ref SCIP_STAGE_PRESOLVING
43334  * - \ref SCIP_STAGE_EXITPRESOLVE
43335  * - \ref SCIP_STAGE_PRESOLVED
43336  * - \ref SCIP_STAGE_INITSOLVE
43337  * - \ref SCIP_STAGE_SOLVING
43338  * - \ref SCIP_STAGE_SOLVED
43339  */
43341  SCIP* scip /**< SCIP data structure */
43342  )
43343 {
43344  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFirstLPDualboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43345 
43346  return scip->stat->firstlpdualbound;
43347 }
43348 
43349 /** gets lower (dual) bound in transformed problem obtained by the first LP solve at the root node
43350  *
43351  * @return the lower (dual) bound in transformed problem obtained by first LP solve at the root node
43352  *
43353  * @pre This method can be called if SCIP is in one of the following stages:
43354  * - \ref SCIP_STAGE_PRESOLVING
43355  * - \ref SCIP_STAGE_EXITPRESOLVE
43356  * - \ref SCIP_STAGE_PRESOLVED
43357  * - \ref SCIP_STAGE_INITSOLVE
43358  * - \ref SCIP_STAGE_SOLVING
43359  * - \ref SCIP_STAGE_SOLVED
43360  */
43362  SCIP* scip /**< SCIP data structure */
43363  )
43364 {
43365  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFirstLPLowerboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43366 
43367  if( scip->stat->firstlpdualbound == SCIP_INVALID ) /*lint !e777*/
43368  return -SCIPinfinity(scip);
43369  else
43370  return SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, scip->stat->firstlpdualbound);
43371 }
43372 
43373 /** the primal bound of the very first solution */
43375  SCIP* scip /**< SCIP data structure */
43376  )
43377 {
43378  return scip->stat->firstprimalbound;
43379 }
43380 
43381 /** gets global primal bound (objective value of best solution or user objective limit) for the original problem
43382  *
43383  * @return the global primal bound (objective value of best solution or user objective limit) for the original problem
43384  *
43385  * @pre This method can be called if SCIP is in one of the following stages:
43386  * - \ref SCIP_STAGE_TRANSFORMED
43387  * - \ref SCIP_STAGE_INITPRESOLVE
43388  * - \ref SCIP_STAGE_PRESOLVING
43389  * - \ref SCIP_STAGE_EXITPRESOLVE
43390  * - \ref SCIP_STAGE_PRESOLVED
43391  * - \ref SCIP_STAGE_INITSOLVE
43392  * - \ref SCIP_STAGE_SOLVING
43393  * - \ref SCIP_STAGE_SOLVED
43394  * - \ref SCIP_STAGE_EXITSOLVE
43395  */
43397  SCIP* scip /**< SCIP data structure */
43398  )
43399 {
43400  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPrimalbound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43401 
43402  return getPrimalbound(scip);
43403 }
43404 
43405 /** gets global upper (primal) bound in transformed problem (objective value of best solution or user objective limit)
43406  *
43407  * @return the global upper (primal) bound in transformed problem (objective value of best solution or user objective limit)
43408  *
43409  * @pre This method can be called if SCIP is in one of the following stages:
43410  * - \ref SCIP_STAGE_TRANSFORMED
43411  * - \ref SCIP_STAGE_INITPRESOLVE
43412  * - \ref SCIP_STAGE_PRESOLVING
43413  * - \ref SCIP_STAGE_EXITPRESOLVE
43414  * - \ref SCIP_STAGE_PRESOLVED
43415  * - \ref SCIP_STAGE_INITSOLVE
43416  * - \ref SCIP_STAGE_SOLVING
43417  * - \ref SCIP_STAGE_SOLVED
43418  * - \ref SCIP_STAGE_EXITSOLVE
43419  */
43421  SCIP* scip /**< SCIP data structure */
43422  )
43423 {
43424  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetUpperbound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43425 
43426  return getUpperbound(scip);
43427 }
43428 
43429 /** gets global cutoff bound in transformed problem: a sub problem with lower bound larger than the cutoff
43430  * cannot contain a better feasible solution; usually, this bound is equal to the upper bound, but if the
43431  * objective value is always integral, the cutoff bound is (nearly) one less than the upper bound;
43432  * additionally, due to objective function domain propagation, the cutoff bound can be further reduced
43433  *
43434  * @return global cutoff bound in transformed problem
43435  *
43436  * @pre This method can be called if SCIP is in one of the following stages:
43437  * - \ref SCIP_STAGE_TRANSFORMED
43438  * - \ref SCIP_STAGE_INITPRESOLVE
43439  * - \ref SCIP_STAGE_PRESOLVING
43440  * - \ref SCIP_STAGE_EXITPRESOLVE
43441  * - \ref SCIP_STAGE_PRESOLVED
43442  * - \ref SCIP_STAGE_INITSOLVE
43443  * - \ref SCIP_STAGE_SOLVING
43444  * - \ref SCIP_STAGE_SOLVED
43445  * - \ref SCIP_STAGE_EXITSOLVE
43446  */
43448  SCIP* scip /**< SCIP data structure */
43449  )
43450 {
43451  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCutoffbound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43452 
43453  return scip->primal->cutoffbound;
43454 }
43455 
43456 /** updates the cutoff bound
43457  *
43458  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
43459  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
43460  *
43461  * @note using this method in the solving stage can lead to an erroneous SCIP solving status; in particular,
43462  * if a solution not respecting the cutoff bound was found before installing a cutoff bound which
43463  * renders the remaining problem infeasible, this solution may be reported as optimal
43464  *
43465  * @pre This method can be called if SCIP is in one of the following stages:
43466  * - \ref SCIP_STAGE_TRANSFORMED
43467  * - \ref SCIP_STAGE_PRESOLVING
43468  * - \ref SCIP_STAGE_PRESOLVED
43469  * - \ref SCIP_STAGE_INITSOLVE
43470  * - \ref SCIP_STAGE_SOLVING
43471  *
43472  * @note the given cutoff bound has to better or equal to known one (SCIPgetCutoffbound())
43473  * @note a given cutoff bound is also used for updating the objective limit, if possible
43474  */
43476  SCIP* scip, /**< SCIP data structure */
43477  SCIP_Real cutoffbound /**< new cutoff bound */
43478  )
43479 {
43480  SCIP_CALL( checkStage(scip, "SCIPupdateCutoffbound", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
43481 
43482  assert(cutoffbound <= SCIPgetCutoffbound(scip));
43483 
43484  SCIP_CALL( SCIPprimalSetCutoffbound(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
43485  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, cutoffbound, FALSE) );
43486 
43487  return SCIP_OKAY;
43488 }
43489 
43490 
43491 /** returns whether the current primal bound is justified with a feasible primal solution; if not, the primal bound
43492  * was set from the user as objective limit
43493  *
43494  * @return TRUE if the current primal bound is justified with a feasible primal solution, otherwise FALSE
43495  *
43496  * @pre This method can be called if SCIP is in one of the following stages:
43497  * - \ref SCIP_STAGE_TRANSFORMED
43498  * - \ref SCIP_STAGE_INITPRESOLVE
43499  * - \ref SCIP_STAGE_PRESOLVING
43500  * - \ref SCIP_STAGE_EXITPRESOLVE
43501  * - \ref SCIP_STAGE_PRESOLVED
43502  * - \ref SCIP_STAGE_INITSOLVE
43503  * - \ref SCIP_STAGE_SOLVING
43504  * - \ref SCIP_STAGE_SOLVED
43505  * - \ref SCIP_STAGE_EXITSOLVE
43506  */
43508  SCIP* scip /**< SCIP data structure */
43509  )
43510 {
43511  SCIP_CALL_ABORT( checkStage(scip, "SCIPisPrimalboundSol", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43512 
43513  return SCIPprimalUpperboundIsSol(scip->primal, scip->set, scip->transprob, scip->origprob);
43514 }
43515 
43516 /** gets current gap |(primalbound - dualbound)/min(|primalbound|,|dualbound|)| if both bounds have same sign,
43517  * or infinity, if they have opposite sign
43518  *
43519  * @return the current gap |(primalbound - dualbound)/min(|primalbound|,|dualbound|)| if both bounds have same sign,
43520  * or infinity, if they have opposite sign
43521  *
43522  * @pre This method can be called if SCIP is in one of the following stages:
43523  * - \ref SCIP_STAGE_PRESOLVING
43524  * - \ref SCIP_STAGE_EXITPRESOLVE
43525  * - \ref SCIP_STAGE_PRESOLVED
43526  * - \ref SCIP_STAGE_INITSOLVE
43527  * - \ref SCIP_STAGE_SOLVING
43528  * - \ref SCIP_STAGE_SOLVED
43529  */
43531  SCIP* scip /**< SCIP data structure */
43532  )
43533 {
43534  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetGap", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43535 
43536  if( SCIPsetIsInfinity(scip->set, getLowerbound(scip)) )
43537  {
43538  /* in case we could not prove whether the problem is unbounded or infeasible, we want to terminate with
43539  * gap = +inf instead of gap = 0
43540  */
43541  if( SCIPgetStatus(scip) == SCIP_STATUS_INFORUNBD )
43542  return SCIPsetInfinity(scip->set);
43543  else
43544  return 0.0;
43545  }
43546 
43547  return SCIPcomputeGap(SCIPsetEpsilon(scip->set), SCIPsetInfinity(scip->set), getPrimalbound(scip), getDualbound(scip));
43548 }
43549 
43550 /** gets current gap |(upperbound - lowerbound)/min(|upperbound|,|lowerbound|)| in transformed problem if both bounds
43551  * have same sign, or infinity, if they have opposite sign
43552  *
43553  * @return current gap |(upperbound - lowerbound)/min(|upperbound|,|lowerbound|)| in transformed problem if both bounds
43554  * have same sign, or infinity, if they have opposite sign
43555  *
43556  * @pre This method can be called if SCIP is in one of the following stages:
43557  * - \ref SCIP_STAGE_PRESOLVED
43558  * - \ref SCIP_STAGE_SOLVING
43559  * - \ref SCIP_STAGE_SOLVED
43560  */
43562  SCIP* scip /**< SCIP data structure */
43563  )
43564 {
43565  SCIP_Real upperbound;
43566  SCIP_Real lowerbound;
43567 
43568  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetTransGap", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43569 
43570  upperbound = getUpperbound(scip);
43571  lowerbound = getLowerbound(scip);
43572 
43573  if( SCIPsetIsInfinity(scip->set, lowerbound) )
43574  /* in case we could not prove whether the problem is unbounded or infeasible, we want to terminate with
43575  * gap = +inf instead of gap = 0
43576  */
43577  if( SCIPgetStatus(scip) == SCIP_STATUS_INFORUNBD )
43578  return SCIPsetInfinity(scip->set);
43579  else
43580  return 0.0;
43581  else if( SCIPsetIsEQ(scip->set, upperbound, lowerbound) )
43582  return 0.0;
43583  else if( SCIPsetIsZero(scip->set, lowerbound)
43584  || SCIPsetIsZero(scip->set, upperbound)
43585  || SCIPsetIsInfinity(scip->set, upperbound)
43586  || SCIPsetIsInfinity(scip->set, -lowerbound)
43587  || lowerbound * upperbound < 0.0 )
43588  return SCIPsetInfinity(scip->set);
43589  else
43590  {
43591  SCIP_Real abslower = REALABS(lowerbound);
43592  SCIP_Real absupper = REALABS(upperbound);
43593 
43594  return REALABS((upperbound - lowerbound)/MIN(abslower, absupper));
43595  }
43596 }
43597 
43598 /** gets number of feasible primal solutions found so far
43599  *
43600  * @return the number of feasible primal solutions found so far
43601  *
43602  * @pre This method can be called if SCIP is in one of the following stages:
43603  * - \ref SCIP_STAGE_TRANSFORMED
43604  * - \ref SCIP_STAGE_INITPRESOLVE
43605  * - \ref SCIP_STAGE_PRESOLVING
43606  * - \ref SCIP_STAGE_EXITPRESOLVE
43607  * - \ref SCIP_STAGE_PRESOLVED
43608  * - \ref SCIP_STAGE_INITSOLVE
43609  * - \ref SCIP_STAGE_SOLVING
43610  * - \ref SCIP_STAGE_SOLVED
43611  * - \ref SCIP_STAGE_EXITSOLVE
43612  */
43614  SCIP* scip /**< SCIP data structure */
43615  )
43616 {
43617  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNSolsFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43618 
43619  return scip->primal->nsolsfound;
43620 }
43621 
43622 /** gets number of feasible primal solutions respecting the objective limit found so far
43623  *
43624  * @return the number of feasible primal solutions respecting the objective limit found so far
43625  *
43626  * @pre This method can be called if SCIP is in one of the following stages:
43627  * - \ref SCIP_STAGE_INIT
43628  * - \ref SCIP_STAGE_PROBLEM
43629  * - \ref SCIP_STAGE_TRANSFORMING
43630  * - \ref SCIP_STAGE_TRANSFORMED
43631  * - \ref SCIP_STAGE_INITPRESOLVE
43632  * - \ref SCIP_STAGE_PRESOLVING
43633  * - \ref SCIP_STAGE_EXITPRESOLVE
43634  * - \ref SCIP_STAGE_PRESOLVED
43635  * - \ref SCIP_STAGE_INITSOLVE
43636  * - \ref SCIP_STAGE_SOLVING
43637  * - \ref SCIP_STAGE_SOLVED
43638  * - \ref SCIP_STAGE_EXITSOLVE
43639  */
43641  SCIP* scip /**< SCIP data structure */
43642  )
43643 {
43645  return 0;
43646 
43647  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLimSolsFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43648 
43649  return scip->primal->nlimsolsfound;
43650 }
43651 
43652 /** gets number of feasible primal solutions found so far, that improved the primal bound at the time they were found
43653  *
43654  * @return the number of feasible primal solutions found so far, that improved the primal bound at the time they were found
43655  *
43656  * @pre This method can be called if SCIP is in one of the following stages:
43657  * - \ref SCIP_STAGE_TRANSFORMED
43658  * - \ref SCIP_STAGE_INITPRESOLVE
43659  * - \ref SCIP_STAGE_PRESOLVING
43660  * - \ref SCIP_STAGE_EXITPRESOLVE
43661  * - \ref SCIP_STAGE_PRESOLVED
43662  * - \ref SCIP_STAGE_INITSOLVE
43663  * - \ref SCIP_STAGE_SOLVING
43664  * - \ref SCIP_STAGE_SOLVED
43665  * - \ref SCIP_STAGE_EXITSOLVE
43666  */
43668  SCIP* scip /**< SCIP data structure */
43669  )
43670 {
43671  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBestSolsFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
43672 
43673  return scip->primal->nbestsolsfound;
43674 }
43675 
43676 /** gets the average pseudo cost value for the given direction over all variables
43677  *
43678  * @return the average pseudo cost value for the given direction over all variables
43679  *
43680  * @pre This method can be called if SCIP is in one of the following stages:
43681  * - \ref SCIP_STAGE_SOLVING
43682  * - \ref SCIP_STAGE_SOLVED
43683  */
43685  SCIP* scip, /**< SCIP data structure */
43686  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
43687  )
43688 {
43689  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocost", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43690 
43691  return SCIPhistoryGetPseudocost(scip->stat->glbhistory, solvaldelta);
43692 }
43693 
43694 /** gets the average pseudo cost value for the given direction over all variables,
43695  * only using the pseudo cost information of the current run
43696  *
43697  * @return the average pseudo cost value for the given direction over all variables,
43698  * only using the pseudo cost information of the current run
43699  *
43700  * @pre This method can be called if SCIP is in one of the following stages:
43701  * - \ref SCIP_STAGE_SOLVING
43702  * - \ref SCIP_STAGE_SOLVED
43703  */
43705  SCIP* scip, /**< SCIP data structure */
43706  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
43707  )
43708 {
43709  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43710 
43711  return SCIPhistoryGetPseudocost(scip->stat->glbhistorycrun, solvaldelta);
43712 }
43713 
43714 /** gets the average number of pseudo cost updates for the given direction over all variables
43715  *
43716  * @return the average number of pseudo cost updates for the given direction over all variables
43717  *
43718  * @pre This method can be called if SCIP is in one of the following stages:
43719  * - \ref SCIP_STAGE_SOLVING
43720  * - \ref SCIP_STAGE_SOLVED
43721  */
43723  SCIP* scip, /**< SCIP data structure */
43724  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
43725  )
43726 {
43727  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostCount", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43728 
43729  return SCIPhistoryGetPseudocostCount(scip->stat->glbhistory, dir)
43730  / MAX(scip->transprob->nbinvars + scip->transprob->nintvars, 1);
43731 }
43732 
43733 /** gets the average number of pseudo cost updates for the given direction over all variables,
43734  * only using the pseudo cost information of the current run
43735  *
43736  * @return the average number of pseudo cost updates for the given direction over all variables,
43737  * only using the pseudo cost information of the current run
43738  *
43739  * @pre This method can be called if SCIP is in one of the following stages:
43740  * - \ref SCIP_STAGE_SOLVING
43741  * - \ref SCIP_STAGE_SOLVED
43742  */
43744  SCIP* scip, /**< SCIP data structure */
43745  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
43746  )
43747 {
43748  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostCountCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43749 
43751  / MAX(scip->transprob->nbinvars + scip->transprob->nintvars, 1);
43752 }
43753 
43754 /** gets the average pseudo cost score value over all variables, assuming a fractionality of 0.5
43755  *
43756  * @return the average pseudo cost score value over all variables, assuming a fractionality of 0.5
43757  *
43758  * @pre This method can be called if SCIP is in one of the following stages:
43759  * - \ref SCIP_STAGE_SOLVING
43760  * - \ref SCIP_STAGE_SOLVED
43761  */
43763  SCIP* scip /**< SCIP data structure */
43764  )
43765 {
43766  SCIP_Real pscostdown;
43767  SCIP_Real pscostup;
43768 
43769  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43770 
43771  pscostdown = SCIPhistoryGetPseudocost(scip->stat->glbhistory, -0.5);
43772  pscostup = SCIPhistoryGetPseudocost(scip->stat->glbhistory, +0.5);
43773 
43774  return SCIPbranchGetScore(scip->set, NULL, pscostdown, pscostup);
43775 }
43776 
43777 /** returns the variance of pseudo costs for all variables in the requested direction
43778  *
43779  * @return the variance of pseudo costs for all variables in the requested direction
43780  *
43781  * @pre This method can be called if SCIP is in one of the following stages:
43782  * - \ref SCIP_STAGE_SOLVING
43783  * - \ref SCIP_STAGE_SOLVED
43784  */
43786  SCIP* scip, /**< SCIP data structure */
43787  SCIP_BRANCHDIR branchdir, /**< the branching direction, up or down */
43788  SCIP_Bool onlycurrentrun /**< use only history of current run? */
43789  )
43790 {
43791  SCIP_HISTORY* history;
43792 
43793  assert(scip != NULL);
43794  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPseudocostVariance", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43795 
43796  history = (onlycurrentrun ? scip->stat->glbhistorycrun : scip->stat->glbhistory);
43797  assert(history != NULL);
43798 
43799  return SCIPhistoryGetPseudocostVariance(history, branchdir);
43800 }
43801 
43802 /** gets the number of pseudo cost updates for the given direction over all variables
43803  *
43804  * @return the number of pseudo cost updates for the given direction over all variables
43805  *
43806  * @pre This method can be called if SCIP is in one of the following stages:
43807  * - \ref SCIP_STAGE_SOLVING
43808  * - \ref SCIP_STAGE_SOLVED
43809  */
43811  SCIP* scip, /**< SCIP data structure */
43812  SCIP_BRANCHDIR dir, /**< branching direction (downwards, or upwards) */
43813  SCIP_Bool onlycurrentrun /**< use only history of current run? */
43814  )
43815 {
43816  SCIP_HISTORY* history;
43817 
43818  assert(scip != NULL);
43819  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPseudocostCount", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43820 
43821  history = (onlycurrentrun ? scip->stat->glbhistorycrun : scip->stat->glbhistory);
43822 
43823  return SCIPhistoryGetPseudocostCount(history, dir);
43824 }
43825 
43826 /** gets the average pseudo cost score value over all variables, assuming a fractionality of 0.5,
43827  * only using the pseudo cost information of the current run
43828  *
43829  * @return the average pseudo cost score value over all variables, assuming a fractionality of 0.5,
43830  * only using the pseudo cost information of the current run
43831  *
43832  * @pre This method can be called if SCIP is in one of the following stages:
43833  * - \ref SCIP_STAGE_SOLVING
43834  * - \ref SCIP_STAGE_SOLVED
43835  */
43837  SCIP* scip /**< SCIP data structure */
43838  )
43839 {
43840  SCIP_Real pscostdown;
43841  SCIP_Real pscostup;
43842 
43843  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43844 
43845  pscostdown = SCIPhistoryGetPseudocost(scip->stat->glbhistorycrun, -0.5);
43846  pscostup = SCIPhistoryGetPseudocost(scip->stat->glbhistorycrun, +0.5);
43847 
43848  return SCIPbranchGetScore(scip->set, NULL, pscostdown, pscostup);
43849 }
43850 
43851 /** gets the average conflict score value over all variables
43852  *
43853  * @return the average conflict score value over all variables
43854  *
43855  * @pre This method can be called if SCIP is in one of the following stages:
43856  * - \ref SCIP_STAGE_SOLVING
43857  * - \ref SCIP_STAGE_SOLVED
43858  */
43860  SCIP* scip /**< SCIP data structure */
43861  )
43862 {
43863  SCIP_Real conflictscoredown;
43864  SCIP_Real conflictscoreup;
43865  SCIP_Real scale;
43866 
43867  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgConflictScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43868 
43869  scale = scip->transprob->nvars * scip->stat->vsidsweight;
43870  conflictscoredown = SCIPhistoryGetVSIDS(scip->stat->glbhistory, SCIP_BRANCHDIR_DOWNWARDS) / scale;
43871  conflictscoreup = SCIPhistoryGetVSIDS(scip->stat->glbhistory, SCIP_BRANCHDIR_UPWARDS) / scale;
43872 
43873  return SCIPbranchGetScore(scip->set, NULL, conflictscoredown, conflictscoreup);
43874 }
43875 
43876 /** gets the average conflict score value over all variables, only using the conflict score information of the current run
43877  *
43878  * @return the average conflict score value over all variables, only using the conflict score information of the current run
43879  *
43880  * @pre This method can be called if SCIP is in one of the following stages:
43881  * - \ref SCIP_STAGE_SOLVING
43882  * - \ref SCIP_STAGE_SOLVED
43883  */
43885  SCIP* scip /**< SCIP data structure */
43886  )
43887 {
43888  SCIP_Real conflictscoredown;
43889  SCIP_Real conflictscoreup;
43890  SCIP_Real scale;
43891 
43892  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgConflictScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43893 
43894  scale = scip->transprob->nvars * scip->stat->vsidsweight;
43895  conflictscoredown = SCIPhistoryGetVSIDS(scip->stat->glbhistorycrun, SCIP_BRANCHDIR_DOWNWARDS) / scale;
43896  conflictscoreup = SCIPhistoryGetVSIDS(scip->stat->glbhistorycrun, SCIP_BRANCHDIR_UPWARDS) / scale;
43897 
43898  return SCIPbranchGetScore(scip->set, NULL, conflictscoredown, conflictscoreup);
43899 }
43900 
43901 /** gets the average inference score value over all variables
43902  *
43903  * @return the average inference score value over all variables
43904  *
43905  * @pre This method can be called if SCIP is in one of the following stages:
43906  * - \ref SCIP_STAGE_SOLVING
43907  * - \ref SCIP_STAGE_SOLVED
43908  */
43910  SCIP* scip /**< SCIP data structure */
43911  )
43912 {
43913  SCIP_Real conflictlengthdown;
43914  SCIP_Real conflictlengthup;
43915 
43916  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgConflictlengthScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43917 
43920 
43921  return SCIPbranchGetScore(scip->set, NULL, conflictlengthdown, conflictlengthup);
43922 }
43923 
43924 /** gets the average conflictlength score value over all variables, only using the conflictlength information of the
43925  * current run
43926  *
43927  * @return the average conflictlength score value over all variables, only using the conflictlength information of the
43928  * current run
43929  *
43930  * @pre This method can be called if SCIP is in one of the following stages:
43931  * - \ref SCIP_STAGE_SOLVING
43932  * - \ref SCIP_STAGE_SOLVED
43933  */
43935  SCIP* scip /**< SCIP data structure */
43936  )
43937 {
43938  SCIP_Real conflictlengthdown;
43939  SCIP_Real conflictlengthup;
43940 
43941  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgConflictlengthScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43942 
43945 
43946  return SCIPbranchGetScore(scip->set, NULL, conflictlengthdown, conflictlengthup);
43947 }
43948 
43949 /** returns the average number of inferences found after branching in given direction over all variables
43950  *
43951  * @return the average number of inferences found after branching in given direction over all variables
43952  *
43953  * @pre This method can be called if SCIP is in one of the following stages:
43954  * - \ref SCIP_STAGE_SOLVING
43955  * - \ref SCIP_STAGE_SOLVED
43956  */
43958  SCIP* scip, /**< SCIP data structure */
43959  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
43960  )
43961 {
43962  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgInferences", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43963 
43964  return SCIPhistoryGetAvgInferences(scip->stat->glbhistory, dir);
43965 }
43966 
43967 /** returns the average number of inferences found after branching in given direction over all variables,
43968  * only using the inference information of the current run
43969  *
43970  * @return the average number of inferences found after branching in given direction over all variables,
43971  * only using the inference information of the current run
43972  *
43973  * @pre This method can be called if SCIP is in one of the following stages:
43974  * - \ref SCIP_STAGE_SOLVING
43975  * - \ref SCIP_STAGE_SOLVED
43976  */
43978  SCIP* scip, /**< SCIP data structure */
43979  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
43980  )
43981 {
43982  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgInferencesCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43983 
43984  return SCIPhistoryGetAvgInferences(scip->stat->glbhistorycrun, dir);
43985 }
43986 
43987 /** gets the average inference score value over all variables
43988  *
43989  * @return the average inference score value over all variables
43990  *
43991  * @pre This method can be called if SCIP is in one of the following stages:
43992  * - \ref SCIP_STAGE_SOLVING
43993  * - \ref SCIP_STAGE_SOLVED
43994  */
43996  SCIP* scip /**< SCIP data structure */
43997  )
43998 {
43999  SCIP_Real inferencesdown;
44000  SCIP_Real inferencesup;
44001 
44002  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgInferenceScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44003 
44006 
44007  return SCIPbranchGetScore(scip->set, NULL, inferencesdown, inferencesup);
44008 }
44009 
44010 /** gets the average inference score value over all variables, only using the inference information of the
44011  * current run
44012  *
44013  * @return the average inference score value over all variables, only using the inference information of the
44014  * current run
44015  *
44016  * @pre This method can be called if SCIP is in one of the following stages:
44017  * - \ref SCIP_STAGE_SOLVING
44018  * - \ref SCIP_STAGE_SOLVED
44019  */
44021  SCIP* scip /**< SCIP data structure */
44022  )
44023 {
44024  SCIP_Real inferencesdown;
44025  SCIP_Real inferencesup;
44026 
44027  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgInferenceScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44028 
44031 
44032  return SCIPbranchGetScore(scip->set, NULL, inferencesdown, inferencesup);
44033 }
44034 
44035 /** returns the average number of cutoffs found after branching in given direction over all variables
44036  *
44037  * @return the average number of cutoffs found after branching in given direction over all variables
44038  *
44039  * @pre This method can be called if SCIP is in one of the following stages:
44040  * - \ref SCIP_STAGE_SOLVING
44041  * - \ref SCIP_STAGE_SOLVED
44042  */
44044  SCIP* scip, /**< SCIP data structure */
44045  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
44046  )
44047 {
44048  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgCutoffs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44049 
44050  return SCIPhistoryGetAvgCutoffs(scip->stat->glbhistory, dir);
44051 }
44052 
44053 /** returns the average number of cutoffs found after branching in given direction over all variables,
44054  * only using the cutoff information of the current run
44055  *
44056  * @return the average number of cutoffs found after branching in given direction over all variables,
44057  * only using the cutoff information of the current run
44058  *
44059  * @pre This method can be called if SCIP is in one of the following stages:
44060  * - \ref SCIP_STAGE_SOLVING
44061  * - \ref SCIP_STAGE_SOLVED
44062  */
44064  SCIP* scip, /**< SCIP data structure */
44065  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
44066  )
44067 {
44068  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgCutoffsCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44069 
44070  return SCIPhistoryGetAvgCutoffs(scip->stat->glbhistorycrun, dir);
44071 }
44072 
44073 /** gets the average cutoff score value over all variables
44074  *
44075  * @return the average cutoff score value over all variables
44076  *
44077  * @pre This method can be called if SCIP is in one of the following stages:
44078  * - \ref SCIP_STAGE_SOLVING
44079  * - \ref SCIP_STAGE_SOLVED
44080  */
44082  SCIP* scip /**< SCIP data structure */
44083  )
44084 {
44085  SCIP_Real cutoffsdown;
44086  SCIP_Real cutoffsup;
44087 
44088  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgCutoffScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44089 
44092 
44093  return SCIPbranchGetScore(scip->set, NULL, cutoffsdown, cutoffsup);
44094 }
44095 
44096 /** gets the average cutoff score value over all variables, only using the cutoff score information of the current run
44097  *
44098  * @return the average cutoff score value over all variables, only using the cutoff score information of the current run
44099  *
44100  * @pre This method can be called if SCIP is in one of the following stages:
44101  * - \ref SCIP_STAGE_SOLVING
44102  * - \ref SCIP_STAGE_SOLVED
44103  */
44105  SCIP* scip /**< SCIP data structure */
44106  )
44107 {
44108  SCIP_Real cutoffsdown;
44109  SCIP_Real cutoffsup;
44110 
44111  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgCutoffScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44112 
44115 
44116  return SCIPbranchGetScore(scip->set, NULL, cutoffsdown, cutoffsup);
44117 }
44118 
44119 /** computes a deterministic measure of time from statistics
44120  *
44121  * @return the deterministic time
44122  *
44123  * @pre This method can be called if SCIP is in one of the following stages:
44124  * - \ref SCIP_STAGE_PRESOLVING
44125  * - \ref SCIP_STAGE_PRESOLVED
44126  * - \ref SCIP_STAGE_SOLVING
44127  * - \ref SCIP_STAGE_SOLVED
44128  */
44130  SCIP* scip /**< SCIP data structure */
44131  )
44132 {
44133 /* TODO: SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDeterministicTime", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) ); */
44134  if(scip->stat == NULL)
44135  return 0.0;
44136 
44137  return 1e-6 * scip->stat->nnz * (
44138  0.00328285264101 * scip->stat->nprimalresolvelpiterations +
44139  0.00531625104146 * scip->stat->ndualresolvelpiterations +
44140  0.000738719124051 * scip->stat->nprobboundchgs +
44141  0.0011123144764 * scip->stat->nisstoppedcalls );
44142 }
44143 
44144 /** outputs problem to file stream */
44145 static
44147  SCIP* scip, /**< SCIP data structure */
44148  SCIP_PROB* prob, /**< problem data */
44149  FILE* file, /**< output file (or NULL for standard output) */
44150  const char* extension, /**< file format (or NULL for default CIP format) */
44151  SCIP_Bool genericnames /**< using generic variable and constraint names? */
44152  )
44153 {
44154  SCIP_RESULT result;
44155  int i;
44156  assert(scip != NULL);
44157  assert(prob != NULL);
44158 
44159  /* try all readers until one could read the file */
44160  result = SCIP_DIDNOTRUN;
44161  for( i = 0; i < scip->set->nreaders && result == SCIP_DIDNOTRUN; ++i )
44162  {
44163  SCIP_RETCODE retcode;
44164 
44165  if( extension != NULL )
44166  retcode = SCIPreaderWrite(scip->set->readers[i], prob, scip->set, file, extension, genericnames, &result);
44167  else
44168  retcode = SCIPreaderWrite(scip->set->readers[i], prob, scip->set, file, "cip", genericnames, &result);
44169 
44170  /* check for reader errors */
44171  if( retcode == SCIP_WRITEERROR )
44172  return retcode;
44173 
44174  SCIP_CALL( retcode );
44175  }
44176 
44177  switch( result )
44178  {
44179  case SCIP_DIDNOTRUN:
44180  return SCIP_PLUGINNOTFOUND;
44181 
44182  case SCIP_SUCCESS:
44183  return SCIP_OKAY;
44184 
44185  default:
44186  assert(i < scip->set->nreaders);
44187  SCIPerrorMessage("invalid result code <%d> from reader <%s> writing <%s> format\n",
44188  result, SCIPreaderGetName(scip->set->readers[i]), extension);
44189  return SCIP_READERROR;
44190  } /*lint !e788*/
44191 }
44192 
44193 /** outputs original problem to file stream
44194  *
44195  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
44196  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
44197  *
44198  * @pre This method can be called if SCIP is in one of the following stages:
44199  * - \ref SCIP_STAGE_PROBLEM
44200  * - \ref SCIP_STAGE_TRANSFORMING
44201  * - \ref SCIP_STAGE_TRANSFORMED
44202  * - \ref SCIP_STAGE_INITPRESOLVE
44203  * - \ref SCIP_STAGE_PRESOLVING
44204  * - \ref SCIP_STAGE_EXITPRESOLVE
44205  * - \ref SCIP_STAGE_PRESOLVED
44206  * - \ref SCIP_STAGE_INITSOLVE
44207  * - \ref SCIP_STAGE_SOLVING
44208  * - \ref SCIP_STAGE_SOLVED
44209  * - \ref SCIP_STAGE_EXITSOLVE
44210  * - \ref SCIP_STAGE_FREETRANS
44211  */
44213  SCIP* scip, /**< SCIP data structure */
44214  FILE* file, /**< output file (or NULL for standard output) */
44215  const char* extension, /**< file format (or NULL for default CIP format)*/
44216  SCIP_Bool genericnames /**< using generic variable and constraint names? */
44217  )
44218 {
44219  SCIP_RETCODE retcode;
44220 
44221  SCIP_CALL( checkStage(scip, "SCIPprintOrigProblem", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
44222 
44223  assert(scip != NULL);
44224  assert( scip->origprob != NULL );
44225 
44226  retcode = printProblem(scip, scip->origprob, file, extension, genericnames);
44227 
44228  /* check for write errors */
44229  if( retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
44230  return retcode;
44231  else
44232  {
44233  SCIP_CALL( retcode );
44234  }
44235 
44236  return SCIP_OKAY;
44237 }
44238 
44239 /** outputs transformed problem of the current node to file stream
44240  *
44241  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
44242  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
44243  *
44244  * @pre This method can be called if SCIP is in one of the following stages:
44245  * - \ref SCIP_STAGE_TRANSFORMED
44246  * - \ref SCIP_STAGE_INITPRESOLVE
44247  * - \ref SCIP_STAGE_PRESOLVING
44248  * - \ref SCIP_STAGE_EXITPRESOLVE
44249  * - \ref SCIP_STAGE_PRESOLVED
44250  * - \ref SCIP_STAGE_INITSOLVE
44251  * - \ref SCIP_STAGE_SOLVING
44252  * - \ref SCIP_STAGE_SOLVED
44253  * - \ref SCIP_STAGE_EXITSOLVE
44254  * - \ref SCIP_STAGE_FREETRANS
44255  */
44257  SCIP* scip, /**< SCIP data structure */
44258  FILE* file, /**< output file (or NULL for standard output) */
44259  const char* extension, /**< file format (or NULL for default CIP format)*/
44260  SCIP_Bool genericnames /**< using generic variable and constraint names? */
44261  )
44262 {
44263  SCIP_RETCODE retcode;
44264 
44265  SCIP_CALL( checkStage(scip, "SCIPprintTransProblem", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
44266 
44267  assert(scip != NULL);
44268  assert(scip->transprob != NULL );
44269 
44270  retcode = printProblem(scip, scip->transprob, file, extension, genericnames);
44271 
44272  /* check for write errors */
44273  if( retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
44274  return retcode;
44275  else
44276  {
44277  SCIP_CALL( retcode );
44278  }
44279 
44280  return SCIP_OKAY;
44281 }
44282 
44283 /** outputs status statistics
44284  *
44285  * @note If limits have been changed between the solution and the call to this function, the status is recomputed and
44286  * thus may to correspond to the original status.
44287  *
44288  * @pre This method can be called if SCIP is in one of the following stages:
44289  * - \ref SCIP_STAGE_INIT
44290  * - \ref SCIP_STAGE_PROBLEM
44291  * - \ref SCIP_STAGE_TRANSFORMED
44292  * - \ref SCIP_STAGE_INITPRESOLVE
44293  * - \ref SCIP_STAGE_PRESOLVING
44294  * - \ref SCIP_STAGE_EXITPRESOLVE
44295  * - \ref SCIP_STAGE_PRESOLVED
44296  * - \ref SCIP_STAGE_SOLVING
44297  * - \ref SCIP_STAGE_SOLVED
44298  */
44300  SCIP* scip, /**< SCIP data structure */
44301  FILE* file /**< output file */
44302  )
44303 {
44304  assert(scip != NULL);
44305  assert(scip->set != NULL);
44306 
44307  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintStatusStatistics", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44308 
44309  SCIPmessageFPrintInfo(scip->messagehdlr, file, "SCIP Status : ");
44310  SCIP_CALL_ABORT( SCIPprintStage(scip, file) );
44311  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
44312 }
44313 
44314 /** outputs statistics for original problem
44315  *
44316  * @pre This method can be called if SCIP is in one of the following stages:
44317  * - \ref SCIP_STAGE_PROBLEM
44318  * - \ref SCIP_STAGE_TRANSFORMED
44319  * - \ref SCIP_STAGE_INITPRESOLVE
44320  * - \ref SCIP_STAGE_PRESOLVING
44321  * - \ref SCIP_STAGE_EXITPRESOLVE
44322  * - \ref SCIP_STAGE_PRESOLVED
44323  * - \ref SCIP_STAGE_SOLVING
44324  * - \ref SCIP_STAGE_SOLVED
44325  */
44327  SCIP* scip, /**< SCIP data structure */
44328  FILE* file /**< output file */
44329  )
44330 {
44331  assert(scip != NULL);
44332  assert(scip->set != NULL);
44333 
44334  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintOrigProblemStatistics", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44335 
44336  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Original Problem :\n");
44337  SCIPprobPrintStatistics(scip->origprob, scip->set, scip->messagehdlr, file);
44338 }
44339 
44340 /** outputs statistics for transformed problem
44341  *
44342  * @pre This method can be called if SCIP is in one of the following stages:
44343  * - \ref SCIP_STAGE_PROBLEM
44344  * - \ref SCIP_STAGE_TRANSFORMED
44345  * - \ref SCIP_STAGE_INITPRESOLVE
44346  * - \ref SCIP_STAGE_PRESOLVING
44347  * - \ref SCIP_STAGE_EXITPRESOLVE
44348  * - \ref SCIP_STAGE_PRESOLVED
44349  * - \ref SCIP_STAGE_SOLVING
44350  * - \ref SCIP_STAGE_SOLVED
44351  */
44353  SCIP* scip, /**< SCIP data structure */
44354  FILE* file /**< output file */
44355  )
44356 {
44357  assert(scip != NULL);
44358  assert(scip->set != NULL);
44359 
44360  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintTransProblemStatistics", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44361 
44362  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Presolved Problem :\n");
44363  SCIPprobPrintStatistics(scip->transprob, scip->set, scip->messagehdlr, file);
44364 }
44365 
44366 /** outputs presolver statistics
44367  *
44368  * @pre This method can be called if SCIP is in one of the following stages:
44369  * - \ref SCIP_STAGE_TRANSFORMED
44370  * - \ref SCIP_STAGE_INITPRESOLVE
44371  * - \ref SCIP_STAGE_PRESOLVING
44372  * - \ref SCIP_STAGE_EXITPRESOLVE
44373  * - \ref SCIP_STAGE_PRESOLVED
44374  * - \ref SCIP_STAGE_SOLVING
44375  * - \ref SCIP_STAGE_SOLVED
44376  */
44378  SCIP* scip, /**< SCIP data structure */
44379  FILE* file /**< output file */
44380  )
44381 {
44382  int i;
44383 
44384  assert(scip != NULL);
44385  assert(scip->set != NULL);
44386 
44387  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintPresolverStatistics", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44388 
44389  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Presolvers : ExecTime SetupTime Calls FixedVars AggrVars ChgTypes ChgBounds AddHoles DelCons AddCons ChgSides ChgCoefs\n");
44390 
44391  /* sort presolvers w.r.t. their name */
44392  SCIPsetSortPresolsName(scip->set);
44393 
44394  /* presolver statistics */
44395  for( i = 0; i < scip->set->npresols; ++i )
44396  {
44397  SCIP_PRESOL* presol;
44398  presol = scip->set->presols[i];
44399  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPpresolGetName(presol));
44400  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %6d %10d %10d %10d %10d %10d %10d %10d %10d %10d\n",
44401  SCIPpresolGetTime(presol),
44402  SCIPpresolGetSetupTime(presol),
44403  SCIPpresolGetNCalls(presol),
44404  SCIPpresolGetNFixedVars(presol),
44405  SCIPpresolGetNAggrVars(presol),
44406  SCIPpresolGetNChgVarTypes(presol),
44407  SCIPpresolGetNChgBds(presol),
44408  SCIPpresolGetNAddHoles(presol),
44409  SCIPpresolGetNDelConss(presol),
44410  SCIPpresolGetNAddConss(presol),
44411  SCIPpresolGetNChgSides(presol),
44412  SCIPpresolGetNChgCoefs(presol));
44413  }
44414 
44415  /* sort propagators w.r.t. their name */
44416  SCIPsetSortPropsName(scip->set);
44417 
44418  for( i = 0; i < scip->set->nprops; ++i )
44419  {
44420  SCIP_PROP* prop;
44421  prop = scip->set->props[i];
44422  if( SCIPpropDoesPresolve(prop) )
44423  {
44424  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPpropGetName(prop));
44425  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %6d %10d %10d %10d %10d %10d %10d %10d %10d %10d\n",
44426  SCIPpropGetPresolTime(prop),
44427  SCIPpropGetSetupTime(prop),
44429  SCIPpropGetNFixedVars(prop),
44430  SCIPpropGetNAggrVars(prop),
44432  SCIPpropGetNChgBds(prop),
44433  SCIPpropGetNAddHoles(prop),
44434  SCIPpropGetNDelConss(prop),
44435  SCIPpropGetNAddConss(prop),
44436  SCIPpropGetNChgSides(prop),
44437  SCIPpropGetNChgCoefs(prop));
44438  }
44439  }
44440 
44441  /* constraint handler presolving methods statistics */
44442  for( i = 0; i < scip->set->nconshdlrs; ++i )
44443  {
44444  SCIP_CONSHDLR* conshdlr;
44445  int maxnactiveconss;
44446 
44447  conshdlr = scip->set->conshdlrs[i];
44448  maxnactiveconss = SCIPconshdlrGetMaxNActiveConss(conshdlr);
44449  if( SCIPconshdlrDoesPresolve(conshdlr)
44450  && (maxnactiveconss > 0 || !SCIPconshdlrNeedsCons(conshdlr)
44451  || SCIPconshdlrGetNFixedVars(conshdlr) > 0
44452  || SCIPconshdlrGetNAggrVars(conshdlr) > 0
44453  || SCIPconshdlrGetNChgVarTypes(conshdlr) > 0
44454  || SCIPconshdlrGetNChgBds(conshdlr) > 0
44455  || SCIPconshdlrGetNAddHoles(conshdlr) > 0
44456  || SCIPconshdlrGetNDelConss(conshdlr) > 0
44457  || SCIPconshdlrGetNAddConss(conshdlr) > 0
44458  || SCIPconshdlrGetNChgSides(conshdlr) > 0
44459  || SCIPconshdlrGetNChgCoefs(conshdlr) > 0
44460  || SCIPconshdlrGetNUpgdConss(conshdlr) > 0) )
44461  {
44462  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPconshdlrGetName(conshdlr));
44463  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %6d %10d %10d %10d %10d %10d %10d %10d %10d %10d\n",
44464  SCIPconshdlrGetPresolTime(conshdlr),
44465  SCIPconshdlrGetSetupTime(conshdlr),
44466  SCIPconshdlrGetNPresolCalls(conshdlr),
44467  SCIPconshdlrGetNFixedVars(conshdlr),
44468  SCIPconshdlrGetNAggrVars(conshdlr),
44469  SCIPconshdlrGetNChgVarTypes(conshdlr),
44470  SCIPconshdlrGetNChgBds(conshdlr),
44471  SCIPconshdlrGetNAddHoles(conshdlr),
44472  SCIPconshdlrGetNDelConss(conshdlr),
44473  SCIPconshdlrGetNAddConss(conshdlr),
44474  SCIPconshdlrGetNChgSides(conshdlr),
44475  SCIPconshdlrGetNChgCoefs(conshdlr));
44476  }
44477  }
44478 
44479  /* root node bound changes */
44480  SCIPmessageFPrintInfo(scip->messagehdlr, file, " root node : - - - %10d - - %10d - - - - -\n",
44481  scip->stat->nrootintfixings, scip->stat->nrootboundchgs);
44482 }
44483 
44484 /** outputs constraint statistics
44485  *
44486  * @pre This method can be called if SCIP is in one of the following stages:
44487  * - \ref SCIP_STAGE_TRANSFORMED
44488  * - \ref SCIP_STAGE_INITPRESOLVE
44489  * - \ref SCIP_STAGE_PRESOLVING
44490  * - \ref SCIP_STAGE_EXITPRESOLVE
44491  * - \ref SCIP_STAGE_PRESOLVED
44492  * - \ref SCIP_STAGE_SOLVING
44493  * - \ref SCIP_STAGE_SOLVED
44494  */
44496  SCIP* scip, /**< SCIP data structure */
44497  FILE* file /**< output file */
44498  )
44499 {
44500  int i;
44501 
44502  assert(scip != NULL);
44503  assert(scip->set != NULL);
44504 
44505  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintConstraintStatistics", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44506 
44507  /* Add maximal number of constraints of the same type? So far this information is not added because of lack of space. */
44508  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Constraints : Number MaxNumber #Separate #Propagate #EnfoLP #EnfoRelax #EnfoPS #Check #ResProp Cutoffs DomReds Cuts Applied Conss Children\n");
44509 
44510  for( i = 0; i < scip->set->nconshdlrs; ++i )
44511  {
44512  SCIP_CONSHDLR* conshdlr;
44513  int startnactiveconss;
44514  int maxnactiveconss;
44515 
44516  conshdlr = scip->set->conshdlrs[i];
44517  startnactiveconss = SCIPconshdlrGetStartNActiveConss(conshdlr);
44518  maxnactiveconss = SCIPconshdlrGetMaxNActiveConss(conshdlr);
44519  if( maxnactiveconss > 0 || !SCIPconshdlrNeedsCons(conshdlr) )
44520  {
44521  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPconshdlrGetName(conshdlr));
44522  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",
44523  startnactiveconss,
44524  maxnactiveconss > startnactiveconss ? '+' : ' ',
44525  maxnactiveconss,
44526  SCIPconshdlrGetNSepaCalls(conshdlr),
44527  SCIPconshdlrGetNPropCalls(conshdlr),
44528  SCIPconshdlrGetNEnfoLPCalls(conshdlr),
44530  SCIPconshdlrGetNEnfoPSCalls(conshdlr),
44531  SCIPconshdlrGetNCheckCalls(conshdlr),
44532  SCIPconshdlrGetNRespropCalls(conshdlr),
44533  SCIPconshdlrGetNCutoffs(conshdlr),
44534  SCIPconshdlrGetNDomredsFound(conshdlr),
44535  SCIPconshdlrGetNCutsFound(conshdlr),
44536  SCIPconshdlrGetNCutsApplied(conshdlr),
44537  SCIPconshdlrGetNConssFound(conshdlr),
44538  SCIPconshdlrGetNChildren(conshdlr));
44539  }
44540  }
44541 }
44542 
44543 /** outputs constraint timing statistics
44544  *
44545  * @pre This method can be called if SCIP is in one of the following stages:
44546  * - \ref SCIP_STAGE_TRANSFORMED
44547  * - \ref SCIP_STAGE_INITPRESOLVE
44548  * - \ref SCIP_STAGE_PRESOLVING
44549  * - \ref SCIP_STAGE_EXITPRESOLVE
44550  * - \ref SCIP_STAGE_PRESOLVED
44551  * - \ref SCIP_STAGE_SOLVING
44552  * - \ref SCIP_STAGE_SOLVED
44553  */
44555  SCIP* scip, /**< SCIP data structure */
44556  FILE* file /**< output file */
44557  )
44558 {
44559  int i;
44560 
44561  assert(scip != NULL);
44562  assert(scip->set != NULL);
44563 
44564  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintConstraintTimingStatistics", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44565 
44566  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Constraint Timings : TotalTime SetupTime Separate Propagate EnfoLP EnfoPS EnfoRelax Check ResProp SB-Prop\n");
44567 
44568  for( i = 0; i < scip->set->nconshdlrs; ++i )
44569  {
44570  SCIP_CONSHDLR* conshdlr;
44571  int maxnactiveconss;
44572 
44573  conshdlr = scip->set->conshdlrs[i];
44574  maxnactiveconss = SCIPconshdlrGetMaxNActiveConss(conshdlr);
44575  if( maxnactiveconss > 0 || !SCIPconshdlrNeedsCons(conshdlr) )
44576  {
44577  SCIP_Real totaltime;
44578 
44579  totaltime = SCIPconshdlrGetSepaTime(conshdlr) + SCIPconshdlrGetPropTime(conshdlr)
44581  + SCIPconshdlrGetEnfoLPTime(conshdlr)
44582  + SCIPconshdlrGetEnfoPSTime(conshdlr)
44583  + SCIPconshdlrGetEnfoRelaxTime(conshdlr)
44584  + SCIPconshdlrGetCheckTime(conshdlr)
44585  + SCIPconshdlrGetRespropTime(conshdlr)
44586  + SCIPconshdlrGetSetupTime(conshdlr);
44587 
44588  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPconshdlrGetName(conshdlr));
44589  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",
44590  totaltime,
44591  SCIPconshdlrGetSetupTime(conshdlr),
44592  SCIPconshdlrGetSepaTime(conshdlr),
44593  SCIPconshdlrGetPropTime(conshdlr),
44594  SCIPconshdlrGetEnfoLPTime(conshdlr),
44595  SCIPconshdlrGetEnfoPSTime(conshdlr),
44596  SCIPconshdlrGetEnfoRelaxTime(conshdlr),
44597  SCIPconshdlrGetCheckTime(conshdlr),
44598  SCIPconshdlrGetRespropTime(conshdlr),
44600  }
44601  }
44602 }
44603 
44604 /** outputs propagator statistics
44605  *
44606  * @pre This method can be called if SCIP is in one of the following stages:
44607  * - \ref SCIP_STAGE_TRANSFORMED
44608  * - \ref SCIP_STAGE_INITPRESOLVE
44609  * - \ref SCIP_STAGE_PRESOLVING
44610  * - \ref SCIP_STAGE_EXITPRESOLVE
44611  * - \ref SCIP_STAGE_PRESOLVED
44612  * - \ref SCIP_STAGE_SOLVING
44613  * - \ref SCIP_STAGE_SOLVED
44614  */
44616  SCIP* scip, /**< SCIP data structure */
44617  FILE* file /**< output file */
44618  )
44619 {
44620  int i;
44621 
44622  assert(scip != NULL);
44623  assert(scip->set != NULL);
44624 
44625  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintPropagatorStatistics", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44626 
44627  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Propagators : #Propagate #ResProp Cutoffs DomReds\n");
44628 
44629  /* sort propagaters w.r.t. their name */
44630  SCIPsetSortPropsName(scip->set);
44631 
44632  for( i = 0; i < scip->set->nprops; ++i )
44633  {
44634  SCIP_PROP* prop;
44635  prop = scip->set->props[i];
44636 
44637  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
44638  SCIPpropGetName(prop),
44639  SCIPpropGetNCalls(prop),
44641  SCIPpropGetNCutoffs(prop),
44642  SCIPpropGetNDomredsFound(prop));
44643  }
44644 
44645  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Propagator Timings : TotalTime SetupTime Presolve Propagate ResProp SB-Prop\n");
44646 
44647  for( i = 0; i < scip->set->nprops; ++i )
44648  {
44649  SCIP_PROP* prop;
44650  SCIP_Real totaltime;
44651 
44652  prop = scip->set->props[i];
44653  totaltime = SCIPpropGetPresolTime(prop) + SCIPpropGetTime(prop) + SCIPpropGetRespropTime(prop)
44655 
44656  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPpropGetName(prop));
44657  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f\n",
44658  totaltime,
44659  SCIPpropGetSetupTime(prop),
44660  SCIPpropGetPresolTime(prop),
44661  SCIPpropGetTime(prop),
44662  SCIPpropGetRespropTime(prop),
44664  }
44665 }
44666 
44667 /** outputs conflict statistics
44668  *
44669  * @pre This method can be called if SCIP is in one of the following stages:
44670  * - \ref SCIP_STAGE_TRANSFORMED
44671  * - \ref SCIP_STAGE_INITPRESOLVE
44672  * - \ref SCIP_STAGE_PRESOLVING
44673  * - \ref SCIP_STAGE_EXITPRESOLVE
44674  * - \ref SCIP_STAGE_PRESOLVED
44675  * - \ref SCIP_STAGE_SOLVING
44676  * - \ref SCIP_STAGE_SOLVED
44677  */
44679  SCIP* scip, /**< SCIP data structure */
44680  FILE* file /**< output file */
44681  )
44682 {
44683  char initstoresize[SCIP_MAXSTRLEN];
44684  char maxstoresize[SCIP_MAXSTRLEN];
44685 
44686  assert(scip != NULL);
44687  assert(scip->set != NULL);
44688 
44689  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintConflictStatistics", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44690 
44691  if( scip->set->conf_maxstoresize == 0 )
44692  {
44693  (void)SCIPsnprintf(initstoresize, SCIP_MAXSTRLEN, "inf");
44694  (void)SCIPsnprintf(maxstoresize, SCIP_MAXSTRLEN, "inf");
44695  }
44696  else
44697  {
44698  int initsize = SCIPconflictstoreGetInitPoolSize(scip->conflictstore);
44699  int maxsize = SCIPconflictstoreGetMaxPoolSize(scip->conflictstore);
44700 
44701  if( maxsize == -1 )
44702  {
44703  (void)SCIPsnprintf(initstoresize, SCIP_MAXSTRLEN, "--");
44704  (void)SCIPsnprintf(maxstoresize, SCIP_MAXSTRLEN, "--");
44705  }
44706  else
44707  {
44708  assert(initsize >= 0);
44709  assert(maxsize >= 0);
44710 
44711  (void)SCIPsnprintf(initstoresize, SCIP_MAXSTRLEN, "%d", initsize);
44712  (void)SCIPsnprintf(maxstoresize, SCIP_MAXSTRLEN, "%d", maxsize);
44713  }
44714  }
44715  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);
44716  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",
44728  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",
44745  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",
44762  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",
44775  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",
44787  SCIPmessageFPrintInfo(scip->messagehdlr, file, " applied globally : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.1f - - %10" SCIP_LONGINT_FORMAT " - -\n",
44795  SCIPmessageFPrintInfo(scip->messagehdlr, file, " applied locally : - - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.1f - - %10" SCIP_LONGINT_FORMAT " - -\n",
44803 }
44804 
44805 /** outputs separator statistics
44806  *
44807  * @pre This method can be called if SCIP is in one of the following stages:
44808  * - \ref SCIP_STAGE_SOLVING
44809  * - \ref SCIP_STAGE_SOLVED
44810  */
44812  SCIP* scip, /**< SCIP data structure */
44813  FILE* file /**< output file */
44814  )
44815 {
44816  int i;
44817 
44818  assert(scip != NULL);
44819  assert(scip->set != NULL);
44820 
44821  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintSeparatorStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44822 
44823  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Separators : ExecTime SetupTime Calls Cutoffs DomReds Cuts Applied Conss\n");
44824  SCIPmessageFPrintInfo(scip->messagehdlr, file, " cut pool : %10.2f %10" SCIP_LONGINT_FORMAT " - - %10" SCIP_LONGINT_FORMAT " - - (maximal pool size: %d)\n",
44825  SCIPcutpoolGetTime(scip->cutpool),
44829 
44830  /* sort separators w.r.t. their name */
44831  SCIPsetSortSepasName(scip->set);
44832 
44833  for( i = 0; i < scip->set->nsepas; ++i )
44834  {
44835  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",
44836  SCIPsepaGetName(scip->set->sepas[i]),
44837  SCIPsepaGetTime(scip->set->sepas[i]),
44838  SCIPsepaGetSetupTime(scip->set->sepas[i]),
44839  SCIPsepaGetNCalls(scip->set->sepas[i]),
44840  SCIPsepaGetNCutoffs(scip->set->sepas[i]),
44841  SCIPsepaGetNDomredsFound(scip->set->sepas[i]),
44842  SCIPsepaGetNCutsFound(scip->set->sepas[i]),
44843  SCIPsepaGetNCutsApplied(scip->set->sepas[i]),
44844  SCIPsepaGetNConssFound(scip->set->sepas[i]));
44845  }
44846 }
44847 
44848 /** outputs pricer statistics
44849  *
44850  * @pre This method can be called if SCIP is in one of the following stages:
44851  * - \ref SCIP_STAGE_SOLVING
44852  * - \ref SCIP_STAGE_SOLVED
44853  */
44855  SCIP* scip, /**< SCIP data structure */
44856  FILE* file /**< output file */
44857  )
44858 {
44859  int i;
44860 
44861  assert(scip != NULL);
44862  assert(scip->set != NULL);
44863 
44864  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintPricerStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44865 
44866  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Pricers : ExecTime SetupTime Calls Vars\n");
44867  SCIPmessageFPrintInfo(scip->messagehdlr, file, " problem variables: %10.2f - %10d %10d\n",
44871 
44872  /* sort pricers w.r.t. their name */
44873  SCIPsetSortPricersName(scip->set);
44874 
44875  for( i = 0; i < scip->set->nactivepricers; ++i )
44876  {
44877  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10.2f %10d %10d\n",
44878  SCIPpricerGetName(scip->set->pricers[i]),
44879  SCIPpricerGetTime(scip->set->pricers[i]),
44880  SCIPpricerGetSetupTime(scip->set->pricers[i]),
44881  SCIPpricerGetNCalls(scip->set->pricers[i]),
44882  SCIPpricerGetNVarsFound(scip->set->pricers[i]));
44883  }
44884 }
44885 
44886 /** outputs branching rule statistics
44887  *
44888  * @pre This method can be called if SCIP is in one of the following stages:
44889  * - \ref SCIP_STAGE_SOLVING
44890  * - \ref SCIP_STAGE_SOLVED
44891  */
44893  SCIP* scip, /**< SCIP data structure */
44894  FILE* file /**< output file */
44895  )
44896 {
44897  int i;
44898 
44899  assert(scip != NULL);
44900  assert(scip->set != NULL);
44901 
44902  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintBranchruleStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44903 
44904  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Branching Rules : ExecTime SetupTime BranchLP BranchExt BranchPS Cutoffs DomReds Cuts Conss Children\n");
44905 
44906  /* sort branching rules w.r.t. their name */
44908 
44909  for( i = 0; i < scip->set->nbranchrules; ++i )
44910  {
44911  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",
44923  }
44924 }
44925 
44926 /** outputs heuristics statistics
44927  *
44928  * @pre This method can be called if SCIP is in one of the following stages:
44929  * - \ref SCIP_STAGE_PRESOLVING
44930  * - \ref SCIP_STAGE_EXITPRESOLVE
44931  * - \ref SCIP_STAGE_PRESOLVED
44932  * - \ref SCIP_STAGE_SOLVING
44933  * - \ref SCIP_STAGE_SOLVED
44934  */
44936  SCIP* scip, /**< SCIP data structure */
44937  FILE* file /**< output file */
44938  )
44939 {
44940  int ndivesets = 0;
44941  int i;
44942 
44943  assert(scip != NULL);
44944  assert(scip->set != NULL);
44945  assert(scip->tree != NULL);
44946 
44947  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintHeuristicStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44948 
44949  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Primal Heuristics : ExecTime SetupTime Calls Found Best\n");
44950  SCIPmessageFPrintInfo(scip->messagehdlr, file, " LP solutions : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
44952  scip->stat->nlpsolsfound, scip->stat->nlpbestsolsfound);
44953  SCIPmessageFPrintInfo(scip->messagehdlr, file, " relax solutions : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
44955  scip->stat->nrelaxsolsfound, scip->stat->nrelaxbestsolsfound);
44956  SCIPmessageFPrintInfo(scip->messagehdlr, file, " pseudo solutions : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
44958  scip->stat->npssolsfound, scip->stat->npsbestsolsfound);
44959  SCIPmessageFPrintInfo(scip->messagehdlr, file, " strong branching : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
44961  scip->stat->nsbsolsfound, scip->stat->nsbbestsolsfound);
44962 
44963  /* sort heuristics w.r.t. their names */
44964  SCIPsetSortHeursName(scip->set);
44965 
44966  for( i = 0; i < scip->set->nheurs; ++i )
44967  {
44968  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
44969  SCIPheurGetName(scip->set->heurs[i]),
44970  SCIPheurGetTime(scip->set->heurs[i]),
44971  SCIPheurGetSetupTime(scip->set->heurs[i]),
44972  SCIPheurGetNCalls(scip->set->heurs[i]),
44973  SCIPheurGetNSolsFound(scip->set->heurs[i]),
44974  SCIPheurGetNBestSolsFound(scip->set->heurs[i]));
44975 
44976  /* count heuristics that use diving; needed to determine output later */
44977  ndivesets += SCIPheurGetNDivesets(scip->set->heurs[i]);
44978  }
44979 
44980  SCIPmessageFPrintInfo(scip->messagehdlr, file, " other solutions : - - - %10" SCIP_LONGINT_FORMAT " -\n",
44981  scip->stat->nexternalsolsfound);
44982 
44983  if ( ndivesets > 0 )
44984  {
44985  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Diving Statistics : Calls Nodes LP Iters Backtracks MinDepth MaxDepth AvgDepth RoundSols NLeafSols MinSolDpt MaxSolDpt AvgSolDpt\n");
44986  for( i = 0; i < scip->set->nheurs; ++i )
44987  {
44988  int s;
44989  for( s = 0; s < SCIPheurGetNDivesets(scip->set->heurs[i]); ++s )
44990  {
44991  SCIP_DIVESET* diveset = SCIPheurGetDivesets(scip->set->heurs[i])[s];
44992  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10d", SCIPdivesetGetName(diveset), SCIPdivesetGetNCalls(diveset));
44993  if( SCIPdivesetGetNCalls(diveset) > 0 )
44994  {
44995  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10d %10d %10.1f %10" SCIP_LONGINT_FORMAT,
44996  SCIPdivesetGetNProbingNodes(diveset),
44997  SCIPdivesetGetNLPIterations(diveset),
44998  SCIPdivesetGetNBacktracks(diveset),
44999  SCIPdivesetGetMinDepth(diveset),
45000  SCIPdivesetGetMaxDepth(diveset),
45001  SCIPdivesetGetAvgDepth(diveset),
45003 
45004  if( SCIPdivesetGetNSolutionCalls(diveset) > 0 )
45005  {
45006  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10d %10d %10d %10.1f\n",
45011  }
45012  else
45013  SCIPmessageFPrintInfo(scip->messagehdlr, file, " - - - -\n");
45014  }
45015  else
45016  SCIPmessageFPrintInfo(scip->messagehdlr, file, " - - - - - - - - - - -\n");
45017  }
45018  }
45019  }
45020 }
45021 
45022 /** outputs compression statistics
45023  *
45024  * @pre This method can be called if SCIP is in one of the following stages:
45025  * - \ref SCIP_STAGE_PRESOLVING
45026  * - \ref SCIP_STAGE_EXITPRESOLVE
45027  * - \ref SCIP_STAGE_PRESOLVED
45028  * - \ref SCIP_STAGE_SOLVING
45029  * - \ref SCIP_STAGE_SOLVED
45030  */
45032  SCIP* scip, /**< SCIP data structure */
45033  FILE* file /**< output file */
45034  )
45035 {
45036  int i;
45037 
45038  assert(scip != NULL);
45039 
45040  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintCompressionStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45041 
45042  /* only print compression statistics if tree reoptimization is enabled */
45043  if( !scip->set->reopt_enable )
45044  return;
45045 
45046  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Tree Compressions : ExecTime SetupTime Calls Found\n");
45047 
45048  /* sort compressions w.r.t. their names */
45049  SCIPsetSortComprsName(scip->set);
45050 
45051  for( i = 0; i < scip->set->ncomprs; ++i )
45052  {
45053  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
45054  SCIPcomprGetName(scip->set->comprs[i]),
45055  SCIPcomprGetTime(scip->set->comprs[i]),
45056  SCIPcomprGetSetupTime(scip->set->comprs[i]),
45057  SCIPcomprGetNCalls(scip->set->comprs[i]),
45058  SCIPcomprGetNFound(scip->set->comprs[i]));
45059  }
45060 }
45061 
45062 /** outputs LP statistics
45063  *
45064  * @pre This method can be called if SCIP is in one of the following stages:
45065  * - \ref SCIP_STAGE_SOLVING
45066  * - \ref SCIP_STAGE_SOLVED
45067  */
45069  SCIP* scip, /**< SCIP data structure */
45070  FILE* file /**< output file */
45071  )
45072 {
45073  assert(scip != NULL);
45074  assert(scip->stat != NULL);
45075  assert(scip->lp != NULL);
45076 
45077  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintLPStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45078 
45079  SCIPmessageFPrintInfo(scip->messagehdlr, file, "LP : Time Calls Iterations Iter/call Iter/sec Time-0-It Calls-0-It ItLimit\n");
45080 
45081  SCIPmessageFPrintInfo(scip->messagehdlr, file, " primal LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
45083  scip->stat->nprimallps + scip->stat->nprimalzeroitlps,
45084  scip->stat->nprimallpiterations,
45085  scip->stat->nprimallps > 0 ? (SCIP_Real)scip->stat->nprimallpiterations/(SCIP_Real)scip->stat->nprimallps : 0.0);
45086  if( SCIPclockGetTime(scip->stat->primallptime) >= 0.01 )
45088  else
45089  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -");
45090  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10" SCIP_LONGINT_FORMAT "\n",
45091  scip->stat->primalzeroittime,
45092  scip->stat->nprimalzeroitlps);
45093 
45094  SCIPmessageFPrintInfo(scip->messagehdlr, file, " dual LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
45096  scip->stat->nduallps + scip->stat->ndualzeroitlps,
45097  scip->stat->nduallpiterations,
45098  scip->stat->nduallps > 0 ? (SCIP_Real)scip->stat->nduallpiterations/(SCIP_Real)scip->stat->nduallps : 0.0);
45099  if( SCIPclockGetTime(scip->stat->duallptime) >= 0.01 )
45101  else
45102  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -");
45103  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10" SCIP_LONGINT_FORMAT "\n",
45104  scip->stat->dualzeroittime,
45105  scip->stat->ndualzeroitlps);
45106 
45107  SCIPmessageFPrintInfo(scip->messagehdlr, file, " lex dual LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
45109  scip->stat->nlexduallps,
45110  scip->stat->nlexduallpiterations,
45111  scip->stat->nlexduallps > 0 ? (SCIP_Real)scip->stat->nlexduallpiterations/(SCIP_Real)scip->stat->nlexduallps : 0.0);
45112  if( SCIPclockGetTime(scip->stat->lexduallptime) >= 0.01 )
45114  else
45115  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -\n");
45116 
45117  SCIPmessageFPrintInfo(scip->messagehdlr, file, " barrier LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
45119  scip->stat->nbarrierlps,
45120  scip->stat->nbarrierlpiterations,
45121  scip->stat->nbarrierlps > 0 ? (SCIP_Real)scip->stat->nbarrierlpiterations/(SCIP_Real)scip->stat->nbarrierlps : 0.0);
45122  if( SCIPclockGetTime(scip->stat->barrierlptime) >= 0.01 )
45124  else
45125  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -");
45126  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10" SCIP_LONGINT_FORMAT "\n",
45127  scip->stat->barrierzeroittime,
45128  scip->stat->nbarrierzeroitlps);
45129 
45130  SCIPmessageFPrintInfo(scip->messagehdlr, file, " diving/probing LP: %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
45132  scip->stat->ndivinglps,
45133  scip->stat->ndivinglpiterations,
45134  scip->stat->ndivinglps > 0 ? (SCIP_Real)scip->stat->ndivinglpiterations/(SCIP_Real)scip->stat->ndivinglps : 0.0);
45135  if( SCIPclockGetTime(scip->stat->divinglptime) >= 0.01 )
45137  else
45138  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -\n");
45139 
45140  SCIPmessageFPrintInfo(scip->messagehdlr, file, " strong branching : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
45142  scip->stat->nstrongbranchs,
45143  scip->stat->nsblpiterations,
45144  scip->stat->nstrongbranchs > 0 ? (SCIP_Real)scip->stat->nsblpiterations/(SCIP_Real)scip->stat->nstrongbranchs : 0.0);
45145  if( SCIPclockGetTime(scip->stat->strongbranchtime) >= 0.01 )
45147  else
45148  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -");
45149  SCIPmessageFPrintInfo(scip->messagehdlr, file, " - - %10d\n", scip->stat->nsbtimesiterlimhit);
45150 
45151  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (at root node) : - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f -\n",
45152  scip->stat->nrootstrongbranchs,
45153  scip->stat->nrootsblpiterations,
45154  scip->stat->nrootstrongbranchs > 0
45156 
45157  SCIPmessageFPrintInfo(scip->messagehdlr, file, " conflict analysis: %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
45159  scip->stat->nconflictlps,
45160  scip->stat->nconflictlpiterations,
45161  scip->stat->nconflictlps > 0 ? (SCIP_Real)scip->stat->nconflictlpiterations/(SCIP_Real)scip->stat->nconflictlps : 0.0);
45162  if( SCIPclockGetTime(scip->stat->conflictlptime) >= 0.01 )
45164  else
45165  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -\n");
45166 }
45167 
45168 /** outputs NLP statistics
45169  *
45170  * @pre This method can be called if SCIP is in one of the following stages:
45171  * - \ref SCIP_STAGE_SOLVING
45172  * - \ref SCIP_STAGE_SOLVED
45173  */
45175  SCIP* scip, /**< SCIP data structure */
45176  FILE* file /**< output file */
45177  )
45178 {
45179  assert(scip != NULL);
45180  assert(scip->stat != NULL);
45181 
45182  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintNLPStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45183 
45184  if( scip->nlp == NULL )
45185  return;
45186 
45187  SCIPmessageFPrintInfo(scip->messagehdlr, file, "NLP : Time Calls\n");
45188 
45189  SCIPmessageFPrintInfo(scip->messagehdlr, file, " all NLPs : %10.2f %10" SCIP_LONGINT_FORMAT "\n",
45191  scip->stat->nnlps);
45192 }
45193 
45194 /** outputs relaxator statistics
45195  *
45196  * @pre This method can be called if SCIP is in one of the following stages:
45197  * - \ref SCIP_STAGE_SOLVING
45198  * - \ref SCIP_STAGE_SOLVED
45199  */
45201  SCIP* scip, /**< SCIP data structure */
45202  FILE* file /**< output file */
45203  )
45204 {
45205  int i;
45206 
45207  assert(scip != NULL);
45208  assert(scip->set != NULL);
45209 
45210  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintRelaxatorStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45211 
45212  if( scip->set->nrelaxs == 0 )
45213  return;
45214 
45215  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Relaxators : Time Calls\n");
45216 
45217  /* sort relaxators w.r.t. their name */
45218  SCIPsetSortRelaxsName(scip->set);
45219 
45220  for( i = 0; i < scip->set->nrelaxs; ++i )
45221  {
45222  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10" SCIP_LONGINT_FORMAT "\n",
45223  SCIPrelaxGetName(scip->set->relaxs[i]),
45224  SCIPrelaxGetTime(scip->set->relaxs[i]),
45225  SCIPrelaxGetNCalls(scip->set->relaxs[i]));
45226  }
45227 }
45228 
45229 /** outputs tree statistics
45230  *
45231  * @pre This method can be called if SCIP is in one of the following stages:
45232  * - \ref SCIP_STAGE_SOLVING
45233  * - \ref SCIP_STAGE_SOLVED
45234  */
45236  SCIP* scip, /**< SCIP data structure */
45237  FILE* file /**< output file */
45238  )
45239 {
45240  assert(scip != NULL);
45241  assert(scip->stat != NULL);
45242  assert(scip->tree != NULL);
45243 
45244  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintTreeStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45245 
45246  SCIPmessageFPrintInfo(scip->messagehdlr, file, "B&B Tree :\n");
45247  SCIPmessageFPrintInfo(scip->messagehdlr, file, " number of runs : %10d\n", scip->stat->nruns);
45248  SCIPmessageFPrintInfo(scip->messagehdlr, file,
45249  " nodes : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " internal, %" SCIP_LONGINT_FORMAT " leaves)\n",
45250  scip->stat->nnodes, scip->stat->ninternalnodes, scip->stat->nnodes - scip->stat->ninternalnodes );
45251  SCIPmessageFPrintInfo(scip->messagehdlr, file, " feasible leaves : %10d\n", scip->stat->nfeasleaves);
45252  SCIPmessageFPrintInfo(scip->messagehdlr, file, " infeas. leaves : %10d\n", scip->stat->ninfeasleaves);
45253  SCIPmessageFPrintInfo(scip->messagehdlr, file, " objective leaves : %10d\n", scip->stat->nobjleaves);
45254  SCIPmessageFPrintInfo(scip->messagehdlr, file,
45255  " nodes (total) : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " internal, %" SCIP_LONGINT_FORMAT " leaves)\n",
45257  SCIPmessageFPrintInfo(scip->messagehdlr, file, " nodes left : %10d\n", SCIPtreeGetNNodes(scip->tree));
45258  SCIPmessageFPrintInfo(scip->messagehdlr, file, " max depth : %10d\n", scip->stat->maxdepth);
45259  SCIPmessageFPrintInfo(scip->messagehdlr, file, " max depth (total): %10d\n", scip->stat->maxtotaldepth);
45260  SCIPmessageFPrintInfo(scip->messagehdlr, file, " backtracks : %10" SCIP_LONGINT_FORMAT " (%.1f%%)\n", scip->stat->nbacktracks,
45261  scip->stat->nnodes > 0 ? 100.0 * (SCIP_Real)scip->stat->nbacktracks / (SCIP_Real)scip->stat->nnodes : 0.0);
45262  SCIPmessageFPrintInfo(scip->messagehdlr, file, " early backtracks : %10" SCIP_LONGINT_FORMAT " (%.1f%%)\n", scip->stat->nearlybacktracks,
45263  scip->stat->nbacktracks > 0 ? 100.0 * (SCIP_Real)scip->stat->nearlybacktracks / (SCIP_Real)scip->stat->nbacktracks : 0.0);
45264  SCIPmessageFPrintInfo(scip->messagehdlr, file, " nodes exc. ref. : %10" SCIP_LONGINT_FORMAT " (%.1f%%)\n", scip->stat->nnodesaboverefbound,
45265  scip->stat->nnodes > 0 ? 100.0 * (SCIP_Real)scip->stat->nnodesaboverefbound / (SCIP_Real)scip->stat->nnodes : 0.0);
45266 
45267  SCIPmessageFPrintInfo(scip->messagehdlr, file, " delayed cutoffs : %10" SCIP_LONGINT_FORMAT "\n", scip->stat->ndelayedcutoffs);
45268  SCIPmessageFPrintInfo(scip->messagehdlr, file, " repropagations : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " domain reductions, %" SCIP_LONGINT_FORMAT " cutoffs)\n",
45269  scip->stat->nreprops, scip->stat->nrepropboundchgs, scip->stat->nrepropcutoffs);
45270  SCIPmessageFPrintInfo(scip->messagehdlr, file, " avg switch length: %10.2f\n",
45271  scip->stat->nnodes > 0
45272  ? (SCIP_Real)(scip->stat->nactivatednodes + scip->stat->ndeactivatednodes) / (SCIP_Real)scip->stat->nnodes : 0.0);
45273  SCIPmessageFPrintInfo(scip->messagehdlr, file, " switching time : %10.2f\n", SCIPclockGetTime(scip->stat->nodeactivationtime));
45274 }
45275 
45276 /** outputs solution statistics
45277  *
45278  * @pre This method can be called if SCIP is in one of the following stages:
45279  * - \ref SCIP_STAGE_PRESOLVING
45280  * - \ref SCIP_STAGE_EXITPRESOLVE
45281  * - \ref SCIP_STAGE_PRESOLVED
45282  * - \ref SCIP_STAGE_SOLVING
45283  * - \ref SCIP_STAGE_SOLVED
45284  */
45286  SCIP* scip, /**< SCIP data structure */
45287  FILE* file /**< output file */
45288  )
45289 {
45290  SCIP_Real primalbound;
45291  SCIP_Real dualbound;
45292  SCIP_Real bestsol;
45293  SCIP_Real gap;
45294  SCIP_Real firstprimalbound;
45295  SCIP_Bool objlimitreached;
45296  char limsolstring[SCIP_MAXSTRLEN];
45297 
45298  assert(scip != NULL);
45299  assert(scip->stat != NULL);
45300  assert(scip->primal != NULL);
45301 
45302  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintSolutionStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45303 
45304  primalbound = getPrimalbound(scip);
45305  dualbound = getDualbound(scip);
45306  gap = SCIPgetGap(scip);
45307 
45308  objlimitreached = FALSE;
45309  if( SCIPgetStage(scip) == SCIP_STAGE_SOLVED && scip->primal->nlimsolsfound == 0
45310  && !SCIPisInfinity(scip, primalbound) )
45311  objlimitreached = TRUE;
45312 
45313  if( scip->primal->nsolsfound != scip->primal->nlimsolsfound )
45314  (void) SCIPsnprintf(limsolstring, SCIP_MAXSTRLEN, ", %" SCIP_LONGINT_FORMAT " respecting the objective limit", scip->primal->nlimsolsfound);
45315  else
45316  limsolstring[0] = '\0';
45317 
45318  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Solution :\n");
45319  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Solutions found : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " improvements%s)\n",
45320  scip->primal->nsolsfound, scip->primal->nbestsolsfound, limsolstring);
45321 
45322  if( objlimitreached || SCIPsetIsInfinity(scip->set, REALABS(primalbound)) )
45323  {
45324  if( scip->set->stage == SCIP_STAGE_SOLVED )
45325  {
45326  if( scip->primal->nlimsolsfound == 0 )
45327  {
45328  if( SCIPgetStatus(scip) == SCIP_STATUS_INFORUNBD )
45329  {
45330  assert(!objlimitreached);
45331  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : infeasible or unbounded\n");
45332  }
45333  else
45334  {
45335  assert(SCIPgetStatus(scip) == SCIP_STATUS_INFEASIBLE);
45336  if( objlimitreached )
45337  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : infeasible (objective limit reached)\n");
45338  else
45339  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : infeasible\n");
45340  }
45341  }
45342  else
45343  {
45344  assert(!objlimitreached);
45345  assert(SCIPgetStatus(scip) == SCIP_STATUS_UNBOUNDED);
45346  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : unbounded\n");
45347  }
45348  }
45349  else
45350  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : -\n");
45351  }
45352  else
45353  {
45354  if( scip->primal->nlimsolsfound == 0 )
45355  {
45356  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : %+21.14e", primalbound);
45357  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (user objective limit)\n");
45358  }
45359  else
45360  {
45361  /* display first primal bound line */
45362  firstprimalbound = scip->stat->firstprimalbound;
45363  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First Solution : %+21.14e", firstprimalbound);
45364 
45365  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (in run %d, after %" SCIP_LONGINT_FORMAT " nodes, %.2f seconds, depth %d, found by <%s>)\n",
45366  scip->stat->nrunsbeforefirst,
45367  scip->stat->nnodesbeforefirst,
45368  scip->stat->firstprimaltime,
45369  scip->stat->firstprimaldepth,
45370  ( scip->stat->firstprimalheur != NULL )
45371  ? ( SCIPheurGetName(scip->stat->firstprimalheur) )
45372  : (( scip->stat->nrunsbeforefirst == 0 ) ? "initial" : "relaxation"));
45373 
45374  if( SCIPisInfinity(scip, scip->stat->firstsolgap) )
45375  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap First Sol. : infinite\n");
45376  else
45377  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap First Sol. : %10.2f %%\n", 100.0 * scip->stat->firstsolgap);
45378 
45379  if( SCIPisInfinity(scip, scip->stat->lastsolgap) )
45380  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap Last Sol. : infinite\n");
45381  else
45382  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap Last Sol. : %10.2f %%\n", 100.0 * scip->stat->lastsolgap);
45383 
45384  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : %+21.14e", primalbound);
45385 
45386  /* display (best) primal bound */
45387  bestsol = SCIPsolGetObj(scip->primal->sols[0], scip->set, scip->transprob, scip->origprob);
45388  bestsol = SCIPretransformObj(scip, bestsol);
45389  if( SCIPsetIsGT(scip->set, bestsol, primalbound) )
45390  {
45391  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (user objective limit)\n");
45392  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Best Solution : %+21.14e", bestsol);
45393  }
45394  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (in run %d, after %" SCIP_LONGINT_FORMAT " nodes, %.2f seconds, depth %d, found by <%s>)\n",
45395  SCIPsolGetRunnum(scip->primal->sols[0]),
45396  SCIPsolGetNodenum(scip->primal->sols[0]),
45397  SCIPsolGetTime(scip->primal->sols[0]),
45398  SCIPsolGetDepth(scip->primal->sols[0]),
45399  SCIPsolGetHeur(scip->primal->sols[0]) != NULL
45401  : (SCIPsolGetRunnum(scip->primal->sols[0]) == 0 ? "initial" : "relaxation"));
45402  }
45403  }
45404  if( objlimitreached || SCIPsetIsInfinity(scip->set, REALABS(dualbound)) )
45405  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Dual Bound : -\n");
45406  else
45407  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Dual Bound : %+21.14e\n", dualbound);
45408  if( SCIPsetIsInfinity(scip->set, gap) )
45409  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap : infinite\n");
45410  else
45411  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap : %10.2f %%\n", 100.0 * gap);
45412 
45413  if( scip->set->misc_calcintegral )
45414  {
45415  if( SCIPgetStatus(scip) == SCIP_STATUS_INFEASIBLE )
45416  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Avg. Gap : - (problem infeasible)\n");
45417  else
45418  {
45419  SCIP_Real avggap;
45420  SCIP_Real primaldualintegral;
45421 
45422  if( !SCIPisFeasZero(scip, SCIPgetSolvingTime(scip)) )
45423  {
45424  primaldualintegral = SCIPstatGetPrimalDualIntegral(scip->stat, scip->set, scip->transprob, scip->origprob);
45425  avggap = primaldualintegral/SCIPgetSolvingTime(scip);
45426  }
45427  else
45428  {
45429  avggap = 0.0;
45430  primaldualintegral = 0.0;
45431  }
45432 
45433  /* caution: this assert is non-deterministic since it depends on the solving time */
45434  assert(0.0 <= avggap && SCIPisLE(scip, avggap, 100.0));
45435 
45436  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Avg. Gap : %10.2f %% (%.2f primal-dual integral)\n",
45437  avggap, primaldualintegral);
45438  }
45439  }
45440  else
45441  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Avg. Gap : - (not evaluated)\n");
45442 }
45443 
45444 /** outputs concurrent solver statistics
45445  *
45446  * @pre This method can be called if SCIP is in one of the following stages:
45447  * - \ref SCIP_STAGE_TRANSFORMED
45448  * - \ref SCIP_STAGE_INITPRESOLVE
45449  * - \ref SCIP_STAGE_PRESOLVING
45450  * - \ref SCIP_STAGE_EXITPRESOLVE
45451  * - \ref SCIP_STAGE_PRESOLVED
45452  * - \ref SCIP_STAGE_SOLVING
45453  * - \ref SCIP_STAGE_SOLVED
45454  */
45456  SCIP* scip, /**< SCIP data structure */
45457  FILE* file /**< output file */
45458  )
45459 {
45460  SCIP_CONCSOLVER** concsolvers;
45461  int nconcsolvers;
45462  int i;
45463  int winner;
45464 
45465  assert(scip != NULL);
45466  assert(scip->set != NULL);
45467 
45468  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintConcsolverStatistics", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45469 
45471  return;
45472 
45473  nconcsolvers = SCIPgetNConcurrentSolvers(scip);
45474  concsolvers = SCIPgetConcurrentSolvers(scip);
45475  winner = SCIPsyncstoreGetWinner(scip->syncstore);
45476 
45477  if( nconcsolvers > 0 )
45478  {
45479  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Concurrent Solvers : SolvingTime SyncTime Nodes LP Iters SolsShared SolsRecvd TighterBnds TighterIntBnds\n");
45480  for( i = 0; i < nconcsolvers; ++i )
45481  {
45482  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",
45483  winner == i ? '*' : ' ',
45484  SCIPconcsolverGetName(concsolvers[i]),
45485  SCIPconcsolverGetSolvingTime(concsolvers[i]),
45486  SCIPconcsolverGetSyncTime(concsolvers[i]),
45487  SCIPconcsolverGetNNodes(concsolvers[i]),
45488  SCIPconcsolverGetNLPIterations(concsolvers[i]),
45489  SCIPconcsolverGetNSolsShared(concsolvers[i]),
45490  SCIPconcsolverGetNSolsRecvd(concsolvers[i]),
45491  SCIPconcsolverGetNTighterBnds(concsolvers[i]),
45492  SCIPconcsolverGetNTighterIntBnds(concsolvers[i])
45493  );
45494  }
45495  }
45496 }
45497 
45498 /** outputs root statistics
45499  *
45500  * @pre This method can be called if SCIP is in one of the following stages:
45501  * - \ref SCIP_STAGE_SOLVING
45502  * - \ref SCIP_STAGE_SOLVED
45503  */
45505  SCIP* scip, /**< SCIP data structure */
45506  FILE* file /**< output file */
45507  )
45508 {
45509  SCIP_Real dualboundroot;
45510  SCIP_Real firstdualboundroot;
45511  SCIP_Real firstlptime;
45512  SCIP_Real firstlpspeed;
45513 
45514  assert(scip != NULL);
45515  assert(scip->stat != NULL);
45516  assert(scip->primal != NULL);
45517 
45518  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintRootStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45519 
45520  dualboundroot = SCIPgetDualboundRoot(scip);
45521  firstdualboundroot = SCIPgetFirstLPDualboundRoot(scip);
45522  firstlptime = SCIPgetFirstLPTime(scip);
45523 
45524  if( firstlptime > 0.0 )
45525  firstlpspeed = (SCIP_Real)scip->stat->nrootfirstlpiterations/firstlptime;
45526  else
45527  firstlpspeed = 0.0;
45528 
45529  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Root Node :\n");
45530  if( SCIPsetIsInfinity(scip->set, REALABS(firstdualboundroot)) )
45531  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP value : -\n");
45532  else
45533  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP value : %+21.14e\n", firstdualboundroot);
45534  if( firstlpspeed > 0.0 )
45535  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP Iters : %10" SCIP_LONGINT_FORMAT " (%.2f Iter/sec)\n",
45537  (SCIP_Real)scip->stat->nrootfirstlpiterations/firstlptime);
45538  else
45539  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP Iters : %10" SCIP_LONGINT_FORMAT "\n", scip->stat->nrootfirstlpiterations);
45540  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP Time : %10.2f\n", firstlptime);
45541 
45542  if( SCIPsetIsInfinity(scip->set, REALABS(dualboundroot)) )
45543  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Final Dual Bound : -\n");
45544  else
45545  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Final Dual Bound : %+21.14e\n", dualboundroot);
45546  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Final Root Iters : %10" SCIP_LONGINT_FORMAT "\n", scip->stat->nrootlpiterations);
45547 
45548  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Root LP Estimate : ");
45549  if( scip->stat->rootlpbestestimate != SCIP_INVALID ) /*lint !e777*/
45550  {
45551  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%+21.14e\n", SCIPretransformObj(scip, scip->stat->rootlpbestestimate));
45552  }
45553  else
45554  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%21s\n","-");
45555 }
45556 
45557 /** outputs timing statistics
45558  *
45559  * @pre This method can be called if SCIP is in one of the following stages:
45560  * - \ref SCIP_STAGE_PROBLEM
45561  * - \ref SCIP_STAGE_TRANSFORMED
45562  * - \ref SCIP_STAGE_INITPRESOLVE
45563  * - \ref SCIP_STAGE_PRESOLVING
45564  * - \ref SCIP_STAGE_EXITPRESOLVE
45565  * - \ref SCIP_STAGE_PRESOLVED
45566  * - \ref SCIP_STAGE_SOLVING
45567  * - \ref SCIP_STAGE_SOLVED
45568  */
45570  SCIP* scip, /**< SCIP data structure */
45571  FILE* file /**< output file */
45572  )
45573 {
45574  SCIP_Real readingtime;
45575 
45576  assert(scip != NULL);
45577  assert(scip->set != NULL);
45578 
45579  SCIP_CALL_ABORT( checkStage(scip, "SCIPprintTimingStatistics", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45580 
45581  readingtime = SCIPgetReadingTime(scip);
45582 
45583  if( SCIPgetStage(scip) == SCIP_STAGE_PROBLEM )
45584  {
45585  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Total Time : %10.2f\n", readingtime);
45586  SCIPmessageFPrintInfo(scip->messagehdlr, file, " reading : %10.2f\n", readingtime);
45587  }
45588  else
45589  {
45590  SCIP_Real totaltime;
45591  SCIP_Real solvingtime;
45592 
45593  solvingtime = SCIPclockGetTime(scip->stat->solvingtime);
45594 
45595  if( scip->set->time_reading )
45596  totaltime = solvingtime;
45597  else
45598  totaltime = solvingtime + readingtime;
45599 
45600  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Total Time : %10.2f\n", totaltime);
45601  SCIPmessageFPrintInfo(scip->messagehdlr, file, " solving : %10.2f\n", solvingtime);
45602  SCIPmessageFPrintInfo(scip->messagehdlr, file, " presolving : %10.2f (included in solving)\n", SCIPclockGetTime(scip->stat->presolvingtime));
45603  SCIPmessageFPrintInfo(scip->messagehdlr, file, " reading : %10.2f%s\n", readingtime, scip->set->time_reading ? " (included in solving)" : "");
45604 
45605  if( scip->stat->ncopies > 0 )
45606  {
45607  SCIP_Real copytime;
45608 
45609  copytime = SCIPclockGetTime(scip->stat->copyclock);
45610 
45611  SCIPmessageFPrintInfo(scip->messagehdlr, file, " copying : %10.2f (%d #copies) (minimal %.2f, maximal %.2f, average %.2f)\n",
45612  copytime, scip->stat->ncopies, scip->stat->mincopytime, scip->stat->maxcopytime, copytime / scip->stat->ncopies);
45613  }
45614  else
45615  SCIPmessageFPrintInfo(scip->messagehdlr, file, " copying : %10.2f %s\n", 0.0, "(0 times copied the problem)");
45616  }
45617 }
45618 
45619 /** comparison method for statistics tables */
45620 static
45622 { /*lint --e{715}*/
45623  return (SCIPtableGetPosition((SCIP_TABLE*)elem1) - (SCIPtableGetPosition((SCIP_TABLE*)elem2)));
45624 }
45625 
45626 /** outputs solving statistics
45627  *
45628  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
45629  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
45630  *
45631  * @note If limits have been changed between the solution and the call to this function, the status is recomputed and
45632  * thus may to correspond to the original status.
45633  *
45634  * @pre This method can be called if SCIP is in one of the following stages:
45635  * - \ref SCIP_STAGE_INIT
45636  * - \ref SCIP_STAGE_PROBLEM
45637  * - \ref SCIP_STAGE_TRANSFORMED
45638  * - \ref SCIP_STAGE_INITPRESOLVE
45639  * - \ref SCIP_STAGE_PRESOLVING
45640  * - \ref SCIP_STAGE_EXITPRESOLVE
45641  * - \ref SCIP_STAGE_PRESOLVED
45642  * - \ref SCIP_STAGE_SOLVING
45643  * - \ref SCIP_STAGE_SOLVED
45644  */
45646  SCIP* scip, /**< SCIP data structure */
45647  FILE* file /**< output file (or NULL for standard output) */
45648  )
45649 {
45650  SCIP_TABLE** tables;
45651  int ntables;
45652  int i;
45653 
45654  assert(scip != NULL);
45655  assert(scip->set != NULL);
45656 
45657  SCIP_CALL( checkStage(scip, "SCIPprintStatistics", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45658 
45659  ntables = SCIPgetNTables(scip);
45660  tables = SCIPgetTables(scip);
45661 
45662  /* sort all tables by position unless this has already been done */
45663  if( ! scip->set->tablessorted )
45664  {
45665  SCIPsortPtr((void**)tables, tablePosComp, ntables);
45666 
45667  scip->set->tablessorted = TRUE;
45668  }
45669 
45670  for( i = 0; i < ntables; ++i )
45671  {
45672  /* skip tables which are not active or only used in later stages */
45673  if( ( ! SCIPtableIsActive(tables[i]) ) || SCIPtableGetEarliestStage(tables[i]) > SCIPgetStage(scip) )
45674  continue;
45675 
45676  SCIP_CALL( SCIPtableOutput(tables[i], scip->set, file) );
45677  }
45678 
45679  return SCIP_OKAY;
45680 }
45681 
45682 /** outputs reoptimization statistics
45683  *
45684  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
45685  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
45686  *
45687  * @pre This method can be called if SCIP is in one of the following stages:
45688  * - \ref SCIP_STAGE_INIT
45689  * - \ref SCIP_STAGE_PROBLEM
45690  * - \ref SCIP_STAGE_TRANSFORMED
45691  * - \ref SCIP_STAGE_INITPRESOLVE
45692  * - \ref SCIP_STAGE_PRESOLVING
45693  * - \ref SCIP_STAGE_EXITPRESOLVE
45694  * - \ref SCIP_STAGE_PRESOLVED
45695  * - \ref SCIP_STAGE_SOLVING
45696  * - \ref SCIP_STAGE_SOLVED
45697  */
45699  SCIP* scip, /**< SCIP data structure */
45700  FILE* file /**< output file (or NULL for standard output) */
45701  )
45702 {
45703  SCIP_Real solving;
45704  SCIP_Real presolving;
45705  SCIP_Real updatetime;
45706 
45707  SCIP_CALL( checkStage(scip, "SCIPprintReoptStatistics", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45708 
45709  /* skip if reoptimization is disabled */
45710  if( !scip->set->reopt_enable )
45711  return SCIP_OKAY;
45712 
45713  solving = SCIPclockGetTime(scip->stat->solvingtimeoverall);
45714  presolving = SCIPclockGetTime(scip->stat->presolvingtimeoverall);
45715  updatetime = SCIPclockGetTime(scip->stat->reoptupdatetime);
45716 
45717  SCIPmessageFPrintInfo(scip->messagehdlr, file, "SCIP Reopt Status : finish after %d runs.\n", scip->stat->nreoptruns);
45718  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Time (sec) :\n");
45719  SCIPmessageFPrintInfo(scip->messagehdlr, file, " solving : %10.2f\n", solving);
45720  SCIPmessageFPrintInfo(scip->messagehdlr, file, " presolving : %10.2f (included in solving)\n", presolving);
45721  SCIPmessageFPrintInfo(scip->messagehdlr, file, " save time : %10.2f\n", SCIPreoptGetSavingtime(scip->reopt));
45722  SCIPmessageFPrintInfo(scip->messagehdlr, file, " update time : %10.2f\n", updatetime);
45723  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Nodes : feas infeas pruned cutoff\n");
45724  SCIPmessageFPrintInfo(scip->messagehdlr, file, " total : %10d %10d %10d %10d\n",
45727  SCIPmessageFPrintInfo(scip->messagehdlr, file, " avg : %10.2f %10.2f %10.2f %10.2f\n",
45732 
45733  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Restarts : global local\n");
45734  SCIPmessageFPrintInfo(scip->messagehdlr, file, " first : %10d --\n", SCIPreoptGetFirstRestarts(scip->reopt));
45735  SCIPmessageFPrintInfo(scip->messagehdlr, file, " last : %10d --\n", SCIPreoptGetLastRestarts(scip->reopt));
45736  SCIPmessageFPrintInfo(scip->messagehdlr, file, " total : %10d %10d\n", SCIPreoptGetNRestartsGlobal(scip->reopt),
45738  SCIPmessageFPrintInfo(scip->messagehdlr, file, " avg : -- %10.2f\n",
45740 
45741  return SCIP_OKAY;
45742 }
45743 
45744 /** outputs history statistics about branchings on variables
45745  *
45746  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
45747  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
45748  *
45749  * @pre This method can be called if SCIP is in one of the following stages:
45750  * - \ref SCIP_STAGE_INIT
45751  * - \ref SCIP_STAGE_PROBLEM
45752  * - \ref SCIP_STAGE_TRANSFORMED
45753  * - \ref SCIP_STAGE_INITPRESOLVE
45754  * - \ref SCIP_STAGE_PRESOLVING
45755  * - \ref SCIP_STAGE_EXITPRESOLVE
45756  * - \ref SCIP_STAGE_PRESOLVED
45757  * - \ref SCIP_STAGE_SOLVING
45758  * - \ref SCIP_STAGE_SOLVED
45759  */
45761  SCIP* scip, /**< SCIP data structure */
45762  FILE* file /**< output file (or NULL for standard output) */
45763  )
45764 {
45765  SCIP_VAR** vars;
45766  int totalnstrongbranchs;
45767  int v;
45768 
45769  SCIP_CALL( checkStage(scip, "SCIPprintBranchingStatistics", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45770 
45771  switch( scip->set->stage )
45772  {
45773  case SCIP_STAGE_INIT:
45774  case SCIP_STAGE_PROBLEM:
45775  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem not yet solved. branching statistics not available.\n");
45776  return SCIP_OKAY;
45777 
45780  case SCIP_STAGE_PRESOLVING:
45782  case SCIP_STAGE_PRESOLVED:
45783  case SCIP_STAGE_SOLVING:
45784  case SCIP_STAGE_SOLVED:
45785  SCIP_CALL( SCIPallocBufferArray(scip, &vars, scip->transprob->nvars) );
45786  for( v = 0; v < scip->transprob->nvars; ++v )
45787  {
45788  SCIP_VAR* var;
45789  int i;
45790 
45791  var = scip->transprob->vars[v];
45792  for( i = v; i > 0 && strcmp(SCIPvarGetName(var), SCIPvarGetName(vars[i-1])) < 0; i-- )
45793  vars[i] = vars[i-1];
45794  vars[i] = var;
45795  }
45796 
45797  SCIPmessageFPrintInfo(scip->messagehdlr, file, " locks branchings inferences cutoffs LP gain pscostcount gain variance \n");
45798  SCIPmessageFPrintInfo(scip->messagehdlr, file, "variable prio factor down up depth down up sb down up down up down up down up down up\n");
45799 
45800  totalnstrongbranchs = 0;
45801  for( v = 0; v < scip->transprob->nvars; ++v )
45802  {
45805  || SCIPgetVarNStrongbranchs(scip, vars[v]) > 0 )
45806  {
45807  int nstrongbranchs;
45808 
45809  nstrongbranchs = SCIPgetVarNStrongbranchs(scip, vars[v]);
45810  totalnstrongbranchs += nstrongbranchs;
45811  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",
45812  SCIPvarGetName(vars[v]),
45813  SCIPvarGetBranchPriority(vars[v]),
45814  SCIPvarGetBranchFactor(vars[v]),
45815  SCIPvarGetNLocksDown(vars[v]),
45816  SCIPvarGetNLocksUp(vars[v]),
45818  + SCIPvarGetAvgBranchdepth(vars[v], SCIP_BRANCHDIR_UPWARDS))/2.0 - 1.0,
45821  nstrongbranchs,
45824  100.0 * SCIPvarGetAvgCutoffs(vars[v], scip->stat, SCIP_BRANCHDIR_DOWNWARDS),
45825  100.0 * SCIPvarGetAvgCutoffs(vars[v], scip->stat, SCIP_BRANCHDIR_UPWARDS),
45826  SCIPvarGetPseudocost(vars[v], scip->stat, -1.0),
45827  SCIPvarGetPseudocost(vars[v], scip->stat, +1.0),
45832  }
45833  }
45834  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",
45837  totalnstrongbranchs,
45856 
45857  SCIPfreeBufferArray(scip, &vars);
45858 
45859  return SCIP_OKAY;
45860 
45861  default:
45862  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
45863  return SCIP_INVALIDCALL;
45864  } /*lint !e788*/
45865 }
45866 
45867 /** outputs node information display line
45868  *
45869  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
45870  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
45871  *
45872  * @pre This method can be called if SCIP is in one of the following stages:
45873  * - \ref SCIP_STAGE_SOLVING
45874  */
45876  SCIP* scip, /**< SCIP data structure */
45877  FILE* file, /**< output file (or NULL for standard output) */
45878  SCIP_VERBLEVEL verblevel, /**< minimal verbosity level to actually display the information line */
45879  SCIP_Bool endline /**< should the line be terminated with a newline symbol? */
45880  )
45881 {
45882  SCIP_CALL( checkStage(scip, "SCIPprintDisplayLine", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
45883 
45884  if( (SCIP_VERBLEVEL)scip->set->disp_verblevel >= verblevel )
45885  {
45886  SCIP_CALL( SCIPdispPrintLine(scip->set, scip->messagehdlr, scip->stat, file, TRUE, endline) );
45887  }
45888 
45889  return SCIP_OKAY;
45890 }
45891 
45892 /** gets total number of implications between variables that are stored in the implication graph
45893  *
45894  * @return the total number of implications between variables that are stored in the implication graph
45895  *
45896  * @pre This method can be called if SCIP is in one of the following stages:
45897  * - \ref SCIP_STAGE_INITPRESOLVE
45898  * - \ref SCIP_STAGE_PRESOLVING
45899  * - \ref SCIP_STAGE_EXITPRESOLVE
45900  * - \ref SCIP_STAGE_PRESOLVED
45901  * - \ref SCIP_STAGE_INITSOLVE
45902  * - \ref SCIP_STAGE_SOLVING
45903  * - \ref SCIP_STAGE_SOLVED
45904  */
45906  SCIP* scip /**< SCIP data structure */
45907  )
45908 {
45909  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNImplications", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45910 
45911  return scip->stat->nimplications;
45912 }
45913 
45914 /** stores conflict graph of binary variables' implications into a file, which can be used as input for the DOT tool
45915  *
45916  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
45917  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
45918  *
45919  * @pre This method can be called if SCIP is in one of the following stages:
45920  * - \ref SCIP_STAGE_TRANSFORMED
45921  * - \ref SCIP_STAGE_INITPRESOLVE
45922  * - \ref SCIP_STAGE_PRESOLVING
45923  * - \ref SCIP_STAGE_EXITPRESOLVE
45924  * - \ref SCIP_STAGE_PRESOLVED
45925  * - \ref SCIP_STAGE_INITSOLVE
45926  * - \ref SCIP_STAGE_SOLVING
45927  * - \ref SCIP_STAGE_SOLVED
45928  * - \ref SCIP_STAGE_EXITSOLVE
45929  *
45930  * @deprecated because binary implications are now stored as cliques, please use SCIPwriteCliqueGraph() instead
45931  *
45932  */
45934  SCIP* scip, /**< SCIP data structure */
45935  const char* filename /**< file name, or NULL for stdout */
45936  )
45937 { /*lint --e{715}*/
45938  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");
45939 
45940  return SCIP_OKAY;
45941 }
45942 
45943 /** update statistical information when a new solution was found */
45945  SCIP* scip /**< SCIP data structure */
45946  )
45947 {
45948  SCIP_Real primalbound;
45949  SCIP_Real dualbound;
45950 
45951  primalbound = getPrimalbound(scip);
45952  dualbound = getDualbound(scip);
45953 
45954  if( SCIPsetIsEQ(scip->set, primalbound, dualbound) )
45955  scip->stat->lastsolgap = 0.0;
45956 
45957  else if( SCIPsetIsZero(scip->set, dualbound)
45958  || SCIPsetIsZero(scip->set, primalbound)
45959  || SCIPsetIsInfinity(scip->set, REALABS(primalbound))
45960  || SCIPsetIsInfinity(scip->set, REALABS(dualbound))
45961  || primalbound * dualbound < 0.0 )
45962  {
45963  scip->stat->lastsolgap = SCIPsetInfinity(scip->set);
45964  }
45965  else
45966  {
45967  SCIP_Real absdual = REALABS(dualbound);
45968  SCIP_Real absprimal = REALABS(primalbound);
45969 
45970  scip->stat->lastsolgap = REALABS((primalbound - dualbound)/MIN(absdual, absprimal));
45971  }
45972 
45973  if( scip->primal->nsols == 1 )
45974  scip->stat->firstsolgap = scip->stat->lastsolgap;
45975 
45976  if( scip->set->stage == SCIP_STAGE_SOLVING && scip->set->misc_calcintegral )
45977  {
45979  }
45980 }
45981 
45982 
45983 
45984 
45985 /*
45986  * timing methods
45987  */
45988 
45989 /** gets current time of day in seconds (standard time zone)
45990  *
45991  * @return the current time of day in seconds (standard time zone).
45992  */
45994  SCIP* scip /**< SCIP data structure */
45995  )
45996 {
45997  assert(scip != NULL);
45998 
45999  return SCIPclockGetTimeOfDay();
46000 }
46001 
46002 /** creates a clock using the default clock type
46003  *
46004  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46005  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46006  */
46008  SCIP* scip, /**< SCIP data structure */
46009  SCIP_CLOCK** clck /**< pointer to clock timer */
46010  )
46011 {
46012  assert(scip != NULL);
46013 
46015 
46016  return SCIP_OKAY;
46017 }
46018 
46019 /** creates a clock counting the CPU user seconds
46020  *
46021  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46022  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46023  */
46025  SCIP* scip, /**< SCIP data structure */
46026  SCIP_CLOCK** clck /**< pointer to clock timer */
46027  )
46028 {
46029  assert(scip != NULL);
46030 
46032 
46033  return SCIP_OKAY;
46034 }
46035 
46036 /** creates a clock counting the wall clock seconds
46037  *
46038  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46039  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46040  */
46042  SCIP* scip, /**< SCIP data structure */
46043  SCIP_CLOCK** clck /**< pointer to clock timer */
46044  )
46045 {
46046  assert(scip != NULL);
46047 
46049 
46050  return SCIP_OKAY;
46051 }
46052 
46053 /** frees a clock
46054  *
46055  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46056  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46057  */
46059  SCIP* scip, /**< SCIP data structure */
46060  SCIP_CLOCK** clck /**< pointer to clock timer */
46061  )
46062 {
46063  assert(scip != NULL);
46064 
46065  SCIPclockFree(clck);
46066 
46067  return SCIP_OKAY;
46068 }
46069 
46070 /** resets the time measurement of a clock to zero and completely stops the clock
46071  *
46072  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46073  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46074  */
46076  SCIP* scip, /**< SCIP data structure */
46077  SCIP_CLOCK* clck /**< clock timer */
46078  )
46079 {
46080  assert(scip != NULL);
46081 
46082  SCIPclockReset(clck);
46083 
46084  return SCIP_OKAY;
46085 }
46086 
46087 /** starts the time measurement of a clock
46088  *
46089  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46090  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46091  */
46093  SCIP* scip, /**< SCIP data structure */
46094  SCIP_CLOCK* clck /**< clock timer */
46095  )
46096 {
46097  assert(scip != NULL);
46098 
46099  SCIPclockStart(clck, scip->set);
46100 
46101  return SCIP_OKAY;
46102 }
46103 
46104 /** stops the time measurement of a clock
46105  *
46106  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46107  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46108  */
46110  SCIP* scip, /**< SCIP data structure */
46111  SCIP_CLOCK* clck /**< clock timer */
46112  )
46113 {
46114  assert(scip != NULL);
46115 
46116  SCIPclockStop(clck, scip->set);
46117 
46118  return SCIP_OKAY;
46119 }
46120 
46121 /** enables or disables all statistic clocks of SCIP concerning plugin statistics,
46122  * LP execution time, strong branching time, etc.
46123  *
46124  * Method reads the value of the parameter timing/statistictiming. In order to disable statistic timing,
46125  * set the parameter to FALSE.
46126  *
46127  * @note: The (pre-)solving time clocks which are relevant for the output during (pre-)solving
46128  * are not affected by this method
46129  *
46130  * @see: For completely disabling all timing of SCIP, consider setting the parameter timing/enabled to FALSE
46131  *
46132  * @pre This method can be called if SCIP is in one of the following stages:
46133  * - \ref SCIP_STAGE_INIT
46134  * - \ref SCIP_STAGE_PROBLEM
46135  * - \ref SCIP_STAGE_TRANSFORMING
46136  * - \ref SCIP_STAGE_TRANSFORMED
46137  * - \ref SCIP_STAGE_INITPRESOLVE
46138  * - \ref SCIP_STAGE_PRESOLVING
46139  * - \ref SCIP_STAGE_EXITPRESOLVE
46140  * - \ref SCIP_STAGE_PRESOLVED
46141  * - \ref SCIP_STAGE_INITSOLVE
46142  * - \ref SCIP_STAGE_SOLVING
46143  * - \ref SCIP_STAGE_SOLVED
46144  * - \ref SCIP_STAGE_EXITSOLVE
46145  * - \ref SCIP_STAGE_FREETRANS
46146  *
46147  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
46148  */
46150  SCIP* scip /**< SCIP data structure */
46151  )
46152 {
46153  SCIP_CALL( checkStage(scip, "SCIPenableOrDisableStatisticTiming", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
46154 
46156 
46157  if( scip->set->stage > SCIP_STAGE_INIT )
46158  {
46159  assert(scip->stat != NULL);
46161  }
46162  if( scip->set->stage >= SCIP_STAGE_TRANSFORMING )
46163  {
46164  assert(scip->conflict != NULL);
46166  }
46167 
46168  return SCIP_OKAY;
46169 }
46170 
46171 /** starts the current solving time
46172  *
46173  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46174  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46175  *
46176  * @pre This method can be called if SCIP is in one of the following stages:
46177  * - \ref SCIP_STAGE_PROBLEM
46178  * - \ref SCIP_STAGE_TRANSFORMING
46179  * - \ref SCIP_STAGE_TRANSFORMED
46180  * - \ref SCIP_STAGE_INITPRESOLVE
46181  * - \ref SCIP_STAGE_PRESOLVING
46182  * - \ref SCIP_STAGE_EXITPRESOLVE
46183  * - \ref SCIP_STAGE_PRESOLVED
46184  * - \ref SCIP_STAGE_INITSOLVE
46185  * - \ref SCIP_STAGE_SOLVING
46186  * - \ref SCIP_STAGE_SOLVED
46187  * - \ref SCIP_STAGE_EXITSOLVE
46188  * - \ref SCIP_STAGE_FREETRANS
46189  *
46190  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
46191  */
46193  SCIP* scip /**< SCIP data structure */
46194  )
46195 {
46196  SCIP_CALL( checkStage(scip, "SCIPstartSolvingTime", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
46197 
46198  SCIPclockStart(scip->stat->solvingtime, scip->set);
46199  SCIPclockStart(scip->stat->solvingtimeoverall, scip->set);
46200 
46201  return SCIP_OKAY;
46202 }
46203 
46204 /** stops the current solving time in seconds
46205  *
46206  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46207  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46208  *
46209  * @pre This method can be called if SCIP is in one of the following stages:
46210  * - \ref SCIP_STAGE_PROBLEM
46211  * - \ref SCIP_STAGE_TRANSFORMING
46212  * - \ref SCIP_STAGE_TRANSFORMED
46213  * - \ref SCIP_STAGE_INITPRESOLVE
46214  * - \ref SCIP_STAGE_PRESOLVING
46215  * - \ref SCIP_STAGE_EXITPRESOLVE
46216  * - \ref SCIP_STAGE_PRESOLVED
46217  * - \ref SCIP_STAGE_INITSOLVE
46218  * - \ref SCIP_STAGE_SOLVING
46219  * - \ref SCIP_STAGE_SOLVED
46220  * - \ref SCIP_STAGE_EXITSOLVE
46221  * - \ref SCIP_STAGE_FREETRANS
46222  *
46223  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
46224  */
46226  SCIP* scip /**< SCIP data structure */
46227  )
46228 {
46229  SCIP_CALL( checkStage(scip, "SCIPstopSolvingTime", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
46230 
46231  SCIPclockStop(scip->stat->solvingtime, scip->set);
46232  SCIPclockStop(scip->stat->solvingtimeoverall, scip->set);
46233 
46234  return SCIP_OKAY;
46235 }
46236 
46237 /** gets the measured time of a clock in seconds
46238  *
46239  * @return the measured time of a clock in seconds.
46240  */
46242  SCIP* scip, /**< SCIP data structure */
46243  SCIP_CLOCK* clck /**< clock timer */
46244  )
46245 {
46246  assert(scip != NULL);
46247 
46248  return SCIPclockGetTime(clck);
46249 }
46250 
46251 /** sets the measured time of a clock to the given value in seconds
46252  *
46253  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46254  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46255  */
46257  SCIP* scip, /**< SCIP data structure */
46258  SCIP_CLOCK* clck, /**< clock timer */
46259  SCIP_Real sec /**< time in seconds to set the clock's timer to */
46260  )
46261 {
46262  assert(scip != NULL);
46263 
46264  SCIPclockSetTime(clck, sec);
46265 
46266  return SCIP_OKAY;
46267 }
46268 
46269 /** gets the current total SCIP time in seconds, possibly accumulated over several problems.
46270  *
46271  * @return the current total SCIP time in seconds, ie. the total time since the SCIP instance has been created
46272  */
46274  SCIP* scip /**< SCIP data structure */
46275  )
46276 {
46277  assert(scip != NULL);
46278 
46279  return SCIPclockGetTime(scip->totaltime);
46280 }
46281 
46282 /** gets the current solving time in seconds
46283  *
46284  * @return the current solving time in seconds.
46285  *
46286  * @pre This method can be called if SCIP is in one of the following stages:
46287  * - \ref SCIP_STAGE_PROBLEM
46288  * - \ref SCIP_STAGE_TRANSFORMING
46289  * - \ref SCIP_STAGE_TRANSFORMED
46290  * - \ref SCIP_STAGE_INITPRESOLVE
46291  * - \ref SCIP_STAGE_PRESOLVING
46292  * - \ref SCIP_STAGE_EXITPRESOLVE
46293  * - \ref SCIP_STAGE_PRESOLVED
46294  * - \ref SCIP_STAGE_INITSOLVE
46295  * - \ref SCIP_STAGE_SOLVING
46296  * - \ref SCIP_STAGE_SOLVED
46297  *
46298  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
46299  */
46301  SCIP* scip /**< SCIP data structure */
46302  )
46303 {
46304  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolvingTime", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
46305 
46306  return SCIPclockGetTime(scip->stat->solvingtime);
46307 }
46308 
46309 /** gets the current reading time in seconds
46310  *
46311  * @return the current reading time in seconds.
46312  *
46313  * @pre This method can be called if SCIP is in one of the following stages:
46314  * - \ref SCIP_STAGE_PROBLEM
46315  * - \ref SCIP_STAGE_TRANSFORMING
46316  * - \ref SCIP_STAGE_TRANSFORMED
46317  * - \ref SCIP_STAGE_INITPRESOLVE
46318  * - \ref SCIP_STAGE_PRESOLVING
46319  * - \ref SCIP_STAGE_EXITPRESOLVE
46320  * - \ref SCIP_STAGE_PRESOLVED
46321  * - \ref SCIP_STAGE_INITSOLVE
46322  * - \ref SCIP_STAGE_SOLVING
46323  * - \ref SCIP_STAGE_SOLVED
46324  *
46325  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
46326  */
46328  SCIP* scip /**< SCIP data structure */
46329  )
46330 {
46331  SCIP_Real readingtime;
46332  int r;
46333 
46334  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetReadingTime", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
46335 
46336  readingtime = 0.0;
46337 
46338  /* sum up the reading time of all readers */
46339  for( r = 0; r < scip->set->nreaders; ++r )
46340  {
46341  assert(scip->set->readers[r] != NULL);
46342  assert(!SCIPisNegative(scip, SCIPreaderGetReadingTime(scip->set->readers[r])));
46343  readingtime += SCIPreaderGetReadingTime(scip->set->readers[r]);
46344  }
46345 
46346  return readingtime;
46347 }
46348 
46349 /** gets the current presolving time in seconds
46350  *
46351  * @return the current presolving time in seconds.
46352  *
46353  * @pre This method can be called if SCIP is in one of the following stages:
46354  * - \ref SCIP_STAGE_INITPRESOLVE
46355  * - \ref SCIP_STAGE_PRESOLVING
46356  * - \ref SCIP_STAGE_EXITPRESOLVE
46357  * - \ref SCIP_STAGE_PRESOLVED
46358  * - \ref SCIP_STAGE_INITSOLVE
46359  * - \ref SCIP_STAGE_SOLVING
46360  * - \ref SCIP_STAGE_SOLVED
46361  *
46362  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
46363  */
46365  SCIP* scip /**< SCIP data structure */
46366  )
46367 {
46368  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPresolvingTime", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
46369 
46370  return SCIPclockGetTime(scip->stat->presolvingtime);
46371 }
46372 
46373 /** gets the time need to solve the first LP in the root node
46374  *
46375  * @return the solving time for the first LP in the root node in seconds.
46376  *
46377  * @pre This method can be called if SCIP is in one of the following stages:
46378  * - \ref SCIP_STAGE_TRANSFORMING
46379  * - \ref SCIP_STAGE_TRANSFORMED
46380  * - \ref SCIP_STAGE_INITPRESOLVE
46381  * - \ref SCIP_STAGE_PRESOLVING
46382  * - \ref SCIP_STAGE_EXITPRESOLVE
46383  * - \ref SCIP_STAGE_PRESOLVED
46384  * - \ref SCIP_STAGE_INITSOLVE
46385  * - \ref SCIP_STAGE_SOLVING
46386  * - \ref SCIP_STAGE_SOLVED
46387  *
46388  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
46389  */
46391  SCIP* scip /**< SCIP data structure */
46392  )
46393 {
46394  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFirstLPTime", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
46395 
46396  return scip->stat->firstlptime;
46397 }
46398 
46399 
46400 
46401 /*
46402  * numeric values and comparisons
46403  */
46404 
46405 /** returns value treated as zero
46406  *
46407  * @return value treated as zero
46408  */
46410  SCIP* scip /**< SCIP data structure */
46411  )
46412 {
46413  assert(scip != NULL);
46414  assert(scip->set != NULL);
46415 
46416  return SCIPsetEpsilon(scip->set);
46417 }
46418 
46419 /** returns value treated as zero for sums of floating point values
46420  *
46421  * @return value treated as zero for sums of floating point values
46422  */
46424  SCIP* scip /**< SCIP data structure */
46425  )
46426 {
46427  assert(scip != NULL);
46428  assert(scip->set != NULL);
46429 
46430  return SCIPsetSumepsilon(scip->set);
46431 }
46432 
46433 /** returns feasibility tolerance for constraints
46434  *
46435  * @return feasibility tolerance for constraints
46436  */
46438  SCIP* scip /**< SCIP data structure */
46439  )
46440 {
46441  assert(scip != NULL);
46442  assert(scip->set != NULL);
46443 
46444  return SCIPsetFeastol(scip->set);
46445 }
46446 
46447 /** returns primal feasibility tolerance of LP solver
46448  *
46449  * @return primal feasibility tolerance of LP solver
46450  */
46452  SCIP* scip /**< SCIP data structure */
46453  )
46454 {
46455  assert(scip != NULL);
46456  assert(scip->set != NULL);
46457 
46458  return SCIPsetLpfeastol(scip->set);
46459 }
46460 
46461 /** returns feasibility tolerance for reduced costs
46462  *
46463  * @return feasibility tolerance for reduced costs
46464  */
46466  SCIP* scip /**< SCIP data structure */
46467  )
46468 {
46469  assert(scip != NULL);
46470  assert(scip->set != NULL);
46471 
46472  return SCIPsetDualfeastol(scip->set);
46473 }
46474 
46475 /** returns convergence tolerance used in barrier algorithm
46476  *
46477  * @return convergence tolerance used in barrier algorithm
46478  */
46480  SCIP* scip /**< SCIP data structure */
46481  )
46482 {
46483  assert(scip != NULL);
46484  assert(scip->set != NULL);
46485 
46486  return SCIPsetBarrierconvtol(scip->set);
46487 }
46488 
46489 /** return the cutoff bound delta
46490  *
46491  * @return cutoff bound data
46492  */
46494  SCIP* scip /**< SCIP data structure */
46495  )
46496 {
46497  assert(scip != NULL);
46498  assert(scip->set != NULL);
46499 
46500  return SCIPsetCutoffbounddelta(scip->set);
46501 }
46502 
46503 /** return the relaxation primal feasibility tolerance
46504  *
46505  * @see SCIPchgRelaxfeastol
46506  * @return relaxfeastol
46507  */
46509  SCIP* scip /**< SCIP data structure */
46510  )
46511 {
46512  assert(scip != NULL);
46513  assert(scip->set != NULL);
46514 
46515  return SCIPsetRelaxfeastol(scip->set);
46516 }
46517 
46518 /** sets the feasibility tolerance for constraints
46519  *
46520  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46521  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46522  */
46524  SCIP* scip, /**< SCIP data structure */
46525  SCIP_Real feastol /**< new feasibility tolerance for constraints */
46526  )
46527 {
46528  assert(scip != NULL);
46529 
46530  /* change the settings */
46531  SCIP_CALL( SCIPsetSetFeastol(scip->set, feastol) );
46532 
46533  return SCIP_OKAY;
46534 }
46535 
46536 /** sets the primal feasibility tolerance of LP solver
46537  *
46538  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46539  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46540  */
46542  SCIP* scip, /**< SCIP data structure */
46543  SCIP_Real lpfeastol, /**< new primal feasibility tolerance of LP solver */
46544  SCIP_Bool printnewvalue /**< should "numerics/lpfeastol = ..." be printed? */
46545  )
46546 {
46547  assert(scip != NULL);
46548 
46549  /* mark the LP unsolved, if the primal feasibility tolerance was tightened */
46550  if( scip->lp != NULL && lpfeastol < SCIPsetLpfeastol(scip->set) )
46551  {
46552  scip->lp->solved = FALSE;
46554  }
46555 
46556  /* change the settings */
46557  SCIP_CALL( SCIPsetSetLpfeastol(scip->set, lpfeastol, printnewvalue) );
46558 
46559  return SCIP_OKAY;
46560 }
46561 
46562 /** sets the feasibility tolerance for reduced costs
46563  *
46564  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46565  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46566  */
46568  SCIP* scip, /**< SCIP data structure */
46569  SCIP_Real dualfeastol /**< new feasibility tolerance for reduced costs */
46570  )
46571 {
46572  assert(scip != NULL);
46573 
46574  /* mark the LP unsolved, if the dual feasibility tolerance was tightened */
46575  if( scip->lp != NULL && dualfeastol < SCIPsetDualfeastol(scip->set) )
46576  {
46577  scip->lp->solved = FALSE;
46579  }
46580 
46581  /* change the settings */
46582  SCIP_CALL( SCIPsetSetDualfeastol(scip->set, dualfeastol) );
46583 
46584  return SCIP_OKAY;
46585 }
46586 
46587 /** sets the convergence tolerance used in barrier algorithm
46588  *
46589  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46590  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46591  */
46593  SCIP* scip, /**< SCIP data structure */
46594  SCIP_Real barrierconvtol /**< new convergence tolerance used in barrier algorithm */
46595  )
46596 {
46597  assert(scip != NULL);
46598 
46599  /* mark the LP unsolved, if the convergence tolerance was tightened, and the LP was solved with the barrier algorithm */
46600  if( scip->lp != NULL && barrierconvtol < SCIPsetBarrierconvtol(scip->set)
46602  scip->lp->solved = FALSE;
46603 
46604  /* change the settings */
46605  SCIP_CALL( SCIPsetSetBarrierconvtol(scip->set, barrierconvtol) );
46606 
46607  return SCIP_OKAY;
46608 }
46609 
46610 /** sets the primal feasibility tolerance of relaxations
46611  *
46612  * This tolerance value is used by the SCIP core and plugins to tighten then feasibility tolerance on relaxations
46613  * (especially the LP relaxation) during a solve. It is set to SCIP_INVALID initially, which means that only the
46614  * feasibility tolerance of the particular relaxation is taken into account. If set to a valid value, however,
46615  * then this value should be used to reduce the primal feasibility tolerance of a relaxation (thus, use the
46616  * minimum of relaxfeastol and the relaxations primal feastol).
46617  *
46618  * @pre The value of relaxfeastol is reset to SCIP_INVALID when initializing the solve (INITSOL).
46619  * Therefore, this method can only be called in one of the following stages of the SCIP solving process:
46620  * - \ref SCIP_STAGE_INITSOLVE
46621  * - \ref SCIP_STAGE_SOLVING
46622  *
46623  * @return previous value of relaxfeastol
46624  */
46626  SCIP* scip, /**< SCIP data structure */
46627  SCIP_Real relaxfeastol /**< new primal feasibility tolerance of relaxations */
46628  )
46629 {
46630  assert(scip != NULL);
46631  assert(scip->set != NULL);
46632 
46633  SCIP_CALL_ABORT( checkStage(scip, "SCIPchgRelaxfeastol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
46634 
46635  return SCIPsetSetRelaxfeastol(scip->set, relaxfeastol);
46636 }
46637 
46638 /** marks that some limit parameter was changed */
46640  SCIP* scip /**< SCIP data structure */
46641  )
46642 {
46643  assert(scip != NULL);
46644 
46645  /* change the settings */
46646  SCIPsetSetLimitChanged(scip->set);
46647 }
46648 
46649 /** outputs a real number, or "+infinity", or "-infinity" to a file */
46651  SCIP* scip, /**< SCIP data structure */
46652  FILE* file, /**< output file (or NULL for standard output) */
46653  SCIP_Real val, /**< value to print */
46654  int width, /**< width of the field */
46655  int precision /**< number of significant digits printed */
46656  )
46657 {
46658  char s[SCIP_MAXSTRLEN];
46659  char strformat[SCIP_MAXSTRLEN];
46660 
46661  assert(scip != NULL);
46662 
46663  if( SCIPsetIsInfinity(scip->set, val) )
46664  (void) SCIPsnprintf(s, SCIP_MAXSTRLEN, "+infinity");
46665  else if( SCIPsetIsInfinity(scip->set, -val) )
46666  (void) SCIPsnprintf(s, SCIP_MAXSTRLEN, "-infinity");
46667  else
46668  {
46669  (void) SCIPsnprintf(strformat, SCIP_MAXSTRLEN, "%%.%dg", precision);
46670  (void) SCIPsnprintf(s, SCIP_MAXSTRLEN, (const char*)strformat, val);
46671  }
46672  (void) SCIPsnprintf(strformat, SCIP_MAXSTRLEN, "%%%ds", width);
46673  SCIPmessageFPrintInfo(scip->messagehdlr, file, (const char*)strformat, s);
46674 }
46675 
46676 /** parse a real value that was written with SCIPprintReal() */
46678  SCIP* scip, /**< SCIP data structure */
46679  const char* str, /**< string to search */
46680  SCIP_Real* value, /**< pointer to store the parsed value */
46681  char** endptr /**< pointer to store the final string position if successfully parsed, otherwise @p str */
46682  )
46683 {
46684  char* localstr;
46685 
46686  assert(scip != NULL);
46687  assert(str != NULL);
46688  assert(value != NULL);
46689  assert(endptr != NULL);
46690 
46691  localstr = (char*)str;
46692 
46693  /* ignore white space */
46694  while(isspace((unsigned char)*localstr))
46695  ++localstr;
46696 
46697  /* test for a special infinity first */
46698  if( strncmp(localstr, "+infinity", 9) == 0 )
46699  {
46700  *value = SCIPinfinity(scip);
46701  *endptr = (char*)(localstr + 9);
46702  return TRUE;
46703  }
46704  else if( strncmp(localstr, "-infinity", 9) == 0 )
46705  {
46706  *value = -SCIPinfinity(scip);
46707  *endptr = (char*)(localstr + 9);
46708  return TRUE;
46709  }
46710  else
46711  {
46712  /* parse a finite value */
46713  return SCIPstrToRealValue(str, value, endptr);
46714  }
46715 }
46716 
46717 /*
46718  * memory management
46719  */
46720 
46721 /** returns block memory to use at the current time
46722  *
46723  * @return the block memory to use at the current time.
46724  */
46726  SCIP* scip /**< SCIP data structure */
46727  )
46728 {
46729  assert(scip != NULL);
46730  assert(scip->set != NULL);
46731  assert(scip->mem != NULL);
46732 
46733  return scip->mem->probmem;
46734 }
46735 
46736 /** returns buffer memory for short living temporary objects
46737  *
46738  * @return the buffer memory for short living temporary objects
46739  */
46741  SCIP* scip /**< SCIP data structure */
46742  )
46743 {
46744  assert(scip != NULL);
46745  assert(scip->mem != NULL);
46746 
46747  return scip->mem->buffer;
46748 }
46749 
46750 /** returns clean buffer memory for short living temporary objects initialized to all zero
46751  *
46752  * @return the buffer memory for short living temporary objects initialized to all zero
46753  */
46755  SCIP* scip /**< SCIP data structure */
46756  )
46757 {
46758  assert(scip != NULL);
46759  assert(scip->mem != NULL);
46760 
46761  return scip->mem->cleanbuffer;
46762 }
46763 
46764 /** returns the total number of bytes used in block and buffer memory
46765  *
46766  * @return the total number of bytes used in block and buffer memory.
46767  */
46769  SCIP* scip /**< SCIP data structure */
46770  )
46771 {
46772  assert(scip != NULL);
46773 
46774  return SCIPmemGetUsed(scip->mem);
46775 }
46776 
46777 /** returns the total number of bytes in block and buffer memory
46778  *
46779  * @return the total number of bytes in block and buffer memory.
46780  */
46782  SCIP* scip /**< SCIP data structure */
46783  )
46784 {
46785  assert(scip != NULL);
46786 
46787  return SCIPmemGetTotal(scip->mem);
46788 }
46789 
46790 /** returns the estimated number of bytes used by external software, e.g., the LP solver
46791  *
46792  * @return the estimated number of bytes used by external software, e.g., the LP solver.
46793  */
46795  SCIP* scip /**< SCIP data structure */
46796  )
46797 {
46798  assert(scip != NULL);
46799 
46800  return SCIPstatGetMemExternEstim(scip->stat);
46801 }
46802 
46803 /** calculate memory size for dynamically allocated arrays
46804  *
46805  * @return the memory size for dynamically allocated arrays.
46806  */
46808  SCIP* scip, /**< SCIP data structure */
46809  int num /**< minimum number of entries to store */
46810  )
46811 {
46812  assert(scip != NULL);
46813 
46814  return SCIPsetCalcMemGrowSize(scip->set, num);
46815 }
46816 
46817 /** extends a dynamically allocated block memory array to be able to store at least the given number of elements;
46818  * use SCIPensureBlockMemoryArray() define to call this method!
46819  *
46820  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46821  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46822  */
46824  SCIP* scip, /**< SCIP data structure */
46825  void** arrayptr, /**< pointer to dynamically sized array */
46826  size_t elemsize, /**< size in bytes of each element in array */
46827  int* arraysize, /**< pointer to current array size */
46828  int minsize /**< required minimal array size */
46829  )
46830 {
46831  assert(scip != NULL);
46832  assert(arrayptr != NULL);
46833  assert(elemsize > 0);
46834  assert(arraysize != NULL);
46835 
46836  if( minsize > *arraysize )
46837  {
46838  int newsize;
46839 
46840  newsize = SCIPsetCalcMemGrowSize(scip->set, minsize);
46841  SCIP_ALLOC( BMSreallocBlockMemorySize(SCIPblkmem(scip), arrayptr, *arraysize * elemsize, newsize * elemsize) );
46842  *arraysize = newsize;
46843  }
46844 
46845  return SCIP_OKAY;
46846 }
46847 
46848 /** prints output about used memory */
46850  SCIP* scip /**< SCIP data structure */
46851  )
46852 {
46853  assert(scip != NULL);
46854  assert(scip->mem != NULL);
46855  assert(scip->set != NULL);
46856 
46857  BMSdisplayMemory();
46858 
46859  SCIPmessagePrintInfo(scip->messagehdlr, "\nParameter Block Memory (%p):\n", scip->mem->setmem);
46861 
46862  SCIPmessagePrintInfo(scip->messagehdlr, "\nSolution Block Memory (%p):\n", scip->mem->probmem);
46864 
46865  SCIPmessagePrintInfo(scip->messagehdlr, "\nMemory Buffers:\n");
46867 
46868  SCIPmessagePrintInfo(scip->messagehdlr, "\nClean Memory Buffers:\n");
46870 }
46871 
46872 
46873 
46874 
46875 /*
46876  * simple functions implemented as defines
46877  */
46878 
46879 /* In debug mode, the following methods are implemented as function calls to ensure
46880  * type validity.
46881  * In optimized mode, the methods are implemented as defines to improve performance.
46882  * However, we want to have them in the library anyways, so we have to undef the defines.
46883  */
46884 
46885 #undef SCIPinfinity
46886 #undef SCIPisInfinity
46887 #undef SCIPisEQ
46888 #undef SCIPisLT
46889 #undef SCIPisLE
46890 #undef SCIPisGT
46891 #undef SCIPisGE
46892 #undef SCIPisZero
46893 #undef SCIPisPositive
46894 #undef SCIPisNegative
46895 #undef SCIPisIntegral
46896 #undef SCIPisScalingIntegral
46897 #undef SCIPisFracIntegral
46898 #undef SCIPfloor
46899 #undef SCIPceil
46900 #undef SCIPround
46901 #undef SCIPfrac
46902 #undef SCIPisSumEQ
46903 #undef SCIPisSumLT
46904 #undef SCIPisSumLE
46905 #undef SCIPisSumGT
46906 #undef SCIPisSumGE
46907 #undef SCIPisSumZero
46908 #undef SCIPisSumPositive
46909 #undef SCIPisSumNegative
46910 #undef SCIPisFeasEQ
46911 #undef SCIPisFeasLT
46912 #undef SCIPisFeasLE
46913 #undef SCIPisFeasGT
46914 #undef SCIPisFeasGE
46915 #undef SCIPisFeasZero
46916 #undef SCIPisFeasPositive
46917 #undef SCIPisFeasNegative
46918 #undef SCIPisFeasIntegral
46919 #undef SCIPisFeasFracIntegral
46920 #undef SCIPfeasFloor
46921 #undef SCIPfeasCeil
46922 #undef SCIPfeasRound
46923 #undef SCIPfeasFrac
46924 #undef SCIPisDualfeasEQ
46925 #undef SCIPisDualfeasLT
46926 #undef SCIPisDualfeasLE
46927 #undef SCIPisDualfeasGT
46928 #undef SCIPisDualfeasGE
46929 #undef SCIPisDualfeasZero
46930 #undef SCIPisDualfeasPositive
46931 #undef SCIPisDualfeasNegative
46932 #undef SCIPisDualfeasIntegral
46933 #undef SCIPisDualfeasFracIntegral
46934 #undef SCIPdualfeasFloor
46935 #undef SCIPdualfeasCeil
46936 #undef SCIPdualfeasRound
46937 #undef SCIPdualfeasFrac
46938 #undef SCIPisLbBetter
46939 #undef SCIPisUbBetter
46940 #undef SCIPisRelEQ
46941 #undef SCIPisRelLT
46942 #undef SCIPisRelLE
46943 #undef SCIPisRelGT
46944 #undef SCIPisRelGE
46945 #undef SCIPisSumRelEQ
46946 #undef SCIPisSumRelLT
46947 #undef SCIPisSumRelLE
46948 #undef SCIPisSumRelGT
46949 #undef SCIPisSumRelGE
46950 #undef SCIPconvertRealToInt
46951 #undef SCIPconvertRealToLongint
46952 #undef SCIPisUpdateUnreliable
46953 #undef SCIPisHugeValue
46954 #undef SCIPgetHugeValue
46955 
46956 /** checks, if values are in range of epsilon */
46958  SCIP* scip, /**< SCIP data structure */
46959  SCIP_Real val1, /**< first value to be compared */
46960  SCIP_Real val2 /**< second value to be compared */
46961  )
46962 {
46963  assert(scip != NULL);
46964  assert(scip->set != NULL);
46965 
46966  return SCIPsetIsEQ(scip->set, val1, val2);
46967 }
46968 
46969 /** checks, if val1 is (more than epsilon) lower than val2 */
46971  SCIP* scip, /**< SCIP data structure */
46972  SCIP_Real val1, /**< first value to be compared */
46973  SCIP_Real val2 /**< second value to be compared */
46974  )
46975 {
46976  assert(scip != NULL);
46977  assert(scip->set != NULL);
46978 
46979  return SCIPsetIsLT(scip->set, val1, val2);
46980 }
46981 
46982 /** checks, if val1 is not (more than epsilon) greater than val2 */
46984  SCIP* scip, /**< SCIP data structure */
46985  SCIP_Real val1, /**< first value to be compared */
46986  SCIP_Real val2 /**< second value to be compared */
46987  )
46988 {
46989  assert(scip != NULL);
46990  assert(scip->set != NULL);
46991 
46992  return SCIPsetIsLE(scip->set, val1, val2);
46993 }
46994 
46995 /** checks, if val1 is (more than epsilon) greater than val2 */
46997  SCIP* scip, /**< SCIP data structure */
46998  SCIP_Real val1, /**< first value to be compared */
46999  SCIP_Real val2 /**< second value to be compared */
47000  )
47001 {
47002  assert(scip != NULL);
47003  assert(scip->set != NULL);
47004 
47005  return SCIPsetIsGT(scip->set, val1, val2);
47006 }
47007 
47008 /** checks, if val1 is not (more than epsilon) lower than val2 */
47010  SCIP* scip, /**< SCIP data structure */
47011  SCIP_Real val1, /**< first value to be compared */
47012  SCIP_Real val2 /**< second value to be compared */
47013  )
47014 {
47015  assert(scip != NULL);
47016  assert(scip->set != NULL);
47017 
47018  return SCIPsetIsGE(scip->set, val1, val2);
47019 }
47020 
47021 /** returns value treated as infinity */
47023  SCIP* scip /**< SCIP data structure */
47024  )
47025 {
47026  assert(scip != NULL);
47027  assert(scip->set != NULL);
47028 
47029  return SCIPsetInfinity(scip->set);
47030 }
47031 
47032 /** checks, if value is (positive) infinite */
47034  SCIP* scip, /**< SCIP data structure */
47035  SCIP_Real val /**< value to be compared against infinity */
47036  )
47037 {
47038  assert(scip != NULL);
47039  assert(scip->set != NULL);
47040 
47041  return SCIPsetIsInfinity(scip->set, val);
47042 }
47043 
47044 /** checks, if value is huge and should be handled separately (e.g., in activity computation) */
47046  SCIP* scip, /**< SCIP data structure */
47047  SCIP_Real val /**< value to be checked whether it is huge */
47048  )
47049 {
47050  assert(scip != NULL);
47051  assert(scip->set != NULL);
47052 
47053  return SCIPsetIsHugeValue(scip->set, val);
47054 }
47055 
47056 /** returns the minimum value that is regarded as huge and should be handled separately (e.g., in activity
47057  * computation)
47058  */
47060  SCIP* scip /**< SCIP data structure */
47061  )
47062 {
47063  assert(scip != NULL);
47064  assert(scip->set != NULL);
47065 
47066  return SCIPsetGetHugeValue(scip->set);
47067 }
47068 
47069 /** checks, if value is in range epsilon of 0.0 */
47071  SCIP* scip, /**< SCIP data structure */
47072  SCIP_Real val /**< value to process */
47073  )
47074 {
47075  assert(scip != NULL);
47076  assert(scip->set != NULL);
47077 
47078  return SCIPsetIsZero(scip->set, val);
47079 }
47080 
47081 /** checks, if value is greater than epsilon */
47083  SCIP* scip, /**< SCIP data structure */
47084  SCIP_Real val /**< value to process */
47085  )
47086 {
47087  assert(scip != NULL);
47088  assert(scip->set != NULL);
47089 
47090  return SCIPsetIsPositive(scip->set, val);
47091 }
47092 
47093 /** checks, if value is lower than -epsilon */
47095  SCIP* scip, /**< SCIP data structure */
47096  SCIP_Real val /**< value to process */
47097  )
47098 {
47099  assert(scip != NULL);
47100  assert(scip->set != NULL);
47101 
47102  return SCIPsetIsNegative(scip->set, val);
47103 }
47104 
47105 /** checks, if value is integral within epsilon */
47107  SCIP* scip, /**< SCIP data structure */
47108  SCIP_Real val /**< value to process */
47109  )
47110 {
47111  assert(scip != NULL);
47112  assert(scip->set != NULL);
47113 
47114  return SCIPsetIsIntegral(scip->set, val);
47115 }
47116 
47117 /** checks whether the product val * scalar is integral in epsilon scaled by scalar */
47119  SCIP* scip, /**< SCIP data structure */
47120  SCIP_Real val, /**< unscaled value to check for scaled integrality */
47121  SCIP_Real scalar /**< value to scale val with for checking for integrality */
47122  )
47123 {
47124  assert(scip != NULL);
47125  assert(scip->set != NULL);
47126 
47127  return SCIPsetIsScalingIntegral(scip->set, val, scalar);
47128 }
47129 
47130 /** checks, if given fractional part is smaller than epsilon */
47132  SCIP* scip, /**< SCIP data structure */
47133  SCIP_Real val /**< value to process */
47134  )
47135 {
47136  assert(scip != NULL);
47137  assert(scip->set != NULL);
47138 
47139  return SCIPsetIsFracIntegral(scip->set, val);
47140 }
47141 
47142 /** rounds value + epsilon down to the next integer */
47144  SCIP* scip, /**< SCIP data structure */
47145  SCIP_Real val /**< value to process */
47146  )
47147 {
47148  assert(scip != NULL);
47149  assert(scip->set != NULL);
47150 
47151  return SCIPsetFloor(scip->set, val);
47152 }
47153 
47154 /** rounds value - epsilon up to the next integer */
47156  SCIP* scip, /**< SCIP data structure */
47157  SCIP_Real val /**< value to process */
47158  )
47159 {
47160  assert(scip != NULL);
47161  assert(scip->set != NULL);
47162 
47163  return SCIPsetCeil(scip->set, val);
47164 }
47165 
47166 /** rounds value to the nearest integer with epsilon tolerance */
47168  SCIP* scip, /**< SCIP data structure */
47169  SCIP_Real val /**< value to process */
47170  )
47171 {
47172  assert(scip != NULL);
47173  assert(scip->set != NULL);
47174 
47175  return SCIPsetRound(scip->set, val);
47176 }
47177 
47178 /** returns fractional part of value, i.e. x - floor(x) in epsilon tolerance */
47180  SCIP* scip, /**< SCIP data structure */
47181  SCIP_Real val /**< value to return fractional part for */
47182  )
47183 {
47184  assert(scip != NULL);
47185  assert(scip->set != NULL);
47186 
47187  return SCIPsetFrac(scip->set, val);
47188 }
47189 
47190 /** checks, if values are in range of sumepsilon */
47192  SCIP* scip, /**< SCIP data structure */
47193  SCIP_Real val1, /**< first value to be compared */
47194  SCIP_Real val2 /**< second value to be compared */
47195  )
47196 {
47197  assert(scip != NULL);
47198  assert(scip->set != NULL);
47199 
47200  return SCIPsetIsSumEQ(scip->set, val1, val2);
47201 }
47202 
47203 /** checks, if val1 is (more than sumepsilon) lower than val2 */
47205  SCIP* scip, /**< SCIP data structure */
47206  SCIP_Real val1, /**< first value to be compared */
47207  SCIP_Real val2 /**< second value to be compared */
47208  )
47209 {
47210  assert(scip != NULL);
47211  assert(scip->set != NULL);
47212 
47213  return SCIPsetIsSumLT(scip->set, val1, val2);
47214 }
47215 
47216 /** checks, if val1 is not (more than sumepsilon) greater than val2 */
47218  SCIP* scip, /**< SCIP data structure */
47219  SCIP_Real val1, /**< first value to be compared */
47220  SCIP_Real val2 /**< second value to be compared */
47221  )
47222 {
47223  assert(scip != NULL);
47224  assert(scip->set != NULL);
47225 
47226  return SCIPsetIsSumLE(scip->set, val1, val2);
47227 }
47228 
47229 /** checks, if val1 is (more than sumepsilon) greater than val2 */
47231  SCIP* scip, /**< SCIP data structure */
47232  SCIP_Real val1, /**< first value to be compared */
47233  SCIP_Real val2 /**< second value to be compared */
47234  )
47235 {
47236  assert(scip != NULL);
47237  assert(scip->set != NULL);
47238 
47239  return SCIPsetIsSumGT(scip->set, val1, val2);
47240 }
47241 
47242 /** checks, if val1 is not (more than sumepsilon) lower than val2 */
47244  SCIP* scip, /**< SCIP data structure */
47245  SCIP_Real val1, /**< first value to be compared */
47246  SCIP_Real val2 /**< second value to be compared */
47247  )
47248 {
47249  assert(scip != NULL);
47250  assert(scip->set != NULL);
47251 
47252  return SCIPsetIsSumGE(scip->set, val1, val2);
47253 }
47254 
47255 /** checks, if value is in range sumepsilon of 0.0 */
47257  SCIP* scip, /**< SCIP data structure */
47258  SCIP_Real val /**< value to process */
47259  )
47260 {
47261  assert(scip != NULL);
47262  assert(scip->set != NULL);
47263 
47264  return SCIPsetIsSumZero(scip->set, val);
47265 }
47266 
47267 /** checks, if value is greater than sumepsilon */
47269  SCIP* scip, /**< SCIP data structure */
47270  SCIP_Real val /**< value to process */
47271  )
47272 {
47273  assert(scip != NULL);
47274  assert(scip->set != NULL);
47275 
47276  return SCIPsetIsSumPositive(scip->set, val);
47277 }
47278 
47279 /** checks, if value is lower than -sumepsilon */
47281  SCIP* scip, /**< SCIP data structure */
47282  SCIP_Real val /**< value to process */
47283  )
47284 {
47285  assert(scip != NULL);
47286  assert(scip->set != NULL);
47287 
47288  return SCIPsetIsSumNegative(scip->set, val);
47289 }
47290 
47291 /** checks, if relative difference of values is in range of feasibility tolerance */
47293  SCIP* scip, /**< SCIP data structure */
47294  SCIP_Real val1, /**< first value to be compared */
47295  SCIP_Real val2 /**< second value to be compared */
47296  )
47297 {
47298  assert(scip != NULL);
47299  assert(scip->set != NULL);
47300 
47301  return SCIPsetIsFeasEQ(scip->set, val1, val2);
47302 }
47303 
47304 /** checks, if relative difference val1 and val2 is lower than feasibility tolerance */
47306  SCIP* scip, /**< SCIP data structure */
47307  SCIP_Real val1, /**< first value to be compared */
47308  SCIP_Real val2 /**< second value to be compared */
47309  )
47310 {
47311  assert(scip != NULL);
47312  assert(scip->set != NULL);
47313 
47314  return SCIPsetIsFeasLT(scip->set, val1, val2);
47315 }
47316 
47317 /** checks, if relative difference of val1 and val2 is not greater than feasibility tolerance */
47319  SCIP* scip, /**< SCIP data structure */
47320  SCIP_Real val1, /**< first value to be compared */
47321  SCIP_Real val2 /**< second value to be compared */
47322  )
47323 {
47324  assert(scip != NULL);
47325  assert(scip->set != NULL);
47326 
47327  return SCIPsetIsFeasLE(scip->set, val1, val2);
47328 }
47329 
47330 /** checks, if relative difference of val1 and val2 is greater than feastol */
47332  SCIP* scip, /**< SCIP data structure */
47333  SCIP_Real val1, /**< first value to be compared */
47334  SCIP_Real val2 /**< second value to be compared */
47335  )
47336 {
47337  assert(scip != NULL);
47338  assert(scip->set != NULL);
47339 
47340  return SCIPsetIsFeasGT(scip->set, val1, val2);
47341 }
47342 
47343 /** checks, if relative difference of val1 and val2 is not lower than -feastol */
47345  SCIP* scip, /**< SCIP data structure */
47346  SCIP_Real val1, /**< first value to be compared */
47347  SCIP_Real val2 /**< second value to be compared */
47348  )
47349 {
47350  assert(scip != NULL);
47351  assert(scip->set != NULL);
47352 
47353  return SCIPsetIsFeasGE(scip->set, val1, val2);
47354 }
47355 
47356 /** checks, if value is in range feasibility tolerance of 0.0 */
47358  SCIP* scip, /**< SCIP data structure */
47359  SCIP_Real val /**< value to process */
47360  )
47361 {
47362  assert(scip != NULL);
47363  assert(scip->set != NULL);
47364 
47365  return SCIPsetIsFeasZero(scip->set, val);
47366 }
47367 
47368 /** checks, if value is greater than feasibility tolerance */
47370  SCIP* scip, /**< SCIP data structure */
47371  SCIP_Real val /**< value to process */
47372  )
47373 {
47374  assert(scip != NULL);
47375  assert(scip->set != NULL);
47376 
47377  return SCIPsetIsFeasPositive(scip->set, val);
47378 }
47379 
47380 /** checks, if value is lower than -feasibility tolerance */
47382  SCIP* scip, /**< SCIP data structure */
47383  SCIP_Real val /**< value to process */
47384  )
47385 {
47386  assert(scip != NULL);
47387  assert(scip->set != NULL);
47388 
47389  return SCIPsetIsFeasNegative(scip->set, val);
47390 }
47391 
47392 /** checks, if value is integral within the LP feasibility bounds */
47394  SCIP* scip, /**< SCIP data structure */
47395  SCIP_Real val /**< value to process */
47396  )
47397 {
47398  assert(scip != NULL);
47399  assert(scip->set != NULL);
47400 
47401  return SCIPsetIsFeasIntegral(scip->set, val);
47402 }
47403 
47404 /** checks, if given fractional part is smaller than feastol */
47406  SCIP* scip, /**< SCIP data structure */
47407  SCIP_Real val /**< value to process */
47408  )
47409 {
47410  assert(scip != NULL);
47411  assert(scip->set != NULL);
47412 
47413  return SCIPsetIsFeasFracIntegral(scip->set, val);
47414 }
47415 
47416 /** rounds value + feasibility tolerance down to the next integer */
47418  SCIP* scip, /**< SCIP data structure */
47419  SCIP_Real val /**< value to process */
47420  )
47421 {
47422  assert(scip != NULL);
47423  assert(scip->set != NULL);
47424 
47425  return SCIPsetFeasFloor(scip->set, val);
47426 }
47427 
47428 /** rounds value - feasibility tolerance up to the next integer */
47430  SCIP* scip, /**< SCIP data structure */
47431  SCIP_Real val /**< value to process */
47432  )
47433 {
47434  assert(scip != NULL);
47435  assert(scip->set != NULL);
47436 
47437  return SCIPsetFeasCeil(scip->set, val);
47438 }
47439 
47440 /** rounds value to the nearest integer in feasibility tolerance */
47442  SCIP* scip, /**< SCIP data structure */
47443  SCIP_Real val /**< value to process */
47444  )
47445 {
47446  assert(scip != NULL);
47447  assert(scip->set != NULL);
47448 
47449  return SCIPsetFeasRound(scip->set, val);
47450 }
47451 
47452 /** returns fractional part of value, i.e. x - floor(x) in feasibility tolerance */
47454  SCIP* scip, /**< SCIP data structure */
47455  SCIP_Real val /**< value to process */
47456  )
47457 {
47458  assert(scip != NULL);
47459  assert(scip->set != NULL);
47460 
47461  return SCIPsetFeasFrac(scip->set, val);
47462 }
47463 
47464 /** checks, if relative difference of values is in range of dual feasibility tolerance */
47466  SCIP* scip, /**< SCIP data structure */
47467  SCIP_Real val1, /**< first value to be compared */
47468  SCIP_Real val2 /**< second value to be compared */
47469  )
47470 {
47471  assert(scip != NULL);
47472  assert(scip->set != NULL);
47473 
47474  return SCIPsetIsDualfeasEQ(scip->set, val1, val2);
47475 }
47476 
47477 /** checks, if relative difference val1 and val2 is lower than dual feasibility tolerance */
47479  SCIP* scip, /**< SCIP data structure */
47480  SCIP_Real val1, /**< first value to be compared */
47481  SCIP_Real val2 /**< second value to be compared */
47482  )
47483 {
47484  assert(scip != NULL);
47485  assert(scip->set != NULL);
47486 
47487  return SCIPsetIsDualfeasLT(scip->set, val1, val2);
47488 }
47489 
47490 /** checks, if relative difference of val1 and val2 is not greater than dual feasibility tolerance */
47492  SCIP* scip, /**< SCIP data structure */
47493  SCIP_Real val1, /**< first value to be compared */
47494  SCIP_Real val2 /**< second value to be compared */
47495  )
47496 {
47497  assert(scip != NULL);
47498  assert(scip->set != NULL);
47499 
47500  return SCIPsetIsDualfeasLE(scip->set, val1, val2);
47501 }
47502 
47503 /** checks, if relative difference of val1 and val2 is greater than dual feasibility tolerance */
47505  SCIP* scip, /**< SCIP data structure */
47506  SCIP_Real val1, /**< first value to be compared */
47507  SCIP_Real val2 /**< second value to be compared */
47508  )
47509 {
47510  assert(scip != NULL);
47511  assert(scip->set != NULL);
47512 
47513  return SCIPsetIsDualfeasGT(scip->set, val1, val2);
47514 }
47515 
47516 /** checks, if relative difference of val1 and val2 is not lower than -dual feasibility tolerance */
47518  SCIP* scip, /**< SCIP data structure */
47519  SCIP_Real val1, /**< first value to be compared */
47520  SCIP_Real val2 /**< second value to be compared */
47521  )
47522 {
47523  assert(scip != NULL);
47524  assert(scip->set != NULL);
47525 
47526  return SCIPsetIsDualfeasGE(scip->set, val1, val2);
47527 }
47528 
47529 /** checks, if value is in range dual feasibility tolerance of 0.0 */
47531  SCIP* scip, /**< SCIP data structure */
47532  SCIP_Real val /**< value to process */
47533  )
47534 {
47535  assert(scip != NULL);
47536  assert(scip->set != NULL);
47537 
47538  return SCIPsetIsDualfeasZero(scip->set, val);
47539 }
47540 
47541 /** checks, if value is greater than dual feasibility tolerance */
47543  SCIP* scip, /**< SCIP data structure */
47544  SCIP_Real val /**< value to process */
47545  )
47546 {
47547  assert(scip != NULL);
47548  assert(scip->set != NULL);
47549 
47550  return SCIPsetIsDualfeasPositive(scip->set, val);
47551 }
47552 
47553 /** checks, if value is lower than -dual feasibility tolerance */
47555  SCIP* scip, /**< SCIP data structure */
47556  SCIP_Real val /**< value to process */
47557  )
47558 {
47559  assert(scip != NULL);
47560  assert(scip->set != NULL);
47561 
47562  return SCIPsetIsDualfeasNegative(scip->set, val);
47563 }
47564 
47565 /** checks, if value is integral within the LP dual feasibility tolerance */
47567  SCIP* scip, /**< SCIP data structure */
47568  SCIP_Real val /**< value to process */
47569  )
47570 {
47571  assert(scip != NULL);
47572  assert(scip->set != NULL);
47573 
47574  return SCIPsetIsDualfeasIntegral(scip->set, val);
47575 }
47576 
47577 /** checks, if given fractional part is smaller than dual feasibility tolerance */
47579  SCIP* scip, /**< SCIP data structure */
47580  SCIP_Real val /**< value to process */
47581  )
47582 {
47583  assert(scip != NULL);
47584  assert(scip->set != NULL);
47585 
47586  return SCIPsetIsDualfeasFracIntegral(scip->set, val);
47587 }
47588 
47589 /** rounds value + dual feasibility tolerance down to the next integer */
47591  SCIP* scip, /**< SCIP data structure */
47592  SCIP_Real val /**< value to process */
47593  )
47594 {
47595  assert(scip != NULL);
47596  assert(scip->set != NULL);
47597 
47598  return SCIPsetDualfeasFloor(scip->set, val);
47599 }
47600 
47601 /** rounds value - dual feasibility tolerance up to the next integer */
47603  SCIP* scip, /**< SCIP data structure */
47604  SCIP_Real val /**< value to process */
47605  )
47606 {
47607  assert(scip != NULL);
47608  assert(scip->set != NULL);
47609 
47610  return SCIPsetDualfeasCeil(scip->set, val);
47611 }
47612 
47613 /** rounds value to the nearest integer in dual feasibility tolerance */
47615  SCIP* scip, /**< SCIP data structure */
47616  SCIP_Real val /**< value to process */
47617  )
47618 {
47619  assert(scip != NULL);
47620  assert(scip->set != NULL);
47621 
47622  return SCIPsetDualfeasRound(scip->set, val);
47623 }
47624 
47625 /** returns fractional part of value, i.e. x - floor(x) in dual feasibility tolerance */
47627  SCIP* scip, /**< SCIP data structure */
47628  SCIP_Real val /**< value to process */
47629  )
47630 {
47631  assert(scip != NULL);
47632  assert(scip->set != NULL);
47633 
47634  return SCIPsetDualfeasFrac(scip->set, val);
47635 }
47636 
47637 /** checks, if the given new lower bound is at least min(oldub - oldlb, |oldlb|) times the bound
47638  * strengthening epsilon better than the old one
47639  */
47641  SCIP* scip, /**< SCIP data structure */
47642  SCIP_Real newlb, /**< new lower bound */
47643  SCIP_Real oldlb, /**< old lower bound */
47644  SCIP_Real oldub /**< old upper bound */
47645  )
47646 {
47647  assert(scip != NULL);
47648 
47649  return SCIPsetIsLbBetter(scip->set, newlb, oldlb, oldub);
47650 }
47651 
47652 /** checks, if the given new upper bound is at least min(oldub - oldlb, |oldub|) times the bound
47653  * strengthening epsilon better than the old one
47654  */
47656  SCIP* scip, /**< SCIP data structure */
47657  SCIP_Real newub, /**< new upper bound */
47658  SCIP_Real oldlb, /**< old lower bound */
47659  SCIP_Real oldub /**< old upper bound */
47660  )
47661 {
47662  assert(scip != NULL);
47663 
47664  return SCIPsetIsUbBetter(scip->set, newub, oldlb, oldub);
47665 }
47666 
47667 /** checks, if relative difference of values is in range of epsilon */
47669  SCIP* scip, /**< SCIP data structure */
47670  SCIP_Real val1, /**< first value to be compared */
47671  SCIP_Real val2 /**< second value to be compared */
47672  )
47673 {
47674  assert(scip != NULL);
47675  assert(scip->set != NULL);
47676 
47677  return SCIPsetIsRelEQ(scip->set, val1, val2);
47678 }
47679 
47680 /** checks, if relative difference of val1 and val2 is lower than epsilon */
47682  SCIP* scip, /**< SCIP data structure */
47683  SCIP_Real val1, /**< first value to be compared */
47684  SCIP_Real val2 /**< second value to be compared */
47685  )
47686 {
47687  assert(scip != NULL);
47688  assert(scip->set != NULL);
47689 
47690  return SCIPsetIsRelLT(scip->set, val1, val2);
47691 }
47692 
47693 /** checks, if relative difference of val1 and val2 is not greater than epsilon */
47695  SCIP* scip, /**< SCIP data structure */
47696  SCIP_Real val1, /**< first value to be compared */
47697  SCIP_Real val2 /**< second value to be compared */
47698  )
47699 {
47700  assert(scip != NULL);
47701  assert(scip->set != NULL);
47702 
47703  return SCIPsetIsRelLE(scip->set, val1, val2);
47704 }
47705 
47706 /** checks, if relative difference of val1 and val2 is greater than epsilon */
47708  SCIP* scip, /**< SCIP data structure */
47709  SCIP_Real val1, /**< first value to be compared */
47710  SCIP_Real val2 /**< second value to be compared */
47711  )
47712 {
47713  assert(scip != NULL);
47714  assert(scip->set != NULL);
47715 
47716  return SCIPsetIsRelGT(scip->set, val1, val2);
47717 }
47718 
47719 /** checks, if relative difference of val1 and val2 is not lower than -epsilon */
47721  SCIP* scip, /**< SCIP data structure */
47722  SCIP_Real val1, /**< first value to be compared */
47723  SCIP_Real val2 /**< second value to be compared */
47724  )
47725 {
47726  assert(scip != NULL);
47727  assert(scip->set != NULL);
47728 
47729  return SCIPsetIsRelGE(scip->set, val1, val2);
47730 }
47731 
47732 /** checks, if relative difference of values is in range of sumepsilon */
47734  SCIP* scip, /**< SCIP data structure */
47735  SCIP_Real val1, /**< first value to be compared */
47736  SCIP_Real val2 /**< second value to be compared */
47737  )
47738 {
47739  assert(scip != NULL);
47740  assert(scip->set != NULL);
47741 
47742  return SCIPsetIsSumRelEQ(scip->set, val1, val2);
47743 }
47744 
47745 /** checks, if relative difference of val1 and val2 is lower than sumepsilon */
47747  SCIP* scip, /**< SCIP data structure */
47748  SCIP_Real val1, /**< first value to be compared */
47749  SCIP_Real val2 /**< second value to be compared */
47750  )
47751 {
47752  assert(scip != NULL);
47753  assert(scip->set != NULL);
47754 
47755  return SCIPsetIsSumRelLT(scip->set, val1, val2);
47756 }
47757 
47758 /** checks, if relative difference of val1 and val2 is not greater than sumepsilon */
47760  SCIP* scip, /**< SCIP data structure */
47761  SCIP_Real val1, /**< first value to be compared */
47762  SCIP_Real val2 /**< second value to be compared */
47763  )
47764 {
47765  assert(scip != NULL);
47766  assert(scip->set != NULL);
47767 
47768  return SCIPsetIsSumRelLE(scip->set, val1, val2);
47769 }
47770 
47771 /** checks, if relative difference of val1 and val2 is greater than sumepsilon */
47773  SCIP* scip, /**< SCIP data structure */
47774  SCIP_Real val1, /**< first value to be compared */
47775  SCIP_Real val2 /**< second value to be compared */
47776  )
47777 {
47778  assert(scip != NULL);
47779  assert(scip->set != NULL);
47780 
47781  return SCIPsetIsSumRelGT(scip->set, val1, val2);
47782 }
47783 
47784 /** checks, if relative difference of val1 and val2 is not lower than -sumepsilon */
47786  SCIP* scip, /**< SCIP data structure */
47787  SCIP_Real val1, /**< first value to be compared */
47788  SCIP_Real val2 /**< second value to be compared */
47789  )
47790 {
47791  assert(scip != NULL);
47792  assert(scip->set != NULL);
47793 
47794  return SCIPsetIsSumRelGE(scip->set, val1, val2);
47795 }
47796 
47797 /** converts the given real number representing an integer to an int; in optimized mode the function gets inlined for
47798  * performance; in debug mode we check some additional conditions
47799  */
47801  SCIP* scip, /**< SCIP data structure */
47802  SCIP_Real real /**< double bound to convert */
47803  )
47804 {
47805  assert(SCIPisFeasIntegral(scip, real));
47806  assert(SCIPisFeasEQ(scip, real, (SCIP_Real)(int)(real < 0 ? real - 0.5 : real + 0.5)));
47807  assert(real < INT_MAX);
47808  assert(real > INT_MIN);
47809 
47810  return (int)(real < 0 ? (real - 0.5) : (real + 0.5));
47811 }
47812 
47813 /** converts the given real number representing an integer to a long integer; in optimized mode the function gets inlined for
47814  * performance; in debug mode we check some additional conditions
47815  */
47817  SCIP* scip, /**< SCIP data structure */
47818  SCIP_Real real /**< double bound to convert */
47819  )
47820 {
47821  assert(SCIPisFeasIntegral(scip, real));
47822  assert(SCIPisFeasEQ(scip, real, (SCIP_Real)(SCIP_Longint)(real < 0 ? real - 0.5 : real + 0.5)));
47823  assert(real < SCIP_LONGINT_MAX);
47824  assert(real > SCIP_LONGINT_MIN);
47825 
47826  return (SCIP_Longint)(real < 0 ? (real - 0.5) : (real + 0.5));
47827 }
47828 
47829 /** Checks, if an iteratively updated value is reliable or should be recomputed from scratch.
47830  * This is useful, if the value, e.g., the activity of a linear constraint or the pseudo objective value, gets a high
47831  * absolute value during the optimization process which is later reduced significantly. In this case, the last digits
47832  * were canceled out when increasing the value and are random after decreasing it.
47833  * We do not consider the cancellations which can occur during increasing the absolute value because they just cannot
47834  * be expressed using fixed precision floating point arithmetic, anymore.
47835  * In order to get more reliable values, the idea is to always store the last reliable value, where increasing the
47836  * absolute of the value is viewed as preserving reliability. Then, after each update, the new absolute value can be
47837  * compared against the last reliable one with this method, checking whether it was decreased by a factor of at least
47838  * "lp/recompfac" and should be recomputed.
47839  */
47841  SCIP* scip, /**< SCIP data structure */
47842  SCIP_Real newvalue, /**< new value after update */
47843  SCIP_Real oldvalue /**< old value, i.e., last reliable value */
47844  )
47845 {
47846  assert(scip != NULL);
47847 
47848  SCIP_CALL_ABORT( checkStage(scip, "SCIPisUpdateUnreliable", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
47849 
47850  return SCIPsetIsUpdateUnreliable(scip->set, newvalue, oldvalue);
47851 }
47852 
47853 /** creates a dynamic array of real values
47854  *
47855  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
47856  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
47857  */
47859  SCIP* scip, /**< SCIP data structure */
47860  SCIP_REALARRAY** realarray /**< pointer to store the real array */
47861  )
47862 {
47863  assert(scip != NULL);
47864 
47865  SCIP_CALL( SCIPrealarrayCreate(realarray, SCIPblkmem(scip)) );
47866 
47867  return SCIP_OKAY;
47868 }
47869 
47870 /** frees a dynamic array of real values
47871  *
47872  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
47873  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
47874  */
47876  SCIP* scip, /**< SCIP data structure */
47877  SCIP_REALARRAY** realarray /**< pointer to the real array */
47878  )
47879 {
47880  assert(scip != NULL);
47881 
47882  SCIP_CALL( SCIPrealarrayFree(realarray) );
47883 
47884  return SCIP_OKAY;
47885 }
47886 
47887 /** extends dynamic array to be able to store indices from minidx to maxidx
47888  *
47889  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
47890  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
47891  */
47893  SCIP* scip, /**< SCIP data structure */
47894  SCIP_REALARRAY* realarray, /**< dynamic real array */
47895  int minidx, /**< smallest index to allocate storage for */
47896  int maxidx /**< largest index to allocate storage for */
47897  )
47898 {
47899  assert(scip != NULL);
47900 
47901  SCIP_CALL( SCIPrealarrayExtend(realarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
47902 
47903  return SCIP_OKAY;
47904 }
47905 
47906 /** clears a dynamic real array
47907  *
47908  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
47909  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
47910  */
47912  SCIP* scip, /**< SCIP data structure */
47913  SCIP_REALARRAY* realarray /**< dynamic real array */
47914  )
47915 {
47916  assert(scip != NULL);
47917 
47918  SCIP_CALL( SCIPrealarrayClear(realarray) );
47919 
47920  return SCIP_OKAY;
47921 }
47922 
47923 /** gets value of entry in dynamic array
47924  *
47925  * @return value of entry in dynamic array
47926  */
47928  SCIP* scip, /**< SCIP data structure */
47929  SCIP_REALARRAY* realarray, /**< dynamic real array */
47930  int idx /**< array index to get value for */
47931  )
47932 {
47933  assert(scip != NULL);
47934 
47935  return SCIPrealarrayGetVal(realarray, idx);
47936 }
47937 
47938 /** sets value of entry in dynamic array
47939  *
47940  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
47941  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
47942  */
47944  SCIP* scip, /**< SCIP data structure */
47945  SCIP_REALARRAY* realarray, /**< dynamic real array */
47946  int idx, /**< array index to set value for */
47947  SCIP_Real val /**< value to set array index to */
47948  )
47949 {
47950  assert(scip != NULL);
47951 
47952  SCIP_CALL( SCIPrealarraySetVal(realarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
47953 
47954  return SCIP_OKAY;
47955 }
47956 
47957 /** increases value of entry in dynamic array
47958  *
47959  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
47960  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
47961  */
47963  SCIP* scip, /**< SCIP data structure */
47964  SCIP_REALARRAY* realarray, /**< dynamic real array */
47965  int idx, /**< array index to increase value for */
47966  SCIP_Real incval /**< value to increase array index */
47967  )
47968 {
47969  assert(scip != NULL);
47970 
47971  SCIP_CALL( SCIPrealarrayIncVal(realarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, incval) );
47972 
47973  return SCIP_OKAY;
47974 }
47975 
47976 /** returns the minimal index of all stored non-zero elements
47977  *
47978  * @return the minimal index of all stored non-zero elements
47979  */
47981  SCIP* scip, /**< SCIP data structure */
47982  SCIP_REALARRAY* realarray /**< dynamic real array */
47983  )
47984 {
47985  assert(scip != NULL);
47986 
47987  return SCIPrealarrayGetMinIdx(realarray);
47988 }
47989 
47990 /** returns the maximal index of all stored non-zero elements
47991  *
47992  * @return the maximal index of all stored non-zero elements
47993  */
47995  SCIP* scip, /**< SCIP data structure */
47996  SCIP_REALARRAY* realarray /**< dynamic real array */
47997  )
47998 {
47999  assert(scip != NULL);
48000 
48001  return SCIPrealarrayGetMaxIdx(realarray);
48002 }
48003 
48004 /** creates a dynamic array of int values
48005  *
48006  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48007  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48008  */
48010  SCIP* scip, /**< SCIP data structure */
48011  SCIP_INTARRAY** intarray /**< pointer to store the int array */
48012  )
48013 {
48014  assert(scip != NULL);
48015 
48016  SCIP_CALL( SCIPintarrayCreate(intarray, SCIPblkmem(scip)) );
48017 
48018  return SCIP_OKAY;
48019 }
48020 
48021 /** frees a dynamic array of int values
48022  *
48023  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48024  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48025  */
48027  SCIP* scip, /**< SCIP data structure */
48028  SCIP_INTARRAY** intarray /**< pointer to the int array */
48029  )
48030 {
48031  assert(scip != NULL);
48032 
48033  SCIP_CALL( SCIPintarrayFree(intarray) );
48034 
48035  return SCIP_OKAY;
48036 }
48037 
48038 /** extends dynamic array to be able to store indices from minidx to maxidx
48039  *
48040  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48041  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48042  */
48044  SCIP* scip, /**< SCIP data structure */
48045  SCIP_INTARRAY* intarray, /**< dynamic int array */
48046  int minidx, /**< smallest index to allocate storage for */
48047  int maxidx /**< largest index to allocate storage for */
48048  )
48049 {
48050  assert(scip != NULL);
48051 
48052  SCIP_CALL( SCIPintarrayExtend(intarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
48053 
48054  return SCIP_OKAY;
48055 }
48056 
48057 /** clears a dynamic int array
48058  *
48059  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48060  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48061  */
48063  SCIP* scip, /**< SCIP data structure */
48064  SCIP_INTARRAY* intarray /**< dynamic int array */
48065  )
48066 {
48067  assert(scip != NULL);
48068 
48069  SCIP_CALL( SCIPintarrayClear(intarray) );
48070 
48071  return SCIP_OKAY;
48072 }
48073 
48074 /** gets value of entry in dynamic array
48075  *
48076  * @return value of entry in dynamic array
48077  */
48079  SCIP* scip, /**< SCIP data structure */
48080  SCIP_INTARRAY* intarray, /**< dynamic int array */
48081  int idx /**< array index to get value for */
48082  )
48083 {
48084  assert(scip != NULL);
48085 
48086  return SCIPintarrayGetVal(intarray, idx);
48087 }
48088 
48089 /** sets value of entry in dynamic array
48090  *
48091  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48092  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48093  */
48095  SCIP* scip, /**< SCIP data structure */
48096  SCIP_INTARRAY* intarray, /**< dynamic int array */
48097  int idx, /**< array index to set value for */
48098  int val /**< value to set array index to */
48099  )
48100 {
48101  assert(scip != NULL);
48102 
48103  SCIP_CALL( SCIPintarraySetVal(intarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
48104 
48105  return SCIP_OKAY;
48106 }
48107 
48108 /** increases value of entry in dynamic array
48109  *
48110  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48111  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48112  */
48114  SCIP* scip, /**< SCIP data structure */
48115  SCIP_INTARRAY* intarray, /**< dynamic int array */
48116  int idx, /**< array index to increase value for */
48117  int incval /**< value to increase array index */
48118  )
48119 {
48120  assert(scip != NULL);
48121 
48122  SCIP_CALL( SCIPintarrayIncVal(intarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, incval) );
48123 
48124  return SCIP_OKAY;
48125 }
48126 
48127 /** returns the minimal index of all stored non-zero elements
48128  *
48129  * @return the minimal index of all stored non-zero elements
48130  */
48132  SCIP* scip, /**< SCIP data structure */
48133  SCIP_INTARRAY* intarray /**< dynamic int array */
48134  )
48135 {
48136  assert(scip != NULL);
48137 
48138  return SCIPintarrayGetMinIdx(intarray);
48139 }
48140 
48141 /** returns the maximal index of all stored non-zero elements
48142  *
48143  * @return the maximal index of all stored non-zero elements
48144  */
48146  SCIP* scip, /**< SCIP data structure */
48147  SCIP_INTARRAY* intarray /**< dynamic int array */
48148  )
48149 {
48150  assert(scip != NULL);
48151 
48152  return SCIPintarrayGetMaxIdx(intarray);
48153 }
48154 
48155 /** creates a dynamic array of bool values
48156  *
48157  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48158  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48159  */
48161  SCIP* scip, /**< SCIP data structure */
48162  SCIP_BOOLARRAY** boolarray /**< pointer to store the bool array */
48163  )
48164 {
48165  assert(scip != NULL);
48166 
48167  SCIP_CALL( SCIPboolarrayCreate(boolarray, SCIPblkmem(scip)) );
48168 
48169  return SCIP_OKAY;
48170 }
48171 
48172 /** frees a dynamic array of bool values
48173  *
48174  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48175  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48176  */
48178  SCIP* scip, /**< SCIP data structure */
48179  SCIP_BOOLARRAY** boolarray /**< pointer to the bool array */
48180  )
48181 {
48182  assert(scip != NULL);
48183 
48184  SCIP_CALL( SCIPboolarrayFree(boolarray) );
48185 
48186  return SCIP_OKAY;
48187 }
48188 
48189 /** extends dynamic array to be able to store indices from minidx to maxidx
48190  *
48191  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48192  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48193  */
48195  SCIP* scip, /**< SCIP data structure */
48196  SCIP_BOOLARRAY* boolarray, /**< dynamic bool array */
48197  int minidx, /**< smallest index to allocate storage for */
48198  int maxidx /**< largest index to allocate storage for */
48199  )
48200 {
48201  assert(scip != NULL);
48202 
48203  SCIP_CALL( SCIPboolarrayExtend(boolarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
48204 
48205  return SCIP_OKAY;
48206 }
48207 
48208 /** clears a dynamic bool array
48209  *
48210  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48211  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48212  */
48214  SCIP* scip, /**< SCIP data structure */
48215  SCIP_BOOLARRAY* boolarray /**< dynamic bool array */
48216  )
48217 {
48218  assert(scip != NULL);
48219 
48220  SCIP_CALL( SCIPboolarrayClear(boolarray) );
48221 
48222  return SCIP_OKAY;
48223 }
48224 
48225 /** gets value of entry in dynamic array
48226  *
48227  * @return value of entry in dynamic array at position idx
48228  */
48230  SCIP* scip, /**< SCIP data structure */
48231  SCIP_BOOLARRAY* boolarray, /**< dynamic bool array */
48232  int idx /**< array index to get value for */
48233  )
48234 {
48235  assert(scip != NULL);
48236 
48237  return SCIPboolarrayGetVal(boolarray, idx);
48238 }
48239 
48240 /** sets value of entry in dynamic array
48241  *
48242  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48243  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48244  */
48246  SCIP* scip, /**< SCIP data structure */
48247  SCIP_BOOLARRAY* boolarray, /**< dynamic bool array */
48248  int idx, /**< array index to set value for */
48249  SCIP_Bool val /**< value to set array index to */
48250  )
48251 {
48252  assert(scip != NULL);
48253 
48254  SCIP_CALL( SCIPboolarraySetVal(boolarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
48255 
48256  return SCIP_OKAY;
48257 }
48258 
48259 /** returns the minimal index of all stored non-zero elements
48260  *
48261  * @return the minimal index of all stored non-zero elements
48262  */
48264  SCIP* scip, /**< SCIP data structure */
48265  SCIP_BOOLARRAY* boolarray /**< dynamic bool array */
48266  )
48267 {
48268  assert(scip != NULL);
48269 
48270  return SCIPboolarrayGetMinIdx(boolarray);
48271 }
48272 
48273 /** returns the maximal index of all stored non-zero elements
48274  *
48275  * @return the maximal index of all stored non-zero elements
48276  */
48278  SCIP* scip, /**< SCIP data structure */
48279  SCIP_BOOLARRAY* boolarray /**< dynamic bool array */
48280  )
48281 {
48282  assert(scip != NULL);
48283 
48284  return SCIPboolarrayGetMaxIdx(boolarray);
48285 }
48286 
48287 /** creates a dynamic array of pointers
48288  *
48289  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48290  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48291  */
48293  SCIP* scip, /**< SCIP data structure */
48294  SCIP_PTRARRAY** ptrarray /**< pointer to store the int array */
48295  )
48296 {
48297  assert(scip != NULL);
48298 
48299  SCIP_CALL( SCIPptrarrayCreate(ptrarray, SCIPblkmem(scip)) );
48300 
48301  return SCIP_OKAY;
48302 }
48303 
48304 /** frees a dynamic array of pointers
48305  *
48306  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48307  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48308  */
48310  SCIP* scip, /**< SCIP data structure */
48311  SCIP_PTRARRAY** ptrarray /**< pointer to the int array */
48312  )
48313 {
48314  assert(scip != NULL);
48315 
48316  SCIP_CALL( SCIPptrarrayFree(ptrarray) );
48317 
48318  return SCIP_OKAY;
48319 }
48320 
48321 /** extends dynamic array to be able to store indices from minidx to maxidx
48322  *
48323  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48324  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48325  */
48327  SCIP* scip, /**< SCIP data structure */
48328  SCIP_PTRARRAY* ptrarray, /**< dynamic int array */
48329  int minidx, /**< smallest index to allocate storage for */
48330  int maxidx /**< largest index to allocate storage for */
48331  )
48332 {
48333  assert(scip != NULL);
48334 
48335  SCIP_CALL( SCIPptrarrayExtend(ptrarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
48336 
48337  return SCIP_OKAY;
48338 }
48339 
48340 /** clears a dynamic pointer array
48341  *
48342  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48343  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48344  */
48346  SCIP* scip, /**< SCIP data structure */
48347  SCIP_PTRARRAY* ptrarray /**< dynamic int array */
48348  )
48349 {
48350  assert(scip != NULL);
48351 
48352  SCIP_CALL( SCIPptrarrayClear(ptrarray) );
48353 
48354  return SCIP_OKAY;
48355 }
48356 
48357 /** gets value of entry in dynamic array */
48359  SCIP* scip, /**< SCIP data structure */
48360  SCIP_PTRARRAY* ptrarray, /**< dynamic int array */
48361  int idx /**< array index to get value for */
48362  )
48363 {
48364  assert(scip != NULL);
48365 
48366  return SCIPptrarrayGetVal(ptrarray, idx);
48367 }
48368 
48369 /** sets value of entry in dynamic array
48370  *
48371  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
48372  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
48373  */
48375  SCIP* scip, /**< SCIP data structure */
48376  SCIP_PTRARRAY* ptrarray, /**< dynamic int array */
48377  int idx, /**< array index to set value for */
48378  void* val /**< value to set array index to */
48379  )
48380 {
48381  assert(scip != NULL);
48382 
48383  SCIP_CALL( SCIPptrarraySetVal(ptrarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
48384 
48385  return SCIP_OKAY;
48386 }
48387 
48388 /** returns the minimal index of all stored non-zero elements
48389  *
48390  * @return the minimal index of all stored non-zero elements
48391  */
48393  SCIP* scip, /**< SCIP data structure */
48394  SCIP_PTRARRAY* ptrarray /**< dynamic ptr array */
48395  )
48396 {
48397  assert(scip != NULL);
48398 
48399  return SCIPptrarrayGetMinIdx(ptrarray);
48400 }
48401 
48402 /** returns the maximal index of all stored non-zero elements
48403  *
48404  * @return the maximal index of all stored non-zero elements
48405  */
48407  SCIP* scip, /**< SCIP data structure */
48408  SCIP_PTRARRAY* ptrarray /**< dynamic ptr array */
48409  )
48410 {
48411  assert(scip != NULL);
48412 
48413  return SCIPptrarrayGetMaxIdx(ptrarray);
48414 }
48415 
48416 /** validate the result of the solve
48417  *
48418  * the validation includes
48419  *
48420  * - checking the feasibility of the incumbent solution in the original problem (using SCIPcheckSolOrig())
48421  *
48422  * - checking if the objective bounds computed by SCIP agree with external primal and dual reference bounds.
48423  *
48424  * All external reference bounds the original problem space and the original objective sense.
48425  *
48426  * For infeasible problems, +/-SCIPinfinity() should be passed as reference bounds depending on the objective sense
48427  * of the original problem.
48428  */
48430  SCIP* scip, /**< SCIP data structure */
48431  SCIP_Real primalreference, /**< external primal reference value for the problem, or SCIP_UNKNOWN */
48432  SCIP_Real dualreference, /**< external dual reference value for the problem, or SCIP_UNKNOWN */
48433  SCIP_Real reftol, /**< relative tolerance for acceptable violation of reference values */
48434  SCIP_Bool quiet, /**< TRUE if no status line should be printed */
48435  SCIP_Bool* feasible, /**< pointer to store if the best solution is feasible in the original problem,
48436  * or NULL */
48437  SCIP_Bool* primalboundcheck, /**< pointer to store if the primal bound respects the given dual reference
48438  * value, or NULL */
48439  SCIP_Bool* dualboundcheck /**< pointer to store if the dual bound respects the given primal reference
48440  * value, or NULL */
48441  )
48442 {
48443  SCIP_Bool localfeasible;
48444  SCIP_Bool localprimalboundcheck;
48445  SCIP_Bool localdualboundcheck;
48446  SCIP_Real primviol;
48447  SCIP_Real dualviol;
48448  assert(scip != NULL);
48449 
48450  /* if no problem exists, there is no need for validation */
48451  if( SCIPgetStage(scip) < SCIP_STAGE_PROBLEM )
48452  {
48453  if( feasible != NULL )
48454  *feasible = TRUE;
48455  if( primalboundcheck != NULL )
48456  *primalboundcheck = TRUE;
48457  if( dualboundcheck != NULL )
48458  *dualboundcheck = TRUE;
48459 
48460  return SCIP_OKAY;
48461  }
48462 
48463  localfeasible = TRUE;
48464  localdualboundcheck = TRUE;
48465 
48466  /* check the best solution for feasibility in the original problem */
48467  if( SCIPgetNSols(scip) > 0 )
48468  {
48469  SCIP_SOL* bestsol = SCIPgetBestSol(scip);
48470  SCIP_Real checkfeastolfac;
48471  SCIP_Real oldfeastol;
48472 
48473  assert(bestsol != NULL);
48474 
48475  /* scale feasibility tolerance by set->num_checkfeastolfac */
48476  oldfeastol = SCIPfeastol(scip);
48477  SCIP_CALL( SCIPgetRealParam(scip, "numerics/checkfeastolfac", &checkfeastolfac) );
48478  if( !SCIPisEQ(scip, checkfeastolfac, 1.0) )
48479  {
48480  SCIP_CALL( SCIPchgFeastol(scip, oldfeastol * checkfeastolfac) );
48481  }
48482 
48483  SCIP_CALL( SCIPcheckSolOrig(scip, bestsol, &localfeasible, !quiet, TRUE) );
48484 
48485  /* restore old feasibilty tolerance */
48486  if( !SCIPisEQ(scip, checkfeastolfac, 1.0) )
48487  {
48488  SCIP_CALL( SCIPchgFeastol(scip, oldfeastol) );
48489  }
48490  }
48491  else
48492  {
48493  localfeasible = TRUE;
48494  }
48495 
48496  primviol = 0.0;
48497  dualviol = 0.0;
48498  /* check the primal and dual bounds computed by SCIP against the external reference values within reference tolerance */
48499  /* solution for an infeasible problem */
48500  if( SCIPgetNSols(scip) > 0 && ((SCIPgetObjsense(scip) == SCIP_OBJSENSE_MINIMIZE && SCIPisInfinity(scip, dualreference))
48501  || (SCIPgetObjsense(scip) == SCIP_OBJSENSE_MAXIMIZE && SCIPisInfinity(scip, -dualreference))) )
48502  localprimalboundcheck = FALSE;
48503  else
48504  {
48505  /* check if reference primal bound is not better than the proven dual bound and, if SCIP claims to be optimal,
48506  * if the
48507  */
48508  SCIP_Real pb = SCIPgetPrimalbound(scip);
48509  SCIP_Real db = SCIPgetDualbound(scip);
48510 
48511  /* compute the relative violation between the primal bound and dual reference value, and vice versa */
48513  {
48514  if( dualreference != SCIP_UNKNOWN ) /*lint !e777 */
48515  primviol = SCIPrelDiff(dualreference, pb);
48516  if( primalreference != SCIP_UNKNOWN ) /*lint !e777 */
48517  dualviol = SCIPrelDiff(db, primalreference);
48518  }
48519  else
48520  {
48521  if( dualreference != SCIP_UNKNOWN ) /*lint !e777 */
48522  primviol = SCIPrelDiff(pb, dualreference);
48523 
48524  if( primalreference != SCIP_UNKNOWN ) /*lint !e777 */
48525  dualviol = SCIPrelDiff(primalreference, db);
48526  }
48527  primviol = MAX(primviol, 0.0);
48528  dualviol = MAX(dualviol, 0.0);
48529 
48530  localprimalboundcheck = EPSP(reftol, primviol);
48531  localdualboundcheck = EPSP(reftol, dualviol);
48532  }
48533 
48534  if( !quiet )
48535  {
48536  SCIPinfoMessage(scip, NULL, "Validation : ");
48537  if( ! localfeasible )
48538  SCIPinfoMessage(scip, NULL, "Fail (infeasible)");
48539  else if( ! localprimalboundcheck )
48540  SCIPinfoMessage(scip, NULL, "Fail (primal bound)");
48541  else if( ! localdualboundcheck )
48542  SCIPinfoMessage(scip, NULL, "Fail (dual bound)");
48543  else
48544  SCIPinfoMessage(scip, NULL, "Success");
48545  SCIPinfoMessage(scip, NULL, "\n");
48546  SCIPinfoMessage(scip, NULL, " %-17s: %10u\n", "cons violation", !localfeasible);
48547  SCIPinfoMessage(scip, NULL, " %-17s: %10.8g (reference: %16.9e)\n", "primal violation", primviol, dualreference);
48548  SCIPinfoMessage(scip, NULL, " %-17s: %10.8g (reference: %16.9e)\n", "dual violation", dualviol, primalreference);
48549  }
48550 
48551  if( feasible != NULL )
48552  *feasible = localfeasible;
48553  if( primalboundcheck != NULL )
48554  *primalboundcheck = localprimalboundcheck;
48555  if( dualboundcheck != NULL )
48556  *dualboundcheck = localdualboundcheck;
48557 
48558  return SCIP_OKAY;
48559 }
48560 
48561 /** creates directed graph structure */
48563  SCIP* scip, /**< SCIP data structure */
48564  SCIP_DIGRAPH** digraph, /**< pointer to store the created directed graph */
48565  int nnodes /**< number of nodes */
48566  )
48567 {
48568  assert(scip != NULL);
48569  assert(digraph != NULL);
48570 
48571  SCIP_CALL( SCIPdigraphCreate(digraph, scip->mem->probmem, nnodes) );
48572 
48573  return SCIP_OKAY;
48574 }
48575 
48576 /** copies directed graph structure
48577  *
48578  * The copying procedure uses the memory of the passed SCIP instance. The user must ensure that the digraph lives
48579  * as most as long as the SCIP instance.
48580  *
48581  * @note The data in nodedata is copied verbatim. This possibly has to be adapted by the user.
48582  */
48584  SCIP* scip, /**< SCIP data structure */
48585  SCIP_DIGRAPH** targetdigraph, /**< pointer to store the copied directed graph */
48586  SCIP_DIGRAPH* sourcedigraph /**< source directed graph */
48587  )
48588 {
48589  assert(scip != NULL);
48590  assert(sourcedigraph != NULL);
48591  assert(targetdigraph != NULL);
48592 
48593  SCIP_CALL( SCIPdigraphCopy(targetdigraph, sourcedigraph, scip->mem->probmem) );
48594 
48595  return SCIP_OKAY;
48596 }
48597 
48598 /** creates and initializes a random number generator
48599  *
48600  * @note The initial seed is changed using SCIPinitializeRandomSeed()
48601  */
48603  SCIP* scip, /**< SCIP data structure */
48604  SCIP_RANDNUMGEN** randnumgen, /**< random number generator */
48605  unsigned int initialseed /**< initial random seed */
48606  )
48607 {
48608  unsigned int modifiedseed;
48609  assert(scip != NULL);
48610  assert(randnumgen != NULL);
48611 
48612  modifiedseed = SCIPinitializeRandomSeed(scip, (int)(initialseed % INT_MAX));
48613 
48614  SCIP_CALL( SCIPrandomCreate(randnumgen, SCIPblkmem(scip), modifiedseed) );
48615 
48616  return SCIP_OKAY;
48617 }
48618 
48619 /** frees a random number generator */
48621  SCIP* scip, /**< SCIP data structure */
48622  SCIP_RANDNUMGEN** randnumgen /**< random number generator */
48623  )
48624 {
48625  assert(scip != NULL);
48626  assert(randnumgen != NULL);
48627 
48628  SCIPrandomFree(randnumgen, SCIPblkmem(scip));
48629 }
48630 
48631 /** initializes a random number generator with a given start seed
48632  *
48633  * @note The seed is changed using SCIPinitializeRandomSeed()
48634  */
48636  SCIP* scip, /**< SCIP data structure */
48637  SCIP_RANDNUMGEN* randnumgen, /**< random number generator */
48638  unsigned int seed /**< new random seed */
48639  )
48640 {
48641  unsigned int modifiedseed;
48642  assert(scip != NULL);
48643  assert(randnumgen != NULL);
48644 
48645  modifiedseed = SCIPinitializeRandomSeed(scip, (int)(seed % INT_MAX));
48646 
48647  SCIPrandomSetSeed(randnumgen, modifiedseed);
48648 }
48649 
48650 /** creates a disjoint set (union find) structure \p uf for \p ncomponents many components (of size one) */
48652  SCIP* scip, /**< SCIP data structure */
48653  SCIP_DISJOINTSET** djset, /**< disjoint set (union find) data structure */
48654  int ncomponents /**< number of components */
48655  )
48656 {
48657  assert(scip != NULL);
48658  assert(djset != NULL);
48659 
48660  SCIP_CALL( SCIPdisjointsetCreate(djset, scip->mem->probmem, ncomponents) );
48661 
48662  return SCIP_OKAY;
48663 }
48664 
48665 /** frees the disjoint set (union find) data structure */
48667  SCIP* scip, /**< SCIP data structure */
48668  SCIP_DISJOINTSET** djset /**< disjoint set (union find) data structure */
48669  )
48670 {
48671  assert(scip != NULL);
48672 
48673  SCIPdisjointsetFree(djset, scip->mem->probmem);
48674 }
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:28920
SCIP_RETCODE SCIPaddLinearCoefsToNlRow(SCIP *scip, SCIP_NLROW *nlrow, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:32408
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:13103
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:47614
SCIP_RETCODE SCIPcreatePartialSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:38049
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:45698
SCIP_Longint nlexduallps
Definition: struct_stat.h:179
SCIP_RETCODE SCIPprintBestSol(SCIP *scip, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:39942
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:4820
SCIP_RETCODE SCIPgetLPBranchCands(SCIP *scip, SCIP_VAR ***lpcands, SCIP_Real **lpcandssol, SCIP_Real **lpcandsfrac, int *nlpcands, int *npriolpcands, int *nfracimplvars)
Definition: scip.c:36995
internal methods for separators
void SCIPfreeRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen)
Definition: scip.c:48620
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:30734
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:43743
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:6853
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:29669
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:35207
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:11896
SCIP_Real SCIPgetFirstPrimalBound(SCIP *scip)
Definition: scip.c:43374
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:30298
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
Definition: scip.c:47357
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:30485
SCIP_RETCODE SCIPtreeAddDiveBoundChange(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_VAR *var, SCIP_BRANCHDIR dir, SCIP_Real value, SCIP_Bool preferred)
Definition: tree.c:6186
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:37396
SCIP_RETCODE SCIPincConsAge(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28366
void SCIPeventhdlrSetInit(SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTINIT((*eventinit)))
Definition: event.c:331
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:43065
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:15786
SCIP_RETCODE SCIPsetRelaxCopy(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXCOPY((*relaxcopy)))
Definition: scip.c:7182
int SCIPgetNCheckConss(SCIP *scip)
Definition: scip.c:12998
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:15488
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:4925
SCIP_RETCODE SCIPaddConsAge(SCIP *scip, SCIP_CONS *cons, SCIP_Real deltaage)
Definition: scip.c:28337
void SCIPlpInvalidateRootObjval(SCIP_LP *lp)
Definition: lp.c:12700
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:7565
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:19205
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:41453
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:31456
SCIP_Real SCIPreoptGetSimToPrevious(SCIP_REOPT *reopt)
Definition: reopt.c:5569
SCIP_RETCODE SCIPgetLPBInvRow(SCIP *scip, int r, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip.c:29778
SCIP_RETCODE SCIPchgVarLbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:22276
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:6195
SCIP_RETCODE SCIPlinkLPSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38570
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:46300
SCIP_Longint SCIPgetNRootLPIterations(SCIP *scip)
Definition: scip.c:42371
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:44811
SCIP_Real firstlpdualbound
Definition: struct_stat.h:116
SCIP_RETCODE SCIPgetNlRowPseudoActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *pseudoactivity)
Definition: scip.c:32799
SCIP_Real SCIPgetAvgPseudocostScoreCurrentRun(SCIP *scip)
Definition: scip.c:43836
SCIP_RETCODE SCIPdisableConsSeparation(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28506
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:6773
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:48113
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:47566
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:5867
SCIP_READER ** readers
Definition: struct_set.h:67
SCIP_Real SCIPfeastol(SCIP *scip)
Definition: scip.c:46437
const char * SCIPexprintGetName(void)
SCIP_Bool SCIPlpDivingRowsChanged(SCIP_LP *lp)
Definition: lp.c:17031
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:7251
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:26630
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:26884
SCIP_RETCODE SCIPcomputeLPRelIntPoint(SCIP *scip, SCIP_Bool relaxrows, SCIP_Bool inclobjcutoff, SCIP_Real timelimit, int iterlimit, SCIP_SOL **point)
Definition: scip.c:30134
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:6430
SCIP_VAR ** SCIPcliqueGetVars(SCIP_CLIQUE *clique)
Definition: implics.c:3353
int SCIPgetPlungeDepth(SCIP *scip)
Definition: scip.c:43154
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:31227
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:5341
trivialnegation primal heuristic
SCIP_Bool SCIPsetIsFeasZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6284
int SCIPgetNDelayedPoolCuts(SCIP *scip)
Definition: scip.c:35099
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:22517
SCIP_Real * SCIPnlpGetVarsLbDualsol(SCIP_NLP *nlp)
Definition: nlp.c:5905
SCIP_RETCODE SCIPcacheRowExtensions(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30607
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:47504
SCIP_Bool SCIPisSumRelLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47746
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:19643
SCIP_RETCODE SCIPlinkCurrentSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38675
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:47292
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:16989
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:31294
void SCIPprintConstraintStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44495
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:41398
SCIP_STAGE SCIPgetStage(SCIP *scip)
Definition: scip.c:821
int SCIPgetSolRunnum(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:39174
SCIP_Real SCIPgetFirstLPLowerboundRoot(SCIP *scip)
Definition: scip.c:43361
#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:48194
methods to interpret (evaluate) an expression tree "fast"
SCIP_RETCODE SCIPchgBarrierconvtol(SCIP *scip, SCIP_Real barrierconvtol)
Definition: scip.c:46592
SCIP_NODESEL ** SCIPgetNodesels(SCIP *scip)
Definition: scip.c:8970
void SCIPlpSetIsRelax(SCIP_LP *lp, SCIP_Bool relax)
Definition: lp.c:16926
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:38862
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:31761
SCIP_RETCODE SCIPgetBinvarRepresentative(SCIP *scip, SCIP_VAR *var, SCIP_VAR **repvar, SCIP_Bool *negated)
Definition: scip.c:19109
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:35958
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:42327
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:27001
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:5282
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:30454
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47305
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:21896
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:30935
SCIP_Bool SCIPisSumGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47243
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:5673
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:40282
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:47668
#define SCIP_DECL_COMPREXEC(x)
Definition: type_compr.h:111
void SCIPtreeSetFocusNodeLP(SCIP_TREE *tree, SCIP_Bool solvelp)
Definition: tree.c:8252
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:19503
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:37645
void SCIPlpEndStrongbranchProbing(SCIP_LP *lp)
Definition: lp.c:15580
#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:48160
SCIP_RETCODE SCIPgetNLPNlRowsData(SCIP *scip, SCIP_NLROW ***nlrows, int *nnlrows)
Definition: scip.c:31406
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:12435
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:46256
#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:17737
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:11108
static SCIP_RETCODE initPresolve(SCIP *scip)
Definition: scip.c:14148
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:26658
SCIP_Real SCIPgetDualboundRoot(SCIP *scip)
Definition: scip.c:43292
SCIP_RETCODE SCIPmarkRelaxSolValid(SCIP *scip, SCIP_Bool includeslp)
Definition: scip.c:20066
SCIP_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: scip.c:41220
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:9653
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:35931
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:7191
SCIP_Real SCIPgetReadingTime(SCIP *scip)
Definition: scip.c:46327
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:29941
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
Definition: scip.c:43447
SCIP_Real SCIPgetVarConflictlengthScoreCurrentRun(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26545
SCIP_Real SCIPsetFloor(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5963
SCIP_RETCODE SCIPflushRowExtensions(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30630
SCIP_Bool SCIPsetIsFeasEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6174
SCIP_Real SCIPgetPrimalbound(SCIP *scip)
Definition: scip.c:43396
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:47655
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:5620
SCIP_RETCODE SCIPapplyCutsProbing(SCIP *scip, SCIP_Bool *cutoff)
Definition: scip.c:36672
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:14364
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:34026
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:48145
SCIP_Real SCIPnodeGetLowerbound(SCIP_NODE *node)
Definition: tree.c:7360
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:39276
methods for implications, variable bounds, and cliques
SCIP_Real * SCIPgetNLPVarsUbDualsol(SCIP *scip)
Definition: scip.c:31384
SCIP_Bool SCIPisFeasFracIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:47405
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:30332
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:13363
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:43475
#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:41555
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:26025
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:46677
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:37432
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:43613
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:42480
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:40584
SCIP_Longint SCIPconflictGetNPseudoReconvergenceLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:8890
void SCIPlpRecalculateObjSqrNorm(SCIP_SET *set, SCIP_LP *lp)
Definition: lp.c:16818
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:48602
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:28394
#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:27806
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:16372
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:12657
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:48635
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:46807
static long bound
SCIP_VAR ** SCIPvarGetMultaggrVars(SCIP_VAR *var)
Definition: var.c:17056
SCIP_Bool SCIPisSumPositive(SCIP *scip, SCIP_Real val)
Definition: scip.c:47268
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
Definition: scip.c:30662
SCIP_RETCODE SCIPrecomputeSolObj(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:39066
static SCIP_DECL_PARAMCHGD(paramChgdNlpiPriority)
Definition: scip.c:9526
SCIP_RETCODE SCIPcreateCPUClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip.c:46024
SCIP_Real SCIPgetVarRedcost(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:19375
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:16402
SCIP_RETCODE SCIPevalExprtreeGlobalBounds(SCIP *scip, SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *val)
Definition: scip.c:33160
SCIP_RETCODE SCIPsetConsPropagated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool propagate)
Definition: scip.c:27953
int SCIPtreeGetProbingDepth(SCIP_TREE *tree)
Definition: tree.c:8328
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:20323
struct SCIP_ParamData SCIP_PARAMDATA
Definition: type_paramset.h:76
void SCIPprintConcsolverStatistics(SCIP *scip, FILE *file)
Definition: scip.c:45455
SCIP_Real SCIPgetRowPseudoFeasibility(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:31025
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:47082
SCIP_Bool SCIPisSumRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47733
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:19072
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:12246
#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:41537
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:47840
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:21511
#define SCIP_CALL_FINALLY(x, y)
Definition: def.h:392
SCIP_Real SCIPgetColRedcost(SCIP *scip, SCIP_COL *col)
Definition: scip.c:30194
SCIP_CUT ** SCIPgetDelayedPoolCuts(SCIP *scip)
Definition: scip.c:35083
SCIP_RETCODE SCIPaddConflictBinvar(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:27382
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:32338
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:37359
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:6358
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:13816
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:47009
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:23205
SCIP_RETCODE SCIPdisableConsPropagation(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28563
#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:41579
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:22180
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:4693
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:17453
SCIP_Real SCIPgetAvgCutoffScoreCurrentRun(SCIP *scip)
Definition: scip.c:44104
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:47578
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:13241
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:47858
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:31610
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:16540
SCIP_Bool SCIPpscostThresholdProbabilityTest(SCIP *scip, SCIP_VAR *var, SCIP_Real frac, SCIP_Real threshold, SCIP_BRANCHDIR dir, SCIP_CONFIDENCELEVEL clevel)
Definition: scip.c:26270
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:43859
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:18951
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:41306
SCIP_RETCODE SCIPprintTransProblem(SCIP *scip, FILE *file, const char *extension, SCIP_Bool genericnames)
Definition: scip.c:44256
SCIP_Real lastsolgap
Definition: struct_stat.h:122
SCIP_RETCODE SCIPaddNewRowCutpool(SCIP *scip, SCIP_CUTPOOL *cutpool, SCIP_ROW *row)
Definition: scip.c:34941
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:5234
SCIP_Real SCIPfeasRound(SCIP *scip, SCIP_Real val)
Definition: scip.c:47441
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:28106
SCIP_RETCODE SCIPsetNlRowExprtreeParam(SCIP *scip, SCIP_NLROW *nlrow, int paramidx, SCIP_Real paramval)
Definition: scip.c:32648
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:5287
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:18032
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:6739
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:48043
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:42444
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
Definition: scip.c:18760
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:32060
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:7119
SCIP_Real SCIPsetInfinity(SCIP_SET *set)
Definition: set.c:5636
SCIP_Real SCIPgetBranchingPoint(SCIP *scip, SCIP_VAR *var, SCIP_Real suggestion)
Definition: scip.c:37498
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:41705
SCIP_RETCODE SCIPreoptAddCons(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_CONS *cons)
Definition: reopt.c:8050
#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:46109
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:35503
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
Definition: scip.c:47381
SCIP_RETCODE SCIPgetLPI(SCIP *scip, SCIP_LPI **lpi)
Definition: scip.c:30025
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:12779
SCIP_Real SCIPvarGetSol(SCIP_VAR *var, SCIP_Bool getlpval)
Definition: var.c:12665
SCIP_RETCODE SCIPaddDelayedPoolCut(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:35045
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:7055
SCIP_RETCODE SCIPchgVarUbLazy(SCIP *scip, SCIP_VAR *var, SCIP_Real lazyub)
Definition: scip.c:22483
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:47962
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:46465
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:43089
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:44299
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:28207
SCIP_Real SCIPgetVarPseudocostCountCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26161
SCIP_RETCODE SCIPsetNlRowExprtree(SCIP *scip, SCIP_NLROW *nlrow, SCIP_EXPRTREE *exprtree)
Definition: scip.c:32622
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:32445
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:36935
SCIP_Longint SCIPpropGetNCalls(SCIP_PROP *prop)
Definition: prop.c:1042
SCIP_Real SCIPgetVarPseudocostScoreCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_Real solval)
Definition: scip.c:26352
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47344
SCIP_RETCODE SCIPextendRealarray(SCIP *scip, SCIP_REALARRAY *realarray, int minidx, int maxidx)
Definition: scip.c:47892
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:24309
SCIP_RETCODE SCIPreoptnodeDelete(SCIP_REOPTNODE **reoptnode, BMS_BLKMEM *blkmem)
Definition: reopt.c:7917
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:45875
#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:11680
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:42554
#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:47280
void SCIPprintTransProblemStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44352
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:10937
SCIP_SOL ** SCIPgetSols(SCIP *scip)
Definition: scip.c:39826
void SCIPprintTimingStatistics(SCIP *scip, FILE *file)
Definition: scip.c:45569
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:16481
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:21979
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:44129
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:15749
void SCIPpropSetExitsol(SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol)))
Definition: prop.c:811
SCIP_Longint SCIPgetNStrongbranchs(SCIP *scip)
Definition: scip.c:42738
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:16979
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:37743
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:26388
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:31242
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:23428
#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:41643
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:40947
void SCIPclockStart(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:280
SCIP_RETCODE SCIPdelPoolCut(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:34786
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:27662
int SCIPgetNActivePricers(SCIP *scip)
Definition: scip.c:5718
SCIP_Real SCIPgetVarMultaggrUbLocal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23899
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:6626
SCIP_RETCODE SCIPaddQuadElementToNlRow(SCIP *scip, SCIP_NLROW *nlrow, SCIP_QUADELEM quadelem)
Definition: scip.c:32532
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:36414
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:41741
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:47022
SCIP_Real SCIPgetVarPseudocostValCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta)
Definition: scip.c:26053
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:47094
SCIP_RETCODE SCIPenableConsSeparation(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28478
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:37290
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:28624
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:27468
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:13402
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:39147
SCIP_RETCODE SCIPaddConflictUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
Definition: scip.c:27245
SCIP_RETCODE SCIPsolveNLP(SCIP *scip)
Definition: scip.c:31587
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:21654
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:21555
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:48009
#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:37473
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:16894
#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:15567
enum SCIP_Varstatus SCIP_VARSTATUS
Definition: type_var.h:48
void SCIPprintHeuristicStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44935
SCIP_Real SCIPconshdlrGetEnfoLPTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4619
int SCIPgetNReoptnodes(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:16816
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:8300
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:10832
SCIP_RETCODE SCIPchgVarLbDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:35439
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:48026
int SCIPgetNPrioPseudoBranchInts(SCIP *scip)
Definition: scip.c:37414
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:43228
SCIP_Bool branch_divingpscost
Definition: struct_set.h:170
SCIP_Longint SCIPgetNRootFirstLPIterations(SCIP *scip)
Definition: scip.c:42390
SCIP_RETCODE SCIPgetLPBInvCol(SCIP *scip, int c, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip.c:29813
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:5079
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:7959
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:17693
SCIP_Longint SCIPgetNNZs(SCIP *scip)
Definition: scip.c:42353
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:27416
SCIP_Real SCIPgetVarAvgCutoffsCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26912
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:34554
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:47530
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:5694
SCIP_VAR ** SCIPgetOrigVars(SCIP *scip)
Definition: scip.c:12219
SCIP_Real SCIPgetVarVSIDSCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26420
SCIP_RETCODE SCIPchgRealParam(SCIP *scip, SCIP_PARAM *param, SCIP_Real value)
Definition: scip.c:4778
#define infty2infty(infty1, infty2, val)
Definition: scip.c:33044
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:8208
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:26969
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:42792
#define SCIP_DECL_CONSEXITSOL(x)
Definition: type_cons.h:200
int SCIPgetNActiveConss(SCIP *scip)
Definition: scip.c:43174
void SCIPconshdlrSetCopy(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
Definition: cons.c:4205
int SCIPgetNNodesLeft(SCIP *scip)
Definition: scip.c:42172
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:33105
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:27212
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:15331
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:36909
SCIP_Bool SCIPisVarPscostRelerrorReliable(SCIP *scip, SCIP_VAR *var, SCIP_Real threshold, SCIP_CONFIDENCELEVEL clevel)
Definition: scip.c:26289
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:27149
SCIP_RETCODE SCIPclearRelaxSolVals(SCIP *scip)
Definition: scip.c:19883
SCIP_Longint nsolsfound
Definition: struct_primal.h:39
SCIP_Longint SCIPgetNBacktracks(SCIP *scip)
Definition: scip.c:43137
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:22633
SCIP_Real SCIPconshdlrGetEnfoPSTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4629
SCIP_Longint SCIPgetNDivingLPIterations(SCIP *scip)
Definition: scip.c:42720
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:20139
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:19801
SCIP_RETCODE SCIPenableOrDisableStatisticTiming(SCIP *scip)
Definition: scip.c:46149
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:5634
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:12045
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:28533
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:44377
SCIP_Bool SCIPallVarsInProb(SCIP *scip)
Definition: scip.c:12558
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:33403
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:16754
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:16979
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:26079
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:31043
SCIP_RETCODE SCIPchgVarLbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:36034
SCIP_Real SCIPlpGetPseudoObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:12811
#define SCIP_DECL_PRICEREXITSOL(x)
Definition: type_pricer.h:92
int SCIPgetPtrarrayMaxIdx(SCIP *scip, SCIP_PTRARRAY *ptrarray)
Definition: scip.c:48406
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:12171
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:32929
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:31338
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:46650
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:22224
static SCIP_RETCODE exitPresolve(SCIP *scip, SCIP_Bool solved, SCIP_Bool *infeasible)
Definition: scip.c:14212
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:17903
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:17393
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:23869
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:46058
SCIP_Bool probingsolvedlp
Definition: struct_tree.h:230
int limit_maxsol
Definition: struct_set.h:279
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip.c:46725
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:31502
SCIP_RETCODE SCIPlpiGetRealSolQuality(SCIP_LPI *lpi, SCIP_LPSOLQUALITY qualityindicator, SCIP_Real *quality)
int SCIPgetNCutsFoundRound(SCIP *scip)
Definition: scip.c:42914
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:12902
SCIP_RETCODE SCIPsetNLPIntPar(SCIP *scip, SCIP_NLPPARAM type, int ival)
Definition: scip.c:31789
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:30366
SCIP_RETCODE SCIPchgVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:22010
SCIP_Bool SCIPisLPDualReliable(SCIP *scip)
Definition: scip.c:29326
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:47453
SCIP_RETCODE SCIPsetNLPStringPar(SCIP *scip, SCIP_NLPPARAM type, const char *sval)
Definition: scip.c:31901
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:46957
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:23969
int SCIPnodeGetDepth(SCIP_NODE *node)
Definition: tree.c:7350
SCIP_PRESOL ** presols
Definition: struct_set.h:74
SCIP_RETCODE SCIPconstructLP(SCIP *scip, SCIP_Bool *cutoff)
Definition: scip.c:29243
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:37111
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:37914
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:20089
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:21947
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:40654
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:37028
SCIP_RETCODE SCIPgetLPColsData(SCIP *scip, SCIP_COL ***cols, int *ncols)
Definition: scip.c:29556
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:24028
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:41346
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:33893
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:41417
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:40924
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:37224
SCIP_Longint SCIPrelaxGetNCalls(SCIP_RELAX *relax)
Definition: relax.c:530
int SCIPreoptGetLastRestarts(SCIP_REOPT *reopt)
Definition: reopt.c:4910
SCIP_RETCODE SCIPchgVarUbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:22363
#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:18992
#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:29470
SCIP_Longint SCIPconflictGetNPropReconvergenceConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:5497
SCIP_Bool SCIPisSumZero(SCIP *scip, SCIP_Real val)
Definition: scip.c:47256
SCIP_LPSOLSTAT SCIPlpGetSolstat(SCIP_LP *lp)
Definition: lp.c:12612
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:48131
SCIP_RETCODE SCIPaddLinearCoefToNlRow(SCIP *scip, SCIP_NLROW *nlrow, SCIP_VAR *var, SCIP_Real val)
Definition: scip.c:32384
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Longint nlpbestsolsfound
Definition: struct_stat.h:94
SCIP_CUT ** SCIPgetPoolCuts(SCIP *scip)
Definition: scip.c:34807
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:17183
SCIP_Longint SCIPcolGetStrongbranchLPAge(SCIP_COL *col, SCIP_STAT *stat)
Definition: lp.c:4629
void SCIPprintBranchruleStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44892
SCIP_Real SCIPgetPresolvingTime(SCIP *scip)
Definition: scip.c:46364
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:46823
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:45645
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:29017
SCIP_PROB * origprob
Definition: struct_scip.h:70
SCIP_Real SCIPgetAvgCutoffs(SCIP *scip, SCIP_BRANCHDIR dir)
Definition: scip.c:44043
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:11986
SCIP_Bool SCIPtreeIsFocusNodeLPConstructed(SCIP_TREE *tree)
Definition: tree.c:8263
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:31085
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:27578
SCIP_RETCODE SCIPcreateProbBasic(SCIP *scip, const char *name)
Definition: scip.c:9997
SCIP_Real SCIPgetObjNorm(SCIP *scip)
Definition: scip.c:11459
SCIP_NLROW ** SCIPgetNLPNlRows(SCIP *scip)
Definition: scip.c:31434
SCIP_RETCODE SCIPcreateDigraph(SCIP *scip, SCIP_DIGRAPH **digraph, int nnodes)
Definition: scip.c:48562
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:4990
SCIP_Real SCIPepsilon(SCIP *scip)
Definition: scip.c:46409
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:18208
SCIP_DECL_EVENTINITSOL(EventhdlrNewSol::scip_initsol)
SCIP_RETCODE SCIPcreateOrigSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:38109
SCIP_Bool SCIPlpIsRootLPRelax(SCIP_LP *lp)
Definition: lp.c:16872
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:23917
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:15513
SCIP_VAR ** vars
Definition: struct_var.h:186
SCIP_RETCODE SCIPaddConflictLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
Definition: scip.c:27178
SCIP_Real SCIPsolGetOrigObj(SCIP_SOL *sol)
Definition: sol.c:2485
SCIP_RETCODE SCIPgetSiblings(SCIP *scip, SCIP_NODE ***siblings, int *nsiblings)
Definition: scip.c:41513
SCIP_Real SCIPgetLowerboundRoot(SCIP *scip)
Definition: scip.c:43316
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:46479
SCIP_RETCODE SCIPsetIncludeSepa(SCIP_SET *set, SCIP_SEPA *sepa)
Definition: set.c:3984
SCIP_Real SCIPgetRowMaxCoef(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30883
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:23792
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:17493
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
Definition: scip.c:47429
SCIP_Real SCIPcomputeVarLbLocal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23813
int nrootintfixings
Definition: struct_stat.h:204
SCIP_Real SCIPgetRowMaxActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30917
SCIP_RETCODE SCIPsetIncludeCompr(SCIP_SET *set, SCIP_COMPR *compr)
Definition: set.c:4355
SCIP_Real SCIPrelaxfeastol(SCIP *scip)
Definition: scip.c:46508
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:41762
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:18901
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:32247
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:48245
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:26314
SCIP_Bool SCIPisRelGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47707
SCIP_RETCODE SCIPchgChildPrio(SCIP *scip, SCIP_NODE *child, SCIP_Real priority)
Definition: scip.c:13608
SCIP_CONSSETCHG * addconssetchg
Definition: struct_cons.h:48
SCIP_RETCODE SCIPscaleVarBranchFactor(SCIP *scip, SCIP_VAR *var, SCIP_Real scale)
Definition: scip.c:25220
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:47417
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:16744
SCIP_Real primalzeroittime
Definition: struct_stat.h:123
SCIP_RETCODE SCIPconstructSyncstore(SCIP *scip)
Definition: scip.c:41946
SCIP_VAR * var
Definition: struct_var.h:178
SCIP_RETCODE SCIPreoptResetActiveConss(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat)
Definition: reopt.c:8217
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:47911
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:13760
#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:47681
int SCIPreoptGetNNodes(SCIP_REOPT *reopt, SCIP_NODE *node)
Definition: reopt.c:5715
int SCIPpresolGetNChgVarTypes(SCIP_PRESOL *presol)
Definition: presol.c:691
SCIP_RETCODE SCIPprintBranchingStatistics(SCIP *scip, FILE *file)
Definition: scip.c:45760
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:17038
SCIP_Bool reopt_storevarhistory
Definition: struct_set.h:464
SCIP_Longint SCIPgetNDualResolveLPIterations(SCIP *scip)
Definition: scip.c:42612
const char * SCIPgetProbName(SCIP *scip)
Definition: scip.c:10885
SCIP_RETCODE SCIPclearPtrarray(SCIP *scip, SCIP_PTRARRAY *ptrarray)
Definition: scip.c:48345
SCIP_RETCODE SCIPcreateWallClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip.c:46041
SCIP_Bool SCIProwIsInLP(SCIP_ROW *row)
Definition: lp.c:16692
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:8225
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:25991
SCIP_Real SCIPgetBranchScore(SCIP *scip, SCIP_VAR *var, SCIP_Real downgain, SCIP_Real upgain)
Definition: scip.c:37450
#define SCIP_DECL_DIALOGDESC(x)
Definition: type_dialog.h:73
SCIP_Bool SCIPisConflictAnalysisApplicable(SCIP *scip)
Definition: scip.c:27127
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:19783
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:5587
SCIP_RETCODE SCIPlinkNLPSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38596
static SCIP_RETCODE initSolve(SCIP *scip, SCIP_Bool solved)
Definition: scip.c:15144
SCIP_RETCODE SCIPintarrayFree(SCIP_INTARRAY **intarray)
Definition: misc.c:4026
int SCIPgetNFixedVars(SCIP *scip)
Definition: scip.c:12123
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:29220
SCIP_Bool SCIPisLbBetter(SCIP *scip, SCIP_Real newlb, SCIP_Real oldlb, SCIP_Real oldub)
Definition: scip.c:47640
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:29344
SCIP_VAR * SCIPfindVar(SCIP *scip, const char *name)
Definition: scip.c:12500
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:48358
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:28419
int SCIPtreeGetNChildren(SCIP_TREE *tree)
Definition: tree.c:8125
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:12080
SCIP_RETCODE SCIPsetConsSeparated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool separate)
Definition: scip.c:27878
SCIP_NODE * SCIPtreeGetBestLeaf(SCIP_TREE *tree)
Definition: tree.c:7109
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:16894
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:36962
int SCIPgetNPrioLPBranchCands(SCIP *scip)
Definition: scip.c:37066
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:25473
SCIP_Real SCIPgetFirstLPDualboundRoot(SCIP *scip)
Definition: scip.c:43340
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:24216
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:16882
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:29731
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:33659
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:5132
#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:46849
#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:25812
SCIP_RETCODE SCIPdelVar(SCIP *scip, SCIP_VAR *var, SCIP_Bool *deleted)
Definition: scip.c:11604
#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:5431
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:34522
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:11060
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:35542
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:8182
SCIP_RETCODE SCIPaddReoptDualBndchg(SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound, SCIP_Real oldbound)
Definition: scip.c:16668
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:36701
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:18109
int SCIPgetNNLPVars(SCIP *scip)
Definition: scip.c:31316
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:38162
SCIP_NLPTERMSTAT SCIPgetNLPTermstat(SCIP *scip)
Definition: scip.c:31632
BMS_BUFMEM * SCIPbuffer(SCIP *scip)
Definition: scip.c:46740
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:34964
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:29402
SCIP_Bool SCIPisSumRelGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47772
SCIP_RETCODE SCIPsetObjIntegral(SCIP *scip)
Definition: scip.c:11337
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:35665
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:28056
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:34867
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:42932
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:15225
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:30829
git hash methods
int SCIPpricestoreGetNVarsApplied(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:663
SCIP_RETCODE SCIPsolve(SCIP *scip)
Definition: scip.c:16109
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:46007
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:47720
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:33450
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:7991
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:37604
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:32672
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:15764
SCIP_Real SCIPdualfeasCeil(SCIP *scip, SCIP_Real val)
Definition: scip.c:47602
SCIP_RETCODE SCIPsolveDiveNLP(SCIP *scip)
Definition: scip.c:32151
#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:34898
void SCIPupdateSolLPRowViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
Definition: scip.c:13772
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:26187
SCIP_Bool SCIPisSumRelLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47759
SCIP_Real SCIPgetRowMinCoef(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30865
int SCIPreoptGetFirstRestarts(SCIP_REOPT *reopt)
Definition: reopt.c:4900
SCIP_RETCODE SCIPgetBinvarRepresentatives(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **repvars, SCIP_Bool *negated)
Definition: scip.c:19156
SCIP_Bool SCIPlpIsPrimalReliable(SCIP_LP *lp)
Definition: lp.c:16959
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:42630
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:32599
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:29170
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:12585
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:41781
void SCIPstoreSolutionGap(SCIP *scip)
Definition: scip.c:45944
SCIP_Real SCIPgetDualsolLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPlpIsDualReliable(SCIP_LP *lp)
Definition: lp.c:16969
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:16759
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:22450
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:32778
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:35698
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:46970
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:13210
int SCIPreoptGetNRestartsGlobal(SCIP_REOPT *reopt)
Definition: reopt.c:4870
SCIP_RETCODE SCIPaddNlRow(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip.c:31478
SCIP_CONS * SCIPprobFindCons(SCIP_PROB *prob, const char *name)
Definition: prob.c:2132
SCIP_RETCODE SCIPwriteNLP(SCIP *scip, const char *filename)
Definition: scip.c:31929
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:25862
SCIP_Longint SCIPconflictGetNBoundexceedingLPReconvergenceConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:8259
SCIP_RETCODE SCIPseparateCutpool(SCIP *scip, SCIP_CUTPOOL *cutpool, SCIP_RESULT *result)
Definition: scip.c:34985
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:36308
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:40881
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:42896
SCIP_RETCODE SCIPdelConsLocal(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:13291
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:8273
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:38942
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:22744
SCIP_RETCODE SCIPfixVarProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval)
Definition: scip.c:36151
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:47131
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:30989
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:40112
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:26748
SCIP_RETCODE SCIPlinkPseudoSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38655
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:16734
SCIP_RETCODE SCIPgetChildren(SCIP *scip, SCIP_NODE ***children, int *nchildren)
Definition: scip.c:41471
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:32293
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:16590
static SCIP_RETCODE prepareReoptimization(SCIP *scip)
Definition: scip.c:15845
SCIP_Real SCIPgetDualbound(SCIP *scip)
Definition: scip.c:43250
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:19305
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:28955
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:47517
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:24088
int repropdepth
Definition: struct_tree.h:219
SCIP_RETCODE SCIPchgCutoffboundDive(SCIP *scip, SCIP_Real newcutoffbound)
Definition: scip.c:35368
SCIP_Bool SCIPisDualSolAvailable(SCIP *scip, SCIP_Bool printreason)
Definition: scip.c:39645
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:14820
#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:15948
SCIP_CONS * SCIPfindOrigCons(SCIP *scip, const char *name)
Definition: scip.c:12712
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:34540
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:43561
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:17367
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:32090
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:28684
char * SCIPfgets(char *s, int size, SCIP_FILE *stream)
Definition: fileio.c:187
SCIP_Bool SCIPisReoptEnabled(SCIP *scip)
Definition: scip.c:17357
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:39401
SCIP_Real SCIPgetConflictVarLb(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:27444
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:42536
SCIP_RETCODE SCIPunlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
Definition: scip.c:21782
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:27928
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:24435
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:9728
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:44678
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:22100
#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:28031
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:26209
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:41031
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:45031
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:31817
SCIP_OBJSENSE objsense
Definition: struct_prob.h:77
SCIP_RETCODE SCIPmarkDoNotMultaggrVar(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:25926
SCIP_RETCODE SCIPreaderResetReadingTime(SCIP_READER *reader)
Definition: reader.c:586
int SCIPgetNChildren(SCIP *scip)
Definition: scip.c:41495
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:47590
SCIP_RETCODE SCIPsumLPRows(SCIP *scip, SCIP_Real *weights, SCIP_REALARRAY *sumcoef, SCIP_Real *sumlhs, SCIP_Real *sumrhs)
Definition: scip.c:29916
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:5000
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:35993
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:12975
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:7082
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:32998
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:23536
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:13422
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
Definition: scip.c:4432
SCIP_DOMCHG * SCIPnodeGetDomchg(SCIP_NODE *node)
Definition: tree.c:7435
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:45068
SCIP_RETCODE SCIPaddNlpiProbRows(SCIP *scip, SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *nlpiprob, SCIP_HASHMAP *var2idx, SCIP_ROW **rows, int nrows)
Definition: scip.c:34401
SCIP_CONS * SCIPfindCons(SCIP *scip, const char *name)
Definition: scip.c:12761
SCIP_Bool SCIPisNLPEnabled(SCIP *scip)
Definition: scip.c:31189
SCIP_RETCODE SCIPenforelaxCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool solinfeasible, SCIP_RESULT *result)
Definition: scip.c:28773
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:42281
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:9290
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:44212
void SCIPprintPropagatorStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44615
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:21186
SCIP_RETCODE SCIPgetExprtreeTransformedVars(SCIP *scip, SCIP_EXPRTREE *tree)
Definition: scip.c:33066
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:28596
void SCIPupdateSolIntegralityViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol)
Definition: scip.c:13749
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:26514
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:39035
SCIP_Real SCIPlpGetObjNorm(SCIP_LP *lp)
Definition: lp.c:16849
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:35139
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:31528
SCIP_Longint SCIPconflictGetNStrongbranchReconvergenceConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:8643
SCIP_Bool SCIPisObjChangedProbing(SCIP *scip)
Definition: scip.c:36285
SCIP_RETCODE SCIPclearBoolarray(SCIP *scip, SCIP_BOOLARRAY *boolarray)
Definition: scip.c:48213
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:37163
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:46567
SCIP_Real SCIPgetLocalDualbound(SCIP *scip)
Definition: scip.c:13383
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:31555
void SCIPupdateDivesetLPStats(SCIP *scip, SCIP_DIVESET *diveset, SCIP_Longint niterstoadd)
Definition: scip.c:36794
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:28166
SCIP_Real SCIPgetVarAvgInferenceScoreCurrentRun(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26715
#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:27348
SCIP_Bool SCIPprobIsObjIntegral(SCIP_PROB *prob)
Definition: prob.c:2250
internal methods for variable pricers
int SCIPgetEffectiveRootDepth(SCIP *scip)
Definition: scip.c:41434
SCIP_RETCODE SCIPcreateChild(SCIP *scip, SCIP_NODE **node, SCIP_Real nodeselprio, SCIP_Real estimate)
Definition: scip.c:37571
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:29690
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:48177
SCIP_ROW * SCIPcutGetRow(SCIP_CUT *cut)
Definition: cutpool.c:372
SCIP_Bool SCIPareSolsEqual(SCIP *scip, SCIP_SOL *sol1, SCIP_SOL *sol2)
Definition: scip.c:39256
SCIP_CUTPOOL * SCIPgetDelayedGlobalCutpool(SCIP *scip)
Definition: scip.c:35115
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:47191
int npresolchgbds
Definition: struct_stat.h:230
void SCIPreoptnodeInit(SCIP_REOPTNODE *reoptnode, SCIP_SET *set)
Definition: reopt.c:7866
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:13825
SCIP_Real SCIPgetVarObjProbing(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:36121
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:31966
SCIP_Real SCIPgetLowerbound(SCIP *scip)
Definition: scip.c:43271
int npresoladdholes
Definition: struct_stat.h:231
SCIP_SOL * SCIPgetReoptLastOptSol(SCIP *scip)
Definition: scip.c:16686
SCIP_Bool SCIPisPrimalboundSol(SCIP *scip)
Definition: scip.c:43507
SCIP_RETCODE SCIPsetSetReoptimizationParams(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: set.c:759
SCIP_RETCODE SCIPrecalcNlRowActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip.c:32843
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:35226
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:43704
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:26240
SCIP_Longint SCIPgetNTotalNodes(SCIP *scip)
Definition: scip.c:42154
int SCIPgetNTotalVars(SCIP *scip)
Definition: scip.c:12383
#define SCIP_DECL_CONCSOLVERINITSEEDS(x)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47331
SCIP_RETCODE SCIPsolveProbingLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: scip.c:36544
SCIP_Real SCIPcomputeVarUbLocal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23834
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:44146
SCIP_Longint nsbbestsolsfound
Definition: struct_stat.h:97
int SCIPgetNOrigConss(SCIP *scip)
Definition: scip.c:12948
int SCIPlpGetNRows(SCIP_LP *lp)
Definition: lp.c:16764
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:23319
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:19249
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:37680
SCIP_Real SCIPgetVarAvgConflictlength(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26576
SCIP_RETCODE SCIPremoveVarFromGlobalStructures(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:25158
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:7147
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:41691
SCIP_RETCODE SCIPgetVarClosestVub(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real *closestvub, int *closestvubidx)
Definition: scip.c:23940
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:21589
void SCIPlpMarkDivingObjChanged(SCIP_LP *lp)
Definition: lp.c:17009
int SCIPgetIntarrayVal(SCIP *scip, SCIP_INTARRAY *intarray, int idx)
Definition: scip.c:48078
void SCIPupdateSolLPConsViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
Definition: scip.c:13796
void SCIPpropSetPresolPriority(SCIP_PROP *prop, SCIP_SET *set, int presolpriority)
Definition: prop.c:941
#define MAXNCLIQUEVARSCOMP
Definition: scip.c:24415
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:7172
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47318
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:46639
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:27529
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:46754
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:16491
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
Definition: scip.c:1360
SCIP_Longint SCIPgetNBarrierLPIterations(SCIP *scip)
Definition: scip.c:42498
#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:31873
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:47875
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:30954
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:30264
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:28256
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:27720
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:34655
SCIP_Bool SCIPisLongintParamValid(SCIP *scip, SCIP_PARAM *param, SCIP_Longint value)
Definition: scip.c:4761
SCIP_Longint SCIPgetNPrimalResolveLPIterations(SCIP *scip)
Definition: scip.c:42574
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:16916
void SCIPprintRootStatistics(SCIP *scip, FILE *file)
Definition: scip.c:45504
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:12628
SCIP_RETCODE SCIPcreateDisjointset(SCIP *scip, SCIP_DISJOINTSET **djset, int ncomponents)
Definition: scip.c:48651
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 SCIPaddCut(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool *infeasible)
Definition: scip.c:34632
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:28453
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:37334
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:16600
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:37183
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:37204
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:47994
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:16427
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:29126
SCIP_RETCODE SCIPsetRealarrayVal(SCIP *scip, SCIP_REALARRAY *realarray, int idx, SCIP_Real val)
Definition: scip.c:47943
SCIP_Bool SCIPisDualfeasNegative(SCIP *scip, SCIP_Real val)
Definition: scip.c:47554
SCIP_Real SCIPgetVarPseudocostCount(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26133
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:29202
SCIP_CLOCK * divinglptime
Definition: struct_stat.h:150
SCIP_Bool SCIPhasPrimalRay(SCIP *scip)
Definition: scip.c:41069
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:33353
SCIP_RETCODE SCIPstopSolvingTime(SCIP *scip)
Definition: scip.c:46225
SCIP_CLOCK * presolvingtimeoverall
Definition: struct_stat.h:145
int SCIPgetBoolarrayMinIdx(SCIP *scip, SCIP_BOOLARRAY *boolarray)
Definition: scip.c:48263
SCIP_RETCODE SCIPgetLPBInvACol(SCIP *scip, int c, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip.c:29883
SCIP_Longint SCIPgetLastDivenode(SCIP *scip)
Definition: scip.c:35766
SCIP_Longint SCIPgetNNodeLPIterations(SCIP *scip)
Definition: scip.c:42648
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:26107
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:32315
SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:160
SCIP_NODE * SCIPgetBestNode(SCIP *scip)
Definition: scip.c:41675
#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:7243
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:47045
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:13140
#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:6241
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:21847
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:43977
int SCIPreoptGetNTotalFeasNodes(SCIP_REOPT *reopt)
Definition: reopt.c:4930
#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:45621
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:31845
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:8167
SCIP_RETCODE SCIPpropCons(SCIP *scip, SCIP_CONS *cons, SCIP_PROPTIMING proptiming, SCIP_RESULT *result)
Definition: scip.c:28889
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:6422
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:20169
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:38765
SCIP_Bool userrestart
Definition: struct_stat.h:259
SCIP_RETCODE SCIPlpGetBasisInd(SCIP_LP *lp, int *basisind)
Definition: lp.c:9597
SCIP_RETCODE SCIPgetLPBInvARow(SCIP *scip, int r, SCIP_Real *binvrow, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip.c:29849
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:32900
SCIP_RETCODE SCIPlpiGetObjval(SCIP_LPI *lpi, SCIP_Real *objval)
SCIP_Real * SCIProwGetVals(SCIP_ROW *row)
Definition: lp.c:16437
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:17545
SCIP_Longint SCIPconshdlrGetNEnfoLPCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4699
SCIP_RETCODE SCIPclearSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38706
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:17417
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:39588
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:47230
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:37244
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:17246
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:10599
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:16906
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:5606
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:40974
internal methods for user interface dialog
int SCIPgetNExternalCodes(SCIP *scip)
Definition: scip.c:9670
int SCIPreoptnodeGetNChildren(SCIP_REOPTNODE *reoptnode)
Definition: reopt.c:5788
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:6305
int SCIPtreeGetEffectiveRootDepth(SCIP_TREE *tree)
Definition: tree.c:8339
#define SCIP_Bool
Definition: def.h:61
void SCIPlpRecomputeLocalAndGlobalPseudoObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:12711
SCIP_RETCODE SCIPsetProbTrans(SCIP *scip, SCIP_DECL_PROBTRANS((*probtrans)))
Definition: scip.c:10038
SCIP_RETCODE SCIPgetNLPStatistics(SCIP *scip, SCIP_NLPSTATISTICS *statistics)
Definition: scip.c:31657
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:30579
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:23136
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:41152
#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:43113
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
Definition: scip.c:29287
SCIP_Real SCIPsetSumepsilon(SCIP_SET *set)
Definition: set.c:5668
SCIP_RETCODE SCIPfreeSyncstore(SCIP *scip)
Definition: scip.c:41979
SCIP_RETCODE SCIPsetConsLocal(SCIP *scip, SCIP_CONS *cons, SCIP_Bool local)
Definition: scip.c:27980
SCIP_DECL_CONSPROP(ConshdlrSubtour::scip_prop)
int SCIPgetNImplVars(SCIP *scip)
Definition: scip.c:11941
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:11310
#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:38202
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:31008
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:11162
SCIP_RETCODE SCIPchgNlRowConstant(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real constant)
Definition: scip.c:32361
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:45200
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:5500
SCIP_Bool SCIPisSumLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47217
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:24900
void SCIPprintTreeStatistics(SCIP *scip, FILE *file)
Definition: scip.c:45235
SCIP_Bool SCIPnlpHasCurrentNodeNLP(SCIP_NLP *nlp)
Definition: nlp.c:5281
SCIP_RETCODE SCIPrecalcNlRowNLPActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip.c:32695
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:39741
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:48429
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:9156
SCIP_RETCODE SCIPprintBestTransSol(SCIP *scip, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:39982
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:45285
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:30396
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:6340
SCIP_RETCODE SCIProundSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *success)
Definition: scip.c:40018
SCIP_RETCODE SCIPsetObjlimit(SCIP *scip, SCIP_Real objlimit)
Definition: scip.c:11240
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:4880
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:46241
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:34349
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:43785
int SCIPvarGetBranchPriority(SCIP_VAR *var)
Definition: var.c:17448
SCIP_SYNCSTORE * SCIPgetSyncstore(SCIP *scip)
Definition: scip.c:42011
void SCIPconshdlrSetDelete(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
Definition: cons.c:4326
int SCIPgetDepth(SCIP *scip)
Definition: scip.c:43039
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:16922
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:46451
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:13552
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:6218
SCIP_RETCODE SCIPupdateNodeLowerbound(SCIP *scip, SCIP_NODE *node, SCIP_Real newbound)
Definition: scip.c:13574
SCIP_Real SCIPgetGap(SCIP *scip)
Definition: scip.c:43530
SCIP_Real SCIPgetAvgConflictlengthScoreCurrentRun(SCIP *scip)
Definition: scip.c:43934
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:30847
SCIP_RETCODE SCIPlpGetBInvRow(SCIP_LP *lp, int r, SCIP_Real *coef, int *inds, int *ninds)
Definition: lp.c:9631
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:35471
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:37378
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:29085
SCIP_RETCODE SCIPcaptureRow(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30512
SCIP_RETCODE SCIPstartSolvingTime(SCIP *scip)
Definition: scip.c:46192
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:20856
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:16999
SCIP_Bool branch_roundsbsol
Definition: struct_set.h:174
SCIP_RETCODE SCIPwriteImplicationConflictGraph(SCIP *scip, const char *filename)
Definition: scip.c:45933
SCIP_RETCODE SCIPgetNLPVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars)
Definition: scip.c:31264
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:29308
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:32121
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:40788
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:36847
int SCIPpropGetNChgCoefs(SCIP_PROP *prop)
Definition: prop.c:1192
SCIP_Longint SCIPgetNPrimalLPs(SCIP *scip)
Definition: scip.c:42408
void SCIPactivateSolViolationUpdates(SCIP *scip)
Definition: scip.c:13808
SCIP_RETCODE SCIPsetRelaxSolVals(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Bool includeslp)
Definition: scip.c:19960
SCIP_RETCODE SCIPaddPoolCut(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:34766
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:24553
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:32821
SCIP_RETCODE SCIPgetNlRowActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *activity)
Definition: scip.c:32871
methods for debugging
SCIP_RETCODE SCIPaddConflictRelaxedUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedub)
Definition: scip.c:27280
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:27313
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:4970
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:30425
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:30555
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:25899
#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:34499
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:25009
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip.c:41186
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:20000
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:38529
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:25952
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:23771
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:27045
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:41266
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:21384
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:48094
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:16866
SCIP_Real SCIPcalcNodeselPriority(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR branchdir, SCIP_Real targetvalue)
Definition: scip.c:37521
SCIP_Real SCIPgetLPRootLooseObjval(SCIP *scip)
Definition: scip.c:29537
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:17613
void SCIPmarkColNotRemovableLocal(SCIP *scip, SCIP_COL *col)
Definition: scip.c:30241
SCIP_Real SCIPconshdlrGetEnfoRelaxTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4639
SCIP_Real SCIPgetReoptSimilarity(SCIP *scip, int run1, int run2)
Definition: scip.c:17436
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:39708
SCIP_RETCODE SCIPaddExternBranchCand(SCIP *scip, SCIP_VAR *var, SCIP_Real score, SCIP_Real solval)
Definition: scip.c:37266
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:42956
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:13638
#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:44063
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:39777
SCIP_Bool SCIPtreeHasCurrentNodeLP(SCIP_TREE *tree)
Definition: tree.c:8317
int SCIPboolarrayGetMinIdx(SCIP_BOOLARRAY *boolarray)
Definition: misc.c:4683
void SCIPprintNLPStatistics(SCIP *scip, FILE *file)
Definition: scip.c:45174
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:8879
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:39501
SCIP_Real SCIPgetLPRootColumnObjval(SCIP *scip)
Definition: scip.c:29514
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:40054
SCIP_Longint SCIPgetNDualResolveLPs(SCIP *scip)
Definition: scip.c:42592
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:28859
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:13463
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
Definition: scip.c:25569
#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:42462
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:25279
int SCIPgetNRuns(SCIP *scip)
Definition: scip.c:42044
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:16950
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:21708
SCIP_RETCODE SCIPcreateEmptyNlRow(SCIP *scip, SCIP_NLROW **nlrow, const char *name, SCIP_Real lhs, SCIP_Real rhs)
Definition: scip.c:32221
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:29750
SCIP_RETCODE SCIPenfolpCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool solinfeasible, SCIP_RESULT *result)
Definition: scip.c:28743
SCIP_RETCODE SCIPreoptnodeAddBndchg(SCIP_REOPTNODE *reoptnode, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR *var, SCIP_Real val, SCIP_BOUNDTYPE boundtype)
Definition: reopt.c:7931
SCIP_Real SCIPgetSolOrigObj(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38988
#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:32270
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:29591
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:46523
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:29267
SCIP_RETCODE SCIPcreateUnknownSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:38077
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:12034
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:43013
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:34612
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:42253
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:47626
int SCIPvarGetMultaggrNVars(SCIP_VAR *var)
Definition: var.c:17044
SCIP_Bool SCIPisSumRelGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47785
#define SCIP_DECL_SEPAEXECSOL(x)
Definition: type_sepa.h:140
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
Definition: scip.c:47033
int reopt_savesols
Definition: struct_set.h:449
SCIP_Real ub
Definition: struct_lp.h:130
SCIP_Real SCIPgetTimeOfDay(SCIP *scip)
Definition: scip.c:45993
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:31105
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:47800
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:46541
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:47816
SCIP_RETCODE SCIPcreateRelaxSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:37977
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:22813
int SCIPgetNOrigContVars(SCIP *scip)
Definition: scip.c:12354
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:40694
SCIP_Bool SCIPisCutNew(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:34748
static SCIP_RETCODE freeReoptSolve(SCIP *scip)
Definition: scip.c:15375
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:41379
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:37548
void SCIPrelaxationSetSolObj(SCIP_RELAXATION *relaxation, SCIP_Real obj)
Definition: relax.c:669
SCIP_Real * SCIPgetNLPVarsLbDualsol(SCIP *scip)
Definition: scip.c:31362
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:40127
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:48326
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:38004
SCIP * scip
Definition: struct_var.h:201
SCIP_Real SCIPgetTransObjscale(SCIP *scip)
Definition: scip.c:11208
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:11851
static SCIP_RETCODE freeSolve(SCIP *scip, SCIP_Bool restart)
Definition: scip.c:15274
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:35830
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:44854
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:41611
#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:11806
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:9200
SCIP_Real SCIPgetVarMultaggrLbLocal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23884
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:36435
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:35064
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:17842
#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:4772
SCIP_Real SCIPnodeGetEstimate(SCIP_NODE *node)
Definition: tree.c:7370
void SCIPenableNLP(SCIP *scip)
Definition: scip.c:31212
SCIP_RETCODE SCIPupdateLocalLowerbound(SCIP *scip, SCIP_Real newbound)
Definition: scip.c:13513
SCIP_Real SCIPlpGetLooseObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:12667
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:43209
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:11551
int SCIPgetBoolarrayMaxIdx(SCIP *scip, SCIP_BOOLARRAY *boolarray)
Definition: scip.c:48277
SCIP_RETCODE SCIPaddSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *stored)
Definition: scip.c:40494
SCIP_Bool SCIPinDive(SCIP *scip)
Definition: scip.c:35796
SCIP_Longint SCIPgetNResolveLPs(SCIP *scip)
Definition: scip.c:42516
SCIP_RETCODE SCIPaddRowCutpool(SCIP *scip, SCIP_CUTPOOL *cutpool, SCIP_ROW *row)
Definition: scip.c:34919
#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:31705
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:16713
SCIP_RETCODE SCIPsetConshdlrExitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITPRE((*consexitpre)))
Definition: scip.c:6229
SCIP_Real SCIPgetAvgCutoffScore(SCIP *scip)
Definition: scip.c:44081
#define SCIP_VERSION
Definition: def.h:110
SCIP_CLIQUE ** SCIPgetCliques(SCIP *scip)
Definition: scip.c:24927
SCIP_Real SCIProwGetConstant(SCIP_ROW *row)
Definition: lp.c:16447
SCIP_Real SCIPgetVarAvgConflictlengthCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26602
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:11185
SCIP_RETCODE SCIPprintNodeRootPath(SCIP *scip, SCIP_NODE *node, FILE *file)
Definition: scip.c:41814
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:25248
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:47542
SCIP_Real firstsolgap
Definition: struct_stat.h:121
SCIP_RETCODE SCIPsetConsStickingAtNode(SCIP *scip, SCIP_CONS *cons, SCIP_Bool stickingatnode)
Definition: scip.c:28081
SCIP_LPSOLSTAT SCIPgetLastStrongbranchLPSolStat(SCIP *scip, SCIP_BRANCHDIR branchdir)
Definition: scip.c:21489
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:30534
SCIP_Bool SCIPisObjIntegral(SCIP *scip)
Definition: scip.c:11380
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:17791
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:8135
#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:42684
void SCIPsepaSetPriority(SCIP_SEPA *sepa, SCIP_SET *set, int priority)
Definition: sepa.c:676
SCIP_Longint SCIPgetNNodeInitLPs(SCIP *scip)
Definition: scip.c:42666
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:40454
SCIP_Longint SCIPgetMemTotal(SCIP *scip)
Definition: scip.c:46781
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:8361
SCIP_RETCODE SCIPcreateNLPSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:37942
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:3116
SCIP_Real SCIPgetAvgConflictlengthScore(SCIP *scip)
Definition: scip.c:43909
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:5815
int SCIPconshdlrGetMaxNActiveConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4839
SCIP_RETCODE SCIPcreatePtrarray(SCIP *scip, SCIP_PTRARRAY **ptrarray)
Definition: scip.c:48292
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:32473
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:30061
int SCIPgetNOrigIntVars(SCIP *scip)
Definition: scip.c:12300
SCIP_RETCODE SCIPsetPropResprop(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPRESPROP((*propresprop)))
Definition: scip.c:7856
SCIP_Real SCIPgetLPObjval(SCIP *scip)
Definition: scip.c:29366
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:29975
SCIP_RETCODE SCIPbranchPseudo(SCIP *scip, SCIP_RESULT *result)
Definition: scip.c:37836
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:19929
SCIP_RETCODE SCIPaddQuadVarsToNlRow(SCIP *scip, SCIP_NLROW *nlrow, int nvars, SCIP_VAR **vars)
Definition: scip.c:32498
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
Definition: scip.c:39876
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:46996
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:10913
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:36568
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:47106
SCIP_RETCODE SCIPchgVarObjDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
Definition: scip.c:35398
SCIP_Real SCIPgetVarImplRedcost(SCIP *scip, SCIP_VAR *var, SCIP_Bool varfixing)
Definition: scip.c:19420
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:32963
SCIP_RETCODE SCIPenfopsCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool solinfeasible, SCIP_Bool objinfeasible, SCIP_RESULT *result)
Definition: scip.c:28712
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
Definition: lp.c:16251
SCIP_TABLE ** SCIPgetTables(SCIP *scip)
Definition: scip.c:9503
SCIP_RETCODE SCIPsepalpCons(SCIP *scip, SCIP_CONS *cons, SCIP_RESULT *result)
Definition: scip.c:28832
SCIP_RETCODE SCIPsolveConcurrent(SCIP *scip)
Definition: scip.c:16425
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:18670
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:39458
SCIP_Longint SCIPgetMemUsed(SCIP *scip)
Definition: scip.c:46768
SCIP_Longint SCIPgetNStrongbranchLPIterations(SCIP *scip)
Definition: scip.c:42756
SCIP_RETCODE SCIPlpSetCutoffbound(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob, SCIP_Real cutoffbound)
Definition: lp.c:9965
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:11486
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:8350
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:22926
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:21273
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:3088
SCIP_RETCODE SCIPsetConshdlrInit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINIT((*consinit)))
Definition: scip.c:6109
SCIP_PROBDATA * SCIPgetProbData(SCIP *scip)
Definition: scip.c:10782
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:19846
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:39095
SCIP_CONS ** SCIPconshdlrGetCheckConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4505
int SCIPgetNReoptRuns(SCIP *scip)
Definition: scip.c:42071
SCIP_Longint SCIPgetNDivingLPs(SCIP *scip)
Definition: scip.c:42702
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:47059
SCIP_RETCODE SCIPrestartSolve(SCIP *scip)
Definition: scip.c:17344
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:7411
SCIP_Real SCIPgetRealarrayVal(SCIP *scip, SCIP_REALARRAY *realarray, int idx)
Definition: scip.c:47927
SCIP_RETCODE SCIPsetConsEnforced(SCIP *scip, SCIP_CONS *cons, SCIP_Bool enforce)
Definition: scip.c:27903
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:32034
#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:46075
SCIP_RETCODE SCIPeventfilterFree(SCIP_EVENTFILTER **eventfilter, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: event.c:1723
int SCIPgetNPricevars(SCIP *scip)
Definition: scip.c:42826
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:42426
int SCIPgetNConss(SCIP *scip)
Definition: scip.c:12856
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:6565
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:8283
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:20228
SCIP_RETCODE SCIPreoptUpdateVarHistory(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_VAR **vars, int nvars)
Definition: reopt.c:6569
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:27755
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:43722
int SCIPgetRealarrayMinIdx(SCIP *scip, SCIP_REALARRAY *realarray)
Definition: scip.c:47980
#define SCIP_DECL_SEPAINITSOL(x)
Definition: type_sepa.h:82
SCIP_Bool SCIPisRelaxSolValid(SCIP *scip)
Definition: scip.c:20046
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:7899
#define SCIP_DECL_HEUREXIT(x)
Definition: type_heur.h:86
SCIP_RETCODE SCIPclearIntarray(SCIP *scip, SCIP_INTARRAY *intarray)
Definition: scip.c:48062
SCIP_Bool SCIPallowDualReds(SCIP *scip)
Definition: scip.c:25879
SCIP_SET * set
Definition: struct_scip.h:62
int SCIPgetNCuts(SCIP *scip)
Definition: scip.c:35190
int SCIPgetNPriceRounds(SCIP *scip)
Definition: scip.c:42808
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:15069
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:41797
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:36632
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:12814
int SCIPgetNCliques(SCIP *scip)
Definition: scip.c:24873
SCIP_RETCODE SCIPsplitReoptRoot(SCIP *scip, int *ncreatedchilds, int *naddedconss)
Definition: scip.c:17518
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:13784
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:30971
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:25353
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:20486
#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:33824
SCIP_Real SCIPretransformObj(SCIP *scip, SCIP_Real obj)
Definition: scip.c:39120
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:47369
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:45905
SCIP_Real SCIPgetAvgInferenceScoreCurrentRun(SCIP *scip)
Definition: scip.c:44020
SCIP_Real * scalars
Definition: struct_var.h:185
SCIP_Longint SCIPgetMemExternEstim(SCIP *scip)
Definition: scip.c:46794
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:11761
int SCIPcolGetNStrongbranchs(SCIP_COL *col)
Definition: lp.c:16382
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:31730
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:17072
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:39228
#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:41114
SCIP_RETCODE SCIPcalcNegatedCliquePartition(SCIP *const scip, SCIP_VAR **const vars, int const nvars, int *const cliquepartition, int *const ncliques)
Definition: scip.c:24773
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:25678
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:4966
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:7330
default user interface dialog
SCIP_Longint SCIPgetNBestSolsFound(SCIP *scip)
Definition: scip.c:43667
SCIP_Longint SCIPconshdlrGetNChildren(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4829
SCIP_RETCODE SCIPcaptureVar(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:18726
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:30688
internal methods for problem statistics
int SCIPgetNPricevarsFound(SCIP *scip)
Definition: scip.c:42844
const char * SCIPbranchruleGetName(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:1932
SCIP_RETCODE SCIPgetNlRowNLPFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *feasibility)
Definition: scip.c:32750
#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:16395
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:16949
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:25384
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:6934
SCIP_Bool SCIPisScalingIntegral(SCIP *scip, SCIP_Real val, SCIP_Real scalar)
Definition: scip.c:47118
SCIP_Bool SCIPsetIsFeasPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6295
SCIP_Real SCIPgetRowMinActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30900
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:24957
#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:6484
#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:44554
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:29427
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:25842
int SCIPgetNPoolCuts(SCIP *scip)
Definition: scip.c:34825
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:18861
#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:16791
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:13344
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:42989
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:47491
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
Definition: scip.c:31154
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:30776
#define SCIP_DECL_CONSACTIVE(x)
Definition: type_cons.h:671
SCIP_RETCODE SCIPsetConsModifiable(SCIP *scip, SCIP_CONS *cons, SCIP_Bool modifiable)
Definition: scip.c:28006
SCIP_NODE * SCIPtreeGetPrioChild(SCIP_TREE *tree)
Definition: tree.c:7003
SCIP_Real primsol
Definition: struct_lp.h:139
SCIP_Bool SCIPlpIsRelax(SCIP_LP *lp)
Definition: lp.c:16939
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:38628
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:25401
SCIP_RETCODE SCIPprintNlRow(SCIP *scip, SCIP_NLROW *nlrow, FILE *file)
Definition: scip.c:33022
SCIP_RETCODE SCIPaddConsLocks(SCIP *scip, SCIP_CONS *cons, int nlockspos, int nlocksneg)
Definition: scip.c:28654
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:11137
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:46493
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:38027
#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:29713
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:46273
SCIP_Real SCIPchgRelaxfeastol(SCIP *scip, SCIP_Real relaxfeastol)
Definition: scip.c:46625
SCIP_NODE * SCIPgetPrioChild(SCIP *scip)
Definition: scip.c:41595
SCIP_Real SCIPgetRowSolFeasibility(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
Definition: scip.c:31128
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:35636
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:38734
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:37788
SCIP_RETCODE SCIPsetProbingLPState(SCIP *scip, SCIP_LPISTATE **lpistate, SCIP_LPINORMS **lpinorms, SCIP_Bool primalfeas, SCIP_Bool dualfeas)
Definition: scip.c:36601
SCIP_NODE * SCIPgetBestChild(SCIP *scip)
Definition: scip.c:41627
SCIP_Longint nprimallpiterations
Definition: struct_stat.h:56
SCIP_Real SCIPfrac(SCIP *scip, SCIP_Real val)
Definition: scip.c:47179
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:8135
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:11043
SCIP_RETCODE SCIPlpGetBInvARow(SCIP_LP *lp, int r, SCIP_Real *binvrow, SCIP_Real *coef, int *inds, int *ninds)
Definition: lp.c:9679
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:35262
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:38807
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:18318
SCIP_Real SCIPgetNodeLowerbound(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:13439
void SCIPprobSetDeltrans(SCIP_PROB *prob, SCIP_DECL_PROBDELTRANS((*probdeltrans)))
Definition: prob.c:350
SCIP_RETCODE SCIPtransformProb(SCIP *scip)
Definition: scip.c:13929
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:48229
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:47070
SCIP_Bool SCIPdoNotMultaggr(SCIP *scip)
Definition: scip.c:25852
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:26483
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:37812
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:31681
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46983
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:43762
SCIP_Real SCIPgetLPRootObjval(SCIP *scip)
Definition: scip.c:29491
SCIP_DECL_EVENTDELETE(EventhdlrNewSol::scip_delete)
SCIP_DECL_CONSCOPY(ConshdlrSubtour::scip_copy)
SCIP_Real SCIPgetVarSol(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:19826
SCIP_RETCODE SCIPstartDiveNLP(SCIP *scip)
Definition: scip.c:32006
SCIP_Longint SCIPgetNLimSolsFound(SCIP *scip)
Definition: scip.c:43640
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:12327
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:30219
int SCIPgetNLPCols(SCIP *scip)
Definition: scip.c:29612
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:48392
SCIP_Real SCIPgetVarMultaggrLbGlobal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23854
SCIP_RETCODE SCIPnewProbingNode(SCIP *scip)
Definition: scip.c:35898
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:36769
SCIP_Real SCIPtreeGetLowerbound(SCIP_TREE *tree, SCIP_SET *set)
Definition: tree.c:7153
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:47393
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:5662
SCIP_Bool SCIPconsIsMarkedPropagate(SCIP_CONS *cons)
Definition: cons.c:8195
SCIP_Bool SCIPisDualfeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47465
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:23656
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:42862
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:5047
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:43684
SCIP_Real SCIPsumepsilon(SCIP *scip)
Definition: scip.c:46423
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:17318
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:43420
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:41659
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:26819
SCIP_RETCODE SCIPtreeRestoreRelaxSol(SCIP_TREE *tree, SCIP_SET *set, SCIP_RELAXATION *relaxation, SCIP_PROB *transprob)
Definition: tree.c:6971
SCIP_RETCODE SCIPstartProbing(SCIP *scip)
Definition: scip.c:35852
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:9704
#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:20403
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:47204
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
Definition: scip.c:29634
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:28296
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:8097
int SCIPgetNExternBranchCands(SCIP *scip)
Definition: scip.c:37143
int SCIPgetNOrigBinVars(SCIP *scip)
Definition: scip.c:12273
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:25320
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:29452
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:32185
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:35311
void SCIPaddNNodes(SCIP *scip, SCIP_Longint nnodes)
Definition: scip.c:42098
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:13043
#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:34843
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:47155
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:17116
void SCIPfreeDisjointset(SCIP *scip, SCIP_DISJOINTSET **djset)
Definition: scip.c:48666
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:38242
SCIP_RETCODE SCIPchgRowRhsDive(SCIP *scip, SCIP_ROW *row, SCIP_Real newrhs)
Definition: scip.c:35575
int SCIPgetNEnabledConss(SCIP *scip)
Definition: scip.c:43191
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:24830
SCIP_REOPTNODE * SCIPgetReoptnode(SCIP *scip, unsigned int id)
Definition: scip.c:16844
SCIP_Longint nrelaxsolsfound
Definition: struct_stat.h:91
SCIP_Real SCIPgetVarFarkasCoef(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:19465
SCIP_Bool SCIPisDualfeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47478
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:32722
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:16831
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:42127
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:12656
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:8155
#define SCIPdebugSolEnable(scip)
Definition: debug.h:264
SCIP_Longint SCIPgetNLPs(SCIP *scip)
Definition: scip.c:42308
#define SCIPABORT()
Definition: def.h:322
SCIP_RETCODE SCIPresetRepresentation(SCIP *scip, SCIP_REOPTNODE **representatives, int nrepresentatives)
Definition: scip.c:17009
SCIP_ROW ** SCIPgetCuts(SCIP *scip)
Definition: scip.c:35172
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:17729
#define SCIP_DECL_PRICERREDCOST(x)
Definition: type_pricer.h:130
SCIP_Real SCIPround(SCIP *scip, SCIP_Real val)
Definition: scip.c:47167
SCIP_Longint SCIPgetNInfeasibleLeaves(SCIP *scip)
Definition: scip.c:42226
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:21621
SCIP_RETCODE SCIPgetActiveVars(SCIP *scip, SCIP_VAR **vars, int *nvars, int varssize, int *requiredsize)
Definition: scip.c:19341
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:36078
SCIP_Real SCIPreoptGetSavingtime(SCIP_REOPT *reopt)
Definition: reopt.c:7555
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:43884
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:44326
SCIP_Longint SCIPgetNFeasibleLeaves(SCIP *scip)
Definition: scip.c:42199
void SCIPupdateDivesetStats(SCIP *scip, SCIP_DIVESET *diveset, int nprobingnodes, int nbacktracks, SCIP_Longint nsolsfound, SCIP_Longint nbestsolsfound, SCIP_Bool leavewassol)
Definition: scip.c:36807
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:30805
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:25971
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:46092
static SCIP_RETCODE displayRelevantStats(SCIP *scip)
Definition: scip.c:15669
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:38905
double real
int SCIPpresolGetNAddConss(SCIP_PRESOL *presol)
Definition: presol.c:731
SCIP_Real SCIPgetVarAvgInferenceScore(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26684
SCIP_Bool SCIPnlpHasSolution(SCIP_NLP *nlp)
Definition: nlp.c:6012
SCIP_RETCODE SCIPaddObjoffset(SCIP *scip, SCIP_Real addval)
Definition: scip.c:11086
SCIP_Real SCIPgetVarObjDive(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:35607
SCIP_RETCODE SCIPdeactiveCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:29046
SCIP_Bool SCIPisInRestart(SCIP *scip)
Definition: scip.c:17576
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:41910
int SCIPconshdlrGetNAddHoles(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4899
SCIP_RETCODE SCIPcopyDigraph(SCIP *scip, SCIP_DIGRAPH **targetdigraph, SCIP_DIGRAPH *sourcedigraph)
Definition: scip.c:48583
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:6405
#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:17020
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:6474
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:23033
void SCIPprobMarkPermuted(SCIP_PROB *prob)
Definition: prob.c:2230
SCIP_Bool SCIPisRelLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47694
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:17973
SCIP_Longint SCIPgetNRootStrongbranchs(SCIP *scip)
Definition: scip.c:42774
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:16314
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:46390
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:47143
SCIP_RETCODE SCIPanalyzeConflict(SCIP *scip, int validdepth, SCIP_Bool *success)
Definition: scip.c:27498
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:25192
SCIP_RETCODE SCIPaddQuadElementsToNlRow(SCIP *scip, SCIP_NLROW *nlrow, int nquadelems, SCIP_QUADELEM *quadelems)
Definition: scip.c:32561
SCIP_RETCODE SCIPprintVar(SCIP *scip, SCIP_VAR *var, FILE *file)
Definition: scip.c:27096
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:8372
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:41087
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:16598
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:33225
struct SCIP_SepaData SCIP_SEPADATA
Definition: type_sepa.h:38
SCIP_Bool SCIPallowObjProp(SCIP *scip)
Definition: scip.c:25889
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:43995
SCIP_RETCODE SCIPgetNegatedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **negvar)
Definition: scip.c:19039
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:4890
SCIP callable library.
SCIP_RETCODE SCIPinitlpCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *infeasible)
Definition: scip.c:28805
SCIP_RETCODE SCIPsetPtrarrayVal(SCIP *scip, SCIP_PTRARRAY *ptrarray, int idx, void *val)
Definition: scip.c:48374
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:26452
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:42878
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:43810
SCIP_CLOCK * lpsoltime
Definition: struct_stat.h:153
SCIP_Bool SCIPcontainsExternBranchCand(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:37310
SCIP_Real SCIPgetRowActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:31065
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:24248
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:7029
SCIP_Real SCIPgetLPColumnObjval(SCIP *scip)
Definition: scip.c:29384
SCIP_NODE * focusnode
Definition: struct_tree.h:180
SCIP_Real SCIPgetAvgInferences(SCIP *scip, SCIP_BRANCHDIR dir)
Definition: scip.c:43957
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:38393
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:33285
SCIP_Real SCIPgetRelaxSolVal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:20110
#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:37872
int nimplications
Definition: struct_stat.h:222
SCIP_Longint SCIPgetSolNodenum(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:39201
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:48309
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:4950
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:27853
SCIP_RETCODE SCIPchgVarName(SCIP *scip, SCIP_VAR *var, const char *name)
Definition: scip.c:18811
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:5322
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:35015
SCIP_RETCODE SCIPchgVarObjProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
Definition: scip.c:36207
SCIP_Real SCIPgetVarAvgCutoffScore(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26938
SCIP_RETCODE SCIPprintSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:39319